Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Wraps addEventListener to capture UI breadcrumbs
function domEventHandler(name, handler, debounce) { if (debounce === void 0) { debounce = false; } return function (event) { // reset keypress timeout; e.g. triggering a 'click' after // a 'keypress' will reset the keypress debounce so that a new // set of keypresses can be recorded keypressTimeout = undefined; // It's possible this handler might trigger multiple times for the same // event (e.g. event propagation through node ancestors). Ignore if we've // already captured the event. if (!event || lastCapturedEvent === event) { return; } lastCapturedEvent = event; if (debounceTimer) { clearTimeout(debounceTimer); } if (debounce) { debounceTimer = setTimeout(function () { handler({ event: event, name: name }); }); } else { handler({ event: event, name: name }); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ready(){super.ready();let root=this;root.__breadcrumbs=document.createElement(\"rich-text-editor-breadcrumbs\");document.body.appendChild(root.__breadcrumbs);root.__breadcrumbs.addEventListener(\"breadcrumb-tap\",root._handleBreadcrumb.bind(root));this._stickyChanged()}", "_createCustomBreadcrumb(breadcrumb) {\n this.addUpdate(() => {\n void addEvent(this, {\n type: EventType.Custom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n },\n });\n });\n }", "function breadcrumbEventHandler(eventName, debounce) {\r\n if (debounce === void 0) {\r\n debounce = false;\r\n }\r\n return function (event) {\r\n // reset keypress timeout; e.g. triggering a 'click' after\r\n // a 'keypress' will reset the keypress debounce so that a new\r\n // set of keypresses can be recorded\r\n keypressTimeout = undefined;\r\n // It's possible this handler might trigger multiple times for the same\r\n // event (e.g. event propagation through node ancestors). Ignore if we've\r\n // already captured the event.\r\n if (!event || lastCapturedEvent === event) {\r\n return;\r\n }\r\n lastCapturedEvent = event;\r\n var captureBreadcrumb = function () {\r\n // try/catch both:\r\n // - accessing event.target (see getsentry/raven-js#838, #768)\r\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\r\n // can throw an exception in some circumstances.\r\n var target;\r\n try {\r\n target = event.target ? _htmlTreeAsString(event.target) : _htmlTreeAsString(event);\r\n } catch (e) {\r\n target = '<unknown>';\r\n }\r\n if (target.length === 0) {\r\n return;\r\n }\r\n Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__[\"getCurrentHub\"])().addBreadcrumb({\r\n category: \"ui.\" + eventName,\r\n message: target\r\n }, {\r\n event: event,\r\n name: eventName\r\n });\r\n };\r\n if (debounceTimer) {\r\n clearTimeout(debounceTimer);\r\n }\r\n if (debounce) {\r\n debounceTimer = setTimeout(captureBreadcrumb);\r\n } else {\r\n captureBreadcrumb();\r\n }\r\n };\r\n}", "function onBreadCrumbClicked(event)\n\t{\n\t\tvar breadcrumbId = event.currentTarget.dataset.breadcrumbId;\n\n\t\tthis.back(breadcrumbId);\n\t}", "function addBreadcrumbEvent(replay, breadcrumb) {\n if (breadcrumb.category === 'sentry.transaction') {\n return;\n }\n\n if (breadcrumb.category === 'ui.click') {\n replay.triggerUserActivity();\n } else {\n replay.checkAndHandleExpiredSession();\n }\n\n replay.addUpdate(() => {\n void addEvent(replay, {\n type: EventType.Custom,\n // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n // but maybe we should just keep them as milliseconds\n timestamp: (breadcrumb.timestamp || 0) * 1000,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n },\n });\n\n // Do not flush after console log messages\n return breadcrumb.category === 'console';\n });\n }", "function _domBreadcrumb(dom) {\n\t // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t function _innerDomBreadcrumb(handlerData) {\n\t let target;\n\t let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n\t if (typeof keyAttrs === 'string') {\n\t keyAttrs = [keyAttrs];\n\t }\n\n\t // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n\t try {\n\t target = handlerData.event.target\n\t ? htmlTreeAsString(handlerData.event.target , keyAttrs)\n\t : htmlTreeAsString(handlerData.event , keyAttrs);\n\t } catch (e) {\n\t target = '<unknown>';\n\t }\n\n\t if (target.length === 0) {\n\t return;\n\t }\n\n\t getCurrentHub().addBreadcrumb(\n\t {\n\t category: `ui.${handlerData.name}`,\n\t message: target,\n\t },\n\t {\n\t event: handlerData.event,\n\t name: handlerData.name,\n\t global: handlerData.global,\n\t },\n\t );\n\t }\n\n\t return _innerDomBreadcrumb;\n\t}", "function _domBreadcrumb(dom) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _innerDomBreadcrumb(handlerData) {\n let target;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n target = handlerData.event.target\n ? utils.htmlTreeAsString(handlerData.event.target , keyAttrs)\n : utils.htmlTreeAsString(handlerData.event , keyAttrs);\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n core.getCurrentHub().addBreadcrumb(\n {\n category: `ui.${handlerData.name}`,\n message: target,\n },\n {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n },\n );\n }\n\n return _innerDomBreadcrumb;\n}", "bindEvents () {\r\n this.subnav.forEach((item) => {\r\n item.addEventListener(\"click\", (e) => {\r\n e.stopPropagation();\r\n const selector = this.slugify(item.childNodes[ 0 ].data);\r\n const currTarget = e.currentTarget;\r\n let target = this.parent.querySelector(`#${selector}`);\r\n\r\n if (target) {\r\n this.currentFolder = selector;\r\n this.subnavContainer.classList.toggle(\"active\");\r\n this.currentIndex = this.findSubnavIndex(currTarget);\r\n\r\n this.toggleActiveSubnav(this.currentIndex);\r\n this.toggleActivePages(target);\r\n history.pushState({\r\n selector: `#${selector}`,\r\n index: this.currentIndex\r\n }, null, `/portal?page=${selector}&index=${this.currentIndex}`);\r\n } else {\r\n if (window.innerWidth < 881) {\r\n this.subnavContainer.classList.toggle(\"active\");\r\n }\r\n target = this.parent.querySelector(`#${this.currentFolder}-${selector}`);\r\n this.toggleActivePages(target);\r\n history.pushState({\r\n selector: `#${this.currentFolder}-${selector}`,\r\n index: this.currentIndex\r\n }, null, `/portal?page=${this.currentFolder}-${selector}&index=${this.currentIndex}`);\r\n }\r\n window.scrollTo(0, 0);\r\n });\r\n });\r\n this.subnavMobileToggle.addEventListener(\"click\", () => {\r\n this.subnavContainer.classList.toggle(\"active\");\r\n });\r\n window.addEventListener(\"popstate\", (e) => {\r\n if (e.state) {\r\n events.emit(\"url-change\", { state: e.state });\r\n } else {\r\n history.back();\r\n }\r\n });\r\n }", "onCrumbClick(crumb) {\n this.navigateTo(crumb.path);\n }", "function _domBreadcrumb(dom) {\n function _innerDomBreadcrumb(handlerData) {\n let target;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n utils.logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event ;\n target = _isEvent(event)\n ? utils.htmlTreeAsString(event.target, { keyAttrs, maxStringLength })\n : utils.htmlTreeAsString(event, { keyAttrs, maxStringLength });\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n core.getCurrentHub().addBreadcrumb(\n {\n category: `ui.${handlerData.name}`,\n message: target,\n },\n {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n },\n );\n }\n\n return _innerDomBreadcrumb;\n}", "function InitBreadcrumb() {\n DynamicDetailsViewCtrl.ePage.Masters.Breadcrumb = {};\n DynamicDetailsViewCtrl.ePage.Masters.Breadcrumb.OnBreadcrumbClick = OnBreadcrumbClick;\n\n GetBreadcrumbList();\n }", "function listen_for_navigation(cb) {\n $('.onboard-progress').find('li').on('click', function() {\n idx = $(this).index();\n _set_active_and_validate(idx, cb);\n });\n }", "function _domBreadcrumb(dom) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _innerDomBreadcrumb(handlerData) {\n let target;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n target = handlerData.event.target\n ? htmlTreeAsString(handlerData.event.target , { keyAttrs, maxStringLength })\n : htmlTreeAsString(handlerData.event , { keyAttrs, maxStringLength });\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n getCurrentHub().addBreadcrumb(\n {\n category: `ui.${handlerData.name}`,\n message: target,\n },\n {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n },\n );\n }\n\n return _innerDomBreadcrumb;\n }", "function addHashListener() {\n $(window).on('hashchange', function () {\n if (lastClickElementHref !== window.location.hash.substring(1)) {\n lastClickElementHref = null;\n\n if (window.location.hash) {\n var tocHref = '/docs/ref/feature/' + window.location.hash.substring(1);\n var tocElement = $('#toc-container').find('div[href=\"\" + tocHref + \"\"]');\n if (tocElement.length === 1) {\n loadContent(tocElement, tocHref);\n } else {\n // check whether it is a hash belonging to a common toc\n tocElement = handleHashInCommonToc(tocHref);\n }\n if (isMobileView() && $('#toc-column').hasClass('in')) {\n $('.breadcrumb-hamburger-nav').trigger('click');\n }\n scrollToTOC(tocElement);\n } else {\n if (isMobileView()) {\n if (!$('#toc-column').hasClass('in')) {\n $('.breadcrumb-hamburger-nav').trigger('click');\n }\n } else {\n scrollToTOC(selectFirstDoc());\n }\n }\n }\n });\n}", "addSentryBreadcrumb(event) {\n if (this.options.sentry) {\n getCurrentHub().addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n }\n }", "addSentryBreadcrumb(event) {\n if (this.options.sentry) {\n core.getCurrentHub().addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: utils.getEventDescription(event),\n },\n {\n event,\n },\n );\n }\n }", "addHandlerNavBtn(handler) {\n this._addRecipeNavBtn.addEventListener('click', handler);\n }", "function breadcrumbsBackButtonClickEventHandler() {\n eaUtils.returnToLastSearchOrProduct(historyCursor, $.currentProduct.getId());\n}", "function addBreadcrumb(breadcrumb) {\r\n callOnHub('addBreadcrumb', breadcrumb);\r\n}", "function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}", "function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}", "function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}", "function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}", "_addEventListener() {\n this.toggleButton.addEventListener('click', this.onToggleNavigationPane);\n\n this.menuLinks.forEach(menuLink => menuLink.addEventListener('click', this.onClickMenuLink));\n\n window.addEventListener('scroll', this.onScroll);\n window.addEventListener('resize', this.onResize);\n }", "handleBackButtonClick() {\n if (this.state.breadcrumbs.length > 1) {\n const currentIndex = this.state.breadcrumbs.length - 1;\n const prevIndex = currentIndex - 1;\n\n this.handleBreadcrumbClick(this.state.breadcrumbs[prevIndex], prevIndex);\n }\n }", "function onNavigation() {\r\n var targetId = this.getPageObjectId();\r\n if (targetId == this.previousId)\r\n return;\r\n this.previousId = targetId;\r\n\r\n // Completion callback for breadcrumb request.\r\n function processBreadcrumbs(bc) {\r\n if (!this.getRootNode()) // initial rendering race condition\r\n return;\r\n\r\n var rootOfThisTree = this.getRootNode().get(\"id\"),\r\n path = \"\";\r\n\r\n // The bc path returned from the service starts at the repository root. If the\r\n // root of this content tree is not the bc path, then we ignore this navigation.\r\n var onPath;\r\n if (rootOfThisTree == \"root\") {\r\n onPath = true;\r\n path = \"/root\"; // $NON-NLS-1$\r\n }\r\n else\r\n onPath = false;\r\n\r\n for (var i=0; i < bc.total; ++i) {\r\n var crumbId = bc.items[i].id;\r\n\r\n if ((crumbId == rootOfThisTree))\r\n onPath = true;\r\n\r\n if (onPath)\r\n path = path.concat(\"/\", crumbId);\r\n }\r\n\r\n // the bc path does not include the target of the navigation, so add it\r\n // before calling selectPath\r\n path = path.concat(\"/\", targetId);\r\n\r\n if (onPath) {\r\n // Use the selectPath method of the Tree to expand to the target node.\r\n this.selectPath(path, \"id\", \"/\", onPathExpanded, this);\r\n }\r\n }\r\n\r\n if (targetId && (targetId.indexOf(\"08\") != 0)) // ignore business objects navigations\r\n getBreadcrumbsForObject(targetId, processBreadcrumbs, this);\r\n }", "function addBreadcrumbs(title, url) {\n var breadcrumbs_list = $('.breadcrumb');\n var parent_el = breadcrumbs_list.find('li.active');\n parent_el.children().attr('href', url).attr('data-remote', \"true\");\n parent_el.removeClass('active');\n var active_li = $('<li></li>').addClass('active');\n var a_value = $('<a>').html(title);\n active_li.append(a_value);\n breadcrumbs_list.append(active_li);\n // Handheld action 'back'\n parent_el.children().click(function() {\n // remove previous <li>\n parent_el.next().remove();\n parent_el.addClass('active');\n });\n}", "function set_breadcrumbs() {\r\n if (j$(\".child_pages_ctn\").children('li').length === 0) {\r\n j$(\"#rd_child_pages\").hide();\r\n\r\n }\r\n\r\n\r\n var childvisible = 0;\r\n var title_width = j$('.page_title_ctn h1').width() + 80;\r\n j$(document).on('click', function (e) {\r\n if (childvisible !== 0 && j$('.rd_child_pages').hasClass('child_icon_close')) {\r\n if (!(e.target.id == 'rd_child_pages' || j$(e.target).parents('#rd_child_pages').length > 0)) {\r\n j$('.rd_child_pages').removeClass('child_icon_close');\r\n childvisible = 0;\r\n j$(\".child_pages_ctn\").removeClass('pop_child_pages');\r\n j$('.rd_child_pages').addClass('child_closed');\r\n }\r\n\r\n }\r\n });\r\n j$(\".child_pages_ctn\").css('width', title_width);\r\n j$(\".rd_child_pages\").click(function (e) {\r\n //This stops the page scrolling to the top on a # link.\r\n if (childvisible == 0 && j$('.rd_child_pages').hasClass('child_closed')) {\r\n j$(\".child_pages_ctn\").css('width', title_width);\r\n j$('.rd_child_pages').removeClass('child_closed');\r\n j$('.rd_child_pages').addClass('child_icon_close');\r\n j$(\".child_pages_ctn\").addClass('pop_child_pages');\r\n setTimeout(function () {\r\n j$('.child_pages_ctn').focus();\r\n }, 1500);\r\n childvisible = 1; //Set search visible flag to visible.\r\n } else {\r\n //Search is currently showing. Slide it back up and hide it.\r\n j$('.rd_child_pages').removeClass('child_icon_close');\r\n childvisible = 0;\r\n j$(\".child_pages_ctn\").removeClass('pop_child_pages');\r\n j$('.rd_child_pages').addClass('child_closed');\r\n }\r\n\r\n });\r\n\r\n}", "function _xhrBreadcrumb(handlerData) {\n\t if (handlerData.endTimestamp) {\n\t // We only capture complete, non-sentry requests\n\t if (handlerData.xhr.__sentry_own_request__) {\n\t return;\n\t }\n\n\t const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};\n\n\t getCurrentHub().addBreadcrumb(\n\t {\n\t category: 'xhr',\n\t data: {\n\t method,\n\t url,\n\t status_code,\n\t },\n\t type: 'http',\n\t },\n\t {\n\t xhr: handlerData.xhr,\n\t input: body,\n\t },\n\t );\n\n\t return;\n\t }\n\t}", "addMenuListeners() {\n this.htmlData.menuParents.forEach(el => {\n el.addEventListener(\"click\", () => this.submenuListener(event));\n });\n window.addEventListener(\"resize\", () => this.checkScreenSize(event));\n this.addOutsideListener();\n }", "function addListen() {\r\n if (document.getElementById(\"related_adsLazyLoad\")) {\r\n document.getElementById(\"related_adsLazyLoad\").addEventListener(\"DOMSubtreeModified\", eventRerun, false);\r\n }\r\n // Your Recent History\r\n // not working, right now\r\n if (document.getElementById(\"rhf\")) {\r\n document.getElementById(\"rhf\").addEventListener(\"DOMSubtreeModified\", eventRerun, false);\r\n }\r\n // Main node for product results for browsing pages\r\n if (document.getElementById(\"rightResultsATF\")) {\r\n document.getElementById(\"rightResultsATF\").addEventListener(\"DOMSubtreeModified\", eventRerun, false);\r\n }\r\n}", "function bcListHandler(e) {\n var parentPath = e.target.id;\n // update currentParentPath\n if (parentPath !== 'bread-crumb-container') {\n if (parentPath == \"\") {\n content.style.display = 'none';\n recentActivity.style.display = 'block';\n currentParentPath = parentPath + '/';\n sendAjaxReq('GET', '/category/all?parent=' + sanitizePath(parentPath), updateAllPanes);\n } else {\n currentParentPath = parentPath + '/';\n sendAjaxReq('GET', '/category/all?parent=' + sanitizePath(parentPath), updateAllPanes);\n }\n }\n }", "subscribe() {\n window.addEventListener('vaadin-router-go', this.__navigationEventHandler);\n }", "subscribe() {\n window.addEventListener('vaadin-router-go', this.__navigationEventHandler);\n }", "function addBranchListeners()\n {\n // Main menu options\n $('#branchSelect').click(function()\n {\n setTimeout(function() { selectBranch(); }, PROGRESS_DELAY);\n showNote('Getting list of branches...');\n });\n $('#branchCommit').click(function()\n {\n setTimeout(function() { commitBranch(true); }, PROGRESS_DELAY);\n showNote('Processing commit request...');\n });\n $('#commitRollbackSelectAll').click(function()\n {\n checkAll(true, 'input[type=\"checkbox\"]')\n });\n $('#commitRollbackSelectNone').click(function()\n {\n checkAll(false, 'input[type=\"checkbox\"]')\n });\n $('#commitOk').click(function()\n {\n commitOk();\n });\n $('#rollbackOk').click(function()\n {\n rollbackOk();\n });\n $('#branchRollback').click(function()\n {\n setTimeout(function() { commitBranch(false); }, PROGRESS_DELAY);\n showNote('Processing rollback request...');\n });\n $('#branchUpdate').click(function()\n {\n setTimeout(function() { updateBranch(); }, PROGRESS_DELAY);\n showNote('Updating branch...');\n });\n $('#branchDelete').click(function()\n {\n deleteBranch();\n });\n $('#deleteBranchOk').click(function()\n {\n deleteBranchOk();\n });\n // From 'Select / Create Branch' Modal\n $('#createBranch').click(function()\n {\n createBranch();\n });\n $('#branchNameWarning').find('button').click(function()\n {\n $('#branchNameWarning').hide();\n });\n $('#acceptTheirs').click(function(e)\n {\n e.preventDefault();\n acceptTheirs();\n });\n $('#acceptMine').click(function(e)\n {\n e.preventDefault();\n acceptMine();\n });\n }", "subscribe() {\n window.addEventListener(\"vaadin-router-go\", this.__navigationEventHandler);\n }", "addSubMenuListeners() {\n const items = this.querySelectorAll('cr-menu-item[sub-menu]');\n items.forEach((menuItem) => {\n const subMenuId = menuItem.getAttribute('sub-menu');\n if (subMenuId) {\n const subMenu = document.querySelector(subMenuId);\n if (subMenu) {\n this.showingEvents_.add(subMenu, 'activate', this);\n }\n }\n });\n }", "setupSubLinks() {\n for (let subLink in this.subLinks) {\n this.subLinks[subLink].addEventListener(\"click\", (e) => {\n let linkID = e.target.id;\n if (linkID === \"\") {\n linkID = e.target.parentNode.id;\n }\n let subViewToShow = linkID.slice(0, -5);\n this.showSubView(subViewToShow);\n });\n }\n }", "function _xhrBreadcrumb(handlerData) {\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[utils.SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data = {\n method,\n url,\n status_code,\n };\n\n const hint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n core.getCurrentHub().addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n },\n hint,\n );\n}", "addHikeListener() {\n // We need to loop through the children of our list and attach a listener to each, remember though that children is a nodeList...not an array. So in order to use something like a forEach we need to convert it to an array.\n }", "function addBreadcrumbs() {\n var table = document.body.getElementsByTagName('table')[0];\n\n var nav = document.createElement('nav');\n nav.id = 'directory-bar';\n table.insertAdjacentElement('beforebegin', nav);\n\n var navWrapper = document.createElement('div');\n navWrapper.classList.add('nav-wrapper');\n nav.appendChild(navWrapper);\n\n var breadcrumbs = document.createElement('div');\n breadcrumbs.id = 'breadcrumbs';\n navWrapper.appendChild(breadcrumbs);\n\n // Convert from UTF-8 byte sequence to readable strings\n // First and last element are empty after split due to URI structure and so removed\n var pathNames = decodeURIComponent(window.location.pathname).split('/');\n pathNames = pathNames.slice(1, pathNames.length-1);\n var href = window.location.protocol + \"//\" + window.location.host + \"/\";\n\n // Unlike the \"file:\" protocol, FTP has a root directory so an empty item is inserted at the front\n if(window.location.protocol == 'ftp:' || pathNames.length == 0) {\n pathNames.unshift('');\n }\n\n // Building the href reference iteratively and adding it to the end of \"breadcrumbs\" div\n for (var i=0; i<pathNames.length; i++) {\n // Do not append to href if item is root directory\n if(pathNames[i] == '') {\n pathNames[i] = '/'; // Root directory will have text '/' as name\n } else {\n href += pathNames[i] + \"/\";\n }\n\n var a = document.createElement('a');\n a.href = href;\n a.classList.add('breadcrumb');\n\n // Determines what colour to make the breadcrumb arrow and hover effect\n var current = localStorage.getItem(\"option\");\n if (current == \"theme4\") {\n var arrowColour = \"breadcrumb-arrow2\";\n\t\t\tvar breadcrumbTextColour = \"breadcrumb-text2\";\n } else {\n var arrowColour = \"breadcrumb-arrow1\";\n\t\t\tvar breadcrumbTextColour = \"breadcrumb-text1\";\n }\n // Adds additional colour attribute to breadcrumb arrow\n a.classList.add(arrowColour);\n\n var span = document.createElement('span');\n span.classList.add(breadcrumbTextColour);\n span.textContent = pathNames[i];\n a.appendChild(span);\n \n breadcrumbs.appendChild(a);\n }\n\n truncateBreadcrumb();\n}", "function addBreadcrumb(breadcrumb) {\n hub.getCurrentHub().addBreadcrumb(breadcrumb);\n}", "addEventsListers() {\r\n document.addEventListener('click', (evt) => {\r\n const priceListRow = hasSomeParentOfClass(evt.target, 'price-table__row');\r\n\r\n if (priceListRow) {\r\n this.switchPriceListRow(priceListRow);\r\n }\r\n });\r\n }", "function createBarChartsListEventListener(){\n var el = document.getElementById(\"bar_saved_charts\");\n if(el){\n el.addEventListener(\"click\", function(e) {\n console.log(e.path[0]);\n if(e.target && e.target.classList[0] == \"barChartItem\") {\n var strId = e.target.id;\n var numId = parseInt(strId);\n buildBarChartFromDatabase(numId);\n }\n else if(e.target && e.target.nodeName == \"IMG\"){\n var strId = e.target.id;\n var numId = parseInt(strId);\n deleteBarChartFromDatabase(numId);\n }\n });\n }\n}", "function update(e){\n var section = e.currentSlide.dataset.section;\n document.getElementById('breadcrumbs').innerHTML = (section) ? '<span>'+section+'</span>' : '';\n }", "function addEventOnMenuAnchor() { \n menuMobile.addEventListener('click', (event) => {\n let anchor = event.target;\n \n if (anchor.tagName != \"A\") return;\n\n switchMenuBtn();\n console.log(anchor.tagName);\n });\n}", "function _xhrBreadcrumb(handlerData) {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};\n\n core.getCurrentHub().addBreadcrumb(\n {\n category: 'xhr',\n data: {\n method,\n url,\n status_code,\n },\n type: 'http',\n },\n {\n xhr: handlerData.xhr,\n input: body,\n },\n );\n\n return;\n }\n}", "function addCrumbItem(text, href) {\r\n let a = document.createElement(\"a\");\r\n a.classList.add(\"crumb-item\");\r\n a.innerText = text;\r\n a.href = href;\r\n\r\n if(document.getElementById(\"breadcrumbs\").firstElementChild != null)\r\n document.getElementById(\"breadcrumbs\").appendChild(document.createTextNode(\">>\"));\r\n\r\n document.getElementById(\"breadcrumbs\").appendChild(a);\r\n \r\n}", "function registerClickHandler() {\n document.querySelector('#spin').addEventListener('click', function (ev) {\n var id,\n nav, // nav element that contains the event target\n pnl, // panel that contains the nav element\n cfg; // new panel configuration\n\n if (isBreadCrumb(ev.target)) {\n id = breadcrumb.getPanelId(ev.target);\n pnl = document.getElementById(id);\n spin.moveTo(pnl);\n return;\n }\n\n // The click might not have been made on the nav element itself\n // but on a child element instead. So we need to work out whether\n // the click target is contained within a nav element.\n nav = getNav(ev.target);\n\n if (!nav) {\n return;\n }\n\n pnl = spin.getPanel(nav);\n\n if (!nav.classList.contains('loaded')) {\n cfg = config.get(nav);\n // reset previously loaded nav item in the current panel (if any)\n if (pnl.querySelector('.nav.loaded')) {\n pnl.querySelector('.nav.loaded').classList.remove('loaded');\n }\n // we reuse the panel following the one from where the click originated\n if (panel.getNext(pnl)) {\n cfg.panel = panel.getNext(pnl).id;\n }\n spin(cfg);\n nav.classList.add('loaded');\n // If nav is already loaded it means that the corresponding panel\n // has been loaded too. So we simply need to move there.\n } else {\n spin.moveTo(panel.getNext(pnl));\n }\n }, false);\n}", "function _xhrBreadcrumb(handlerData) {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};\n\n getCurrentHub().addBreadcrumb(\n {\n category: 'xhr',\n data: {\n method,\n url,\n status_code,\n },\n type: 'http',\n },\n {\n xhr: handlerData.xhr,\n input: body,\n },\n );\n\n return;\n }\n }", "function addEventListeners() {\n $(window).load(routing);\n $(window).bind('hashchange', routing);\n }", "__init14() {this._handleWindowBlur = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.blur',\n });\n\n // Do not count blur as a user action -- it's part of the process of them\n // leaving the page\n this._doChangeToBackgroundTasks(breadcrumb);\n };}", "function setupListener() {\r\n container.addEventListener('click', clickHandler);\r\n}", "__init15() {this._handleWindowFocus = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.focus',\n });\n\n // Do not count focus as a user action -- instead wait until they focus and\n // interactive with page\n this._doChangeToForegroundTasks(breadcrumb);\n };}", "[addDivListener](event, listener) {\n this.htmlDiv.addEventListener(event, listener);\n }", "addEventListeners() {\n\t\tthis.container.addEventListener( 'click', this.handleClick, false );\n\t}", "_bindEvents() {\n document.addEventListener('click', (e) => {\n if (e.target.classList.contains('pagination-nav__btn')) {\n this._currentPage = e.target.innerText\n\n this._onPageChange(this._currentPage)\n this._setSelectedPage()\n }\n })\n }", "function createListener() {\n let listener = fetchNode('.pagination');\n listener.addEventListener('click', event => {\n onClick(event.target.innerHTML);\n });\n}", "componentDidMount () {\n const homepageLink = document.getElementsByClassName('navbar-brand')[0];\n homepageLink.addEventListener('click', this.backToLanding);\n }", "function init_breadcrumb() {\n\tif ($(\"breadcrumb\")) {\n\n\t\tvar item_y = null;\n\t\tvar isInFollowingLine = false;\n\n\t\t$A($(\"breadcrumb\").getElementsByTagName(\"dd\")).each(function(item) {\n\t\t\titem = $(item);\n\n\t\t\t//calculate the y-offset position of the current breadcrumb item\n\t\t\tif(item_y == null) {\n\t\t\t\titem_y = Position.cumulativeOffset(item)[1];\n\t\t\t}\n\t\t\tif(item_y < Position.cumulativeOffset(item)[1]) {\n\t\t\t\tisInFollowingLine = true;\n\t\t\t}\n\n\t\t\t//reduce the z-index of the current item\n\t\t\tif(isInFollowingLine) {\n\t\t\t\titem.setStyle({'zIndex':parseInt(item.getStyle('zIndex')) - 1 });\n\t\t\t}\n\n\t\t\t//breadcrumb JS hover only needed for IE<7\n\t\t\tif (Info.browser.isIEpre7) {\n\t\t\t\tvar curBreadcrumbLayer = item.down(\"div\");\n\n\t\t\t\tif(typeof curBreadcrumbLayer == \"undefined\") {\n\t\t\t\t\t// special treatment IE5.5\n\t\t\t\t\tcurBreadcrumbLayer = item.getElementsByTagName(\"DIV\")[0];\n\t\t\t\t}\n\n\t\t\t\tif(curBreadcrumbLayer) {\n\t\t\t\t\tvar iframeLining = new IframeLining(curBreadcrumbLayer);\n\n\t\t\t\t\titem.observe(\"mouseover\", function(e) {\n\t\t\t\t\t\tthis.addClassName(\"active\");\n\t\t\t\t\t\tiframeLining.show();\n\t\t\t\t\t}.bindAsEventListener(item));\n\n\t\t\t\t\titem.observe(\"mouseout\", function(e) {\n\t\t\t\t\t\tvar relatedTarget = $(e.relatedTarget || e.toElement);\n\n\t\t\t\t\t\tif(relatedTarget!=this && relatedTarget.childOf(this)==false) {\n\t\t\t\t\t\t\tthis.removeClassName(\"active\");\n\t\t\t\t\t\t\tiframeLining.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}.bindAsEventListener(item));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\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 addBreadcrumb(breadcrumb) {\n\t getCurrentHub().addBreadcrumb(breadcrumb);\n\t}", "function addBreadcrumb(breadcrumb) {\n getCurrentHub().addBreadcrumb(breadcrumb);\n }", "function addNavEventListeners() {\n document.querySelectorAll(\"nav a\").forEach((navLink) =>\n navLink.addEventListener(\"click\", (event) => {\n event.preventDefault();\n render(state[event.target.text]);\n router.updatePageLinks();\n })\n );\n}", "function _historyBreadcrumb(handlerData) {\n\t let from = handlerData.from;\n\t let to = handlerData.to;\n\t const parsedLoc = parseUrl(WINDOW$1.location.href);\n\t let parsedFrom = parseUrl(from);\n\t const parsedTo = parseUrl(to);\n\n\t // Initial pushState doesn't provide `from` information\n\t if (!parsedFrom.path) {\n\t parsedFrom = parsedLoc;\n\t }\n\n\t // Use only the path component of the URL if the URL matches the current\n\t // document (almost all the time when using pushState)\n\t if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n\t to = parsedTo.relative;\n\t }\n\t if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n\t from = parsedFrom.relative;\n\t }\n\n\t getCurrentHub().addBreadcrumb({\n\t category: 'navigation',\n\t data: {\n\t from,\n\t to,\n\t },\n\t });\n\t}", "function processBreadcrumbs(bc) {\r\n if (!this.getRootNode()) // initial rendering race condition\r\n return;\r\n\r\n var rootOfThisTree = this.getRootNode().get(\"id\"),\r\n path = \"\";\r\n\r\n // The bc path returned from the service starts at the repository root. If the\r\n // root of this content tree is not the bc path, then we ignore this navigation.\r\n var onPath;\r\n if (rootOfThisTree == \"root\") {\r\n onPath = true;\r\n path = \"/root\"; // $NON-NLS-1$\r\n }\r\n else\r\n onPath = false;\r\n\r\n for (var i=0; i < bc.total; ++i) {\r\n var crumbId = bc.items[i].id;\r\n\r\n if ((crumbId == rootOfThisTree))\r\n onPath = true;\r\n\r\n if (onPath)\r\n path = path.concat(\"/\", crumbId);\r\n }\r\n\r\n // the bc path does not include the target of the navigation, so add it\r\n // before calling selectPath\r\n path = path.concat(\"/\", targetId);\r\n\r\n if (onPath) {\r\n // Use the selectPath method of the Tree to expand to the target node.\r\n this.selectPath(path, \"id\", \"/\", onPathExpanded, this);\r\n }\r\n }", "_addEventListener() {\n this._wave.waveElement.addEventListener('click', () =>\n this._addBubbles(this._config.app.bubblesAddedOnClick.count, 2, 1, false)\n );\n }", "addListeners() {\n // Event listener for watching window width and disabling our parent toggles\n window.addEventListener('resize', debounce(() => {\n this.handleDisablingToggles();\n }));\n\n // Event listener for toggling active class on menu\n this.menuToggle.addEventListener('click', () => {\n this.toggleMenuActiveClass();\n });\n\n // Event Listener for parent nav links to open their child list\n this.parentToggles.forEach(toggle => {\n toggle.addEventListener('click', e => {\n this.constructor.toggleParentActiveClass(e);\n });\n });\n }", "function pageShowEventHandlers(event)\n{\n checkForDirectoryListing();\n}", "function bindDashboardEvents(){\n configureNavigation();\n \n }", "__attachListeners() {\n if (qx.bom.History.SUPPORTS_HASH_CHANGE_EVENT) {\n var boundFunc = qx.lang.Function.bind(this.__onHashChange, this);\n this.__checkOnHashChange =\n qx.event.GlobalError.observeMethod(boundFunc);\n qx.bom.Event.addNativeListener(\n window,\n \"hashchange\",\n this.__checkOnHashChange\n );\n } else {\n qx.event.Idle.getInstance().addListener(\n \"interval\",\n this.__onHashChange,\n this\n );\n }\n }", "fillBreadcrumb() {\n const { breadcrumbs } = this.pageElements;\n const li = document.createElement('li');\n \n li.textContent = this.restaurant.name;\n li.classList.add('breadcrumbs__nav-item');\n li.setAttribute('aria-current', 'page');\n\n breadcrumbs.appendChild(li);\n }", "function bindCurrentFolderPath() {\n\tconst load = (event) => {\n\t\tconst folderPath = event.target.getAttribute('data-path');\n\t\tloadDirectory(folderPath)();\n\t};\n\n\t// all folders and their paths\n\tconst paths = document.getElementsByClassName('path');\n\t// attach click event to each folder\n\tfor(let i = 0; i < paths.length; i++) {\n\t\tpaths[i].addEventListener('click', load, false);\n\t}\n}", "function handleDom(handlerData) {\n // Taken from https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts#L112\n let target;\n let targetNode;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n targetNode = getTargetNode(handlerData);\n target = htmlTreeAsString(targetNode);\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return null;\n }\n\n return createBreadcrumb({\n category: `ui.${handlerData.name}`,\n message: target,\n data: {\n // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(targetNode ? { nodeId: record.mirror.getId(targetNode ) } : {}),\n },\n });\n }", "function initListeners() {\n vc_navbar.addEventListener(\"redirect\", goTo);\n }", "function _addHashEventListeners() {\n \n //console.p('@Added event listener call route() with window.location.hash');\n \n inc.ROUTES.route(decodeURI(window.location.hash));\n }", "function onClickingLink(event, breadcrumb) {\r\n event.preventDefault(); // prevent default action\r\n $state.go(breadcrumb.stateName); // move to state\r\n }", "function lemurlog_OnMouseDown(event)\n{\n\n if(lemurlog_g_enable === false)\n {\n return;\n }\n var url = this.href;\n if(!lemurlog_IsRecordableURL(url))\n {\n return;\n }\n \n // added by Jason Priem\n // clicks are only recorded if the user is on a search page.\n var currentLoc = window.top.getBrowser().selectedBrowser.contentWindow.location.href;\n if (!lemurlog_IsSearchURL(currentLoc)) {\n return;\n }\n \n\n var time = new Date().getTime();\n while (Application.storage.get(\"lemurlog_clickLock\", false))\n {\n\t//sleep(1);\n setTimeout( \"lemurlog_OnMouseDown(event)\", 1000 );\n return;\n }\n Application.storage.set(\"lemurlog_clickLock\", true);\n \n var clickInfos = JSON.parse(Application.storage.get(\"lemurlog_clickInfo\", JSON.stringify(new Array())));\n \n var lemurlogtoolbar_clickInfo = {};\n lemurlogtoolbar_clickInfo[\"url\"] = url;\n var id = gBrowser.selectedTab.linkedBrowser.parentNode.id;\n lemurlogtoolbar_clickInfo[\"srcID\"] = id;\n var lemurlogtoolbar_srcURL = window.content.location.href;\n lemurlogtoolbar_clickInfo[\"lemurlogtoolbar_srcURL\"] = lemurlogtoolbar_srcURL;\n \n switch(event.button)\n {\n case 0:\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"LClick\\t\" + time +\"\\t\"+ url +\"\\n\");\n\t lemurlogtoolbar_clickInfo[\"time\"] = time;\n\t clickInfos.push(lemurlogtoolbar_clickInfo);\n break;\n case 1:\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"MClick\\t\" + time +\"\\t\"+ url +\"\\n\");\n\t lemurlogtoolbar_clickInfo[\"time\"] = time;\n\t clickInfos.push(lemurlogtoolbar_clickInfo);\t \n break;\n case 2:\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"RClick\\t\" + time +\"\\t\"+ url +\"\\n\");\n\t lemurlogtoolbar_clickInfo[\"time\"] = time;\n\t clickInfos.push(lemurlogtoolbar_clickInfo);\t \n break;\n default:\n }\n \n Application.storage.set(\"lemurlog_clickInfo\", JSON.stringify(clickInfos));\n Application.storage.set(\"lemurlog_clickLock\", false);\n}", "function addListener(domElement) {\n\tdomElement.addEventListener(\"click\", function(event) {\n\t\tlet ul = document.querySelector(\"ul\");\n\t\tlet li = this.parentNode.parentNode;\n\t\tul.removeChild(li);\n\t});\n}", "function _onPageLoadOuter() {\n // Back-forward navigation can add nodes: create a clean slate.\n removeAddedNodes(); // defined by application.\n onPageLoad(); // defined by application.\n}", "function addEventListeners() {\n\n}", "function listener(){\r\n document.getElementById(\"home\").addEventListener('click', clickHome)\r\n document.getElementById(\"blog\").addEventListener('click', clickBlog)\r\n document.getElementById(\"projects\").addEventListener('click', clickProjects)\r\n document.getElementById(\"about\").addEventListener('click', clickAbout)\r\n document.getElementById(\"contact\").addEventListener('click', clickContact)\r\n}", "megaMenuListener() {\n const $toggles = document.querySelectorAll('.acf-field[data-name=\"mega_menu\"] input[type=\"radio\"]');\n\n // add listener\n $toggles.forEach(($t) => {\n $t.addEventListener('click', (e) => {\n const $wrapper = e.currentTarget.closest('.menu-item');\n\n // need timeout to wait for ACF listener\n setTimeout(() => {\n this.megaMenuAddClasses($wrapper);\n });\n });\n });\n\n // activate mega menu classes on load\n const $parentItems = document.querySelectorAll('.menu-item.menu-item-depth-0');\n $parentItems.forEach(($i) => {\n this.megaMenuAddClasses($i);\n });\n }", "function clickTree( ev ) {\n\t\t\t\t\tupdateLinkInTree( ev.currentTarget );\n\t\t\t\t}", "function _consoleBreadcrumb(handlerData) {\n\t // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n\t // console warnings. This happens when a Vue template is rendered with\n\t // an undeclared variable, which we try to stringify, ultimately causing\n\t // Vue to issue another warning which repeats indefinitely.\n\t // see: https://github.com/getsentry/sentry-javascript/pull/6010\n\t // see: https://github.com/getsentry/sentry-javascript/issues/5916\n\t for (let i = 0; i < handlerData.args.length; i++) {\n\t if (handlerData.args[i] === 'ref=Ref<') {\n\t handlerData.args[i + 1] = 'viewRef';\n\t break;\n\t }\n\t }\n\t const breadcrumb = {\n\t category: 'console',\n\t data: {\n\t arguments: handlerData.args,\n\t logger: 'console',\n\t },\n\t level: severityLevelFromString(handlerData.level),\n\t message: safeJoin(handlerData.args, ' '),\n\t };\n\n\t if (handlerData.level === 'assert') {\n\t if (handlerData.args[0] === false) {\n\t breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n\t breadcrumb.data.arguments = handlerData.args.slice(1);\n\t } else {\n\t // Don't capture a breadcrumb for passed assertions\n\t return;\n\t }\n\t }\n\n\t getCurrentHub().addBreadcrumb(breadcrumb, {\n\t input: handlerData.args,\n\t level: handlerData.level,\n\t });\n\t}", "function eventHandler(e) {\n\t if (e.page.path === _loader2.default.getPage(pathname).path) {\n\t _emitter2.default.off(\"onPostLoadPageResources\", eventHandler);\n\t clearTimeout(timeoutId);\n\t window.___history.push(pathname);\n\t }\n\t }", "function _historyBreadcrumb(handlerData) {\n let from = handlerData.from;\n let to = handlerData.to;\n const parsedLoc = parseUrl(WINDOW$2.location.href);\n let parsedFrom = parseUrl(from);\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n getCurrentHub().addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n }", "function _consoleBreadcrumb(handlerData) {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/6010\n // see: https://github.com/getsentry/sentry-javascript/issues/5916\n for (let i = 0; i < handlerData.args.length; i++) {\n if (handlerData.args[i] === 'ref=Ref<') {\n handlerData.args[i + 1] = 'viewRef';\n break;\n }\n }\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n getCurrentHub().addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n }", "componentDidMount () {\n activeDropdowns.push(this);\n window.addEventListener('click', this._bodyListener, true);\n }", "function allEventListners() {\n // toggler icon click event\n navToggler.addEventListener('click', togglerClick);\n // nav links click event\n navLinks.forEach(elem => elem.addEventListener('click', navLinkClick));\n}", "addEvents() {\n document.querySelector('.overlay-model__close').addEventListener('click', () => {\n this.closeOverlay();\n });\n document.querySelector('.overlay-model').addEventListener('click', () => {\n this.closeOverlay();\n });\n\n document.querySelector('.overlay-model__popup').addEventListener('click', () => {\n event.stopPropagation();\n });\n\n if(this.length > 0) {\n document.querySelector('.overlay-model__nav--left').addEventListener('click', () => {\n event.stopPropagation();\n this.nav('left');\n });\n\n document.querySelector('.overlay-model__nav--right').addEventListener('click', () => {\n event.stopPropagation();\n this.nav('right');\n });\n }\n\n // Key events\n document.onkeydown = (evt) => {\n if (evt.keyCode === 27 && this.overlay) { // ESC\n this.closeOverlay();\n }\n\n // Add navigation if more then 1 item exists\n if(this.length > 0) {\n if (evt.keyCode === 37 && this.overlay) { // Left\n this.nav('left');\n } else if (evt.keyCode === 39 && this.overlay) { // Right\n this.nav('right');\n }\n }\n };\n }", "function allEventListners() {\n // toggler icon click event\n navToggler.addEventListener(\"click\", togglerClick);\n // nav links click event\n navLinks.forEach((elem) => elem.addEventListener(\"click\", navLinkClick));\n }", "addTreeItemHandlers(treeItem) {\n var item = treeItem.tag;\n // Tree items load request\n if (item.loadsChildrenFolders) {\n treeItem.loadItems.add(() => {\n this.loadChildrenOf(item, () => {\n this.treeViewChildrenOf(item, treeItem);\n if (treeItem.selected) {\n this.listViewChildrenOf(item);\n }\n treeItem.reportItemsLoaded();\n });\n });\n }\n // Tree item selection change\n treeItem.selectedChanged.add(() => {\n if (treeItem.selected) {\n this._treeSelectedItem = item;\n this.detailViewOf(item);\n if (item.childrenLoaded) {\n this.paginator.visible = item.childrenPages > 1;\n this.listViewChildrenOf(item);\n }\n else if (!item.loadsChildrenFolders) {\n this.loadChildrenOf(item, () => {\n if (treeItem.selected) {\n this.paginator.visible = item.childrenPages > 1;\n this.listViewChildrenOf(item);\n }\n });\n }\n }\n });\n // Children change reaction\n //item.childrenChanged.handlers = [];\n item.childrenChanged.add(() => {\n this.loadChildrenOf(item, () => {\n this.treeViewChildrenOf(item, treeItem);\n if (treeItem.selected) {\n this.listViewChildrenOf(item);\n }\n treeItem.reportItemsLoaded();\n });\n });\n item.childrenPagesChanged.add(() => {\n this.paginator.pages = item.childrenPages;\n });\n }", "function IETabNotifyListener(event) {\n\tvar evt = document.createEvent(\"MessageEvent\");\n\tevt.initMessageEvent(\"ContainerMessage\", true, true, event.data, document.location.href, 0, window);\n\tdocument.dispatchEvent(evt);\n}", "function bindEvents(){\n document.querySelector('#pre').addEventListener('click', () => {\n handleTraversal(preorder)\n })\n document.querySelector('#in').addEventListener('click', () => {\n handleTraversal(inorder)\n })\n document.querySelector('#post').addEventListener('click', () => {\n handleTraversal(postorder)\n })\n }", "handleTOC() {\n const links = Array.from(this.nav.getElementsByTagName(\"a\")).filter(\n (link) => {\n return link.getAttribute(\"href\").indexOf(\"#\") >= 0\n }\n )\n\n links.forEach((link) =>\n link.addEventListener(\"click\", (e) => {\n this.doToggle()\n })\n )\n }", "function prepareEventHandlers() {\r\n var testList = document.getElementById(\"testList\");\r\n var selectedTest = document.getElementById(\"selectedTest\");\r\n\r\n var title = document.getElementById(\"rule18\");\r\n\tsetCrumbs(1);\r\n testList.onchange = function() {\r\n var value = testList.value;\r\n \t var testIndex = testList.selectedIndex;\r\n title.innerHTML = value;\r\n title.style.textDecoration= \"underline\";\r\n\t\tsetCrumbs(2);\r\n getSelectedLab();\r\n }\r\n document.getElementById(\"quitButton\").onClick = function () {\r\n location.href = \"www.google.com\";\r\n alert(\"Quit!\");\r\n };\r\n}", "function lemurlog_OnTabAdded_15(event)\n{\n if (event.relatedNode !== gBrowser.mPanelContainer)\n {\n return; //Could be anywhere in the DOM (unless bubbling is caught at the interface?)\n }\n if(lemurlog_g_enable === false)\n {\n return;\n }\n\n if (event.target.localName == \"vbox\")// Firefox\n { \n var time = new Date().getTime();\n\tvar id = gBrowser.getBrowserForDocument(event.target).parentNode.id;\n\n\t// Get the URL that was clicked to make this happen (assums all\n\t// MClicks and tabAdded events occur in the same order).\n\twhile( Application.storage.get(\"lemurlog_clickLock\", false) )\n\t{\n\t\t//sleep(1);\n setTimeout( \"lemurlog_OnTabAdded(event)\", 1000 );\n return;\n\t}\n\tApplication.storage.set(\"lemurlog_clickLock\", true) ;\n\n\n\tvar lemurlogtoolbar_clickInfo = JSON.parse(\n\t\tApplication.storage.get(\"lemurlog_clickInfo\", \n\t\t\tJSON.stringify( new Array()) ));\n\n\tvar lemurlogtoolbar_srcURL = \"\"\n\tvar url = \"\"\n\tvar srcID = \"\"\n\n\tif (lemurlogtoolbar_clickInfo.length > 1)\n\t{\n\t\twhile (time - lemurlogtoolbar_clickInfo[0][\"time\"] > lemurlog_MIN_INTERVAL)\n\t\t{\n\t\t\tlemurlogtoolbar_clickInfo.splice(0,1);\n\t\t}\n\t\tlemurlogtoolbar_srcURL = lemurlogtoolbar_clickInfo[0][\"lemurlogtoolbar_srcURL\"];\n\t\turl = lemurlogtoolbar_clickInfo[0][\"url\"];\n\t\tsrcID = lemurlogtoolbar_clickInfo[0][\"srcID\"];\n\t\tlemurlogtoolbar_clickInfo.splice(0,1);\n\t}\n\telse\n\t{\n\t\tlemurlogtoolbar_srcURL = \"undefined\";\n\t}\n\n\tApplication.storage.set(\"lemurlog_clickInfo\", \n\t\tJSON.stringify(lemurlogtoolbar_clickInfo));\n\n\tApplication.storage.set(\"lemurlog_clickLock\", false);\n\n\tlemurlog_WriteLogFile(lemurlog_LOG_FILE, \"AddTab\\t\" + time + \"\\t\" +\n\t\tid + \"\\t\" + url + \"\\t\" + srcID + \"\\t\" + lemurlogtoolbar_srcURL + \"\\n\");\n\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"AddTab\\t\" + time + \"\\n\");\n }\n}", "componentDidMount () {\n activeDropdowns.push(this);\n window.addEventListener('click', this._bodyListener);\n }", "function _fetchBreadcrumb(handlerData) {\n\t // We only capture complete fetch requests\n\t if (!handlerData.endTimestamp) {\n\t return;\n\t }\n\n\t if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n\t // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n\t return;\n\t }\n\n\t if (handlerData.error) {\n\t getCurrentHub().addBreadcrumb(\n\t {\n\t category: 'fetch',\n\t data: handlerData.fetchData,\n\t level: 'error',\n\t type: 'http',\n\t },\n\t {\n\t data: handlerData.error,\n\t input: handlerData.args,\n\t },\n\t );\n\t } else {\n\t getCurrentHub().addBreadcrumb(\n\t {\n\t category: 'fetch',\n\t data: {\n\t ...handlerData.fetchData,\n\t status_code: handlerData.response.status,\n\t },\n\t type: 'http',\n\t },\n\t {\n\t input: handlerData.args,\n\t response: handlerData.response,\n\t },\n\t );\n\t }\n\t}", "function initListener() {\n const dragElm = document.getElementById(\"almonit_drag\");\n const expandBarElm = document.getElementById(\"almonit_expandBar\");\n const urlBar = document.getElementById(\"almonit_ENS_url\");\n\n shortcutEvents(expandBarElm, urlBar);\n dragElement(dragElm);\n\n expandBarElm.addEventListener(\n \"click\",\n function (e) {\n const targetClass = e.target.parentNode.parentNode.classList;\n if (targetClass.contains(\"noclick\")) {\n targetClass.remove(\"noclick\");\n } else {\n targetClass.toggle(\"almonit-active\");\n if (!targetClass.contains(\"almonit-active\")) {\n urlBar.style.setProperty(\"display\", \"none\", \"important\");\n }\n saveUrlBarLocation();\n }\n },\n false\n );\n\n dragElm.addEventListener(\"transitionend\", function (e) {\n const targetClass = e.target.classList;\n\n const leftPx = parseFloat(e.target.style.left);\n const topPx = parseFloat(e.target.style.top);\n\n if (\n leftPx > window.innerWidth / 2 &&\n window.innerWidth > 1030 //HARDCODE\n ) {\n if (\n dragElm.style.transform === \"\" ||\n dragElm.style.transform === \"none\"\n ) {\n reverseBar(dragElm, expandBarElm);\n }\n\n urlBar.style.setProperty(\"top\", topPx + 10 + \"px\");\n urlBar.style.setProperty(\"left\", leftPx - urlBar.offsetWidth + \"px\");\n } else {\n urlBar.style.setProperty(\"top\", parseFloat(topPx, 10) + 10 + \"px\");\n urlBar.style.setProperty(\"left\", parseFloat(leftPx, 10) + 60 + \"px\");\n }\n\n urlBar.style.setProperty(\n \"display\",\n targetClass.contains(\"almonit-active\") ? \"block\" : \"\",\n \"important\"\n );\n });\n\n window.onresize = function () {\n if (window.innerHeight <= parseFloat(dragElm.style.top, 10) + 200) {\n dragElm.style.setProperty(\"top\", window.innerHeight - 50 + \"px\");\n urlBar.style.setProperty(\"top\", window.innerHeight - 40 + \"px\");\n }\n\n if (\n window.innerWidth <= parseFloat(dragElm.style.left, 10) + 515 &&\n window.innerWidth > 1030\n ) {\n dragElm.style.setProperty(\"left\", window.innerWidth - 60 + \"px\");\n urlBar.style.setProperty(\"left\", window.innerWidth - 500 + \"px\");\n }\n\n if (window.innerWidth < 1030) reverseBar(dragElm, expandBarElm, true);\n };\n\n restoreDragPosition(dragElm, urlBar, expandBarElm);\n}" ]
[ "0.704246", "0.6735263", "0.6622724", "0.6514452", "0.64408505", "0.6408898", "0.63610303", "0.63193476", "0.6208438", "0.61376977", "0.60940075", "0.5994608", "0.5973832", "0.5948128", "0.5930501", "0.5881445", "0.58801144", "0.5864432", "0.5862348", "0.58268285", "0.58268285", "0.58268285", "0.58268285", "0.58232534", "0.58203924", "0.5793445", "0.57506317", "0.5750146", "0.5675322", "0.56676096", "0.5658295", "0.56511563", "0.5626865", "0.56239796", "0.5619488", "0.5611311", "0.5610503", "0.56098205", "0.56045204", "0.560317", "0.56018513", "0.5590768", "0.55777806", "0.5565904", "0.5560046", "0.55579275", "0.5550319", "0.5549992", "0.5549893", "0.5549606", "0.55479926", "0.5536454", "0.5527405", "0.55226606", "0.55226403", "0.5517813", "0.5502421", "0.55016893", "0.5490535", "0.54894173", "0.54789126", "0.5466279", "0.54542", "0.54518545", "0.5449383", "0.5447783", "0.54474", "0.544537", "0.5442728", "0.5436441", "0.54299957", "0.5429771", "0.54289067", "0.5422705", "0.54202384", "0.54115635", "0.539253", "0.5390814", "0.5389693", "0.5384551", "0.53782886", "0.5375945", "0.5360574", "0.5357114", "0.53563434", "0.53513765", "0.5348993", "0.5347302", "0.53430873", "0.5339981", "0.53369975", "0.53335524", "0.53277504", "0.53166765", "0.5315657", "0.53129435", "0.53077203", "0.5306873", "0.53038996", "0.5301958", "0.5299305" ]
0.0
-1
Wraps addEventListener to capture keypress UI events
function keypressEventHandler(handler) { // TODO: if somehow user switches keypress target before // debounce timeout is triggered, we will only capture // a single breadcrumb from the FIRST target (acceptable?) return function (event) { var target; try { target = event.target; } catch (e) { // just accessing event properties can throw an exception in some rare circumstances // see: https://github.com/getsentry/raven-js/issues/838 return; } var tagName = target && target.tagName; // only consider keypress events on actual input elements // this will disregard keypresses targeting body (e.g. tabbing // through elements, hotkeys, etc) if (!tagName || (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)) { return; } // record first keypress in a series, but ignore subsequent // keypresses until debounce clears if (!keypressTimeout) { domEventHandler('input', handler)(event); } clearTimeout(keypressTimeout); keypressTimeout = setTimeout(function () { keypressTimeout = undefined; }, debounceDuration); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onElementKeyPress(event) {}", "onElementKeyPress(event) {}", "_registerKeyPressEvents() {\n window.addEventListener(\"keydown\", ((event) => {\n const increase = 1;\n this._handleKeyEvent(event.keyCode, increase);\n }));\n window.addEventListener(\"keyup\", ((event) => {\n const increase = -1;\n this._handleKeyEvent(event.keyCode, increase);\n }));\n }", "keyupHandler(event) {\n window.addEventListener('keydown', this.keydown);\n }", "function handlerUserInput() {\n\tdocument.addEventListener('keyup', function(event) {\n\t\tconsole.log(event);\n\t\tconsole.log(event.key); //k\n\t});\n}", "HandleKeyDown(event) {}", "static _addKeyboardEventListeners() {\n window.addEventListener(\"keydown\", (keyboard) => {\n Input._setKeyDown(keyboard.code);\n });\n window.addEventListener(\"keyup\", (keyboard) => {\n Input._setKeyUp(keyboard.code);\n Input._executeOnReleaseFunction(keyboard.code);\n });\n }", "bind() {\n\t\tdocument.addEventListener('keydown', this.handleKeyPress);\n\t}", "function bind() {\n document.addEventListener('keydown', handleEvent);\n}", "handleKeyDown (event) {\n }", "function keydownEventListener(event) {\n\tvar elementXPath = getXPath(event.target);\n\tvar keyIdentifier;\n\tif (isCharacterKeyPress(event)) {\n\t\t// For charcter keys return printable character instead of code\n\t\tkeyIdentifier = String.fromCharCode(event.which);\n\t} else {\n\t\tkeyIdentifier = event.which;\n\t};\n\n\tif (isCharacterKeyPress(event) && ((!event.altKey && !event.metaKey && !event.shiftKey && !event.ctrlKey) || (!event.altKey && !event.metaKey && event.shiftKey && !event.ctrlKey))) {\n\t\t// Ignore as it's just normal key press and will be sent via \"keypress event\" or someone did Shift+key to make it capital – again will be sent via keypress event\n\t} else {\n\t\tconsole.log('Pressed down: ' + keyIdentifier + ' on ' + elementXPath + ' alt: ' + event.altKey + ' meta: ' + event.metaKey + ' shift: ' + event.shiftKey + ' ctrl: ' + event.ctrlKey);\n\t\tsendEvent(\"{\\\"path\\\":\\\"\" + elementXPath + \"\\\", \\\"action\\\":\\\"keydown\\\", \\\"keyIdentifier\\\":\\\"\" + keyIdentifier + \"\\\", \\\"metaKey\\\":\\\"\" + event.metaKey + \"\\\", \\\"ctrlKey\\\":\\\"\" + event.ctrlKey + \"\\\", \\\"altKey\\\":\\\"\" + event.altKey + \"\\\", \\\"shiftKey\\\":\\\"\" + event.shiftKey + \"\\\"}\");\n\t};\n}", "function receiveInput() {\n document.addEventListener('keyup', listen);\n document.addEventListener('click', listen);\n}", "function handleKeyEvent(event) {\n if (isEventModifier(event)) {\n return;\n }\n\n if (ignoreInputEvents && isInputEvent(event)) {\n return;\n }\n\n const eventName = getKeyEventName(event);\n const listeners = __subscriptions[eventName.toLowerCase()] || [];\n\n if (typeof __monitor === 'function') {\n const matched = listeners.length > 0;\n __monitor(eventName, matched, event);\n }\n\n if (listeners.length) {\n event.preventDefault();\n }\n\n // flag to tell if execution should continue;\n let propagate = true;\n //\n for (let i = listeners.length - 1; i >= 0; i--) {\n if (listeners[i]) {\n propagate = listeners[i](event);\n }\n if (propagate === false) {\n break;\n }\n }\n // listeners.map(listener => listener());\n }", "function initListeners(){\n document.onkeydown = keyEventHandler;\n //window.addEventListener('onkeydown', keyEventHandler, false);\n}", "function addKeydownEventListener() {\n document.addEventListener('keydown', function(e) {\n var allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down'\n };\n\n player.handleInput(allowedKeys[e.keyCode]);\n });\n\n}", "componentDidMount() {\n document.addEventListener(\"keydown\", this.handleKeyPress);\n \n }", "bindKeys() {\n document.addEventListener('keydown', this.handleKeys);\n }", "function onKeyDown(e) {\n // do not handle key events when not in input mode\n if (!imode) {\n return;\n }\n\n // only handle special keys here\n specialKey(e);\n }", "onElementKeyUp(event) {}", "onElementKeyUp(event) {}", "keypressInput(e) {\n // console.log(e);\n let keycode = event.key; // also for cross-browser compatible\n (this.acceptMoves) && this.ea.publish('keyPressed', keycode);\n }", "initializeKeyboardEvents() {\n document.addEventListener(\"keydown\", (event) => {\n if (this.keyboardEvents.get(event.key)) {\n this.keyboardEvents.get(event.key)(event)\n }\n })\n }", "addEventListeners() {\n document.addEventListener('keydown', (e) => {\n this.eventListener(e, true);\n });\n document.addEventListener('keyup', (e) => {\n this.eventListener(e, false);\n });\n }", "_addKeypress() {\n\t\tif (this.options.keyword) {\n\t\t\tthis.keylog = [];\n\t\t\tthis.keyword = this.options.keyword;\n\t\t\tthis._onKeypress = this._onKeypress.bind(this);\n\t\t\tdocument.addEventListener('keypress', this._onKeypress);\n\t\t}\n\t}", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "function keyPressHandler(event)\n\t{\n\t\t// Make sure it's not the same event firing over and over again\n\t\tif (keyPressEvent == event) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tkeyPressEvent = event;\n\t\t}\n\n\t\t// Get character that was typed\n\t\tvar charCode = event.which;\n\t\tif (charCode == KEYCODE_RETURN)\t// If return, clear and get out\n\t\t{\n\t\t\tclearTypingBuffer();\n\t\t\tclearTypingTimer();\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear timer if still running, and start it again\n\t\tclearTypingTimer();\n\t\ttypingTimer = setTimeout(clearTypingBuffer, typingTimeout);\n\n\t\t// Add new character to typing buffer\n\t\tvar char = String.fromCharCode(charCode);\n\t\ttypingBuffer.push(char);\n\n\t\t// Check typed text for shortcuts\n\t\tcheckShortcuts(char, typingBuffer, event.target);\n\t}", "function keyPressDown(event){\n\n let key = (96 <= event.keyCode && event.keyCode <= 105)? event.keyCode - 48 : event.keyCode;\n if(key >= 16 && key <= 18){\n\n if(pressedModifiers.indexOf(key) === -1){\n\n pressedModifiers.push(key);\n }\n if(event.data && event.data.modifierFunc){\n\n event.data.modifierFunc(event);\n }\n\n } else {\n\n if(event.data && event.data.keyFunc){\n\n event.data.keyFunc(event);\n }\n }\n if(event.data && event.data.func){\n\n event.data.func(event);\n }\n for (var handler in waitingForInput) {\n if (waitingForInput.hasOwnProperty(handler)) {\n waitingForInput[handler](event);\n }\n }\n\n}", "function onKeyDown(event) {\n}", "function startListening() {\n element.addEventListener(listenForEvent, handleKeyEvent);\n }", "handlePCInputKeyDown(ev){\n EventUtils.filterNumericInput(ev)\n }", "componentDidMount() {\n document.addEventListener('keydown', this.handleKeyPress)\n }", "function addKeyboardListeners() {\n window.addEventListener('keydown', handleKeydown, false);\n }", "listen() {\n window.addEventListener(\"keydown\", this.callbackFunc.bind());\n }", "function setKeyEvent(){\n addEvent(document,\"keydown\",keyBoardHandler);\n}", "componentDidMount() {\n // console.log('component did mount, handleKeyPress added');\n window.addEventListener(\"keydown\", this.handleKeyPress);\n }", "function keyListener(e) {\n // check which element fired the function\n let number = null;\n if($(e.target).is('button')) {\n number = $(e.target).html();\n } else {\n number = e.key;\n }\n\n if ((playing || messing) && visuals[number]) {\n const key = visuals[number];\n const skey = number;\n visualise(key);\n userSequence.push(parseInt(number));\n $numberDisplay.removeClass('hiddener');\n $numberDisplay.html(skey);\n setTimeout(hideKey, 500);\n compareArrays();\n }\n }", "function keyboardListener() {\n\tdocument.addEventListener('keydown', (ev) => {\n\t\tconst key = parseInt(ev.key);\n\t\tif(!isNaN(key)) {\n\t\t\tsetValue(key);\n\t\t}\n\t})\n}", "componentDidMount() {\n document.addEventListener('keydown', this.handleKeyPress, false);\n }", "function handleKeyDown(event) {\n wgl.listOfPressedKeys[event.keyCode] = true;\n // console.log(\"keydown - keyCode=%d, charCode=%d\", event.keyCode, event.charCode);\n }", "function canvasHandleKeyDown(e){\r\n\tvar key = e.keyCode;\r\n\t//println(key);\r\n\tif(useStates){\r\n\t\tStates.current().input.handleKeyDown(e);\r\n\t}\r\n\tgInput.handleKeyDown(e);\r\n}", "function keyDownHandler(event) {\n keyHandler(true, event);\n}", "static listen(){\n document.addEventListener('keypress',Keyboard.keypressHandler);\n \n var buttons = document.querySelectorAll('.button');\n for(var i = 0; i<buttons.length; i++){\n buttons[i].addEventListener('click', Keyboard.buttonClickHandler);\n }\n }", "function addKeypressEvents() {\r\n document.addEventListener('keypress', openInNewWindow, false);\r\n}", "function canvasHandleKeyPress(e){\r\n\tvar key = e.which;\r\n\tif(useStates){\r\n\t\tStates.current().input.handleKeyPress(e);\r\n\t}\r\n\tgInput.handleKeyPress(e);\r\n}", "handleKeyUp(){\n\n }", "function addKeyPressHandler() {\r\n 'use strict';\r\n document.body.addEventListener('keyup', function (event) {\r\n event.preventDefault();\r\n console.log(event.keyCode);\r\n\r\n // 7.1.3 - Listening for the keypress event\r\n if (event.keyCode === ESC_KEY) {\r\n hideDetails();\r\n }\r\n });\r\n}", "static trackKeypress(_event) {\n _event.preventDefault();\n Setup.keyPressed[_event.keyCode] = (_event.type == \"keydown\");\n }", "keyDown(e) {\n this._modifiers(e);\n const _keyCode = this.translateKeyCodes(e.keyCode);\n const _wantsToStopTheEvent = [];\n if (!this.status.cmdKeyDown && this._detectCmdKey(_keyCode)) {\n this.status.setCmdKey(true);\n _wantsToStopTheEvent.push(true);\n }\n const enabled = this._listeners.enabled;\n const _keyDowners = this._listeners.byEvent.keyDown;\n const _keyRepeaters = this._listeners.byEvent.keyRepeat;\n const _repeating = this._lastKeyDown === _keyCode && this.status.hasKeyDown(_keyCode);\n this.status.addKeyDown(_keyCode);\n const _filterMethod = _repeating ? _viewId => {\n return _keyRepeaters.includes(_viewId) && _keyDowners.includes(_viewId);\n } : _viewId => {\n return _keyDowners.includes(_viewId);\n };\n this._filterViewIdToValidView(enabled, _filterMethod).filter(_ctrl => {\n return this.isFunction(_ctrl.keyDown);\n }).some(_ctrl => {\n if (_ctrl.keyDown(_keyCode)) {\n _wantsToStopTheEvent.push(_ctrl.viewId);\n // no other keyDown events delegated after first responder returns true\n return true;\n }\n else {\n return false;\n }\n });\n // Some keys are special (esc and return) and they have their own\n // special events: defaultKey and escKey, which aren't limited\n // to instances of HControl, but any parent object will work.\n if (_wantsToStopTheEvent.length === 0 && !_repeating && this._defaultKeyActions[_keyCode.toString()]) {\n const _defaultKeyMethod = this._defaultKeyActions[_keyCode.toString()];\n if (this.defaultKey(_defaultKeyMethod, null, [])) {\n _wantsToStopTheEvent.push(true);\n }\n }\n this._lastKeyDown = _keyCode;\n if (_wantsToStopTheEvent.length !== 0) {\n Event.stop(e);\n }\n }", "keyDown(e) {\n this._modifiers(e);\n const _keyCode = this.translateKeyCodes(e.keyCode);\n const _wantsToStopTheEvent = [];\n if (!this.status.cmdKeyDown && this._detectCmdKey(_keyCode)) {\n this.status.setCmdKey(true);\n _wantsToStopTheEvent.push(true);\n }\n const enabled = this._listeners.enabled;\n const _keyDowners = this._listeners.byEvent.keyDown;\n const _keyRepeaters = this._listeners.byEvent.keyRepeat;\n const _repeating = this._lastKeyDown === _keyCode && this.status.hasKeyDown(_keyCode);\n this.status.addKeyDown(_keyCode);\n const _filterMethod = _repeating ? _viewId => {\n return _keyRepeaters.includes(_viewId) && _keyDowners.includes(_viewId);\n } : _viewId => {\n return _keyDowners.includes(_viewId);\n };\n this._filterViewIdToValidView(enabled, _filterMethod).filter(_ctrl => {\n return this.isFunction(_ctrl.keyDown);\n }).some(_ctrl => {\n if (_ctrl.keyDown(_keyCode)) {\n _wantsToStopTheEvent.push(_ctrl.viewId);\n // no other keyDown events delegated after first responder returns true\n return true;\n }\n else {\n return false;\n }\n });\n // Some keys are special (esc and return) and they have their own\n // special events: defaultKey and escKey, which aren't limited\n // to instances of HControl, but any parent object will work.\n if (_wantsToStopTheEvent.length === 0 && !_repeating && this._defaultKeyActions[_keyCode.toString()]) {\n const _defaultKeyMethod = this._defaultKeyActions[_keyCode.toString()];\n if (this.defaultKey(_defaultKeyMethod, null, [])) {\n _wantsToStopTheEvent.push(true);\n }\n }\n this._lastKeyDown = _keyCode;\n if (_wantsToStopTheEvent.length !== 0) {\n Event.stop(e);\n }\n }", "componentDidMount() {\n window.addEventListener('keydown', this.handleKeyPress);\n }", "function clickListener(event) {\n if (isPressHold) {\n // For Mobile Safari capture phase at least, returning false doesn't work; must use pD() and sP() explicitly.\n // Since it's wonky, do both for good measure.\n event.preventDefault();\n event.stopPropagation();\n isPressHold = false;\n return false;\n }\n\n return undefined;\n } // , on Chrome preventDefault on \"keyup\" will avoid triggering contextmenu event", "addEventListener(element, eventName, handler) {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(() => {\n return (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__[\"ɵgetDOM\"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }", "keyDown(_keycode) {}", "componentDidMount() {\n document.addEventListener(\"keydown\", this._handleKeyDown)\n }", "function keyup_handler(event)\n{\n\tgame.handle_key(event.code, false);\n}", "onElementKeyDown(event) {\n super.onElementKeyDown(event);\n }", "onElementKeyDown(event) {\n super.onElementKeyDown(event);\n }", "function enableKeyPress() {\n // Add event listener for keyboard press events to the canvas\n window.addEventListener(\"keydown\", function (evt) {\n connectedGame.keyPressEvent(evt);\n }, false);\n }", "setInputHandler() {\n document.addEventListener('keyup', function(e) {\n var allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down'\n };\n player.handleInput(allowedKeys[e.keyCode]);\n });\n }", "_addKeyHandler() {\n // Keyboard.addKeyHandlers...\n }", "function processKeyPress(event){\n if (!validKeys.includes(event.keyCode)) {\n return;\n }\n // prevent default browser mapping of keys\n event.preventDefault();\n\n let isShifted = event.shiftKey;\n let element = undefined;\n \n if (isShifted) {\n let shiftedKey = shiftedKeys[event.keyCode];\n element = document.querySelector(`[data-key=\"${shiftedKey}\"]`);\n } else {\n element = document.querySelector(`[data-key=\"${event.keyCode}\"]`);\n }\n let mouseDown = new Event('mousedown');\n element.dispatchEvent(mouseDown);\n // init mouse up and delay 100 ms, keyup seems to fire faster than mouseup so when using keyboard you can barely see calculator key animations\n setTimeout(() => {\n let mouseUp = new Event('mouseup');\n element.dispatchEvent(mouseUp);\n }, 100);\n }", "function keyDownHandler(e) {\n\twasdKeys.onKeyDown(e);\n}", "_bindInputHandlers() {\n window.addEventListener(\"keyup\", this._keyUpListener.bind(this), false);\n window.addEventListener(\"keydown\", this._keyDownListener.bind(this), false);\n this._inputHandlersBinded = true;\n }", "function keypressEventHandler() {\r\n // TODO: if somehow user switches keypress target before\r\n // debounce timeout is triggered, we will only capture\r\n // a single breadcrumb from the FIRST target (acceptable?)\r\n return function (event) {\r\n var target;\r\n try {\r\n target = event.target;\r\n } catch (e) {\r\n // just accessing event properties can throw an exception in some rare circumstances\r\n // see: https://github.com/getsentry/raven-js/issues/838\r\n return;\r\n }\r\n var tagName = target && target.tagName;\r\n // only consider keypress events on actual input elements\r\n // this will disregard keypresses targeting body (e.g. tabbing\r\n // through elements, hotkeys, etc)\r\n if (!tagName || tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable) {\r\n return;\r\n }\r\n // record first keypress in a series, but ignore subsequent\r\n // keypresses until debounce clears\r\n if (!keypressTimeout) {\r\n breadcrumbEventHandler('input')(event);\r\n }\r\n clearTimeout(keypressTimeout);\r\n keypressTimeout = setTimeout(function () {\r\n keypressTimeout = undefined;\r\n }, debounceDuration);\r\n };\r\n}", "handleKeyPressed(event) {\n if (event.keyCode)\n this.search()\n}", "initKeyboard() {\n document.addEventListener('keyup', e => {\n\n this.playAudio();\n\n switch (e.key) {\n case \"Escape\":\n this.clearAll()\n break;\n case \"Backspace\":\n this.clearEntry();\n break;\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n case \"%\":\n this.addOperation(e.key);\n break;\n case \"Enter\":\n case \"=\":\n this.calc();\n break;\n case \",\":\n case \".\":\n this.addDot(\".\");\n break;\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n this.addOperation(parseInt(e.key));\n break;\n case \"c\":\n if (e.ctrlKey) this.copyToClipBoard();\n break\n case \"v\":\n if (e.ctrlKey) this.pasteFromClipBoard();\n break\n }\n });\n }", "componentDidMount() {\n document.addEventListener('keydown', this.handleKeyDown);\n }", "function inputText (e){\n\tconsole.log(\"here\");\n\treturn outputEvent.innerHTML = userInput;\n\n\t//var onKeyUp = function(e) {\n\t//var userInput = document.getElementById('keypress-input').value; \t\n}", "function registerKeyboardHandler(parent) {\n\tdocument.getElementById(\"Name\").addEventListener('keydown', function(e){keyPressed(e, parent);}, false);\n\tdocument.getElementById(\"Email\").addEventListener('keydown', function(e){keyPressed(e, parent);}, false);\n\tdocument.getElementById(\"Date Time\").addEventListener('keydown', function(e){keyPressed(e, parent);}, false);\n}", "setupListener(){\n let allowedKeyCodes = this.allowedKeyCodes;\n let t = this;\n window.addEventListener(\"keydown\",function (e) {\n // We willen geen onnodige keyCodes sturen dus ff filteren\n if(allowedKeyCodes.indexOf(e.keyCode) > -1){\n if(e.keyCode === 32){\n t.placeBomb();\n }else{\n t.keyPress[e.keyCode] = true;\n }\n }\n },false);\n window.addEventListener(\"keyup\",function (e) {\n // We willen geen onnodige keyCodes sturen dus ff filteren\n if(allowedKeyCodes.indexOf(e.keyCode) > -1){\n delete t.keyPress[e.keyCode];\n }\n },false);\n }", "function enableKeyRelease() {\n // Add event listener for keyboard release events to the canvas\n window.addEventListener(\"keyup\", function (evt) {\n connectedGame.keyReleaseEvent(evt);\n }, false);\n }", "onKeyDown(e) {\n e = e || window.event;\n //console.log(e.shiftKey);\n }", "function keydownHandler(e) {\n var keyCode = e.keyCode;\n \n // enter key code = 13\n if (keyCode == 13) {\n clickHandler();\n }\n}", "function setDefaultEvents() {\n document.addEventListener(\"tizenhwkey\", keyEventHandler);\n }", "keyCode(){\r\n window.addEventListener(\"keydown\", (e)=>{\r\n for(let i = 65; i < 91; i++){\r\n if(e.keyCode == `${i}`){\r\n target = String.fromCharCode(i).toLowerCase();\r\n for(let j = 0; j < keys.length; j++){\r\n if(target === keys[j].textContent){\r\n keys[j].click();\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }", "_textBoxKeyDownHandler(event) {\n const that = this,\n key = event.key;\n\n if (that._scrollView) {\n that._handleScrollbarsDisplay();\n }\n\n that._autoExpandUpdate();\n that.value && that.value.length > 0 ? that.$.addClass('has-value') : that.$.removeClass('has-value');\n\n if (['Enter', 'Escape'].indexOf(key) === -1) {\n that._preventProgramaticValueChange = true;\n }\n\n if (['ArrowLeft', 'ArrowUp', 'ArrowDown', 'ArrowRight'].indexOf(key) > -1) {\n that._scrollView.scrollTo(that.$.input.scrollTop);\n }\n\n if (['PageUp', 'PageDown'].indexOf(key) > -1 && JQX.Utilities.Core.Browser.Chrome) {\n if (event.key === 'PageUp') {\n that.$.input.setSelectionRange(0, 0);\n that.$.input.scrollTop = 0;\n }\n\n if (event.key === 'PageDown') {\n that.$.input.setSelectionRange(that.$.input.value.length, that.$.input.value.length);\n that.$.input.scrollTop = that._scrollView.verticalScrollBar.max;\n }\n\n event.preventDefault();\n }\n }", "function onKeyPress(e) {\n const pressed = e.keyCode;\n\n switch(pressed) {\n case 82: // R\n handleRestart();\n break;\n case 83: // S\n handleStartMenu();\n break;\n case 27:\n // Esc\n handlePause();\n break;\n }\n}", "registerPlayerEvent() {\n document.addEventListener('keydown', (event) => {\n const keyCode = event.keyCode;\n switch (keyCode) {\n case UP: //z\n this.moveUp = true;\n this.orientation['Y'] = 'up';\n break;\n case DOWN: //s\n this.orientation['Y'] = 'down';\n this.moveDown = true;\n break;\n case RIGHT: //d\n this.orientation['X'] = 'right';\n this.moveRight = true;\n break;\n case LEFT: //q\n this.orientation['X'] = 'left';\n this.moveLeft = true;\n break;\n case SPACE: //spaceBar\n // this.isShooting = true;\n this.inventory.currentGun.isShooting = true;\n break;\n case 69: //spaceBar\n }\n this.keypressed[keyCode] = true;\n }\n );\n\n\n document.addEventListener('keyup', (event) => {\n const keyCode = event.keyCode;\n\n switch (keyCode) {\n case UP: //z\n this.lastKeyPressed = keyCode;\n this.moveUp = false;\n break;\n case DOWN: //s\n this.lastKeyPressed = keyCode;\n this.moveDown = false;\n break;\n case RIGHT: //d\n this.lastKeyPressed = keyCode;\n this.moveRight = false;\n break;\n case LEFT: //q\n this.lastKeyPressed = keyCode;\n this.moveLeft = false;\n break;\n case SPACE: //spaceBar\n // this.isShooting = false;\n this.inventory.currentGun.isShooting = false;\n this.keypressed[keyCode] = false; //Wtf ?\n break;\n }\n this.keypressed[keyCode] = false;\n }\n )\n }", "initKeyboard() {\n document.addEventListener('keyup', e => {\n this.playAudio();\n\n switch (e.key) {\n case 'Escape':\n this.clearAll();\n break;\n \n case 'Backspace':\n this.clearEntry();\n break;\n \n // O valor da tecla é o mesmo valor de e.key, utiliza-se a mesma forma de operação.\n case '+':\n case '-':\n case '*':\n case '/':\n case '%':\n this.addOperation(e.key);\n break;\n \n // Pode ser usada a tecla 'Enter' ou a tecla '=' para a mesma ação.\n case 'Enter':\n case '=':\n this.calc();\n break;\n \n // Pode ser usada a tecla '.' ou a tecla ',' para a mesma ação. \n case '.':\n case ',':\n this.addDot();\n break;\n \n // É o mesmo método para todos os números.\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n this.addOperation(parseInt(e.key));\n break;\n\n case 'c':\n // Verifica se o C foi apertado em conjunto com o Ctrl\n if(e.ctrlKey) this.copyToClipboard();\n break; \n }\n });\n }", "initKeyboard() {\n document.addEventListener('keyup', e => {\n this.playAudio();\n switch (e.key) {\n case 'Escape':\n this.clearAll();\n break;\n\n case 'Backspace':\n this.clearEntry();\n break;\n\n case '+':\n case '-':\n case '*':\n case '/':\n case '%':\n this.addOperation(e.key);\n break;\n\n case 'Enter':\n case '=':\n this.calc();\n break;\n\n case '.':\n case ',':\n this.addDot();\n\n break;\n case 'igual':\n this.calc();\n break;\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n this.addOperation(parseInt(e.key));\n break;\n\n case 'c':\n if (e.ctrlKey) this.copyToClipboard()\n break;\n }\n });\n }", "_bindEvents() {\n document.addEventListener('keydown', this._keydownHandler.bind(this), false);\n document.addEventListener('keyup', this._keyupHandler.bind(this), false);\n }", "componentDidMount() {\n\t\tdocument.addEventListener('keydown', this.handleKeyPress);\n\t\t\n\t}", "function keyPressHandler(evt) {\n evt = evt || window.event;\n if (evt) {\n var keyCode = evt.charCode || evt.keyCode;\n charLogged = String.fromCharCode(keyCode);\n stream.push(charLogged);\n }\n }", "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "componentDidMount() {\n document.addEventListener(\"keydown\", this.pressKey, false);\n }", "componentDidMount() {\n document.addEventListener(\"keydown\", this.pressKey, false);\n }", "componentDidMount() {\n document.addEventListener('keydown', this.handleKey);\n }", "function activateKeyEvent(clickedCard){\n//selects inputs and addEventlistner to keyup\t\n\tinput.addEventListener(\"keyup\", function(){\n//checks the e.keyCode equals 13 is enter\n\t\tif(event.keyCode === 13) {\n//if the condition is true it calls functions to clearInput\t\t\t\n\t\t\tclearInputEvent()\n//otherwise if false \t\t\n\t\t}else {\n//if the condition is false it calls function to mirrorText passes clickedCard\t\t\n\t\tmirrorText(clickedCard);\n\t\t}\n\t\t\n\t\t\n\t});\n}", "function onKeyPress(event) {\n\t\n\tswitch (event.key) {\n\t\t\n\t\t// Light Keys\n\t\tcase \"ArrowDown\":\n\t\tcase \"ArrowUp\":\n\t\tcase \"ArrowRight\":\n\t\tcase \"ArrowLeft\":\n\t\tcase \"+\":\n\t\tcase \"-\":\n\t\t\tlightEventHandler(event);\n\t\t\tbreak;\n\n\t\t// Camera keys\n\t\tcase \"w\":\n\t\tcase \"s\":\n\t\tcase \"d\":\n\t\tcase \"a\":\n\t\tcase \"q\":\n\t\tcase \"e\":\n\t\t\tSC.keyPress(event); // pass the listener event to the camera (Required for SphericalCamera Module)\n\t\t\tupdateMVP(); // re-generate the MVP matrix and update it\n\t\t\tbreak;\n\t}\n\n\trender(); // draw with the new view\n}", "function callWithKeyDown(functionCalledOnKeyPress) {\n return new Promise(resolve => {\n function onKeyPress() {\n document.removeEventListener('keypress', onKeyPress, false);\n resolve(functionCalledOnKeyPress());\n }\n document.addEventListener('keypress', onKeyPress, false);\n\n eventSender.keyDown(' ', []);\n });\n}", "function KeyListener () {\n this.pressedKeys = [];\n this.keydown = function (e) { \n this.pressedKeys[e.keyCode] = true; \n };\n this.keyup = function(e){ \n this.pressedKeys[e.keyCode] = false; \n };\n document.addEventListener(\"keydown\", this.keydown.bind(this));\n document.addEventListener(\"keyup\", this.keyup.bind(this));\n}", "handleEvent(event) {\n switch (event.type) {\n case \"keydown\":\n this.pressed[event.code] = true;\n break;\n case \"keyup\":\n this.pressed[event.code] = false;\n break;\n default:\n break;\n }\n }", "addEventListener(element, eventName, handler) {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(() => {\n return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__[\"ɵgetDOM\"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }", "addEventListener(element, eventName, handler) {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(() => {\n return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__[\"ɵgetDOM\"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }", "addEventListener(element, eventName, handler) {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(() => {\n return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__[\"ɵgetDOM\"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }", "addEventListener(element, eventName, handler) {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(() => {\n return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__[\"ɵgetDOM\"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }", "addEventListener(element, eventName, handler) {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName);\n const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n return this.manager.getZone().runOutsideAngular(() => {\n return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__[\"ɵgetDOM\"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }", "function setKeypressHandler(windowOrFrame, keyHandler) {\n var doc = windowOrFrame.document;\n if (doc) {\n if (doc.attachEvent) {\n doc.attachEvent(\n 'onkeypress',\n function () {\n keyHandler(windowOrFrame.event);\n }\n );\n }\n else {\n doc.onkeypress = keyHandler;\n }\n }\n }", "function keyupEventListener (event) {\n let key = event.keyCode;\n\n switch (key) {\n case keys.left:\n case keys.right:\n determineOrientation(event);\n break;\n case keys.delete:\n break;\n case keys.enter:\n case keys.space:\n activateTab(event.target, true);\n break;\n }\n}", "_bindInputHandlers() {\n window.addEventListener('keyup', (this._keyUpListener).bind(this), false);\n window.addEventListener('keydown', (this._keyDownListener).bind(this), false);\n this._inputHandlersBinded = true;\n }", "function KeyListener() {\n this.pressedKeys = [];\n this.keydown = function(e) { this.pressedKeys[e.keyCode] = true };\n this.keyup = function(e) { this.pressedKeys[e.keyCode] = false };\n document.addEventListener(\"keydown\", this.keydown.bind(this));\n document.addEventListener(\"keyup\", this.keyup.bind(this));\n }" ]
[ "0.7511093", "0.7511093", "0.7385871", "0.7310685", "0.7279947", "0.72450763", "0.6906862", "0.6886166", "0.68537796", "0.68148106", "0.6799994", "0.6776772", "0.6749719", "0.67320675", "0.67041856", "0.6669992", "0.66390294", "0.663687", "0.65940875", "0.65940875", "0.6589069", "0.6583737", "0.6571921", "0.65597266", "0.6539744", "0.6534273", "0.6532475", "0.65248257", "0.6523435", "0.6517116", "0.6503912", "0.64965403", "0.649573", "0.6489351", "0.64819086", "0.647214", "0.6429128", "0.64264566", "0.63943666", "0.6388763", "0.6383887", "0.6380118", "0.6342379", "0.6328879", "0.63070226", "0.62939864", "0.62840587", "0.6281659", "0.6281659", "0.62793684", "0.6255539", "0.6254858", "0.62362766", "0.6235426", "0.623467", "0.6214722", "0.6214722", "0.620544", "0.62002534", "0.6194073", "0.6190067", "0.6188206", "0.6181097", "0.61807823", "0.6180512", "0.6174371", "0.61743563", "0.61684865", "0.61670154", "0.6158795", "0.61414313", "0.6135129", "0.6124388", "0.61217856", "0.611508", "0.61080754", "0.6107564", "0.6105118", "0.6100095", "0.60999", "0.6099444", "0.60976845", "0.60851115", "0.6079432", "0.6059857", "0.6059857", "0.60580975", "0.6053302", "0.6046462", "0.6036922", "0.6036702", "0.6033531", "0.603328", "0.603328", "0.603328", "0.603328", "0.603328", "0.6029224", "0.6026304", "0.6025957", "0.6025789" ]
0.0
-1
Creates a new Browser SDK instance.
function BrowserClient(options) { if (options === void 0) { options = {}; } return _super.call(this, backend_BrowserBackend, options) || this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function createInstance() {\n // Private method to create a new instance of the browser\n const newInstance = await puppeteer.launch({\n headless: 'new',\n executablePath: \"/usr/bin/chromium-browser\",\n args: [\"--no-sandbox\", \"--disable-setuid-sandbox\", \"--run-all-compositor-stages-before-draw\"] // SEE BELOW WARNING!!!\n });\n return newInstance;\n }", "getBrowserInstance () {\n return instance\n }", "create(nextPolicy, options) {\n return new StorageBrowserPolicy(nextPolicy, options);\n }", "create(nextPolicy, options) {\n return new StorageBrowserPolicy(nextPolicy, options);\n }", "function factory () {\n return new SauceBrowser({\n browser: 'chrome',\n version: '60.0',\n platform: 'linux'\n }, {})\n}", "function createDriver() {\n let browserConfig = process.env.BROWSER || 'firefox';\n let browser = browserConfig.toLowerCase();\n if (['chrome', 'firefox', 'ie'].indexOf(browser) < 0) browser = 'firefox';\n // const binary = new firefox.Binary(firefox.Channel.RELEASE);\n // binary.addArguments('-headless');\n const options = new firefox.Options();\n options.addArguments('-headless');\n return new webDriver.Builder()\n .forBrowser(browser)\n .setFirefoxOptions(options)\n .usingServer('http://localhost:4444/wd/hub')\n .build();\n}", "async init(){\r\n try{\r\n this.browser = await pptrFirefox.launch();\r\n this.page = await this.browser.newPage();\r\n await this.setName(this.page);\r\n await this.setPrice(this.page);\r\n await this.setImage();\r\n }catch{\r\n throw error;\r\n }\r\n }", "static Create(opts = {}, cb) {\n IndexedDBStore.Create(opts.storeName ? opts.storeName : 'browserfs', (e, store) => {\n if (store) {\n const idbfs = new IndexedDBFileSystem(typeof (opts.cacheSize) === 'number' ? opts.cacheSize : 100);\n idbfs.init(store, (e) => {\n if (e) {\n cb(e);\n }\n else {\n cb(null, idbfs);\n }\n });\n }\n else {\n cb(e);\n }\n });\n }", "function createBrowserWindow() {\n // create the browser window\n const currentWindow = new BrowserWindow({\n width: 1380,\n height: 700\n });\n\n // maximize the window\n currentWindow.maximize();\n\n // load the index file of the application\n currentWindow.loadFile('./public/index.html');\n //open dev tools\n // currentWindow.webContents.openDevTools();\n }", "async init () {\n this.browser = await puppeteer.launch({\n headless: this.headless,\n args: this.args,\n ...this.launchOptions\n })\n\n this.page = await this.browser.newPage()\n }", "function createForm(){\n addWindow = new BrowserWindow({\n width: 800,\n height: 400,\n title: 'New Form'\n });\n\n addWindow.loadURL(url.format({\n pathname: path.join(__dirname, \"../public/createForm.html\"),\n protocol: 'file:',\n slashes: true\n }));\n}", "function Browser() {\n\tthis.width = 1280;\n\tthis.height = 768;\n\n\tthis.window = new BrowserWindow({\n\t\twidth: this.width,\n\t\theight: this.height,\n\t\tframe: false,\n\t\t\"web-preferences\": {\n\t\t\tplugins: true,\n\t\t\tjavascript: true\n\t\t}\n\t});\n\n\t// todo change to global brand\n\tthis.window.setTitle(\"Infinium\");\n\trequire(\"./modules/applicationMenu.js\")();\n\n\tthis.window.loadUrl(\"file://\" + __dirname + \"/browser.html\");\n\tthis.window.on(\"closed\", function () {\n\t\tthis.window = null;\n\t}.bind(this));\n\n\tthis.window.focus();\n}", "sdk() {\n return new WebClient(this.getToken());\n }", "async function initializeBrowserAndPage() {\n let browser = await puppeteer.launch({\n headless: false,\n args: [\n '--no-sandbox',\n '--disable-setuid-sandbox',\n '--disable-web-security',\n ],\n });\n let page = await browser.newPage();\n await page.setUserAgent(\n 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0'\n );\n return { browser, page };\n}", "function Newhomepage(browser)\n{\n this.browser= browser;\n}", "function BrowserClient(options) {\r\n if (options === void 0) {\r\n options = {};\r\n }\r\n return _super.call(this, _backend__WEBPACK_IMPORTED_MODULE_3__[\"BrowserBackend\"], options) || this;\r\n }", "function BrowserClient(options) {\n if (options === void 0) { options = {}; }\n return _super.call(this, _backend__WEBPACK_IMPORTED_MODULE_3__[\"BrowserBackend\"], options) || this;\n }", "static create () {}", "async function createBrowserSession() {\n const chrome = {\n capabilities: {\n browserName: 'chrome'\n },\n logLevel: 'silent',\n };\n // Create a new chrome web driver\n browser = await remote(chrome);\n}", "function createWindow () {\n console.log('starting up browser window');\n const win = new BrowserWindow({\n width: 800,\n height: 600,\n webPreferences: {\n nodeIntegration: true\n }\n });\n const view = new BrowserView();\n\n console.log('setting browserview')\n win.setBrowserView(view);\n view.setBounds({ x: 0, y: 0, width: 600, height: 400 });\n view.webContents.loadURL('https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_a_target');\n //view.webContents.openDevTools({mode: 'detach'});\n\n win.loadFile('index.html');\n}", "function start(config) {\r\n var dog = new Dog(config);\r\n dog.createBrowser();\r\n\r\n return dog;\r\n}", "newPage() {\n return this._browser._createPageInContext(this._id);\n }", "newPage() {\n return this._browser._createPageInContext(this._id);\n }", "newPage() {\n return this._browser._createPageInContext(this._id);\n }", "function browserClient() {\n // If we have an internal GraphQL server, we need to append it with a\n // call to `getServerURL()` to add the correct host (in dev + production)\n const uri = _config2.default.graphQLServer ? `${(0, _env.getServerURL)()}${_config2.default.graphQLEndpoint}` : _config2.default.graphQLEndpoint;\n\n return createClient({\n networkInterface: getNetworkInterface(uri)\n });\n}", "async openBrowser (id, pageUrl) {\r\n const conf = {\r\n show: debug.enabled,\r\n openDevTools: debug.enabled,\r\n };\r\n\r\n this.nightmareInstances[id] = Nightmare(conf);\r\n\r\n await this.nightmareInstances[id].goto(pageUrl);\r\n }", "constructor(handleCreate) {\n this.query = this.query.bind(this);\n this.handleSuccess = this.handleSuccess.bind(this);\n this.pengine = new window.Pengine({\n server: \"http://localhost:3030/pengine\",\n application: \"proylcc\",\n oncreate: handleCreate,\n onsuccess: this.handleSuccess,\n onfailure: this.handleFailure,\n onerror: this.handleError,\n destroy: false\n });\n }", "function Browser(ws, mbody) { \n this.ws = ws;\n this.setupId(mbody);\n this.name = \"Browser \" + this.orgId + \" \" + ws.upgradeReq.connection.remoteAddress;\n global.Browsers.addBrowser(this);\n}", "function amzn_ps_bm_browser() {\n DOCUMENT = document;\n var interfaceMembers = ['getPlatformConfigs','setPlatformConfigs','addLocalPlatformConfig','init']; // these member function that should be implemented across all browsers\n this.getInterfaceMembers = function(){\n return interfaceMembers;\n };\n this.name = 'chrome';\n}", "static async build() {\n const browser = await puppeteer.launch({\n headless: true,\n devtools: false,\n args: [\n \"--no-sandbox\",\n \"--disable-setuid-sandbox\",\n \"--disable-dev-shm-usage\"\n ]\n });\n\n const page = await browser.newPage();\n await page.setViewport({\n width: 1920,\n height: 1080,\n deviceScaleFactor: 1\n });\n\n return new BVTester(browser, page);\n }", "createPlayerDashboard() {\r\n\r\n this.dashboard = new BrowserWindow({\r\n webPreferences: {\r\n nodeIntegration: true,\r\n contextIsolation: false,\r\n experimentalFeatures: true,\r\n },\r\n autoHideMenuBar: true,\r\n icon: path.join(__dirname, 'images/android-chrome-384x384.png'),\r\n title: `Dsign dashboard`,\r\n width: 600,\r\n height: 800,\r\n minHeight: 500,\r\n minWidth: 600,\r\n useContentWidth: true\r\n });\r\n\r\n this.dashboard.loadFile(`${__dirname}${path.sep}${this._getDashboardEntryPoint()}`);\r\n\r\n /**\r\n * On close browser window\r\n */\r\n this.dashboard.on('closed', () => {\r\n this.dashboard = null;\r\n app.quit();\r\n });\r\n }", "function createApp(){\n\tconsole.log('createApp: ')\n\tu.createMetroApp(app.name);\n}", "function Browser() {\n this.onLoadCallback = new eXo.core.HashMap() ;\n this.onResizeCallback = new eXo.core.HashMap() ;\n this.onScrollCallback = new eXo.core.HashMap() ;\n \n this.breakStream;\n window.onresize = this.managerResize ;\n window.onscroll = this.onScroll ;\n \n this.initCommon() ;\n this.detectBrowser();\n\n if(this.opera) this.initOpera() ;\n else if(this.ie) this.initIE() ;\n else if(this.webkit) this.initSafari() ;\n else this.initMozilla() ;\n}", "async init(options = {}) {\n this.options = options;\n\n let {\n cacheDisabled = true,\n enableJavaScript = true,\n requestHeaders = {},\n networkIdleTimeout,\n authorization,\n userAgent,\n intercept,\n meta\n } = options;\n\n this.log.debug('Initialize page', meta);\n this.network.timeout = networkIdleTimeout;\n this.network.authorization = authorization;\n this.meta = meta;\n\n let [, { frameTree }, version] = await Promise.all([\n this.send('Page.enable'),\n this.send('Page.getFrameTree'),\n this.send('Browser.getVersion')\n ]);\n\n this.frameId = frameTree.frame.id;\n // by default, emulate a non-headless browser\n userAgent ||= version.userAgent.replace('Headless', '');\n\n // auto-attach related targets\n let autoAttachTarget = {\n waitForDebuggerOnStart: false,\n autoAttach: true,\n flatten: true\n };\n\n await Promise.all([\n this.send('Runtime.enable'),\n this.send('Target.setAutoAttach', autoAttachTarget),\n this.send('Page.setLifecycleEventsEnabled', { enabled: true }),\n this.send('Network.setCacheDisabled', { cacheDisabled }),\n this.send('Network.setExtraHTTPHeaders', { headers: requestHeaders }),\n this.send('Network.setUserAgentOverride', { userAgent }),\n this.send('Security.setIgnoreCertificateErrors', { ignore: true }),\n this.send('Emulation.setScriptExecutionDisabled', { value: !enableJavaScript })\n ]);\n\n if (intercept) {\n await this.network.intercept(intercept);\n }\n\n return this;\n }", "function createInstance() {\n return axios.create(getInstanceOptions());\n }", "create() {\n Spark.post('/api/websites', this.form)\n .then(response => {\n this.showWebsite(response);\n\n this.resetForm();\n\n this.$emit('updateWebsites');\n });\n }", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "async function launchBrowser ({ basePath = basePathDefault, userId = unAuthenticatedUser, headless = false, forceNewDataDir = false } = {}) {\n const { userDataDir, userDownloadDir } = await makeDirs({ basePath, userId, forceNewDataDir })\n const { browser, mainPage } = await setup({ headless, userDataDir, userDownloadDir })\n // console.log(`Launched browser headless:${headless} userDataDir:${userDataDir} userDownloadDir:${userDownloadDir}`)\n return {\n userDataDir,\n userDownloadDir,\n browser,\n mainPage\n }\n}", "function createEnigma(){\n var enigmaApp = new Enigma();\n enigmaApp.init()\n .startApp();\n return enigmaApp;\n}", "function createWindow () {\n\n let win = new BrowserWindow({\n width: 800,\n height: 600,\n webPreferences: {\n nodeIntegration: true\n }\n })\n\n // html injection point\n win.loadFile('./app/index.html')\n\n // dev Tools\n win.webContents.openDevTools()\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _SafeString2['default'];\n hb.Exception = _Exception2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "static create(web, pageName, title, pageLayoutType = \"Article\") {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n // patched because previously we used the full page name with the .aspx at the end\r\n // this allows folk's existing code to work after the re-write to the new API\r\n pageName = pageName.replace(/\\.aspx$/i, \"\");\r\n // this is the user data we will use to init the author field\r\n // const currentUserLogin = await ClientSidePage.getPoster(\"/_api/web/currentuser\").select(\"UserPrincipalName\").get<{ UserPrincipalName: string }>();\r\n // initialize the page, at this point a checked-out page with a junk filename will be created.\r\n const pageInitData = yield ClientSidePage.initFrom(web, \"_api/sitepages/pages\").postCore({\r\n body: jsS(Object.assign(metadata(\"SP.Publishing.SitePage\"), {\r\n PageLayoutType: pageLayoutType,\r\n })),\r\n });\r\n // now we can init our page with the save data\r\n const newPage = new ClientSidePage(web, \"\", pageInitData);\r\n // newPage.authors = [currentUserLogin.UserPrincipalName];\r\n newPage.title = pageName;\r\n yield newPage.save(false);\r\n newPage.title = title;\r\n return newPage;\r\n });\r\n }", "function create() {\n var ariConfig = config.getAppConfig().ari;\n\n ari.getClient(ariConfig, ariConfig.applicationName)\n .then(function(client) {\n logger.debug({\n ari: {\n url: ariConfig.url,\n username: ariConfig.username\n }\n }, 'Connected to ARI');\n\n client.on('StasisStart', fsm.create);\n\n logger.info('Voicemail Main application started');\n })\n .catch(function(err) {\n logger.error({err: err}, 'Error connecting to ARI');\n throw err;\n });\n}", "function createWindow() {\n let window = new BrowserWindow({\n width: 800,\n height: 600,\n title: 'Live Telemetry - Einstein Motorsport',\n autoHideMenuBar: true,\n icon: path.join(__dirname, 'img/logo-black-128x128.png'),\n webPreferences: {\n nodeIntegration: true\n }\n });\n\n // Load index.html file as main entry\n window.loadFile('index.html');\n}", "function createPage() {\n // Clear the preview div.\n $('#previewDiv').empty();\n \n // Add a new page.\n addPage(new Page());\n}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _SafeString2['default'];\n\t hb.Exception = _Exception2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _SafeString2['default'];\n\t hb.Exception = _Exception2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _SafeString2['default'];\n\t hb.Exception = _Exception2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "static new() {\n let g = new this();\n g.init();\n return g;\n }", "function createCustomLauncher (browser, platform, version) {\n\treturn {\n\t\tbase: 'SauceLabs',\n\t\tbrowserName: browser,\n\t\tplatform: platform,\n\t\tversion: version\n\t};\n}", "constructor(application, settings = {}) { \n this.application = application\n this.settings = settings\n this.browserWindow = null\n // const {appHomePath, pathToOpen} = settings\n\n const options = {\n show: true,\n title: 'Morning',\n backgroundColor: \"#fff\",\n width: 800,\n height: 600\n }\n\n this.browserWindow = new BrowserWindow(options)\n this.browserWindow.loadURL('https://www.google.com.hk')\n\n // this.application.addWindow(this)\n\n this.handleEvents()\n\n // loadSettings.appHome = process.env.MORNING_HOME\n \n \n // this.browserWindow.on('window:loaded' , function () {\n\n // })\n }", "buildProtocol() {\n this.pcolInstance = new WsBrowserClientProtocol(\n this,\n this.options.version,\n this.options.delimiter\n );\n }", "function createHTMLPage () {\r\n /* Creates the overall layout of any app\r\n TitleBar and the element to render everything else (root)\r\n */\r\n\r\n /* Create the titlebar */\r\n let TitleBar = document.createElement(\"div\");\r\n TitleBar.setAttribute(\"id\", \"window-titlebar\");\r\n\r\n let TitleBarTitle = document.createElement(\"div\");\r\n TitleBarTitle.setAttribute(\"id\", \"window-titlebar-title\");\r\n TitleBar.appendChild(TitleBarTitle);\r\n\r\n /* Create the titlebar buttons */\r\n let TitleBarButtons = document.createElement(\"div\");\r\n TitleBarButtons.setAttribute(\"id\", \"window-titlebar-btns\");\r\n\r\n let MinimizeButton = document.createElement(\"a\");\r\n MinimizeButton.setAttribute(\"href\", \"#\");\r\n MinimizeButton.setAttribute(\"id\", \"window-min-btn\");\r\n\r\n TitleBarButtons.appendChild(MinimizeButton);\r\n\r\n let MaximizeButton = document.createElement(\"a\");\r\n MaximizeButton.setAttribute(\"href\", \"#\");\r\n MaximizeButton.setAttribute(\"id\", \"window-max-btn\");\r\n\r\n TitleBarButtons.appendChild(MaximizeButton);\r\n\r\n let ExitButton = document.createElement(\"a\");\r\n ExitButton.setAttribute(\"href\", \"#\");\r\n ExitButton.setAttribute(\"id\", \"window-close-btn\");\r\n\r\n TitleBarButtons.appendChild(ExitButton);\r\n\r\n TitleBar.appendChild(TitleBarButtons);\r\n\r\n /* Create the root element to load everything else */\r\n let Root = document.createElement(\"div\");\r\n Root.setAttribute(\"id\", \"window-root\");\r\n\r\n /* Render elements in the Browser Window's body */\r\n let body = document.getElementsByTagName(\"body\")[0];\r\n body.appendChild(TitleBar);\r\n body.appendChild(Root);\r\n}", "function CustomWorld() {\n this.driver = new seleniumWebdriver.Builder()\n .forBrowser(configStuff.browser)\n .build();\n}", "createNew(path, widgetName = 'default', kernel) {\n return this._createOrOpenDocument('create', path, widgetName, kernel);\n }", "function createWindow() {\n\tdisplay = electron.screen.getPrimaryDisplay();\n\twidth = display.bounds.width;\n\theight = display.bounds.height;\n\t// Create the browser window.\n\twin = new BrowserWindow({\n\t\twidth: 100,\n\t\theight: 50,\n\t\tmovable: false,\n\t\tresizable: false,\n\t\tx: width - 20,\n\t\ty: height - 20,\n\t\tframe: false,\n\t\tautoHideMenuBar: true,\n\t\talwaysOnTop: true\n\t});\n\n\t// and load the index.html of the app.\n\twin.loadFile('app/index.html');\n}", "function CreateWindow()\n{\n // Create browser window\n window = new BrowserWindow(\n {\n width: 1400,\n height: 600,\n minWidth: 1000,\n minHeight: 600,\n center: true,\n icon: __dirname + '\\\\Assets\\\\Images\\\\Icon\\\\app@256.png',\n frame: false\n });\n\n // Load index.html\n window.loadURL(url.format(\n {\n pathname: path.join(__dirname, '../../index.html'),\n protocol: 'file',\n slashes: true\n }));\n\n // Open devtools\n window.webContents.openDevTools();\n\n window.on('closed', () =>\n {\n window = null;\n });\n}", "async openBrowser(id, pageUrl, browserName) {\r\n const capabilities = Object.assign(Object.assign({}, this._generateBasicCapabilities(browserName)), this._getAdditionalCapabilities());\r\n capabilities.local = isLocalEnabled();\r\n // Give preference to the already running local identifier\r\n capabilities.localIdentifier = process.env.BROWSERSTACK_LOCAL_IDENTIFIER;\r\n if (capabilities.local && !capabilities.localIdentifier) {\r\n const connector = await this._createConnector();\r\n capabilities.localIdentifier = connector.connectorInstance.localIdentifierFlag;\r\n }\r\n if (capabilities.os.toLowerCase() === 'android') {\r\n const parsedPageUrl = url_1.parse(pageUrl);\r\n const browserProxy = await this._getBrowserProxy(parsedPageUrl.hostname, parsedPageUrl.port);\r\n pageUrl = 'http://' + browserProxy.targetHost + ':' + browserProxy.proxyPort + parsedPageUrl.path;\r\n }\r\n if (!capabilities.name)\r\n capabilities.name = `TestCafe test run ${id}`;\r\n if (browserName.includes('chrome'))\r\n this._prepareChromeCapabilities(capabilities);\r\n if (browserName.includes('firefox'))\r\n await this._prepareFirefoxCapabilities(capabilities);\r\n await this.backend.openBrowser(id, pageUrl, capabilities);\r\n this.setUserAgentMetaInfo(id, this.backend.getSessionUrl(id));\r\n }", "function createPage() {\n var pageInstance = new Page();\n\n function pageFn(/* args */) {\n return page.apply(pageInstance, arguments);\n }\n\n // Copy all of the things over. In 2.0 maybe we use setPrototypeOf\n pageFn.callbacks = pageInstance.callbacks;\n pageFn.exits = pageInstance.exits;\n pageFn.base = pageInstance.base.bind(pageInstance);\n pageFn.strict = pageInstance.strict.bind(pageInstance);\n pageFn.start = pageInstance.start.bind(pageInstance);\n pageFn.stop = pageInstance.stop.bind(pageInstance);\n pageFn.show = pageInstance.show.bind(pageInstance);\n pageFn.back = pageInstance.back.bind(pageInstance);\n pageFn.redirect = pageInstance.redirect.bind(pageInstance);\n pageFn.replace = pageInstance.replace.bind(pageInstance);\n pageFn.dispatch = pageInstance.dispatch.bind(pageInstance);\n pageFn.exit = pageInstance.exit.bind(pageInstance);\n pageFn.configure = pageInstance.configure.bind(pageInstance);\n pageFn.sameOrigin = pageInstance.sameOrigin.bind(pageInstance);\n pageFn.clickHandler = pageInstance.clickHandler.bind(pageInstance);\n\n pageFn.create = createPage;\n\n Object.defineProperty(pageFn, 'len', {\n get: function(){\n return pageInstance.len;\n },\n set: function(val) {\n pageInstance.len = val;\n }\n });\n\n Object.defineProperty(pageFn, 'current', {\n get: function(){\n return pageInstance.current;\n },\n set: function(val) {\n pageInstance.current = val;\n }\n });\n\n // In 2.0 these can be named exports\n pageFn.Context = Context;\n pageFn.Route = Route;\n\n return pageFn;\n }", "function createEmotionInstance() {\n const head = document.head;\n const config = {\n container: document.createElement('div'),\n key: 'leafygreen-ui',\n };\n\n head.insertBefore(config.container, head.firstChild);\n\n return createEmotion(config);\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n }", "function create() {\n\t\t\t\tvar hb = new base.HandlebarsEnvironment();\n\n\t\t\t\tUtils.extend(hb, base);\n\t\t\t\thb.SafeString = _handlebarsSafeString2['default'];\n\t\t\t\thb.Exception = _handlebarsException2['default'];\n\t\t\t\thb.Utils = Utils;\n\t\t\t\thb.escapeExpression = Utils.escapeExpression;\n\n\t\t\t\thb.VM = runtime;\n\t\t\t\thb.template = function (spec) {\n\t\t\t\t\treturn runtime.template(spec, hb);\n\t\t\t\t};\n\n\t\t\t\treturn hb;\n\t\t\t}", "function BrowserObjectGraph(opts) {\n this.init(opts || {});\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n hb.VM = runtime;\n\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n\t\t var hb = new base.HandlebarsEnvironment();\n\t\n\t\t Utils.extend(hb, base);\n\t\t hb.SafeString = _handlebarsSafeString2['default'];\n\t\t hb.Exception = _handlebarsException2['default'];\n\t\t hb.Utils = Utils;\n\t\t hb.escapeExpression = Utils.escapeExpression;\n\t\n\t\t hb.VM = runtime;\n\t\t hb.template = function (spec) {\n\t\t return runtime.template(spec, hb);\n\t\t };\n\t\n\t\t return hb;\n\t\t}", "createBrowserFetcher(options) {\r\n return this.pptr.createBrowserFetcher(options);\r\n }", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}", "function BrowserOptions() {\n Page.call(this, 'bluetooth', '', 'bluetooth-container');\n }", "function createWindow() {\n\twin = new BrowserWindow({width: 800, height: 600}); // Create the browser window\n\twin.loadURL(\"file://\" + __dirname + \"/index.html\"); // Load the page of the app\n\twin.webContents.openDevTools(); // Open the developer tools\n\n\twin.on(\"closed\", function() { // The user closed the window\n\t\twin = null; // Discard our reference to the window object\n\t});\n}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\n\t return hb;\n\t}", "function create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _handlebarsSafeString2['default'];\n hb.Exception = _handlebarsException2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n }", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\t\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\t\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\t\n\t return hb;\n\t}", "function create() {\n\t var hb = new base.HandlebarsEnvironment();\n\t\n\t Utils.extend(hb, base);\n\t hb.SafeString = _handlebarsSafeString2['default'];\n\t hb.Exception = _handlebarsException2['default'];\n\t hb.Utils = Utils;\n\t hb.escapeExpression = Utils.escapeExpression;\n\t\n\t hb.VM = runtime;\n\t hb.template = function (spec) {\n\t return runtime.template(spec, hb);\n\t };\n\t\n\t return hb;\n\t}" ]
[ "0.6634029", "0.5996018", "0.59461725", "0.59461725", "0.5860824", "0.5532018", "0.55178505", "0.55124", "0.5498515", "0.5480728", "0.54473406", "0.543767", "0.54267293", "0.5426521", "0.5405011", "0.5371086", "0.5360678", "0.5356838", "0.52900726", "0.52738893", "0.5259392", "0.52399737", "0.52399737", "0.52399737", "0.5202507", "0.51988024", "0.51689935", "0.51572436", "0.5148894", "0.51241034", "0.5112928", "0.5081597", "0.5055196", "0.5044917", "0.5030533", "0.50207615", "0.50121504", "0.50061244", "0.49966455", "0.4993082", "0.49921262", "0.49901542", "0.49875656", "0.497567", "0.49731827", "0.49725693", "0.49725693", "0.49725693", "0.496619", "0.49638414", "0.49603918", "0.49583548", "0.49408567", "0.49406117", "0.49366507", "0.49311596", "0.49237236", "0.49215797", "0.4921379", "0.49203694", "0.49158618", "0.49124724", "0.4908616", "0.49080387", "0.49047774", "0.49045417", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.4903812", "0.48980585", "0.48978356", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48958275", "0.48931384", "0.48824623", "0.48824623" ]
0.5506262
8
Present the user with a report dialog.
function showReportDialog(options) { if (options === void 0) { options = {}; } if (!options.eventId) { options.eventId = hub_getCurrentHub().lastEventId(); } var client = hub_getCurrentHub().getClient(); if (client) { client.showReportDialog(options); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showReportDialog() {\n return;\n}", "function showReportDialog(options) {\r\n if (options === void 0) {\r\n options = {};\r\n }\r\n if (!options.eventId) {\r\n options.eventId = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().lastEventId();\r\n }\r\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\r\n if (client) {\r\n client.showReportDialog(options);\r\n }\r\n}", "function showReportDialog(options) {\n if (options === void 0) { options = {}; }\n if (!options.eventId) {\n options.eventId = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().lastEventId();\n }\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\n if (client) {\n client.showReportDialog(options);\n }\n}", "function showReportDialog(options = {}, hub = core.getCurrentHub()) {\n // doesn't work without a document (React Native)\n if (!helpers.WINDOW.document) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n const { client, scope } = hub.getStackTop();\n const dsn = options.dsn || (client && client.getDsn());\n if (!dsn) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n if (!options.eventId) {\n options.eventId = hub.lastEventId();\n }\n\n const script = helpers.WINDOW.document.createElement('script');\n script.async = true;\n script.src = core.getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n const injectionPoint = helpers.WINDOW.document.head || helpers.WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n}", "function showReportDialog(options = {}, hub = getCurrentHub()) {\n\t // doesn't work without a document (React Native)\n\t if (!WINDOW$1.document) {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Global document not defined in showReportDialog call');\n\t return;\n\t }\n\n\t const { client, scope } = hub.getStackTop();\n\t const dsn = options.dsn || (client && client.getDsn());\n\t if (!dsn) {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('DSN not configured for showReportDialog call');\n\t return;\n\t }\n\n\t if (scope) {\n\t options.user = {\n\t ...scope.getUser(),\n\t ...options.user,\n\t };\n\t }\n\n\t if (!options.eventId) {\n\t options.eventId = hub.lastEventId();\n\t }\n\n\t const script = WINDOW$1.document.createElement('script');\n\t script.async = true;\n\t script.src = getReportDialogEndpoint(dsn, options);\n\n\t if (options.onLoad) {\n\t // eslint-disable-next-line @typescript-eslint/unbound-method\n\t script.onload = options.onLoad;\n\t }\n\n\t const injectionPoint = WINDOW$1.document.head || WINDOW$1.document.body;\n\t if (injectionPoint) {\n\t injectionPoint.appendChild(script);\n\t } else {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Not injecting report dialog. No injection point found in HTML');\n\t }\n\t}", "function showReportPropertyDialog(options) {\n return spReportPropertyDialog.showModalDialog(options);\n }", "function openAppSpecificReportDialog() {\n var dialogHeight = 870;\n var dialogWidth = 1150;\n var frameSource = PageNavUserInfo.webAppContextPath + PageNavUserInfo.homeTabHtmlFragment.replace('.html', '-rpt.html');\n\n var dialogElement = $('#reportingDialog');\n dialogElement.attr('title','Graphics Sectors Report');\n dialogElement.attr('style','padding: 0');\n dialogElement.html('<iframe id=\"asb-report-frame\" src=\"' + frameSource + '\" width=\"99%\" height=\"99%\"></iframe>');\n\n dialogElement.dialog({ modal: true, autoOpen: false, draggable: false, width: 500 });\n var uiDialogTitle = $('.ui-dialog-title');\n $(uiDialogTitle).css('width', '75%');\n // TODO localize buttonlabel\n $(uiDialogTitle).after('<button class=\"ui-widget\" id=\"reportButton\" type=\"button\" onClick=\"onReportButtonClick(event);\" ' +\n 'style=\"float:right;margin-right:30px;\">' + 'Run Report' + '</button>' );\n dialogElement.dialog( 'option', \"position\", {my:\"right top\", at:\"right-10 top\"} );\n dialogElement.dialog( 'option', \"height\", dialogHeight );\n dialogElement.dialog( 'option', \"width\", dialogWidth );\n dialogElement.dialog('open');\n}", "function loadForm() {\n var $this = $(this),\n type = $this.attr('id').split('-')[2],\n opts = options[type];\n\n if (windowManager) {\n windowManager.openWindow(reportDialog);\n } else {\n function ReportDialog(config) {\n ReportDialog.super.call(this, config);\n }\n OO.inheritClass(ReportDialog, OO.ui.ProcessDialog);\n\n ReportDialog.static.name = 'report-dialog';\n ReportDialog.static.title = opts.buttonText;\n ReportDialog.static.actions = [\n { label: 'Cancel', flags: ['safe', 'close'] },\n { label: 'Submit', action: 'submit', flags: ['secondary'] },\n ];\n\n // initialise dialog, append content\n ReportDialog.prototype.initialize = function () {\n ReportDialog.super.prototype.initialize.apply(this, arguments);\n this.content = new OO.ui.PanelLayout({\n padded: true,\n expanded: true\n });\n this.content.$element.append(opts.form);\n this.$body.append(this.content.$element);\n this.$content.addClass('vstf-ui-Dialog');\n this.$content.addClass('soap-reports');\n };\n\n // Handle actions\n ReportDialog.prototype.getActionProcess = function (action) {\n if (action === 'submit') {\n var dialog = this;\n dialog.pushPending();\n dialog.actions.others[0].pushPending();\n submitForm(opts).then(function() {\n dialog.popPending();\n dialog.actions.others[0].popPending();\n }); // disable the Submit button\n }\n return ReportDialog.super.prototype.getActionProcess.call(this, action);\n };\n\n // Create the Dialog and add the window manager.\n windowManager = new OO.ui.WindowManager({\n classes: ['vstf-windowManager']\n });\n $(document.body).append(windowManager.$element);\n // Create a new dialog window.\n reportDialog = new ReportDialog({\n size: 'larger'\n });\n // Add window and open\n windowManager.addWindows([reportDialog]);\n windowManager.openWindow(reportDialog);\n\n // Close dialog when clicked outside the dialog\n reportDialog.$frame.parent().on('click', function (e) {\n if (!$(e.target).closest('.vstf-ui-Dialog').length) {\n reportDialog.close();\n }\n });\n\n // Expand dialog when socks is clicked\n $('#socks, label[for=socks]').on('click', function (e) {\n setTimeout(function(){\n reportDialog.updateSize();\n }, 600);\n });\n\n mw.hook('soap.reportsform').fire();\n }\n }", "function openReportDialog() {\n // Change cursor to reports\n changeCursor('reports');\n\n // Open the reports dialog box\n $(\"#createReports\").dialog({\n title: 'Reports',\n width: 300,\n height: 400,\n position: [$(window).width() - 330, $(window).height() - 520]\n });\n\n // Re-position the dialog of window is resized\n dojo.connect(dijit.byId('map'), 'resize', function () {\n $(\"#createReports\").dialog({\n position: [$(window).width() - 330, $(window).height() - 520]\n });\n });\n}", "function projectPendInvReport() {\n window.open(\n 'Report?' +\n 'id=' +\n projectID +\n '&type=Project PendInv Report ' +\n '~' +\n $('#pendingInvoiceSelector2').val()\n );\n}", "function OpenReport(url) {\n setTimeout(function () {\n var dialogStyle = \"dialogWidth: 600px; dialogHeight: 500px; resizable: yes\";\n var returnValue = showModalDialog(url, null, dialogStyle);\n }\n , 100);\n}", "function generateTeamReport() {\n var dialog1 = {\n 'title': 'Response Form',\n 'customTitle': false,\n 'subText': 'Would you like to generate a team report?'\n };\n \n var dialog2 = {\n 'title': 'Enter Time Tracking Response Link',\n 'subText': 'Please enter the response link to generate team report:'\n };\n \n reportDialog(dialog1, createTeamReport, dialog2);\n}", "function\nASSERT_Reporter_Viewer(){\n/*m)private void*/this.setDisplay=function(\n/*a)string*/content\n){\nthis.widget.document.getElementById('report').innerHTML += content;\n}\t//---setDisplay\n\n/*m)private void*/this.setClear=function(){\nif(!this.isReportClosed()) this.widget.document.getElementById('report').innerHTML = '';\n}\t//---setClear\n\n/*m)protected void*/this.setClose=function(){\nif(!this.isReportClosed()) this.widget.close();\n}\t//---setClose\n\n/*m)private void*/this.getViewer = function () {\n if (this.isReportClosed()) this.widget = window.open(REPORTER_URL, 'REPORTER',\n\t'width=' + REPORTER_WIDTH + ',height=' + REPORTER_HEIGHT + ',left=' + REPORTER_LEFT + ',top=' + REPORTER_TOP + ',dependent=1,scrollbars=1');\n} \t//---getViewer\n\n/*m)private boolean*/this.isReportClosed=function(){\nreturn !this.widget || this.widget.closed;\n}\t//---isReportClosed\n\n/*m)private window*/this.widget = null;\n}", "function launchReport(script) {\n Launch(script, 'Report', 800, 550);\n}", "function injectReportDialog(options) {\n if (options === void 0) { options = {}; }\n if (!options.eventId) {\n logger.error(\"Missing eventId option in showReportDialog call\");\n return;\n }\n if (!options.dsn) {\n logger.error(\"Missing dsn option in showReportDialog call\");\n return;\n }\n var script = document.createElement('script');\n script.async = true;\n script.src = new api_API(options.dsn).getReportDialogEndpoint(options);\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n (document.head || document.body).appendChild(script);\n}", "function displayUserReport(data) {\n $('body').append(\n \t'<p>' + 'Report: ' + data.report + '</p>');\n}", "function showDialog() {\n var ui = HtmlService.createTemplateFromFile('Dialog')\n .evaluate()\n .setWidth(400)\n .setHeight(150);\n DocumentApp.getUi().showModalDialog(ui, DIALOG_TITLE);\n}", "function showDialog() {\n printDebugMsg(\"Show dialog\");\n var ui = HtmlService.createTemplateFromFile('Dialog')\n .evaluate()\n .setWidth(400)\n .setHeight(190)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n SpreadsheetApp.getUi().showModalDialog(ui, DIALOG_TITLE);\n}", "function OnGUI (){\n\tif(showJanelaReport)\n\t\twindowRect = GUI.Window (100, windowRect, WindowFunction_Report, \"Staff Report\");\n}", "function createReport(options, create, createFromScreenBuilder) {\n // Valid options:\n // .folder\n // .typeId\n\n spReportPropertyDialog.showModalDialog(options).then(function (result) {\n if (!result)\n return;\n\n if (result.reportId && result.reportId > 0) {\n\n //var currentNavItem = spNavService.getCurrentItem();\n var parentNavItem = spNavService.getParentItem();\n\n if (parentNavItem) {\n if (parentNavItem.data && !sp.isNullOrUndefined(parentNavItem.data.createNewReport)) {\n parentNavItem.data.createNewReport = true;\n\n if (createFromScreenBuilder) {\n if (!sp.isNullOrUndefined(parentNavItem.data.createFromScreenBuilder)) {\n parentNavItem.data.createFromScreenBuilder = true;\n } else {\n parentNavItem.data = _.extend(\n parentNavItem.data || {},\n {\n createFromScreenBuilder: true\n });\n }\n }\n\n } else {\n parentNavItem.data = _.extend(\n parentNavItem.data || {},\n {\n createNewReport: true,\n createFromScreenBuilder: createFromScreenBuilder ? true : false\n });\n }\n }\n\n if (create) {\n spNavService.navigateToChildState(\n 'reportBuilder',\n result.reportId,\n {returnOnCompletion: true});\n } else {\n /////\n // TODO: Why was this done??\n /////\n\n //spNavService.navigateToChildState(\n // 'report',\n // result.reportId,\n // { returnOnCompletion: true });\n spNavService.navigateToSibling('report', result.reportId);\n }\n }\n else if (result.report) {\n /////\n // TODO: Where is this method?\n /////\n exports.updateReportModel(-1, result.report).then(function (reportModelResponse) {\n if (reportModelResponse) {\n spNavService.navigateToChildState(\n 'reportBuilder',\n reportModelResponse,\n {returnOnCompletion: true});\n }\n });\n }\n });\n }", "navigateToReportPage() {\n return this._navigate(this.buttons.report, 'reportPage.js');\n }", "function onReportClick() {\n\tcommonFunctions.sendScreenshot();\n}", "showReport() {\n this.props.showReport();\n }", "function getAndDisplayUserReport() {\n getUserInfo(displayUserReport);\n}", "function showDialog(file, title)\n{\n \tvar html = HtmlService.createTemplateFromFile(file).evaluate();\n\tSpreadsheetApp.getUi().showModalDialog(html, title);\n}", "function fn_showpassreport(type)\n{\t\n\tsetTimeout('removesections(\"#reports-password\");',500);\n\tvar val = $('#districtid').val()+\"~\"+$('#schoolid').val()+\"~\"+type;\n\t$.Zebra_Dialog('Download the report as ', {\n 'type': 'question',\n\t'custom_class': 'myclass',\n 'title': 'Export Users report',\n\t'overlay_close':false,\n 'buttons': [\n {caption: 'PDF', callback: function() { \n\t\t\t\t\toper=\"userpassword\";\n\t\t\t\t\tfilename=$(\"#hidpassname\").val()+new Date().getTime();\n ajaxloadingalert('Loading, please wait.');\n\t\t\t\t\tsetTimeout('showpageswithpostmethod(\"reports-pdfviewer\",\"reports/reports-pdfviewer.php\",\"id='+val+'&oper='+oper+'&filename='+filename+'\");',500);\n\t\t\t\t\t\n\t\t\t\t\t}},\n {caption: 'Excel', callback: function() { \n\t\t\t\t\twindow.open(\"reports/password/reports-password-excelviewer.php?id=\"+val);\n\t\t\t\t\t}},\n\t\t\t\t\t {caption: 'Cancel', callback: function() { \n\t\t\t\t\t}}\n\t\t\t\t\t]\n});\n}", "function PrintReport() {\n try {\n $(\".buttons-excel\").trigger('click');\n\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function PrintReport() {\n try {\n $(\".buttons-excel\").trigger('click');\n\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function onReportDiagnosticClick() {\r\n if (reportDiagnosticInput.checked) {\r\n reportDiagnosticToggleSwitch.click();\r\n } else {\r\n tau.openPopup(reportDiagnosticPopup);\r\n }\r\n }", "function _makeReport() {\n document.getElementById(\"reportTable\").hidden = false;\n document.getElementById(\"chartContainer\").hidden = false;\n updateReportFromDB();\n}", "function Install_InsertReport()\n{\n var typeid;\n if( _gr_isIE )\n typeid = 'classid=\"clsid:25240C9A-6AA5-416c-8CDA-801BBAF03928\" ';\n else\n typeid = 'type=\"application/x-grplugin-report\" ';\n typeid += gr_CodeBase;\n\tdocument.write('<object id=\"_ReportOK\" ' + typeid);\n\tdocument.write(' width=\"0\" height=\"0\" VIEWASTEXT>');\n\tdocument.write('</object>');\n}", "function PrintReport()\n{\n try {\n debugger;\n\n $(\".buttons-excel\").trigger('click');\n\n\n }\n catch (e)\n {\n notyAlert('error', e.message);\n }\n}", "function showTemplateDialog() {\n\tvar dialog = document.getElementById('my-dialog');\n\t\n\tif (dialog) {\n\t\tdialog.show();\n\t\t} else {\n\t\tons.createElement('dialog.html', { append: true })\n\t\t.then(function(dialog) {\n\t\t\tdialog.show();\n\t\t});\n\t}\n}", "function btnPrint_OnClick() {\n\n var CycleID = objddlBillingCycle.value;\n var RadID = objddlRadiologist.value;\n\n if (CycleID != \"00000000-0000-0000-0000-000000000000\") {\n parent.GsFileType = \"PDF\";\n parent.GsLaunchURL = \"AP/DocumentPrinting/VRSDocPrint.aspx?DocID=2&CYCLE=\" + CycleID + \"&RADID=\" + RadID + \"&UID=\" + UserID;\n parent.PopupReportViewer();\n }\n else {\n parent.PopupMessage(RootDirectory, strForm, \"btnPrint_OnClick()\", \"229\", \"true\");\n }\n}", "function enterReport(proj_name, proj_address, proj_city, proj_county, proj_state, proj_desc, bldg_size, proj_mgr, proj_sup, architect, civil_eng, mech_eng, elec_eng, plumb_eng, land_arch, int_design, sched_start, sched_compl, actual_start, actual_compl, sched_reason, init_budget, final_budget, budget_reason, sector, const_type, awards, proj_challenges, proj_strengths, UserId) {\n var UserId = currentUser.id;\n // function enterReport(pers_spir, pers_emot, pers_health, pers_pr_req) {\n $.post(\"/api/reportentry\", {\n proj_name: proj_name,\n proj_address: proj_address,\n proj_city: proj_city,\n proj_county: proj_county,\n proj_state: proj_state,\n proj_desc: proj_desc,\n bldg_size: bldg_size,\n proj_mgr: proj_mgr,\n proj_sup: proj_sup,\n architect: architect,\n civil_eng: civil_eng,\n mech_eng: mech_eng,\n elec_eng: elec_eng,\n plumb_eng: plumb_eng,\n land_arch: land_arch,\n int_design: int_design,\n sched_start: sched_start,\n sched_compl: sched_compl,\n actual_start: actual_start,\n actual_compl: actual_compl,\n sched_reason: sched_reason,\n init_budget: init_budget,\n final_budget: final_budget,\n budget_reason: budget_reason,\n sector: sector,\n const_type: const_type,\n awards: awards,\n proj_challenges: proj_challenges,\n proj_strengths: proj_strengths,\n UserId: UserId\n\n }).then(function (data) {\n console.log(\"abcde\")\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n }).catch(handleLoginErr);\n }", "function showstockreport(reportmsg,title){\n\t//var defer = $.Deferred();,\n\t$(\"#reportdiv\").remove()\n\t//$myDialog=\"\";\n\t$myDialog=$(\"<div id='reportdiv'>\"+reportmsg+\"</div>\");\n\t$myDialog.dialog({\n\t appendTo: \"#stockpage-container\",\n\t title: title, \n\t zIndex: 10000,\n\t autoOpen: true,\n resizable: false,\n height:600,\n\t width:1000,\n modal: true,\n buttons: {\n \"طباعة\": function() {\n\t\t\t//$( this ).confirmed= true;\n\t\t\tdata=$(\"#reportdiv\").html()\n\t\t\tspecific_css=\"<style>.repcontainer{width:100%;font-family: sans-serif;background-color:#FFF;\t}.repheader{margin:10px 3px;\t}.reptable{padding:5px;border:solid #999 1px;\t}.boxer { display: table; border-collapse: collapse; width:950px; } .boxer .box-row { display: table-row; float:right; margin:0px 2px; width:100%;} .boxer .box { display: table-cell; text-align: center; vertical-align:middle; border: 1px solid #999; float:right; padding:3px; min-height:120px; font-size:18px;}.tblhead .box { display: table-cell; text-align: center; vertical-align:middle; border: 1px solid #999; float:right; padding:3px; min-height:50px; font-size:18px;}.tblcode{width:25px;\t}.tblitmname{width:105px;\t}.tblsold{\twidth:55px;}.tblbought{\twidth:55px;}.tblspoil{\twidth:55px;}.tbltrans{\twidth:57px;}.tblcorrbal{\twidth:55px;}.tblunit{\twidth:40px;}.tblnotes{width:150px;\t}.tblbal{width:100px;\t}.tbldat{width:100px;\t}.bld{\tfont-weight:bold;}.tblhead{background-color:#CCC;height:59px;\t}.opn{\tbackground-color:#F0F0F0;}.headertitle{width:100%;font-size:24px;height:80px;text-align:right;direction:rtl;\t}.headrow{\tfloat:right;\twidth:100%;}.headtxttitle{\tfont-weight:bold;\tdisplay:inline-block;\tfloat:right;\tmargin:5px;}.headtxt{\tdisplay:inline-block;\tfloat:right;\tmargin:5px;}</style>\"\n\t\t\tPopup(data,specific_css)\n\t\t\t //callbackdialog(true,object,option)\n //$( this ).dialog( \"close\" );\n\t\t \n },\n \"اغلاق\": function() {\n\t\t\t//$( this ).confirmed=false;\n\t\t\t//callbackdialog(false,object,option)\n $( this ).dialog( \"close\" );\n\t\t\n }\n }\n });/// end of dialog\t\n}////end of func", "function EnviarAviso(){\n\t$(\"#dialogEnviarAviso\").dialog(\"open\");\n}", "function CreateResultWindow(report)\n{\n return window.open('ReportResult.aspx?file=' + report, \"\", \"\"); \n}", "function notifyMissingIngridients(){\n showPagesHelper(\"#missingIngridientsReport\");\n}", "function OpenReportOption()\n{\n var currentVisibleFields = \"\";\n var currentVisibleFieldsWithWidth = \"\";\n \n if(OBSettings.SQL_GROUP_BY == \"NONE\" ) {\n currentVisibleFields = GetCurrentVisibleFieldNames();\n currentVisibleFieldsWithWidth = GetCurrentVisibleFieldNamesWithWidth();\n }\n else {\n currentVisibleFields = OBSettings.SQL_SELECT;\n\n //currentVisibleFields = GetCurrentVisibleFieldNamesWithWidth();\n if (OBSettings.ACTIVE_GRID == 'DETAIL_GRID') {\n currentVisibleFields = GetCurrentVisibleFieldNames();\n currentVisibleFieldsWithWidth = GetCurrentVisibleFieldNamesWithWidth();\n }\n\n \n }\n \n if(OBSettings.COLOR_MODE == 1)\n {\n OpenChild('./Report/common_template.html?isGroupColoredID=1&fields='+currentVisibleFields+'&fieldswidth='+currentVisibleFieldsWithWidth, 'PDFReportOptions', true, 330, 150, 'no', 'no');\n }\n else\n {\n OpenChild('./Report/common_template.html?isGroupColoredID=null&fields='+currentVisibleFields+'&fieldswidth='+currentVisibleFieldsWithWidth, 'PDFReportOptions', true, 330, 150, 'no', 'no');\n }\n}", "function openBugReportDialog() {\n var _emailDialog = Ti.UI.createEmailDialog({ subject:'Insights Bug Report - v' + lib.appInfo.getVersionAsString() + ' - Android', toRecipients:['platform-feedback@appcelerator.com'] });\n\n _emailDialog.messageBody = 'Please describe the issue:\\n\\n\\n' + 'If possible, please provide the steps to reproduce the issue:\\n\\n\\nAny additional details?\\n\\n\\nMay we contact you via email in regards to this report? Yes / No\\n\\n--------------------\\n- Insights v' + lib.appInfo.getVersionAsString() + '\\n - ' + Ti.Platform.model + ' ' + Ti.Platform.version + ' ' + Ti.Platform.architecture;\n\n _emailDialog.addEventListener('complete', function(e) {\n var _dialog = null;\n\n switch (e.result) {\n // #ANDROID: #BUG: We won't show a sent state alert as this also happens if the user discards. Sent as a state makes absolutely no sense if the user discards... I guess we can't tell what the user does to distinguish?\n // case _emailDialog.SENT:\n // _dialog = Ti.UI.createAlertDialog({ title:'Thank You', message:'Your bug report has been submitted.' });\n // _dialog.show();\n // break;\n case _emailDialog.FAILED:\n // #APPTS-3835\n _dialog = Ti.UI.createAlertDialog({ title:'Email Error', message:'Your bug report could not be sent due to an error. Please check your email configuration, network connection, and try again.\\n\\nWe apologize for any inconvenience.' });\n _dialog.show();\n break;\n default: break;\n }\n });\n\n _emailDialog.open();\n}", "function sendReport() {\r\n\t framework.sendReport(); \r\n}", "function previewExcelReport() {\r\n if (usrSubmitIsValid(false)) {\r\n var reportId = nlapiGetFieldValues('custpage_fmt_reports_select');\r\n if (reportId.length == 1) {\r\n var url = nlapiResolveURL('SUITELET', 'customscript_loec_ssu_setreportspage', 'customdeploy_loec_ssu_setreportspage');\r\n url += '&ispreview=T&select=' + reportId;\r\n url += '&selname=' + encodeURIComponent(nlapiGetFieldText('custpage_fmt_reports_select'));\r\n url += '&costcenter=' + nlapiGetFieldValue('custpage_fmt_reports_costcenter');\r\n url += '&year=' + nlapiGetFieldValue('custpage_fmt_reports_year');\r\n url += '&postingperiod=' + nlapiGetFieldValue('custpage_fmt_reports_postingperiod');\r\n url += '&date=' + nlapiGetFieldValue('custpage_fmt_reports_date');\r\n url += '&ppfrom=' + nlapiGetFieldValue('custpage_fmt_reports_ppfrom');\r\n url += '&ppto=' + nlapiGetFieldValue('custpage_fmt_reports_ppto');\r\n window.open(url, '_blank', 'toolbar=0,location=0,menubar=0');\r\n } else {\r\n alert('You can only preview one report at a time, please go back and make sure only one report is selected in the Report Name Field.');\r\n nlapiSetFieldValues('custpage_fmt_reports_select', ['']);\r\n }\r\n }\r\n}", "savePDFDialog() {\n dialog.showSaveDialog({ filters: [\n { name: 'PDF-Dokument', extensions: ['pdf'] }\n ]},(fileName) => {\n if (fileName === undefined) {\n console.log(\"Du hast die Datei nicht gespeichert\");\n return;\n }\n\n communicator.pdfPrint(fileName);\n });\n }", "function triggerPrintDialog() {\n window.print();\n }", "function SWEShowReportPopup (url, strReportName)\n{ \n if (url == \"\")\n {\n if ( typeof(s_SWEReport ) != \"undefined\" )\n {\n s_SWEReport.options[0].selected = true;\n }\n return;\n }\n \n if (strReportName == null)\n {\n strReportName = \"\";\n }\n \n var strCurrentFrame = Top()._swescript.GetCurrentAppletName();\n if (strCurrentFrame == null)\n {\n strCurrentFrame = \"\";\n }\n \n //propSet string like : @0`0`2`0``0`CurrentFrameName`<CurrentFrame>`ReportExecutableName`<ReportName>`\n //Some of them will not be used, but still we add them.\n var propSet = \"@0`0`2`0``0`\";\n propSet = propSet + \"CurrentFrameName`\" + strCurrentFrame + \"`\";\n propSet = propSet + \"ReportExecutableName`\" + strReportName + \"`\";\n \n url = SWEAppendArgsToURL(url, \"SWEIPS\", propSet);\n \n var bFromPopup = IsSWEPopup(this);\n if (pendingChanges(bFromPopup) && StopForSavingData(bFromPopup))\n {\n if ( typeof(s_SWEReport ) != \"undefined\" )\n {\n s_SWEReport.options[0].selected = true;\n }\n return;\n }\n\n \n SWEShowPopup(url);\n \n if ( typeof(s_SWEReport ) != \"undefined\" )\n {\n s_SWEReport.options[0].selected = true;\n }\n}", "showTableDialog() {\n if (this.tableDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.tableDialogModule.show();\n }\n }", "selectReport(report) {\n this.$scope.reportHash = report;\n this.setMode('report');\n }", "function createReport(individual, reportId) {\n\t\tif (reportId !== undefined) {\n\t\t\t$('[resource=\"'+individual.id+'\"]').find(\"#createReport\").dropdown('toggle');\n\t\t\tredirectToReport(individual, reportId);\n\t\t} else {\n\t\t\tvar s = new veda.SearchModel(\"'rdf:type' == 'v-s:ReportsForClass' && 'v-ui:forClass' == '\"+individual[\"rdf:type\"][0].id+\"'\", null);\n\t\t\tif (Object.getOwnPropertyNames(s.results).length == 0) {\n\t\t\t\talert('Нет отчета. Меня жизнь к такому не готовила.');\n\t\t\t} else if (Object.getOwnPropertyNames(s.results).length == 1) {\n\t\t\t\t$('[resource=\"'+individual.id+'\"]').find(\"#createReport\").dropdown('toggle');\n\t\t\t\tredirectToReport(individual, Object.getOwnPropertyNames(s.results)[0]);\n\t\t\t} else {\n\t\t\t\tvar reportsDropdown = $('[resource=\"'+individual.id+'\"]').find(\"#chooseReport\");\n\t\t\t\tif (reportsDropdown.html()== '') {\n\t\t\t\t\tObject.getOwnPropertyNames(s.results).forEach( function (res_id) {\n\t\t\t\t\t\t$(\"<li/>\", {\n\t\t\t \t\t\t \"style\" : \"cursor:pointer\", \n\t \t \"text\" : report['rdfs:label'][0],\n\t \t \"click\": (function (e) {\n\t \t\t redirectToReport(individual, Object.getOwnPropertyNames(res_id)[0]);\n\t \t })\n\t \t}).appendTo(reportsDropdown);\n\t\t\t\t\t});\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function buttonReport(buttonId, buttonName, buttonValue) {\n \t\t\t// information about the id of the button\n \t\t\tvar userMessage1 = \"Button id: \" + buttonId + \"\\n\";\n \t\t\t// then about the button name\n \t\t\tvar userMessage2 = \"Button name: \" + buttonName + \"\\n\";\n \t\t\t// and the button value\n \t\t\tvar userMessage3 = \"Button value: \" + buttonValue + \"\\n\";\n \t\t\t// alert the user\n \t\t\talert(userMessage1 + userMessage2 + userMessage3);\n \t\t}", "function generateReport(id, name)\r\n{\r\n\t//Tracker#13895.Removing the invalid Record check and the changed fields check(Previous logic).\r\n\r\n // Tracker#: 13709 ADD ROW_NO FIELD TO CONSTRUCTION_D AND CONST_MODEL_D\r\n\t// Check for valid record to execute process(New logic).\r\n \tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\t//Tracker# 13972 NO MSG IS SHOWN TO THE USER IF THERE ARE CHANGES ON THE SCREEN WHEN USER CLICKS ON THE REPORT LINK\r\n\t//Check for the field data modified or not.\r\n\tvar objHtmlData = _getWorkAreaDefaultObj().checkForNavigation();\r\n\r\n\tif(objHtmlData!=null && objHtmlData.hasUserModifiedData()==true)\r\n {\r\n //perform save operation\r\n objHtmlData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n\t\tvar str = 'report.do?id=' + id + '&reportname=' + name;\r\n \toW('report', str, 800, 650);\r\n }\r\n\r\n}", "showPageSetupDialog() {\n if (this.pageSetupDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.pageSetupDialogModule.show();\n }\n }", "function load_report_page() {\n page = 'user_help';\n load_page();\n}", "function doSummary() {\n if (userType == \"EXT\") {\n $(\"#merchAccts\").val($(\"#merchAccts\").val());\n }\n else {\n validateSummary4INT();\n $(\"#merchAccts\").val();\n }\n\n // cacheSearchValues();\n\n $.blockUI({\n message: PROCESSING,\n overlayCSS: {backgroundColor: '#E5F3FF'}\n });\n\n $(\"#reportForm\").attr(\"action\", \"summaryReport.htm\");\n $(\"#reportForm\").submit();\n}", "function ShowDetailsDialog(){\n $('#DetailsDialog').dialog('open');\n}", "function showDialog(){\n\t$.dialog.show();\n}", "function alertUser() {\n resetOutput();\n let alertDialog = document.getElementById(\"alertCustomDialog\");\n alertDialog.showModal();\n\n}", "function report (result){\n displayActions();\n displayInventory();\n displayScene();\n}", "function SubmitReport(nReportID)\n{\n\tvar hidReportID = document.getElementById('hidReportID');\n\n\thidReportID.value = nReportID;\n\tdocument.forms[0].submit();\n}", "function submitReport(report) {\n $.post(\"/api/reports\", report, function() {\n window.location.href = \"/blog\";\n });\n }", "openDialog() {\n var message = this.getQuestion() + chalk.dim(this.messageCTA + ' Waiting...');\n this.screen.render(message, '');\n\n // Pause Readline to prevent stdin and stdout from being modified while the editor is showing\n this.rl.pause();\n this.dialog.open(this.endDialog.bind(this));\n }", "function showDSFormDialog() {\n\tdocument.getElementById('dspopupModal').style.display = \"block\";\n\tpushMenu();\n}", "function exportReport(exportType) {\r\n\tvar network_id = $('#selectbox_agency').val();\r\n\tvar title= $('#selectbox_agency option:selected').text();\r\n\tvar loadingUrl = rootUrl + '/GenerateJasperReport' + '?export_type='\r\n\t\t\t+ exportType + '&jrxml=daily_vlmo&p_end_date='\r\n\t\t\t+ selectEndDate.format('yyyy-mm-dd') + '&p_start_date='\r\n\t\t\t+ selectStartDate.format('yyyy-mm-dd') + '&path=vlmo'\r\n\t\t\t+ \"&p_network_id=\" + network_id+\"&p_title=\"+title;\r\n\twindow.open(loadingUrl);\r\n}", "function printReport(startDate, endDate) {\n\n\t//Add a name to the report\n\tvar report = Banana.Report.newReport(\"Trial Balance\");\n\n\t//Add a title\n\treport.addParagraph(\"Trial Balance\", \"heading1\");\n\treport.addParagraph(\" \", \"\");\n\n\t//Create a table for the report\n\tvar table = report.addTable(\"table\");\n\t\n\t//Add column titles to the table\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \"\", 1);\n\ttableRow.addCell(\"Trial Balance at \" + Banana.Converter.toLocaleDateFormat(endDate), \"alignRight bold\", 3);\n\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \" bold borderBottom\");\n\ttableRow.addCell(\"\", \" bold borderBottom\");\n\ttableRow.addCell(\"Debit\", \"alignCenter bold borderBottom\");\n\ttableRow.addCell(\"Credit\", \"alignCenter bold borderBottom\");\n\n\t/* 1. Print the balance sheet */\n\tprintBalanceSheet(startDate, endDate, report, table);\n\n\t/* 2. Print the profit & loss statement */\n\tprintProfitLossStatement(startDate, endDate, report, table);\n\n\t/* 3. Print totals */\n\tprintTotals(report, table);\n\n\t//Add a footer to the report\n\taddFooter(report);\n\n\t//Print the report\n\tvar stylesheet = createStyleSheet();\n\tBanana.Report.preview(report, stylesheet);\n}", "function GenerateReport(GenfromSavedFilters, Withemail) {\n\n //$('.loading').hide();\n //SetLoadingImageVisibility(false);\n hasExcelData = true;\n\n var isPageValid = ValidateScreen();\n\n if (!isPageValid)\n return false;\n\n GenerateReportAddCall();\n\n}", "function addReportClick($event) {\n $mdDialog.show({\n controller: 'EmpAddReportController',\n controllerAs: 'vm',\n templateUrl: 'app/main/employee/write-report/add-report-dialog.tmpl.html',\n targetEvent: $event,\n locals: {\n customer: vm.selectedCustomer\n }\n })\n .then(function(report) {\n var data = {\n cus_id: vm.selectedCustomer.id,\n subject: report.subject,\n content: report.content\n };\n apiService.postAPI(SERVER_ADDREPORTEMP,true, data, function(e){\n var isSuccess = e.success == 1;\n if(!isSuccess){\n $mdDialog.show(\n $mdDialog.alert()\n .clickOutsideToClose(true)\n .title('Error')\n .textContent('Add report cannot be save! please try again.')\n .ok('OK!')\n );\n return;\n }\n $mdToast.show({\n template: '<md-toast><span flex>Lưu báo cáo thành công.</span></md-toast>',\n position: 'bottom right',\n hideDelay: 3000\n });\n vm.reports.unshift(e.result);\n });\n }, emailCancel);\n\n function emailCancel() {\n }\n }", "function showFailureReport(hostName) {\n\tvar str = '<div id=\"showFailureReportTable\" class=\"failureReportdiv\"></div>';\n\t/* Soni_Begin_27/09/2012_Changing thetitle of pop window from \"Failure Report for to Trust Report for */\n //fnOpenDialog(str,\"Failure report for \"+ hostName, 950, 600,false);\n\tfnOpenDialog(str,\"Trust Report\", 950, 600,false);\n /* Soni_Begin_27/09/2012_Changing thetitle of pop window from \"Failure Report for to Trust Report for */\n \n $('#showFailureReportTable').prepend(disabledDiv);\n sendJSONAjaxRequest(false, 'getData/getFailurereportForHost.html',\"hostName=\"+hostName , getFailureReportSuccess, null);\n}", "function showReportFlag(iId){\n //center the dialog\n var left = ($(document).width()/2) - ($('#flagdialog').width()/2);\n var top = ($('html').height()/2) - ($('#flagdialog').height()/2);\n $('#flagdialog').css('top', \"\" + top + \"px\");\n $('#flagdialog').css('left', \"\" + left + \"px\");\n \n //show the dialog and put the shade\n $('#flagdialog').fadeIn('normal');\n $('#glassloading').slideToggle('normal');\n \n //put the right values in the file hidden fields\n $('#reasonshidden').val(iId);\n \n}", "function onReportDiagnosticPopupBeforeShow() {\r\n if (seeAllClosed) {\r\n seeAllClosed = false;\r\n } else {\r\n setTimeout(resetReportDiagnosticPopupPosition, 0);\r\n }\r\n }", "function onReportDiagnosticPopupOkBtnClick() {\r\n reportDiagnosticToggleSwitch.click();\r\n }", "function DrawReport(oJsonResult) {\n\n if (oJsonResult.ERROR != null) {\n window.alert(options.PluginName + \": Server error getting report:\\n\" + oJsonResult.ERROR);\n return;\n }\n\n try {\n\n //Get result table\n var oResultTable = oJsonResult.resultTable;\n\n //Get the DOM object displaying the result table\n var oPrintedTable = getReportTables(oResultTable, true/*Draw column names*/);\n\n //Add export to Excel link \n var oDivReportName = $(\".ReportDataExcel\", oContainer);\n applyExcelLinkWithPrintableColumns(oDivReportName, options);\n\n\n //Get template element to be populated by report \n var oDivReportData = $(\".ReportData\", oContainer);\n\n oDivReportData.html(oPrintedTable);\n\n }\n catch (errorMsg) {\n window.alert(options.PluginName + \": Error displaying report:\\n\" + errorMsg);\n }\n }", "function showDialog() {\r\n \r\n // create dialog\r\n var dialogWindow = new Window('dialog', 'Auf PRINT-Artboard kopieren'); \r\n\r\n\r\n // choose number of columns for print\r\n dialogWindow.add('statictext', undefined, \"Spaltenanzahl\");\r\n dialogWindow.columnSelect = dialogWindow.add('dropdownlist', undefined, [1,2,3,4]);\r\n dialogWindow.columnSelect.selection = 0;\r\n\r\n\r\n // choose title, source, author \r\n dialogWindow.headerFooterBar = dialogWindow.add(\"panel\", undefined, \"Kopf- und Fusszeile\");\r\n dialogWindow.headerFooterBar.add('statictext', undefined, \"Titel\");\r\n dialogWindow.headerFooterBar.title = dialogWindow.headerFooterBar.add(\"edittext\", { x: 0, y: 0, width: 200, height: 20 }, titleTextFrame.contents);\r\n dialogWindow.headerFooterBar.add('statictext', undefined, \"Quellen\");\r\n dialogWindow.headerFooterBar.sources = dialogWindow.headerFooterBar.add(\"edittext\", { x: 0, y: 0, width: 200, height: 20 }, sourcesTextFrame.contents);\r\n dialogWindow.headerFooterBar.add('statictext', undefined, \"Kürzel\");\r\n dialogWindow.headerFooterBar.author = dialogWindow.headerFooterBar.add(\"edittext\", { x: 0, y: 0, width: 200, height: 20 }, authorTextFrame.contents);\r\n\r\n // choose font conversion\r\n dialogWindow.convertFonts = dialogWindow.add('checkbox', undefined, \"Alle enthaltenen Schriftelemente zu Univers Condensed/8pt konvertieren\");\r\n dialogWindow.convertFontsToBlack = dialogWindow.add('checkbox', undefined, \"Schriftelemente zusätzlich schwarz einfärben\");\r\n\r\n // add okay button and add listener\r\n dialogWindow.button = dialogWindow.add('button', undefined, \"Import for Print\");\r\n dialogWindow.button.onClick = importForPrint;\r\n dialogWindow.show(); \r\n function importForPrint() {\r\n var numColumns = dialogWindow.columnSelect.selection + 1;\r\n var title = dialogWindow.headerFooterBar.title.text;\r\n var sources = dialogWindow.headerFooterBar.sources.text;\r\n var author = dialogWindow.headerFooterBar.author.text;\r\n var convertFonts = dialogWindow.convertFonts.value;\r\n var convertFontsToBlack = dialogWindow.convertFontsToBlack.value;\r\n dialogWindow.close();\r\n\r\n updatePrintTextFrames(title, sources, author);\r\n duplicateToPrintArtboard(numColumns);\r\n if (convertFonts === true) {\r\n convertCount = convertPrintTextFramesToUnivers(printGraphicGroup, convertFontsToBlack, 0);\r\n alert(convertCount + \" Schriftelemente wurden in der Grafik gefunden und zu Univers Condensed/8pt konvertiert.\")\r\n }\r\n alert(\"Grafik wurde erfolgreich auf dem PRINT-Artboard eingefügt\")\r\n }\r\n\r\n}", "function ShowNewUserUI() {\n \n //Popup object/dialog.\n var oPopup = (mbIE) ? $f(\"NewEmployeePopup\") : $f(\"NewEmployeePopup\").contentWindow;\n \n goCloak.Show(\"ContentBox\", GetMaxZindex(), \"ContentBox\");\n \n //Set the action to perform if user clicks \"Run\" in the popup.\n //oPopup.SetProperty(\"GoCallback\", \"window.parent.Report_Run();\"); \n \n var oSrc = $(\"HdrUserAction\"); \n \n //Calc the position of the popup.\n var iLeft = oSrc.parentNode.offsetLeft + 50;\n if (iLeft < 0) iLeft = 20;\n var iTop = oSrc.parentNode.offsetTop + oSrc.parentNode.offsetHeight + 30;\n if (iTop < 0) iTop = 20;\n \n var sEmployeeType = \"admin-new-user\"; \n var sEmployeeID = 0;\n var sCompanyID = 0;\n var sCompanyName = null;\n\n //Position and display dialog.\n oPopup.ShowUI(iTop, iLeft, goCloak, sEmployeeType, sEmployeeID, sCompanyID, sCompanyName, this, true);\n\n}", "function showImport(){\n $(\"#import-dialog\").show();\n}", "addNewReport() {\n \n }", "function submit(){\n // set the sheet names for the excel doc\n var keys = [\"sponsored\",\"non_sponsored\",\"pending\",\"protocols\"];\n keys.forEach(function(key){\n reports[key]['sheet_name'] = key;\n });\n var event = {\n report_title : \"foo\",\n filename: makeFilename(req.params.querystring.p_Invest_ID),\n reports: reports\n }\n //RDashExports.generateExcel(event, fakeContext );\n ExcelExport.generateExcel(event, fakeContext );\n }", "function reportUser() {\n xhr = new XMLHttpRequest();\n var url = document.URL + 'report';\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n console.log('User reported with success!');\n }\n }\n xhr.send();\n }", "function displayPDF_stmtAccountTrxCharges(currentPageRef,reportUrl)\n{\n\t////////////////////////////////////\n\t//object works IE8, does not work in FireFox\n\t//var chooseLanguageDivContent = '<div id=\"openPDFDivId\"><object data=\"' + certificateReportUrl + '\" type=\"application/pdf\" width=\"100%\" height=\"100%\"> <p>cannot open PDF</a></p> </object></div>';\n\n\t//IFrame works on FireFox , does not work on IE8\n\t//var chooseLanguageDivContent = '<div id=\"openPDFDivId\"><iframe src=\"' + certificateReportUrl + '\" width=\"100%\" height=\"100%\"> </iframe></div>';\n\n\t//Embed works IE8, does not work on FireFox\n\t//var chooseLanguageDivContent = '<div id=\"openPDFDivId\"><embed src=\"' + certificateReportUrl + '\" width=\"100%\" height=\"100%\"></div>';\n\n\tvar openPDFDiv = null;\n\n\tif ($.browser.msie) \n\t{\n\t\topenPDFDiv = '<div id=\"openPDFDivId_'+ currentPageRef +'\"><embed src=\"' + reportUrl + '\" width=\"100%\" height=\"100%\"></div>';\n\t} else \n\t{\n\t\topenPDFDiv = '<div id=\"openPDFDivId_'+ currentPageRef +'\"><iframe src=\"' + reportUrl + '\" width=\"100%\" height=\"100%\"> </iframe></div>';\n\t}\n\n\tvar openPDFDivElement = $(openPDFDiv);\n\n\t$('body').append(openPDFDivElement);\n\n\topenPDFDivElement.dialog( {\n\t\tmodal : true,\n\t\ttitle : stat_of_account_key,\n\t\tautoOpen : false,\n\t\t//show : 'slide',\n\t\tposition : 'center',\n\t\twidth : returnMaxWidth(950),\n\t\theight : returnMaxHeight(750),\n\t\tclose : function() \n\t\t{\n\t\t\tif ($(\"#openPDFDivId\")) \n\t\t\t{\n\t\t\t\t$(\"#openPDFDivId_\"+ currentPageRef).dialog(\"destroy\");\n\t\t\t\t$(\"#openPDFDivId_\"+ currentPageRef).remove();\n\t\t\t}\n\t\t}\n\t});\n\n\t$(openPDFDivElement).dialog(\"open\");\n\t\t\n}", "function configure() {\n\n const popupUrl = `${window.location.origin}/dialog.html`;\n\n let input = \"\";\n\n tableau.extensions.ui.displayDialogAsync(popupUrl, input, { height: 540, width: 800 }).then((closePayload) => {\n // The close payload is returned from the popup extension via the closeDialog method.\n $('#interval').text(closePayload);\n }).catch((error) => {\n // One expected error condition is when the popup is closed by the user (meaning the user\n // clicks the 'X' in the top right of the dialog). This can be checked for like so:\n switch (error.errorCode) {\n case tableau.ErrorCodes.DialogClosedByUser:\n console.log(\"Dialog was closed by user\");\n break;\n default:\n console.error(error.message);\n }\n });\n }", "function enableWaitReport(show) {\n if (typeof jQuery != 'undefined') {\n if (show == true) {\n $('#divWaitReport').show();\n } else {\n $('#divWaitReport').hide();\n }\n } else {\n console.log('Common.enableWaitReport() - jQuery not defined!');\n }\n}", "function MostrarDialogoImprimir() {\n window.print();\n}", "function reporte(obj, idLamp) {\n// alert(idLamp);\n\twindow.open(\"admin/reporte.php?id=\"+idLamp,'','width=1000,height=400,toolbar=no,location=no,left=200,top=200');\n}", "function reportePDF(){\n\tvar desde = $('#bd-desde').val();\n\tvar hasta = $('#bd-hasta').val();\n\twindow.open('../php/productos.php?desde='+desde+'&hasta='+hasta);\n}", "function showDialogBarcodeCreation() {\n var title = 'Generate and Export Barcodes'; \n var templateName = 'barcodes'; \n var width = 800; \n \n createDialog(title,templateName,width);\n}", "function createReportWindow(arg) {\n const reportWin = new BrowserWindow({\n width: 900,\n height: 650,\n x: 20,\n y: 30,\n resizable: true,\n webPreferences: {\n nodeIntegration: true\n },\n show: false\n });\n\n reportWin.loadFile(\"./src/resultsWindow/index.html\");\n reportWin.once(\"ready-to-show\", () => {\n reportWin.webContents.send(\"load_results\", arg);\n reportWin.show();\n });\n // reportWin.webContents.openDevTools();\n}", "function SendReportToExcel(sReportName){\n \n var oParams = GetReportParameters();\n \n var url = _reports_ExcelExportUrl + \"?ReportId=\" + sReportName \n + \"&idWorkflow=\" + oParams.workflowId\n + \"&idWfClass=\" + oParams.wfclassId\n + \"&userFilters=\" + oParams.userFiltersString\n + \"&date=\" + new Date()\n + \"&idStopwatch=\" + oParams.stopwatchId\n + \"&idCounter=\" + oParams.counterId;\n\n\n if(oParams.dateFrom != \"\"){\n url += \"&dtmFrom=\" + oParams.dateFrom\n + \"&dtmTo=\" + oParams.dateTo\n }\n\n window.open(url, \"Bizagi\");\n}", "function showAlert() {\r\n console.log('show alert');\r\n console.log($mdDialog);\r\n var alert = $mdDialog.alert({\r\n title: 'Manual Jog',\r\n //content: 'This is an example of how easy dialogs can be!',\r\n content: manualHtmlString,\r\n ok: 'Close'\r\n });\r\n $mdDialog\r\n .show( alert )\r\n .finally(function() {\r\n alert = undefined;\r\n });\r\n }", "function showDialog(panel){\n // create an iframe with ID = modalFrameId in the dialog window, then open the dialog\n $(\"#dialogPanelId\").html('<iframe id=\"modalIframeId\" width=\"100%\" height=\"100%\" marginWidth=\"0\" marginHeight=\"0\" frameBorder=\"0\" scrolling=\"auto\" />').dialog(\"open\");\n\n // locate the iFrame and set the iFrame source to be the Xi form to run. Add in the form parameter by locating the value of the hidden form field contained in the panel that was clicked.\n $(\"#modalIframeId\").attr(\"src\",\"/ufs/ufsmain?formid=ES030513_DIALOG_POPUP&P1=\"+$(panel).find('.panelValue').first().val());\n}", "function showAlert() {\n alert = $mdDialog.alert({\n title: 'Attention',\n textContent: 'This is an example of how easy dialogs can be!',\n ok: 'Close'\n });\n\n $mdDialog\n .show(alert)\n .finally(function () {\n alert = undefined;\n });\n }", "function sendReport() {\r\n\t\r\n\ttry {\r\n\t\t// Step 1. Get Report Model by ReportName\r\n\t\tvar reportInfoResult = aa.reportManager.getReportInfoModelByName(reportName);\r\n\t\tif(reportInfoResult.getSuccess() == false) {\r\n\t\t\t// Notify adimistrator via Email, for example\r\n\t\t\tlogError(\"Could not found this report \" + reportName);\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Step 2. Initialize report\r\n\t\treport = reportInfoResult.getOutput();\r\n\t\treport.setModule(module);\r\n\t\treport.setCapId(capId1 + \"-\" + capId2 + \"-\" + capId3 );\r\n\t\treport.setReportParameters(reportParamters);\r\n\t\treport.getEDMSEntityIdModel().setAltId(capIDString);\r\n\t\t\r\n\t\t// Step 3. Check permission on report\r\n\t\tvar permissionResult = aa.reportManager.hasPermission(reportName,reportUser);\r\n\t\tif(permissionResult.getSuccess() == false || permissionResult.getOutput().booleanValue() == false) {\r\n\t\t\t// Notify adimistrator via Email, for example\r\n\t\t\tlogError(\"The user \" + reportUser + \" does not have perssion on this report \" + reportName);\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Step 4. Run report\r\n\t\tvar reportResult = aa.reportManager.getReportResult(report);\r\n\t\tif(reportResult.getSuccess() == false){\r\n\t\t\t// Notify adimistrator via Email, for example\r\n\t\t\tlogError(\"Could not get report from report manager normally, error message please refer to: \" + reportResult.getErrorMessage());\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Step 5, Store Report File to harddisk\r\n\t\treportResult = reportResult.getOutput();\r\n\t var reportFileResult = aa.reportManager.storeReportToDisk(reportResult);\r\n\t\tif(reportFileResult.getSuccess() == false) {\r\n\t\t\t// Notify adimistrator via Email, for example\r\n\t\t\tlogError(\"The appliation does not have permission to store this temporary report \" + reportName + \", error message please refer to:\" + reportResult.getErrorMessage());\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Step 6. Send Report via Email\r\n\t var reportFile = reportFileResult.getOutput();\r\n\t\tvar sendResult = aa.sendEmail(emailFrom, emailTo, emailCC, emailSubject, emailContent, reportFile);\r\n\t\tif(sendResult.getSuccess()) {\r\n\t\t\tlogDebug(\"A copy of this report has been sent to the valid email addresses.\"); \r\n\t }\r\n\t else {\r\n\t\t\tlogError(\"System failed send report to selected email addresses because mail server is broken or report file size is great than 5M.\");\r\n\t }\r\n\t}\r\n\tcatch(err){\r\n\t\tlogError(\"One error occurs. Error description: \" + err.description );\r\n\t\treturn false;\r\n\t}\t\r\n}", "function generaReportErm(){\n\t\n\twindow.location.href= \"/CruscottoAuditAtpoWebWeb/jsonATPO/getReportErmPDF\";\n\t\n}", "function exportPDF() {\n console.log(\"Going to export a PDF\");\n viz.showExportPDFDialog();\n}", "function showReports() {\n var reportsTab = document.getElementsByClassName(\"reports-tab\");\n reportsTab[0].className = \"tab reports-tab selected\";\n\n var reports = document.getElementsByClassName(\"reports\");\n reports[0].style.display = \"flex\";\n\n var firmwareUpdaterTab = document.getElementsByClassName(\"firmware-updater-tab\");\n firmwareUpdaterTab[0].className = \"tab firmware-updater-tab\";\n\n var firmwareUpdater = document.getElementsByClassName(\"firmware-updater\");\n firmwareUpdater[0].style.display = \"none\";\n\n var alertRulesTab = document.getElementsByClassName(\"alert-rules-tab\");\n alertRulesTab[0].className = \"tab alert-rules-tab\";\n\n var alertRules = document.getElementsByClassName(\"alert-rules\");\n alertRules[0].style.display = \"none\";\n\n cameraReport();\n}", "function showPayeePage() {\n gTrans.showDialogCorp = true;\n document.addEventListener(\"evtSelectionDialogInput\", handleInputPayeeAccOpen, false);\n document.addEventListener(\"evtSelectionDialogCloseInput\", handleInputPayeeAccClose, false);\n document.addEventListener(\"tabChange\", tabChanged, false);\n document.addEventListener(\"onInputSelected\", okSelected, false);\n //Tao dialog\n dialog = new DialogListInput(CONST_STR.get('TRANS_LOCAL_DIALOG_TITLE_ACC'), 'TH', CONST_PAYEE_INTER_TRANSFER);\n dialog.USERID = gCustomerNo;\n dialog.PAYNENAME = \"1\";\n dialog.TYPETEMPLATE = \"0\";\n dialog.showDialog(callbackShowDialogSuccessed, '');\n}", "function reportClicked() {\n chrome.runtime.sendMessage({ \"button\": \"report\", \"id\": data[currentIndex]._id });\n}", "function onSchedule_() {\n FormApp.getUi().showModalDialog(\n HtmlService.createHtmlOutputFromFile(\"Main\").setWidth(600).setHeight(675), \"Schedule\");\n}", "static createAndDisplay(parameters) {\n const dg = new SuiLayoutDialog(parameters);\n dg.display();\n }", "function showStartScreen(){ \n var dialogVariables = Dialogs.showDialog(new optionsDialog(), Constants.DIALOG_TYPE_WIZARD, \"Choose Attribute and Objects\"); \n return dialogVariables; \n}", "function showExport() {\n $(\"#export-dialog\").show();\n buildSelectApiTree(\"#export-dialog\",gdata.apiList,\"collapsed\")\n $(\"#export-dialog .filename\").focus();\n}", "function reports(req,res){\n res.render('admin/general/views/reports');\n}" ]
[ "0.76670206", "0.7275469", "0.72505516", "0.68038166", "0.6778175", "0.6692404", "0.66070193", "0.6514185", "0.6461248", "0.6453411", "0.6404945", "0.6345106", "0.61511767", "0.6120984", "0.60982496", "0.6069775", "0.60486877", "0.5928666", "0.59062123", "0.58739394", "0.58636683", "0.58367556", "0.5835468", "0.5801998", "0.57687587", "0.5765494", "0.57211107", "0.57211107", "0.57024604", "0.5702428", "0.5652183", "0.5589035", "0.55779976", "0.5564644", "0.553678", "0.55082643", "0.55023766", "0.5489693", "0.5486174", "0.5479973", "0.5474097", "0.5462156", "0.54613256", "0.54509854", "0.5427075", "0.54164964", "0.54055315", "0.5390055", "0.5388912", "0.538529", "0.5381775", "0.5378385", "0.5377724", "0.5367618", "0.5359805", "0.53559685", "0.535336", "0.5337122", "0.5330446", "0.53285724", "0.5310438", "0.53028005", "0.5295778", "0.52931345", "0.52883697", "0.5279507", "0.5276746", "0.5266407", "0.52616996", "0.52503884", "0.52503365", "0.52494705", "0.52488273", "0.5240894", "0.52315956", "0.52290684", "0.5211549", "0.51992637", "0.51979566", "0.5190778", "0.5185894", "0.5181761", "0.5177259", "0.51698595", "0.5168821", "0.5167844", "0.51585555", "0.51575524", "0.5156697", "0.51555353", "0.5152636", "0.51498765", "0.5149726", "0.51465577", "0.51462466", "0.5145864", "0.5138027", "0.51347286", "0.5132498", "0.51303154" ]
0.7562877
1
This is the getter for lastEventId.
function lastEventId() { return hub_getCurrentHub().lastEventId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lastEventId() {\n\t return getCurrentHub().lastEventId();\n\t}", "function lastEventId() {\n return core.getCurrentHub().lastEventId();\n}", "function lastEventId() {\n return core_1.getCurrentHub().lastEventId();\n}", "get eventId() {\n return this._eventData.id;\n }", "get eventId() {\n return this._eventData.id;\n }", "function lastEventId() {\n return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().lastEventId();\n}", "function lastEventId() {\r\n return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().lastEventId();\r\n}", "function lastEvent() {\n if (story.length === 0) {\n throw new Error('Cannot get last event of empty story');\n }\n return story[story.length - 1];\n }", "static getLastId() {\r\n let lastId = 0\r\n if (eventos.length > 0) {\r\n lastId = eventos[eventos.length - 1].id\r\n console.log('O lastId do utilizador é = ' + lastId)\r\n }\r\n\r\n return lastId\r\n }", "get eventDate() {\n return new Date(this._eventData.event_timestamp);\n }", "get eventDate() {\n return new Date(this._eventData.event_timestamp);\n }", "get _lastId () {\n return new ID(this._id.user, this._id.clock + this._length - 1)\n }", "get _lastId () {\n return new ID(this._id.user, this._id.clock + this._length - 1)\n }", "get lastId () {\n return createID(this.id.client, this.id.clock + this.length - 1)\n }", "get eventDate() {\n this._logger.debug(\"eventDate[get]\");\n return this._eventDate;\n }", "getEventType() {\n return this.eventType;\n }", "get lastMessage() {}", "get lastMessage() { return this.get('lastMessage'); }", "get eventTimingReference () {\r\n\t\treturn this._eventTimingReference;\r\n\t}", "get event() {\n return contextEvent.get();\n }", "get lastAssignedID() {\r\n return this._lastAssignedID;\r\n }", "get eventData () {\r\n\t\treturn this._eventData;\r\n\t}", "get lastMessageDate() { return this.get('lastMessageDate'); }", "get eventTimingDate () {\r\n\t\treturn this._eventTimingDate;\r\n\t}", "get eventTimingDateTime () {\r\n\t\treturn this._eventTimingDateTime;\r\n\t}", "get eventMessage() {\n var _a;\n return (_a = this._eventData.event_data.message) !== null && _a !== void 0 ? _a : '';\n }", "get event() {\n return this._event;\n }", "get lastSystemChange() {\n\t\treturn this.__lastSystemChange;\n\t}", "static getLastId(){\n let lastId =0\n if (games.length > 0) {\n lastId = games[games.length-1].id\n }\n return lastId\n }", "get lastStatusChange() {\n return this.getStringAttribute('last_status_change');\n }", "get_last_update() {\n return this._last_update\n }", "function _getEventTimestamp(event) {\n\t return event.timeStamp || Date.now();\n\t }", "function getEventId () {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = Math.random() * 16 | 0\n const v = c === 'x' ? r : (r & 0x3 | 0x8)\n return v.toString(16)\n })\n}", "get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }", "get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }", "get event () {\n\t\treturn this._event;\n\t}", "get event() {\n\t\treturn this.__event;\n\t}", "get event() {\n\t\treturn this.__event;\n\t}", "get event() {\n\t\treturn this.__event;\n\t}", "static getLastId() {\r\n let lastId = 0\r\n if (utilizadores.length > 0) {\r\n lastId = utilizadores[utilizadores.length - 1].id\r\n console.log('O lastId do utilizador é = ' + lastId)\r\n }\r\n\r\n return lastId\r\n }", "get lastAccessed() {\n return this.originalResponse.lastAccessed;\n }", "get lastAccessed() {\n return this.originalResponse.lastAccessed;\n }", "get eventDate() {\n this._logService.debug(\"gsDiggUserDTO.eventDate[get]\");\n return this._eventDate;\n }", "function eventEnd(event) {\n\t\treturn event.end ? cloneDate(event.end) : defaultEventEnd(event);\n\t}", "function eventEnd(event) {\n\t\treturn event.end ? cloneDate(event.end) : defaultEventEnd(event);\n\t}", "function eventEnd(event) {\n\t\treturn event.end ? cloneDate(event.end) : defaultEventEnd(event);\n\t}", "getEvent(id) {\r\n return apiClient.get(\"/events/\" + id);\r\n }", "get eventVersion() {\n return this._eventData.version;\n }", "get eventVersion() {\n return this._eventData.version;\n }", "get lastTokenLocation() {\n\t\treturn this.state.lastTokenLocation;\n\t}", "function $getEventType(e) {\r\n\t\treturn e.type;\r\n\t}", "function getId() {\n return (Events.length);\n}", "function lastHour() {\n var d = new Date();\n d.setHours(d.getHours() - 1);\n return d.getTime();\n }", "get lastUpdatedDate() {\n return this.getStringAttribute('last_updated_date');\n }", "get _thereWereNewEvents() {\n this._logService.trace(\"gsDiggEventManager._thereWereNewEvents[get]\");\n return this._thereWereNewEventsValue;\n }", "get lastDayEventListElem() {\n const daysEl = this.elemTripDays.querySelectorAll(`.day`);\n return daysEl[daysEl.length - 1].querySelector(`.trip-events__list`);\n }", "getLastTraceInContext(contextId) {\n return this._lastTraceByContextId[contextId];\n }", "lastRequest() {\n return this._lastRequest;\n }", "lastCourseId() {\r\n this.log(\"retrieving last entry id\");\r\n return this.context\r\n .retrieveSingle(` \r\n SELECT last_insert_rowid() AS id;\r\n `);\r\n }", "getTimeStamp() {\n return this.timestamp;\n }", "get eventTimingTiming () {\r\n\t\treturn this._eventTimingTiming;\r\n\t}", "function nextEventId() {\n\n\t\t\tfunction max(array) {\n\t\t\t\t// keep picking the larger value until it is the largest\n\t\t\t\treturn array.reduce(function (lhs, rhs) {\n\t\t\t\t\treturn rhs > lhs ? rhs : lhs;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// find the next integer after the largest ID in our store\n\t\t\treturn max(events.map(function (evt) {\n\t\t\t\treturn evt.id;\n\t\t\t})) + 1;\n\t\t}", "get _last_caller() {\n return recentModelCallerComponent\n }", "get onDidSave() {\r\n return this._onDidSave.event;\r\n }", "get onDidSave() {\r\n return this._onDidSave.event;\r\n }", "get latestFilterField() {\n return this.filters.last ? this.filters.last.property : null;\n }", "get_lastMsg()\n {\n return this.liveFunc._lastMsg;\n }", "get() {\n return this.lastValue;\n }", "getLastUpdated(id) {\n return this.getData(id)\n .then(data => data.length ? data[data.length - 1].timestamp : null);\n }", "function getEventById(id) {\n for (var i = 0; i < this.item.eventsList.length; i++) {\n if (this.item.eventsList[i].id.toString() == id) {\n return this.item.eventsList[i];\n }\n }\n\n return null;\n }", "get eventName () {\r\n\t\treturn this._eventName;\r\n\t}", "get latestFilterField() {\n return this.filters.last ? this.filters.last.property : null;\n }", "getMostRecentKey() {\n return this.listOfMostRecent.head.key;\n }", "function getSingleEvent() {\n return {\n type: \"FETCH_SINGLE_EVENT\"\n };\n}", "get lastModified() {\n return this.getStringAttribute('last_modified');\n }", "last() {\n return this._last && this._last.value;\n }", "get eventResourceKey() {\n return `${this.event ? this.eventId : this.data.eventId || this.internalId}-${this.resource ? this.resourceId : this.data.resourceId || this.internalId}`;\n }", "function getLastSelectedEdge() {\r\n return lastSelectedEdge;\r\n}", "get adverseEvent() {\n if (!this._adverseEvent.value) return null;\n return this._adverseEvent.value.coding[0].displayText.value;\n }", "get eventParticipant () {\n\t\treturn this._eventParticipant;\n\t}", "get eventType() {\n return this._eventData.event_type;\n }", "get eventType() {\n return this._eventData.event_type;\n }", "get mostRecentInput() {\n return this._mostRecent;\n }", "state() {\n return this.eventContext.state();\n }", "static get lastDiffLocation () {\n if (GlobalModel.hasOwnProperty(\"_lastDiffLocation\")===false) {\n GlobalModel._lastDiffLocation = null;\n }\n \n return GlobalModel._lastDiffLocation;\n }", "lastResponse() {\n return this._lastResponse;\n }", "get rawEvent(): TelegramRawEvent {\n return this._rawEvent;\n }", "lastInsert() {\n return this._lastInsert;\n }", "get lastchanged() { return lastchanged }", "getMostRecentKey() {\r\n return this.listOfMostRecent.head.key;\r\n }", "get dateModified () { return this.lastModified; }", "get_lastTimeRemoved()\n {\n return this.liveFunc._lastTimeRemoved;\n }", "function fetchEndTime() {\n\t\treturn localStorage['endTime'];\n\t}", "function grabEventData(eventId) {\n //Grab all event data from Dashboard Service\n var allEvents = EventDashboardFactory.getEventData();\n\n //Match with the given eventId\n for (var i = 0; i < allEvents.length; i++) {\n if (parseInt(eventId) === allEvents[i].id) {\n return allEvents[i];\n }\n }\n console.log('Could not get event data for event id: ', eventId);\n }", "function getEventDescription(event) {\n\t const { message, event_id: eventId } = event;\n\t if (message) {\n\t return message;\n\t }\n\n\t const firstException = getFirstException(event);\n\t if (firstException) {\n\t if (firstException.type && firstException.value) {\n\t return `${firstException.type}: ${firstException.value}`;\n\t }\n\t return firstException.type || firstException.value || eventId || '<unknown>';\n\t }\n\t return eventId || '<unknown>';\n\t}", "get LastSequence() {\n return this[sLastSequence];\n }", "lastKey() {\n return this.keyArray()[this.keyArray().length - 1];\n }", "function getId() {\n\t return ++lastId;\n\t }", "function getId() {\n\t return ++lastId;\n\t }", "function getId() {\n\t return ++lastId;\n\t }" ]
[ "0.79700005", "0.79668206", "0.7807068", "0.71792233", "0.71792233", "0.71561086", "0.7094254", "0.66781336", "0.6424028", "0.60172457", "0.60172457", "0.59468675", "0.59468675", "0.59381956", "0.5925975", "0.5906", "0.58846474", "0.5879715", "0.5864876", "0.58641136", "0.5800039", "0.57995325", "0.57817346", "0.57594573", "0.57545006", "0.5643121", "0.5639545", "0.56306624", "0.562241", "0.5601178", "0.55901265", "0.5579674", "0.5575606", "0.5547668", "0.5547668", "0.554601", "0.55143386", "0.55143386", "0.55143386", "0.5492488", "0.5484703", "0.5484703", "0.54481", "0.54091996", "0.54091996", "0.54091996", "0.54036087", "0.53556514", "0.53556514", "0.53465915", "0.53126234", "0.52965844", "0.5296526", "0.5289507", "0.5278667", "0.52778095", "0.5272156", "0.52552354", "0.5215784", "0.5215551", "0.5213531", "0.5212727", "0.51807255", "0.51805544", "0.51805544", "0.5172636", "0.5143019", "0.5135524", "0.51286626", "0.5117605", "0.5106639", "0.50980467", "0.5095558", "0.50923574", "0.5087453", "0.50836986", "0.5081224", "0.50796616", "0.5078687", "0.50732255", "0.50697136", "0.50697136", "0.50646883", "0.504898", "0.50482726", "0.50371635", "0.5036025", "0.5025883", "0.50228614", "0.5008246", "0.5005287", "0.50009316", "0.4999645", "0.49963626", "0.49853465", "0.49838638", "0.4982578", "0.49780965", "0.49780965", "0.49780965" ]
0.7679224
3
This function is here to be API compatible with the loader.
function forceLoad() { // Noop }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalLoader() { }", "function Loader() {\n\n}", "load() {}", "load() {}", "initLoader(loaderName) {\n loaderName = true;\n }", "lateLoad() {\n\n }", "transient private protected internal function m182() {}", "function LoaderProto() {}", "function LoaderProto() {}", "function LoaderProto() {}", "load() {\r\n\r\n }", "transient private internal function m185() {}", "load() {\n\n }", "private internal function m248() {}", "_loading() {\n }", "patched() {\n this._handleImageLoad();\n }", "loaded() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "protected internal function m252() {}", "private public function m246() {}", "isLoadedFromFileSystem() {\n return false;\n }", "load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }", "get loadType() {}", "transient private protected public internal function m181() {}", "function forceLoad() {}", "function GetLoaderInternalData(value) {\n // Loader methods could be placed on wrapper prototypes like\n // String.prototype.\n if (typeof value !== \"object\")\n throw std_TypeError(\"Loader method called on incompatible primitive\");\n\n let loaderData = callFunction(std_WeakMap_get, loaderInternalDataMap, value);\n if (loaderData === undefined)\n throw std_TypeError(\"Loader method called on incompatible object\");\n return loaderData;\n}", "constructor () {\n this.hdrCubeLoader = new HDRCubeTextureLoader();\n this.gltfLoader = new GLTFLoader();\n this.fbxLoader = new FBXLoader();\n this.jsonLoader = new JSONLoader();\n this.textureLoader = new TextureLoader();\n this.fontLoader = new FontLoader();\n this.isLoaded = false;\n }", "async load () {}", "cacheLoader (mainNameSpace) {\n \n let NoEmptyNamespace = false \n if (mainNameSpace) {\n \n let keys_exists = Object.keys(mainNameSpace) ; \n\n (keys_exists || keys_exists.length > 0)?NoEmptyNamespace = true : NoEmptyNamespace \n \n if(NoEmptyNamespace){\n \n for(let method in mainNameSpace){\n \n (typeof mainNameSpace[method] == \"function\") ? mainNameSpace[method]() : console.warn(`no module found on ${mainNameSpace}`)\n }\n }\n }\n \n }", "registerLoader (name, loaderFunc) {\n registerLoader(name, loaderFunc)\n }", "registerLoader (name, loaderFunc) {\n registerLoader(name, loaderFunc)\n }", "static LoadFromFile() {}", "static private protected internal function m118() {}", "static final private internal function m106() {}", "function XLoader() {\r\n return __loadScript(\"YLoader\", 2);\r\n}", "function _____SHARED_functions_____(){}", "function defaultLoader() {\n H.events.dispatch(\"error\", {\n \"msg\": \"loader/loaderSync has not been configured.\"\n });\n return null;\n}", "static transient final protected public internal function m46() {}", "LoadAsset() {}", "static LoadFromMemory() {}", "function preLoad() {\n return;\n}", "async onLoad() {}", "transient final private protected internal function m167() {}", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "LoadSourceState() {\n\n }", "function Loader() {\n this.loadRes = [];\n this._groupListens = {};\n }", "function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }", "function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }", "__previnit(){}", "function createLoaderLoad(object) {\n return {\n // modules is an object for ES5 implementation\n modules: {},\n loads: [],\n loaderObj: object\n };\n }", "onLoad() { }", "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 }", "onLoad() {}", "preload() {\n \n }", "function ResourceLoader() {\n this.loadedScenesByUid = {};\n this.loadedCommonEventsById = [];\n }", "function loading() {\n}", "load() {\n return this.loading || (this.loading = this.loadFunc().then(support => this.support = support, err => { this.loading = null; throw err; }));\n }", "destroyLoader(loaderName) {\n loaderName = false;\n }", "async afterLoad () {\n }", "function forceLoad() {\n\t // Noop\n\t}", "loadingData() {}", "loadingData() {}", "transient private public function m183() {}", "import() {\n }", "obtain(){}", "static ready() { }", "load(callback) {\n callback();\n }", "_initialize() {\n\n }", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "function ComponentDefLoader() {\n this.pending = null;\n this.loading = 0;\n this.counter = 0;\n this.scriptTagCounter = 0;\n this.requestedDescriptors = {};\n this.lastContextParameterName;\n}", "if (!this._loadImage) {\n this._loadImage = import('blueimp-load-image');\n }", "function UrlFlipperLoader( context ) { this._ctx = context; }", "function run() {\r\n\t// Initialize the loader before anything happens\r\n\tloader.init();\r\n}", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "loadJSONOrig(gl, avatarName) {\nvar VER_3_DIG, jsnchrctr;\nthis.gl = gl;\nthis.avatarName = avatarName;\n//-------\n// Init.\nthis.avBase = Config.getAvBase(this.avatarName);\nthis.readJSON = (jfile) => {\n// @STD_DATA_IN.getJSON \"#{@avBase}#{jfile}\"\nlggr.warn(`Character: Synchronous reading of JSON data not possible for ${this.avBase}${jfile}`);\nreturn null;\n};\n// Load JSON avatar definition data and check the version is ok.\njsnchrctr = this.readJSON(\"avdef.json\");\nVER_3_DIG = Math.floor(100 * Number(jsnchrctr.version));\nif (VER_3_DIG < 310) {\nthrow new Error(`Avatar version ${VER_3_DIG} is not viable!`);\n}\n// Populate this character.\nthis.loadVolumeLimits(jsnchrctr);\nthis.loadMeshes(jsnchrctr);\nthis.loadInitPose(jsnchrctr);\nthis.loadSkeleton(jsnchrctr);\nthis.loadAmbientMotionDef(jsnchrctr);\nthis.loadTextureData(jsnchrctr);\n// Tidy up loose ends.\nthis.setUpTextureFromJSON();\nthis.setLengthScaleFactor();\nthis.setUpMeshesForGL();\nreturn void 0; // void result\n}", "static load() {\n\t\t\treturn loader().then(ResolvedComponent => {\n\t\t\t\tComponent = ResolvedComponent.default || ResolvedComponent\n\t\t\t})\n\t\t}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function createTranslateLoader(http) {\n}", "function Preloader() \n{\n}", "function load(){\r\n\r\n}", "load( resolver ) {\n const nextToLoad = this.layers.find( ( { isready } ) => !isready );\n if( nextToLoad ) {\n const loader = Promise.all( nextToLoad.prop.use.map( ({ type = \"url\", ...use }) =>\n type === \"url\" ? Loader.default.obtain( use ) : this.get( use.path )\n ));\n loader.then(( packs ) => {\n packs.map( (pkj, index) => {\n const { type = \"url\" } = nextToLoad.prop.use[index];\n if(type === \"url\") {\n this.appendData( pkj, nextToLoad.src );\n }\n else {\n this.merge( pkj, true );\n }\n } );\n nextToLoad.isready = true;\n this.load( resolver );\n });\n }\n else {\n resolver( this );\n }\n }", "load(cb){\r\n\r\n\t\tconsole.log('Loading assets (difficulty: 1)');\r\n\r\n\t\t// Chiama il metodo load della classe parent\r\n\t\tsuper.load(cb, 1);\r\n\t}", "preload () {}", "set loadType(value) {}", "function getYepnope () {\n var y = yepnope;\n y.loader = {\n load: load,\n i : 0\n };\n return y;\n }", "static transient final private protected internal function m40() {}", "load() { this.log('Loaded'); }", "function ContentLoader()\n{\n this.cache = true;\n}", "constructor () {\n // define satellite load priority.\n this.loadPriority = 10\n }", "preload() {}", "static deserialize() {}", "static LoadFromMemoryAsync() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}" ]
[ "0.67016244", "0.6482633", "0.63876814", "0.63876814", "0.627492", "0.62743604", "0.6266905", "0.6228069", "0.6228069", "0.6228069", "0.61503536", "0.60480213", "0.60456216", "0.5990577", "0.59856623", "0.5981982", "0.59621817", "0.594965", "0.5887062", "0.5842174", "0.58269054", "0.5791978", "0.5696973", "0.56940204", "0.5693958", "0.5675749", "0.5659638", "0.5625812", "0.56032985", "0.559573", "0.5571576", "0.5571576", "0.5567574", "0.55494493", "0.5525698", "0.55231494", "0.54806876", "0.5464057", "0.545898", "0.54366106", "0.54320705", "0.5411301", "0.5403894", "0.5385895", "0.5385768", "0.5379118", "0.5378375", "0.5376387", "0.53648174", "0.53648174", "0.5363786", "0.5350348", "0.53502315", "0.534571", "0.534571", "0.534571", "0.5341772", "0.5327269", "0.5318867", "0.53074276", "0.53033394", "0.53008974", "0.5295619", "0.5291373", "0.5273887", "0.5273887", "0.5269357", "0.5262937", "0.5248958", "0.52478874", "0.52403605", "0.52391225", "0.5237729", "0.5236399", "0.5235769", "0.52340764", "0.5232095", "0.52270544", "0.5225331", "0.5216924", "0.5211161", "0.5207982", "0.5207891", "0.52069503", "0.52045023", "0.5199645", "0.5196966", "0.5195502", "0.5194154", "0.5185712", "0.5185173", "0.51798046", "0.51736665", "0.5172945", "0.51712877", "0.5171208", "0.51705223", "0.51622564", "0.51622564", "0.51622564", "0.51622564" ]
0.0
-1
This function is here to be API compatible with the loader.
function onLoad(callback) { callback(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalLoader() { }", "function Loader() {\n\n}", "load() {}", "load() {}", "initLoader(loaderName) {\n loaderName = true;\n }", "lateLoad() {\n\n }", "transient private protected internal function m182() {}", "function LoaderProto() {}", "function LoaderProto() {}", "function LoaderProto() {}", "load() {\r\n\r\n }", "transient private internal function m185() {}", "load() {\n\n }", "private internal function m248() {}", "_loading() {\n }", "patched() {\n this._handleImageLoad();\n }", "loaded() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "protected internal function m252() {}", "private public function m246() {}", "isLoadedFromFileSystem() {\n return false;\n }", "transient private protected public internal function m181() {}", "load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }", "get loadType() {}", "function forceLoad() {}", "function GetLoaderInternalData(value) {\n // Loader methods could be placed on wrapper prototypes like\n // String.prototype.\n if (typeof value !== \"object\")\n throw std_TypeError(\"Loader method called on incompatible primitive\");\n\n let loaderData = callFunction(std_WeakMap_get, loaderInternalDataMap, value);\n if (loaderData === undefined)\n throw std_TypeError(\"Loader method called on incompatible object\");\n return loaderData;\n}", "constructor () {\n this.hdrCubeLoader = new HDRCubeTextureLoader();\n this.gltfLoader = new GLTFLoader();\n this.fbxLoader = new FBXLoader();\n this.jsonLoader = new JSONLoader();\n this.textureLoader = new TextureLoader();\n this.fontLoader = new FontLoader();\n this.isLoaded = false;\n }", "async load () {}", "cacheLoader (mainNameSpace) {\n \n let NoEmptyNamespace = false \n if (mainNameSpace) {\n \n let keys_exists = Object.keys(mainNameSpace) ; \n\n (keys_exists || keys_exists.length > 0)?NoEmptyNamespace = true : NoEmptyNamespace \n \n if(NoEmptyNamespace){\n \n for(let method in mainNameSpace){\n \n (typeof mainNameSpace[method] == \"function\") ? mainNameSpace[method]() : console.warn(`no module found on ${mainNameSpace}`)\n }\n }\n }\n \n }", "registerLoader (name, loaderFunc) {\n registerLoader(name, loaderFunc)\n }", "registerLoader (name, loaderFunc) {\n registerLoader(name, loaderFunc)\n }", "static LoadFromFile() {}", "static private protected internal function m118() {}", "static final private internal function m106() {}", "function XLoader() {\r\n return __loadScript(\"YLoader\", 2);\r\n}", "function _____SHARED_functions_____(){}", "static transient final protected public internal function m46() {}", "function defaultLoader() {\n H.events.dispatch(\"error\", {\n \"msg\": \"loader/loaderSync has not been configured.\"\n });\n return null;\n}", "LoadAsset() {}", "static LoadFromMemory() {}", "function preLoad() {\n return;\n}", "async onLoad() {}", "transient final private protected internal function m167() {}", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "LoadSourceState() {\n\n }", "function Loader() {\n this.loadRes = [];\n this._groupListens = {};\n }", "function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }", "function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }", "__previnit(){}", "onLoad() { }", "function createLoaderLoad(object) {\n return {\n // modules is an object for ES5 implementation\n modules: {},\n loads: [],\n loaderObj: object\n };\n }", "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 }", "onLoad() {}", "preload() {\n \n }", "function ResourceLoader() {\n this.loadedScenesByUid = {};\n this.loadedCommonEventsById = [];\n }", "function loading() {\n}", "load() {\n return this.loading || (this.loading = this.loadFunc().then(support => this.support = support, err => { this.loading = null; throw err; }));\n }", "destroyLoader(loaderName) {\n loaderName = false;\n }", "async afterLoad () {\n }", "function forceLoad() {\n\t // Noop\n\t}", "transient private public function m183() {}", "loadingData() {}", "loadingData() {}", "import() {\n }", "obtain(){}", "static ready() { }", "_initialize() {\n\n }", "load(callback) {\n callback();\n }", "if (!this._loadImage) {\n this._loadImage = import('blueimp-load-image');\n }", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "function ComponentDefLoader() {\n this.pending = null;\n this.loading = 0;\n this.counter = 0;\n this.scriptTagCounter = 0;\n this.requestedDescriptors = {};\n this.lastContextParameterName;\n}", "function UrlFlipperLoader( context ) { this._ctx = context; }", "function run() {\r\n\t// Initialize the loader before anything happens\r\n\tloader.init();\r\n}", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "loadJSONOrig(gl, avatarName) {\nvar VER_3_DIG, jsnchrctr;\nthis.gl = gl;\nthis.avatarName = avatarName;\n//-------\n// Init.\nthis.avBase = Config.getAvBase(this.avatarName);\nthis.readJSON = (jfile) => {\n// @STD_DATA_IN.getJSON \"#{@avBase}#{jfile}\"\nlggr.warn(`Character: Synchronous reading of JSON data not possible for ${this.avBase}${jfile}`);\nreturn null;\n};\n// Load JSON avatar definition data and check the version is ok.\njsnchrctr = this.readJSON(\"avdef.json\");\nVER_3_DIG = Math.floor(100 * Number(jsnchrctr.version));\nif (VER_3_DIG < 310) {\nthrow new Error(`Avatar version ${VER_3_DIG} is not viable!`);\n}\n// Populate this character.\nthis.loadVolumeLimits(jsnchrctr);\nthis.loadMeshes(jsnchrctr);\nthis.loadInitPose(jsnchrctr);\nthis.loadSkeleton(jsnchrctr);\nthis.loadAmbientMotionDef(jsnchrctr);\nthis.loadTextureData(jsnchrctr);\n// Tidy up loose ends.\nthis.setUpTextureFromJSON();\nthis.setLengthScaleFactor();\nthis.setUpMeshesForGL();\nreturn void 0; // void result\n}", "static load() {\n\t\t\treturn loader().then(ResolvedComponent => {\n\t\t\t\tComponent = ResolvedComponent.default || ResolvedComponent\n\t\t\t})\n\t\t}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function Preloader() \n{\n}", "function createTranslateLoader(http) {\n}", "function load(){\r\n\r\n}", "load( resolver ) {\n const nextToLoad = this.layers.find( ( { isready } ) => !isready );\n if( nextToLoad ) {\n const loader = Promise.all( nextToLoad.prop.use.map( ({ type = \"url\", ...use }) =>\n type === \"url\" ? Loader.default.obtain( use ) : this.get( use.path )\n ));\n loader.then(( packs ) => {\n packs.map( (pkj, index) => {\n const { type = \"url\" } = nextToLoad.prop.use[index];\n if(type === \"url\") {\n this.appendData( pkj, nextToLoad.src );\n }\n else {\n this.merge( pkj, true );\n }\n } );\n nextToLoad.isready = true;\n this.load( resolver );\n });\n }\n else {\n resolver( this );\n }\n }", "load(cb){\r\n\r\n\t\tconsole.log('Loading assets (difficulty: 1)');\r\n\r\n\t\t// Chiama il metodo load della classe parent\r\n\t\tsuper.load(cb, 1);\r\n\t}", "preload () {}", "set loadType(value) {}", "static transient final private protected internal function m40() {}", "function getYepnope () {\n var y = yepnope;\n y.loader = {\n load: load,\n i : 0\n };\n return y;\n }", "load() { this.log('Loaded'); }", "constructor () {\n // define satellite load priority.\n this.loadPriority = 10\n }", "function ContentLoader()\n{\n this.cache = true;\n}", "static deserialize() {}", "preload() {}", "static LoadFromMemoryAsync() {}", "static transient final protected function m44() {}", "initialize() {}", "initialize() {}", "initialize() {}" ]
[ "0.67003626", "0.6482175", "0.63854223", "0.63854223", "0.6273288", "0.6272162", "0.62713087", "0.6226564", "0.6226564", "0.6226564", "0.61486953", "0.605238", "0.6043744", "0.59952253", "0.5985659", "0.5981532", "0.5960925", "0.5954019", "0.58916694", "0.5846652", "0.5831625", "0.57898504", "0.5698297", "0.5694708", "0.5692939", "0.5674039", "0.565832", "0.56229293", "0.56001633", "0.5595333", "0.5569708", "0.5569708", "0.55665076", "0.55536354", "0.5530587", "0.5521788", "0.54826605", "0.54634744", "0.54625946", "0.5434266", "0.5430995", "0.5410818", "0.5402368", "0.5390755", "0.5390684", "0.5384345", "0.53773856", "0.5374336", "0.5365589", "0.5365589", "0.5365472", "0.53496826", "0.53487617", "0.5348436", "0.5348436", "0.5348436", "0.5341258", "0.53259784", "0.5316316", "0.53082216", "0.5302551", "0.52995366", "0.5294203", "0.5290211", "0.5273529", "0.5273348", "0.5273348", "0.5262683", "0.5250106", "0.5248991", "0.523922", "0.5238106", "0.5235145", "0.52342945", "0.52339804", "0.5231839", "0.52301705", "0.52259773", "0.5223302", "0.5215468", "0.52100104", "0.5207815", "0.52068394", "0.5206563", "0.52036923", "0.519594", "0.5194577", "0.519409", "0.5193862", "0.5189701", "0.5186129", "0.5178789", "0.51717883", "0.51713276", "0.51706356", "0.5169776", "0.516859", "0.5162471", "0.51622087", "0.51622087", "0.51622087" ]
0.0
-1
A promise that resolves when all current events have been sent. If you provide a timeout and the queue takes longer to drain the promise returns false.
function flush(timeout) { var client = hub_getCurrentHub().getClient(); if (client) { return client.flush(timeout); } return syncpromise_SyncPromise.reject(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drain(timeout) {\n return new syncpromise.SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void syncpromise.resolvedSyncPromise(item).then(() => {\n // eslint-disable-next-line no-plusplus\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }", "function drain(timeout) {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }", "function drain(timeout) {\n\t return new SyncPromise((resolve, reject) => {\n\t let counter = buffer.length;\n\n\t if (!counter) {\n\t return resolve(true);\n\t }\n\n\t // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n\t const capturedSetTimeout = setTimeout(() => {\n\t if (timeout && timeout > 0) {\n\t resolve(false);\n\t }\n\t }, timeout);\n\n\t // if all promises resolve in time, cancel the timer and resolve to `true`\n\t buffer.forEach(item => {\n\t void resolvedSyncPromise(item).then(() => {\n\t // eslint-disable-next-line no-plusplus\n\t if (!--counter) {\n\t clearTimeout(capturedSetTimeout);\n\t resolve(true);\n\t }\n\t }, reject);\n\t });\n\t });\n\t }", "function flush(timeout) {\n const client = core.getCurrentHub().getClient();\n return client ? client.flush(timeout) : Promise.resolve(false);\n}", "function flush(timeout) {\r\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\r\n if (client) {\r\n return client.flush(timeout);\r\n }\r\n return Promise.reject(false);\r\n}", "function flushQueue() {\n return localforage.getItem('queue').then(queue => {\n if (!queue || (queue && !queue.length)) {\n return Promise.resolve();\n }\n\n console.log('Sending ', queue.length, ' requests...');\n return sendInOrder(queue).then(() => localforage.setItem('queue', []));\n })\n}", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async waitUntilPendingNotificationsDone(timeout) {\n const count = this.pendingNotifications;\n debug('Number of pending notifications: %d', count);\n if (count === 0)\n return;\n await (0, p_event_1.multiple)(this, 'observersNotified', { count, timeout });\n }", "function flush(timeout) {\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\n if (client) {\n return client.flush(timeout);\n }\n return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__[\"SyncPromise\"].reject(false);\n}", "qEmpty() {\n return this.queue.empty();\n }", "queueIsFull() {\n return this.queue.length >= this.maxSize\n }", "sendEvents() {\n\t\tthis.sendTimer = setTimeout(() => {\n\t\t\tconst { sendBatchSize, enabled, sendInterval, sendTimeout, url } = this.config;\n\t\t\tconst { eventsDir } = this;\n\n\t\t\tif (!enabled || !url || (this.lastSend + sendInterval) > Date.now() || !eventsDir || !isDir(eventsDir)) {\n\t\t\t\t// not enabled or not time to send\n\t\t\t\treturn this.sendEvents();\n\t\t\t}\n\n\t\t\tlet sends = 0;\n\n\t\t\t// sendBatch() is recursive and will continue to scoop up `sendBatchSize` of events\n\t\t\t// until they're all gone\n\t\t\tconst sendBatch = () => {\n\t\t\t\tconst batch = [];\n\t\t\t\tfor (const name of fs.readdirSync(eventsDir)) {\n\t\t\t\t\tif (jsonRegExp.test(name)) {\n\t\t\t\t\t\tbatch.push(path.join(eventsDir, name));\n\t\t\t\t\t\tif (batch.length >= sendBatchSize) {\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}\n\n\t\t\t\t// check if we found any events to send\n\t\t\t\tif (!batch.length) {\n\t\t\t\t\tif (sends) {\n\t\t\t\t\t\tlog('No more events to send');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog('No events to send');\n\t\t\t\t\t}\n\t\t\t\t\tthis.lastSend = Date.now();\n\t\t\t\t\treturn this.sendEvents();\n\t\t\t\t}\n\n\t\t\t\tlog(__n(batch.length, 'Sending %%s event', 'Sending %%s events', highlight(batch.length)));\n\n\t\t\t\tconst json = [];\n\n\t\t\t\tfor (const file of batch) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tjson.push(JSON.parse(fs.readFileSync(file)));\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// Rather then squelch the error we'll remove here\n\t\t\t\t\t\tlog(`Failed to read ${highlight(file)}, removing`);\n\t\t\t\t\t\tfs.unlinkSync(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.pending = new Promise(resolve => {\n\t\t\t\t\trequest({\n\t\t\t\t\t\tjson,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\ttimeout: sendTimeout,\n\t\t\t\t\t\turl\n\t\t\t\t\t}, (err, resp) => {\n\t\t\t\t\t\tresolve();\n\n\t\t\t\t\t\tif (err || resp.statusCode >= 300) {\n\t\t\t\t\t\t\terror(__n(\n\t\t\t\t\t\t\t\tbatch.length,\n\t\t\t\t\t\t\t\t'Failed to send %%s event: %%s',\n\t\t\t\t\t\t\t\t'Failed to send %%s events: %%s',\n\t\t\t\t\t\t\t\thighlight(batch.length),\n\t\t\t\t\t\t\t\terr ? err.message : `${resp.statusCode} - ${resp.statusMessage}`\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.lastSend = Date.now();\n\t\t\t\t\t\t\treturn this.sendEvents();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlog(__n(batch.length, 'Successfully sent %%s event', 'Successfully sent %%s events', highlight(batch.length)));\n\n\t\t\t\t\t\tfor (const file of batch) {\n\t\t\t\t\t\t\tif (isFile(file)) {\n\t\t\t\t\t\t\t\tfs.unlinkSync(file);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsends++;\n\t\t\t\t\t\tsendBatch();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tsendBatch();\n\t\t}, 1000);\n\t}", "flushQueue_() {\n if (this.isReady() && this.queueSize()) {\n this.postMessageApi_.send(\n MessageType_Enum.IFRAME_TRANSPORT_EVENTS,\n /** @type {!JsonObject} */\n ({events: this.pendingEvents_})\n );\n this.pendingEvents_ = [];\n }\n }", "_m_queue_drain() {\n const lo_this = this;\n\n const li_duration_global_ms = f_chrono_stop(lo_this._as_queue_chrono_name);\n const li_call_per_sec = f_number_round_with_precision((1000 * lo_this._ai_call_count_exec_total / li_duration_global_ms), 1);\n\n if (lo_this._ai_call_count_exec_total) {\n f_console_verbose(1, `${lo_this.m_get_context(\"drain\")} - performed a total of [${lo_this._ai_call_count_exec_total}] calls in [${f_human_duration(li_duration_global_ms, true)}] at cps=[${li_call_per_sec}], max-parallel=[${lo_this._ai_parallel_max}], max-length=[${lo_this._ai_queue_len_max}], dur-avg=[${f_human_duration((lo_this._ai_call_duration_total_ms / lo_this._ai_call_count_exec_total), true)}], dur-min=[${f_human_duration(lo_this._ai_call_duration_min_ms, true)}], dur-max=[${f_human_duration(lo_this._ai_call_duration_max_ms, true)}]`);\n }\n\n // is there a call-back associated to the event [queue_drain] ?\n const pf_queue_drain = lo_this.m_pick_option(null, \"pf_queue_drain\", true);\n if (pf_queue_drain) {\n pf_queue_drain();\n }\n }", "_m_queue_empty() {\n const lo_this = this;\n\n if (lo_this._ai_call_count_pushed_total) {\n f_console_verbose(1, `${lo_this.m_get_context(\"empty\")} - total of [${lo_this._ai_call_count_pushed_total}] calls submitted to the queue`);\n }\n\n // is there a call-back associated to the event [queue_empty] ?\n const pf_queue_empty = lo_this.m_pick_option(null, \"pf_queue_empty\", true);\n if (pf_queue_empty) {\n pf_queue_empty();\n }\n }", "checkQueue() {\n\t\tif (this.queueCheckFlag) return\n\n\t\tthis.queueCheckFlag = true\n\t\tthis.logger.info(`checkQueue planned - interval ${this.RabbitMQ.checkQueue.interval}`)\n\n\t\tsetTimeout(() => {\n\t\t\tthis.logger.info(`checkQueue`)\n\t\t\tthis.getMQChannel()\n\n\t\t\tif (this.RabbitMQ.checkQueue.repeat) {\n\t\t\t\tthis.queueCheckFlag = false\n\t\t\t\tthis.checkQueue()\n\t\t\t}\n\t\t}, this.RabbitMQ.checkQueue.interval)\n\t}", "function sendQueueEntry() {\n if (this._is_connected && this._queue.length) {\n this._uniqueSocket.write(this._queue[0][0], this._encoding, () => {\n\n // Get rid of sent message only if write was successful.\n let shifted_entry = this._queue.shift();\n\n // Second element of queue entry can be resolve function of promise,\n // if entry was pushed to queue as a result of IpcClient#whenEmitted call.\n if (shifted_entry[1] !== null && typeof shifted_entry[1] === \"function\") {\n shifted_entry[1](); // Resolve promise.\n }\n\n if (!this._queue.length) {\n this._emptying_queue = false;\n }\n else {\n sendQueueEntry.call(this);\n }\n });\n }\n else {\n this._emptying_queue = false;\n }\n}", "_waitingForQuiescence() {\n return (\n !isEmpty(this._subsBeingRevived) ||\n !isEmpty(this._methodsBlockingQuiescence)\n );\n }", "_isClientDoneProcessing(timeout) {\n return new utils.SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }", "isEmpty() {\n if (this.queue.length) {\n return false;\n }\n return true;\n }", "function hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}", "function hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}", "function hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n }", "function checkQueue(){\n\tif(notificationQueue.length && alertComplete){\n\t\talertComplete = false;\n\t\tdoAlert(notificationQueue.shift());\n\t}\n}", "executeQueue() {\n return new Promise(async (resolve, reject) => {\n try {\n let commands = this.queue;\n\n debug(`Executing queue with ${commands.length} command(s)`);\n\n let response = this.execute(commands);\n\n this.queue = [];\n\n resolve(response);\n } catch (err) {\n reject(err);\n }\n });\n }", "waitUntilSettled () {\n return new Promise((resolve) => {\n const start = (new Date()).getTime()\n const interval = setInterval(() => {\n const now = (new Date()).getTime()\n\n if (this.sentMessages !== this.receivedMessages && now - start < SETTLE_TIMEOUT) return\n clearInterval(interval)\n resolve()\n }, 100)\n })\n }", "function fire(emitter, event, timeout) {\n if (timeout === void 0) { timeout = undefined; }\n return __awaiter(this, void 0, void 0, function () {\n var waitables, asyncEvent;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n waitables = [];\n asyncEvent = Object.assign(event, {\n waitUntil: function (thenable) {\n if (Object.isFrozen(waitables)) {\n throw new Error('waitUntil cannot be called asynchronously.');\n }\n waitables.push(thenable);\n }\n });\n try {\n emitter.fire(asyncEvent);\n // Asynchronous calls to `waitUntil` should fail.\n Object.freeze(waitables);\n }\n finally {\n delete asyncEvent['waitUntil'];\n }\n if (!waitables.length) {\n return [2 /*return*/];\n }\n if (!(timeout !== undefined)) return [3 /*break*/, 2];\n return [4 /*yield*/, Promise.race([Promise.all(waitables), new Promise(function (resolve) { return setTimeout(resolve, timeout); })])];\n case 1:\n _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, Promise.all(waitables)];\n case 3:\n _a.sent();\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n });\n }", "_isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }", "_queue () {\n var _this = this;\n async.whilst(\n function condition () {\n return !!_this._queueTasks.length || _this._break;\n },\n function iterator (next) {\n var task = _this._queueTasks.shift();\n task.consumer(next);\n },\n function end () {\n setTimeout(_this._queue.bind(_this), 100);\n }\n );\n }", "waitForJoiningCompleted() {\n return this.waitingForJoinPromise.promise;\n }", "push(fn, onTimeout, timeout)\n {\n if (this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY)\n {\n // ignore invalid status\n return false;\n }\n\n if (typeof fn !== 'function')\n {\n throw new Error('fn should be a function.');\n }\n this.queue.push({\n fn : fn,\n ontimeout : onTimeout,\n timeout : timeout});\n\n if (this.status === SeqQueueManager.STATUS_IDLE)\n {\n this.status = SeqQueueManager.STATUS_BUSY;\n process.nextTick(this._next.bind(this), this.curId);\n }\n return true;\n }", "get waiting()\n {\n return this.queueLength === 0;\n }", "flush() {\n // Pending Promises for _putMetricData calls\n const promises = []\n\n // Get a CloudWatch client (this will be falsy if we're not\n // really sending)\n const cw = this._setup()\n while (this._queue.length) {\n // Grab a batch of metrics from the queue - the maximum batch\n // size is 20.\n const queue = this._queue.slice(0, 20)\n this._queue = this._queue.slice(20)\n\n // Send the metrics\n promises.push(this._putMetricData(cw, queue))\n }\n\n return Promise.all(promises).catch(\n /* istanbul ignore next */\n (err) => console.warn(`Metrics: error during flush: ${err}`)\n )\n }", "isReady() {\n if (this._ready) { return; }\n\n this._ready = true;\n this._failed = false;\n this._error = null;\n\n while (this._queue.length > 0) {\n const { thunk, resolve, reject } = this._queue.shift();\n thunk().then(resolve).catch(reject);\n }\n }", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "function notifyDrainListeners() {\n var notifiedSomebody = false;\n if (!!drainQueue.length) {\n // As we exhaust priority levels, notify the appropriate drain listeners.\n //\n var drainPriority = currentDrainPriority();\n while (+drainPriority === drainPriority && drainPriority > highWaterMark) {\n pumpingPriority = drainPriority;\n notifyCurrentDrainListener();\n notifiedSomebody = true;\n drainPriority = currentDrainPriority();\n }\n }\n return notifiedSomebody;\n }", "function checkMessageQueue() {\n // If the queue isn't empty\n if($tw.Bob.MessageQueue.length > 0) {\n // Remove messages that have already been sent and have received all\n // their acks and have waited the required amonut of time.\n $tw.Bob.MessageQueue = pruneMessageQueue($tw.Bob.MessageQueue);\n // Check if there are any messages that are more than 500ms old and have\n // not received the acks expected.\n // These are assumed to have been lost and need to be resent\n const oldMessages = $tw.Bob.MessageQueue.filter(function(messageData) {\n if(Date.now() - messageData.time > $tw.settings.advanced.localMessageQueueTimeout || 500) {\n return true;\n } else {\n return false;\n }\n });\n oldMessages.forEach(function (messageData) {\n // If we are in the browser there is only one connection, but\n // everything here is the same.\n const targetConnections = $tw.node?(messageData.wiki?$tw.connections.filter(function(item) {\n return item.wiki === messageData.wiki\n }):[]):[$tw.connections[0]];\n targetConnections.forEach(function(connection) {\n _sendMessage(connection, messageData)\n });\n });\n if(messageQueueTimer) {\n clearTimeout(messageQueueTimer);\n }\n messageQueueTimer = setTimeout(checkMessageQueue, $tw.settings.advanced.localMessageQueueTimeout || 500);\n } else {\n clearTimeout(messageQueueTimer);\n messageQueueTimer = false;\n }\n }", "receive() {\n if(this.receiveDataQueue.length !== 0) return Promise.resolve(this.receiveDataQueue.shift());\n\n if(!this.connected) return Promise.reject(this.closeEvent || new Error('Not connected.'));\n\n const receivePromise = new Promise((resolve, reject) => this.receiveCallbacksQueue.push({ resolve, reject }));\n\n return receivePromise;\n }", "_isClientDoneProcessing(timeout) {\n\t return new SyncPromise(resolve => {\n\t let ticked = 0;\n\t const tick = 1;\n\n\t const interval = setInterval(() => {\n\t if (this._numProcessing == 0) {\n\t clearInterval(interval);\n\t resolve(true);\n\t } else {\n\t ticked += tick;\n\t if (timeout && ticked >= timeout) {\n\t clearInterval(interval);\n\t resolve(false);\n\t }\n\t }\n\t }, tick);\n\t });\n\t }", "function isInQueue() {\n var self = API.getSelf();\n return API.getWaitList().indexOf(self) !== -1 || API.getDJs().indexOf(self) !== -1;\n}", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "function handleQueue() {\n if (this._is_connected && this._queue.length && !this._emptying_queue) {\n this._emptying_queue = true;\n sendQueueEntry.call(this);\n }\n}", "function Process_Sendq() {\n\tif (!this.empty) {\n\t\tthis.send(this.socket);\n\t}\n}", "_emptyQueue () {\n // create the queue if it doesn't exist\n if (!this.queue) {\n this.queue = []\n return\n }\n if (this.queue.length === 0) return\n if (!this.isConnected()) return\n\n log('Emptying queue (size : %d)', this.queue.length)\n\n // re-send all of the data\n while (this.queue.length > 0) {\n if (!this.isConnected()) return\n let packet = this.queue[0]\n this.send(packet.channel, packet.data)\n this.queue.shift()\n }\n }", "function processQueue() {\n emptyQueue = true;\n drainQueue(true);\n }", "async _trySendBatch(rheaMessage, options = {}) {\n const abortSignal = options.abortSignal;\n const retryOptions = options.retryOptions || {};\n const timeoutInMs = getRetryAttemptTimeoutInMs(retryOptions);\n retryOptions.timeoutInMs = timeoutInMs;\n const sendEventPromise = async () => {\n var _a, _b;\n const initStartTime = Date.now();\n const sender = await this._getLink(options);\n const timeTakenByInit = Date.now() - initStartTime;\n logger.verbose(\"[%s] Sender '%s', credit: %d available: %d\", this._context.connectionId, this.name, sender.credit, sender.session.outgoing.available());\n let waitTimeForSendable = 1000;\n if (!sender.sendable() && timeoutInMs - timeTakenByInit > waitTimeForSendable) {\n logger.verbose(\"%s Sender '%s', waiting for 1 second for sender to become sendable\", this._context.connectionId, this.name);\n await delay(waitTimeForSendable);\n logger.verbose(\"%s Sender '%s' after waiting for a second, credit: %d available: %d\", this._context.connectionId, this.name, sender.credit, (_b = (_a = sender.session) === null || _a === void 0 ? void 0 : _a.outgoing) === null || _b === void 0 ? void 0 : _b.available());\n }\n else {\n waitTimeForSendable = 0;\n }\n if (!sender.sendable()) {\n // let us retry to send the message after some time.\n const msg = `[${this._context.connectionId}] Sender \"${this.name}\", ` +\n `cannot send the message right now. Please try later.`;\n logger.warning(msg);\n const amqpError = {\n condition: ErrorNameConditionMapper.SenderBusyError,\n description: msg\n };\n throw translate(amqpError);\n }\n logger.verbose(\"[%s] Sender '%s', sending message with id '%s'.\", this._context.connectionId, this.name);\n if (timeoutInMs <= timeTakenByInit + waitTimeForSendable) {\n const desc = `${this._context.connectionId} Sender \"${this.name}\" ` +\n `with address \"${this.address}\", was not able to send the message right now, due ` +\n `to operation timeout.`;\n logger.warning(desc);\n const e = {\n condition: ErrorNameConditionMapper.ServiceUnavailableError,\n description: desc\n };\n throw translate(e);\n }\n try {\n const delivery = await sender.send(rheaMessage, {\n format: 0x80013700,\n timeoutInSeconds: (timeoutInMs - timeTakenByInit - waitTimeForSendable) / 1000,\n abortSignal\n });\n logger.info(\"[%s] Sender '%s', sent message with delivery id: %d\", this._context.connectionId, this.name, delivery.id);\n }\n catch (err) {\n throw err.innerError || err;\n }\n };\n const config = {\n operation: sendEventPromise,\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.sendMessage,\n abortSignal: abortSignal,\n retryOptions: retryOptions\n };\n try {\n await retry(config);\n }\n catch (err) {\n const translatedError = translate(err);\n logger.warning(\"[%s] Sender '%s', An error occurred while sending the message %s\", this._context.connectionId, this.name, `${translatedError === null || translatedError === void 0 ? void 0 : translatedError.name}: ${translatedError === null || translatedError === void 0 ? void 0 : translatedError.message}`);\n logErrorStackTrace(translatedError);\n throw translatedError;\n }\n }", "function flushWatcherQueue () {\n flushing = true\n let watcher\n let id\n\n queue.sort((a, b) => a.id - b.id)\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index]\n id = watcher.id\n has[id] = null\n watcher.run()\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production') {\n circular[id] = (circular[id] || 0) + 1\n if (circular[id] > MAX_UPDATE_COUNT) {\n console.error(\n `[MIP warn]:You may have an infinite update loop in watcher with expression \"${watcher.exp}\"`\n )\n break\n }\n }\n }\n\n resetState()\n}", "function waitForMockman(eventType, n) {\n var records = [];\n return Q.Promise(function(resolve) {\n mockman.on(eventType, function(record) {\n records.push(record);\n if(records.length === n) {\n resolve(records);\n }\n });\n });\n }", "function eventNameIsAvailable(eventName) {\n return $q(function(resolve, reject) {\n var count = 0;\n\n for( var i = 0; i < myEvents.length; i++ ) {\n getNameOfEventWithID(myEvents[i]).then(function(name) {\n count++;\n if( name == eventName ) {\n reject();\n }\n if( count == myEvents.length ) {\n resolve();\n }\n });\n }\n\n if(myEvents.length == 0) {\n resolve();\n }\n });\n }", "function drainQueue() {\n\t\trunHandlers(handlerQueue);\n\t\thandlerQueue = [];\n\t}", "flush() {\n var start = Date.now();\n while(this._queue.length > 0) {\n var task = this._queue.shift();\n task.work(task.scheduler, task.state);\n if(this._gap > 0 && Date.now() - start > this._gap) {\n break;\n }\n }\n\n if(this._queue.length > 0) {\n this._flushNext();\n }\n else {\n this.isProcessing = false;\n }\n }", "async drain() {\n let drained = false;\n this.draining = true;\n while (!drained) {\n drained = this.workersAvailable.every(w => w === 0);\n if (!drained) {\n await msleep(this.workerSearchSleepTime);\n }\n }\n this.draining = false;\n }", "function flushTasks() {\n return new Promise(function(resolve, reject) {\n window.setTimeout(resolve, 0);\n });\n }", "function debounceCollect(fn, wait) {\n var timer;\n var queue = {};\n var idx = 0;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new _rxjs.Observable(obs => {\n clearTimeout(timer);\n timer = setTimeout(flush, wait);\n var queueItem = {\n args: args,\n observer: obs,\n completed: false\n };\n var id = idx++;\n queue[id] = queueItem;\n return () => {\n // console.log('completed', queueItem.args)\n queueItem.completed = true;\n };\n });\n };\n\n function flush() {\n var currentlyFlushingQueue = queue;\n queue = {};\n var queueItemIds = Object.keys(currentlyFlushingQueue) // Todo: use debug\n // .map(id => {\n // if (currentlyFlushingQueue[id].completed) {\n // console.log('Dropped', currentlyFlushingQueue[id].args)\n // }\n // return id\n // })\n .filter(id => !currentlyFlushingQueue[id].completed);\n\n if (queueItemIds.length === 0) {\n // nothing to do\n return;\n }\n\n var collectedArgs = queueItemIds.map(id => currentlyFlushingQueue[id].args);\n fn(collectedArgs).subscribe({\n next(results) {\n results.forEach((result, i) => {\n var queueItem = currentlyFlushingQueue[queueItemIds[i]];\n\n if (!queueItem.completed) {\n queueItem.observer.next(results[i]);\n }\n });\n },\n\n complete() {\n queueItemIds.forEach(id => {\n var entry = currentlyFlushingQueue[id];\n\n if (!entry.completed) {\n entry.observer.complete();\n }\n });\n },\n\n error(err) {\n queueItemIds.forEach(id => {\n var entry = currentlyFlushingQueue[id];\n\n if (!entry.completed) {\n entry.observer.error(err);\n }\n });\n }\n\n });\n }\n}", "function playFromQueue(){\n if (!startConsuming) {\n setTimeout(playFromQueue, Math.floor(Math.random() * 1000) + 500);\n return;\n }\n var event = eventQueue.shift();\n if(event != null && event.actor.display_login != null && !shouldEventBeIgnored(event) && svg != null){\n playSound(event.actor.display_login.length*1.1, event.type);\n if(!document.hidden)\n drawEvent(event, svg);\n }else{\n console.log(\"Ignored ex 1\");\n }\n setTimeout(playFromQueue, Math.floor(Math.random() * 1000) + 500);\n $('.events-remaining-value').html(eventQueue.length);\n}", "async consume() {\n if (this.state.consuming) return;\n if (!this.queue.meta.length) return;\n\n this.state.consuming = true;\n console.log('Consuming queue...', 'Orders in queue: ' + this.queue.meta.length);\n\n const filledTransactions = await this.queue.digest();\n\n //repopulate queue with closing (unconfirmed) transactions\n for (let orderId in filledTransactions) {\n const txn = filledTransactions[orderId];\n const price = Number(txn.price);\n if (txn.side === 'BUY') {\n const profit = price + (price * this.config.profitPercentage) + (price * .001);\n this.sell(Number(txn.executedQty), profit);\n }\n if (txn.side === 'SELL') {\n const profit = price - (price * this.config.profitPercentage) - (price * .001);\n this.purchase(Number(txn.executedQty), profit);\n }\n }\n\n console.log('Consumed queue.', 'Orders in queue: ' + this.queue.meta.length);\n this.state.consuming = false;\n }", "async runWaitingTxns() {\n if (this.isLocked) throw new Error(`runWaitingTxns() ran when not actually ready to lock`);\n try {\n console.group('Processing all queued transactions');\n\n // process until there's nothing left\n this.isLocked = true;\n while (this.waitQueue.length) {\n const {args, resolve, reject} = this.waitQueue.shift();\n // pipe result to the original\n const txnPromise = this.immediateTransact(args);\n txnPromise.then(resolve, reject);\n await txnPromise;\n }\n this.isLocked = false;\n\n } finally {\n console.groupEnd();\n if (this.waitQueue.length) {\n console.warn('WARN: still had work queued after runWaitingTxns() completed');\n }\n }\n }", "function drainQueue() {\n\t runHandlers(handlerQueue);\n\t handlerQueue = [];\n\t }", "function drainQueue() {\n runHandlers(handlerQueue);\n handlerQueue = [];\n}", "isEmpty() {\n return this.queue.size() === 0;\n }", "async poll() {\n while (!this.stopping) {\n var messages = await this.queueService.pollClaimQueue();\n debug('Fetched %s messages', messages.length);\n\n await Promise.all(messages.map(async (message) => {\n // Don't let a single task error break the loop, it'll be retried later\n // as we don't remove message unless they are handled\n try {\n await this.handleMessage(message);\n } catch (err) {\n this.monitor.reportError(err, 'warning');\n }\n }));\n\n if (messages.length === 0 && !this.stopping) {\n // Count that the queue is empty, we should have this happen regularly.\n // otherwise, we're not keeping up with the messages. We can setup\n // alerts to notify us if this doesn't happen for say 40 min.\n this.monitor.count('claim-queue-empty');\n await this.sleep(this.pollingDelay);\n }\n }\n }", "function getEventsToQueue(calendar_id, endTimeDate){\n\n var calendar = CalendarApp.getCalendarById(calendar_id)\n var now = new Date();\n\n var raw_events = calendar.getEvents(endTimeDate, now); //gets all events that OCCURED between endTimeDate and now\n\n var res = []\n\n for(var i = 0; i < raw_events.length; i++){\n var title = raw_events[i].getTitle()\n \n if( ~ title.indexOf(\"EMAILED\") || ~ title.indexOf('LOCKED') || ~ title.indexOf(\"TEXTED\")\n || ~ title.indexOf(\"CALLED\")|| ~ title.indexOf(\"FAXED\") || ~ title.indexOf(\"QUEUED\") || ~ title.indexOf(\"FAILED\") || ~ title.indexOf(\"STOPPED\")) continue; //don't reprocess a tagged event\n \n if(raw_events[i].getEndTime().getTime() >= endTimeDate.getTime()){\n console.log('locking event: ' + raw_events[i].getTitle())\n try{\n markLocked(raw_events[i]) //mark it as locked now so we don't touch it again if this run takes more than one minute\n } catch(err){ //if you get an error, then it's the quota of too-fast event manipulation, so stop here and return\n console.log(\"error when locking: \" + JSON.stringify(err))\n MailApp.sendEmail('aminata@sirum.org','HIT THE QUOTA ISSUE','')\n break\n }\n res.push(raw_events[i]) //only take events that STARTED a minute ago\n }\n }\n Logger.log(res)\n return res\n\n}", "fetchQueued() {\n return fetchSoon.fetchSearchRequests(this._myStartableQueued());\n }", "isEmpty () {\n return Boolean(this.queue.length === 0)\n }", "function drainQueue() {\n taskit.runTasks(queue);\n queue = [];\n }", "drain() {\n const tail = this.tail;\n return tail.then(() => {\n if (this.tail === tail) {\n return;\n }\n return this.drain();\n });\n }", "function batchingQueue(\n { max_qty, quiesce_time},\n { current_timestamp, setTimeout, clearTimeout },\n sink,\n) {\n let buf = [];\n let quiescing;\n const toDate = ts => new Date(ts);\n\n function flush() {\n if (buf.length > 0) {\n sink(buf); // ISSUE: async? consume promise?\n buf = [];\n }\n if (quiescing !== undefined) {\n clearTimeout(quiescing);\n quiescing = undefined;\n }\n }\n\n return harden({\n push: (item) => {\n let due = false;\n const t = current_timestamp();\n buf.push(item);\n if (buf.length >= max_qty) {\n console.log({ current: toDate(t), qty: buf.length, max_qty });\n flush();\n } else {\n if (quiescing !== undefined) {\n clearTimeout(quiescing);\n }\n const last_activity = t;\n quiescing = setTimeout(() => {\n const t = current_timestamp();\n console.log({\n quiesce_time,\n current: toDate(t),\n last_activity: toDate(last_activity),\n delta: (t - last_activity) / 1000,\n });\n flush();\n }, quiesce_time);\n }\n },\n finish: () => {\n flush();\n }\n });\n}", "async dispatchAsyncEvent(eventName) {\n // Wait for all the previous blockers before dispatching the event.\n let blockersPromise = this._blockersPromise.catch(() => {});\n return (this._blockersPromise = blockersPromise.then(async () => {\n let blockers = new Set();\n let cancel = this.dispatchCustomEvent(\n eventName,\n {\n addBlocker(promise) {\n // Any exception in the blocker will cancel the operation.\n blockers.add(\n promise.catch(ex => {\n Cu.reportError(ex);\n return true;\n })\n );\n },\n },\n true\n );\n if (blockers.size) {\n let timeoutPromise = new Promise((resolve, reject) => {\n this.window.setTimeout(reject, BLOCKERS_TIMEOUT_MS);\n });\n try {\n let results = await Promise.race([\n Promise.all(blockers),\n timeoutPromise,\n ]);\n cancel = cancel || results.some(result => result === false);\n } catch (ex) {\n Cu.reportError(\n new Error(`One of the blockers for ${eventName} timed out.`)\n );\n return true;\n }\n }\n return cancel;\n }));\n }", "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function redux_saga_core_esm_flush() {\n release();\n var task;\n\n while (!semaphore && (task = redux_saga_core_esm_queue.shift()) !== undefined) {\n exec(task);\n }\n}", "async function flushPromises() {\n // eslint-disable-next-line @lwc/lwc/no-async-operation\n return new Promise((resolve) => setTimeout(resolve, 0));\n }", "function check_queue_write() {\n\tif (intf.intf.queue_write.length < 1) {\n\t\tintf.intf.writing = false;\n\t\treturn false;\n\t}\n\n\tintf.intf.writing = true;\n\treturn true;\n}", "processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.resetTimer = this.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }" ]
[ "0.6735874", "0.66713154", "0.6627388", "0.6355362", "0.6202156", "0.60480195", "0.6021893", "0.5971303", "0.5971303", "0.59321934", "0.5791965", "0.5651994", "0.5579035", "0.55449414", "0.5516379", "0.5484764", "0.54521686", "0.5447947", "0.5388345", "0.53577274", "0.53565437", "0.53560203", "0.5337452", "0.5337452", "0.53174317", "0.5303718", "0.52775747", "0.5250716", "0.52483803", "0.5219301", "0.52125055", "0.5207465", "0.5192036", "0.5183716", "0.51727676", "0.5171804", "0.5170107", "0.5170107", "0.5164684", "0.51622397", "0.5155921", "0.5134869", "0.5134633", "0.51047444", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5070748", "0.5068095", "0.5058033", "0.5045205", "0.5036522", "0.50170815", "0.49856654", "0.49825868", "0.49517456", "0.4949879", "0.49430153", "0.4934857", "0.49288973", "0.49280357", "0.4921265", "0.49208227", "0.4920254", "0.49172753", "0.4917222", "0.4915422", "0.49115792", "0.4900087", "0.48943818", "0.4893019", "0.48921818", "0.48831174", "0.48804244", "0.48748755", "0.48740816", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48668423", "0.48668423", "0.48668423", "0.48668423", "0.48594183", "0.48438746", "0.48434383", "0.4842677" ]
0.57021
11
A promise that resolves when all current events have been sent. If you provide a timeout and the queue takes longer to drain the promise returns false.
function sdk_close(timeout) { var client = hub_getCurrentHub().getClient(); if (client) { return client.close(timeout); } return syncpromise_SyncPromise.reject(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drain(timeout) {\n return new syncpromise.SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void syncpromise.resolvedSyncPromise(item).then(() => {\n // eslint-disable-next-line no-plusplus\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }", "function drain(timeout) {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }", "function drain(timeout) {\n\t return new SyncPromise((resolve, reject) => {\n\t let counter = buffer.length;\n\n\t if (!counter) {\n\t return resolve(true);\n\t }\n\n\t // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n\t const capturedSetTimeout = setTimeout(() => {\n\t if (timeout && timeout > 0) {\n\t resolve(false);\n\t }\n\t }, timeout);\n\n\t // if all promises resolve in time, cancel the timer and resolve to `true`\n\t buffer.forEach(item => {\n\t void resolvedSyncPromise(item).then(() => {\n\t // eslint-disable-next-line no-plusplus\n\t if (!--counter) {\n\t clearTimeout(capturedSetTimeout);\n\t resolve(true);\n\t }\n\t }, reject);\n\t });\n\t });\n\t }", "function flush(timeout) {\n const client = core.getCurrentHub().getClient();\n return client ? client.flush(timeout) : Promise.resolve(false);\n}", "function flush(timeout) {\r\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\r\n if (client) {\r\n return client.flush(timeout);\r\n }\r\n return Promise.reject(false);\r\n}", "function flushQueue() {\n return localforage.getItem('queue').then(queue => {\n if (!queue || (queue && !queue.length)) {\n return Promise.resolve();\n }\n\n console.log('Sending ', queue.length, ' requests...');\n return sendInOrder(queue).then(() => localforage.setItem('queue', []));\n })\n}", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveEmpty;\n this._resolveEmpty = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async waitUntilPendingNotificationsDone(timeout) {\n const count = this.pendingNotifications;\n debug('Number of pending notifications: %d', count);\n if (count === 0)\n return;\n await (0, p_event_1.multiple)(this, 'observersNotified', { count, timeout });\n }", "function flush(timeout) {\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\n if (client) {\n return client.flush(timeout);\n }\n return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__[\"SyncPromise\"].reject(false);\n}", "function flush(timeout) {\n var client = hub_getCurrentHub().getClient();\n if (client) {\n return client.flush(timeout);\n }\n return syncpromise_SyncPromise.reject(false);\n}", "qEmpty() {\n return this.queue.empty();\n }", "queueIsFull() {\n return this.queue.length >= this.maxSize\n }", "sendEvents() {\n\t\tthis.sendTimer = setTimeout(() => {\n\t\t\tconst { sendBatchSize, enabled, sendInterval, sendTimeout, url } = this.config;\n\t\t\tconst { eventsDir } = this;\n\n\t\t\tif (!enabled || !url || (this.lastSend + sendInterval) > Date.now() || !eventsDir || !isDir(eventsDir)) {\n\t\t\t\t// not enabled or not time to send\n\t\t\t\treturn this.sendEvents();\n\t\t\t}\n\n\t\t\tlet sends = 0;\n\n\t\t\t// sendBatch() is recursive and will continue to scoop up `sendBatchSize` of events\n\t\t\t// until they're all gone\n\t\t\tconst sendBatch = () => {\n\t\t\t\tconst batch = [];\n\t\t\t\tfor (const name of fs.readdirSync(eventsDir)) {\n\t\t\t\t\tif (jsonRegExp.test(name)) {\n\t\t\t\t\t\tbatch.push(path.join(eventsDir, name));\n\t\t\t\t\t\tif (batch.length >= sendBatchSize) {\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}\n\n\t\t\t\t// check if we found any events to send\n\t\t\t\tif (!batch.length) {\n\t\t\t\t\tif (sends) {\n\t\t\t\t\t\tlog('No more events to send');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog('No events to send');\n\t\t\t\t\t}\n\t\t\t\t\tthis.lastSend = Date.now();\n\t\t\t\t\treturn this.sendEvents();\n\t\t\t\t}\n\n\t\t\t\tlog(__n(batch.length, 'Sending %%s event', 'Sending %%s events', highlight(batch.length)));\n\n\t\t\t\tconst json = [];\n\n\t\t\t\tfor (const file of batch) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tjson.push(JSON.parse(fs.readFileSync(file)));\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// Rather then squelch the error we'll remove here\n\t\t\t\t\t\tlog(`Failed to read ${highlight(file)}, removing`);\n\t\t\t\t\t\tfs.unlinkSync(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.pending = new Promise(resolve => {\n\t\t\t\t\trequest({\n\t\t\t\t\t\tjson,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\ttimeout: sendTimeout,\n\t\t\t\t\t\turl\n\t\t\t\t\t}, (err, resp) => {\n\t\t\t\t\t\tresolve();\n\n\t\t\t\t\t\tif (err || resp.statusCode >= 300) {\n\t\t\t\t\t\t\terror(__n(\n\t\t\t\t\t\t\t\tbatch.length,\n\t\t\t\t\t\t\t\t'Failed to send %%s event: %%s',\n\t\t\t\t\t\t\t\t'Failed to send %%s events: %%s',\n\t\t\t\t\t\t\t\thighlight(batch.length),\n\t\t\t\t\t\t\t\terr ? err.message : `${resp.statusCode} - ${resp.statusMessage}`\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tthis.lastSend = Date.now();\n\t\t\t\t\t\t\treturn this.sendEvents();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlog(__n(batch.length, 'Successfully sent %%s event', 'Successfully sent %%s events', highlight(batch.length)));\n\n\t\t\t\t\t\tfor (const file of batch) {\n\t\t\t\t\t\t\tif (isFile(file)) {\n\t\t\t\t\t\t\t\tfs.unlinkSync(file);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsends++;\n\t\t\t\t\t\tsendBatch();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tsendBatch();\n\t\t}, 1000);\n\t}", "flushQueue_() {\n if (this.isReady() && this.queueSize()) {\n this.postMessageApi_.send(\n MessageType_Enum.IFRAME_TRANSPORT_EVENTS,\n /** @type {!JsonObject} */\n ({events: this.pendingEvents_})\n );\n this.pendingEvents_ = [];\n }\n }", "_m_queue_drain() {\n const lo_this = this;\n\n const li_duration_global_ms = f_chrono_stop(lo_this._as_queue_chrono_name);\n const li_call_per_sec = f_number_round_with_precision((1000 * lo_this._ai_call_count_exec_total / li_duration_global_ms), 1);\n\n if (lo_this._ai_call_count_exec_total) {\n f_console_verbose(1, `${lo_this.m_get_context(\"drain\")} - performed a total of [${lo_this._ai_call_count_exec_total}] calls in [${f_human_duration(li_duration_global_ms, true)}] at cps=[${li_call_per_sec}], max-parallel=[${lo_this._ai_parallel_max}], max-length=[${lo_this._ai_queue_len_max}], dur-avg=[${f_human_duration((lo_this._ai_call_duration_total_ms / lo_this._ai_call_count_exec_total), true)}], dur-min=[${f_human_duration(lo_this._ai_call_duration_min_ms, true)}], dur-max=[${f_human_duration(lo_this._ai_call_duration_max_ms, true)}]`);\n }\n\n // is there a call-back associated to the event [queue_drain] ?\n const pf_queue_drain = lo_this.m_pick_option(null, \"pf_queue_drain\", true);\n if (pf_queue_drain) {\n pf_queue_drain();\n }\n }", "_m_queue_empty() {\n const lo_this = this;\n\n if (lo_this._ai_call_count_pushed_total) {\n f_console_verbose(1, `${lo_this.m_get_context(\"empty\")} - total of [${lo_this._ai_call_count_pushed_total}] calls submitted to the queue`);\n }\n\n // is there a call-back associated to the event [queue_empty] ?\n const pf_queue_empty = lo_this.m_pick_option(null, \"pf_queue_empty\", true);\n if (pf_queue_empty) {\n pf_queue_empty();\n }\n }", "checkQueue() {\n\t\tif (this.queueCheckFlag) return\n\n\t\tthis.queueCheckFlag = true\n\t\tthis.logger.info(`checkQueue planned - interval ${this.RabbitMQ.checkQueue.interval}`)\n\n\t\tsetTimeout(() => {\n\t\t\tthis.logger.info(`checkQueue`)\n\t\t\tthis.getMQChannel()\n\n\t\t\tif (this.RabbitMQ.checkQueue.repeat) {\n\t\t\t\tthis.queueCheckFlag = false\n\t\t\t\tthis.checkQueue()\n\t\t\t}\n\t\t}, this.RabbitMQ.checkQueue.interval)\n\t}", "function sendQueueEntry() {\n if (this._is_connected && this._queue.length) {\n this._uniqueSocket.write(this._queue[0][0], this._encoding, () => {\n\n // Get rid of sent message only if write was successful.\n let shifted_entry = this._queue.shift();\n\n // Second element of queue entry can be resolve function of promise,\n // if entry was pushed to queue as a result of IpcClient#whenEmitted call.\n if (shifted_entry[1] !== null && typeof shifted_entry[1] === \"function\") {\n shifted_entry[1](); // Resolve promise.\n }\n\n if (!this._queue.length) {\n this._emptying_queue = false;\n }\n else {\n sendQueueEntry.call(this);\n }\n });\n }\n else {\n this._emptying_queue = false;\n }\n}", "_waitingForQuiescence() {\n return (\n !isEmpty(this._subsBeingRevived) ||\n !isEmpty(this._methodsBlockingQuiescence)\n );\n }", "_isClientDoneProcessing(timeout) {\n return new utils.SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }", "isEmpty() {\n if (this.queue.length) {\n return false;\n }\n return true;\n }", "function hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}", "function hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}", "function hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n }", "function checkQueue(){\n\tif(notificationQueue.length && alertComplete){\n\t\talertComplete = false;\n\t\tdoAlert(notificationQueue.shift());\n\t}\n}", "executeQueue() {\n return new Promise(async (resolve, reject) => {\n try {\n let commands = this.queue;\n\n debug(`Executing queue with ${commands.length} command(s)`);\n\n let response = this.execute(commands);\n\n this.queue = [];\n\n resolve(response);\n } catch (err) {\n reject(err);\n }\n });\n }", "waitUntilSettled () {\n return new Promise((resolve) => {\n const start = (new Date()).getTime()\n const interval = setInterval(() => {\n const now = (new Date()).getTime()\n\n if (this.sentMessages !== this.receivedMessages && now - start < SETTLE_TIMEOUT) return\n clearInterval(interval)\n resolve()\n }, 100)\n })\n }", "function fire(emitter, event, timeout) {\n if (timeout === void 0) { timeout = undefined; }\n return __awaiter(this, void 0, void 0, function () {\n var waitables, asyncEvent;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n waitables = [];\n asyncEvent = Object.assign(event, {\n waitUntil: function (thenable) {\n if (Object.isFrozen(waitables)) {\n throw new Error('waitUntil cannot be called asynchronously.');\n }\n waitables.push(thenable);\n }\n });\n try {\n emitter.fire(asyncEvent);\n // Asynchronous calls to `waitUntil` should fail.\n Object.freeze(waitables);\n }\n finally {\n delete asyncEvent['waitUntil'];\n }\n if (!waitables.length) {\n return [2 /*return*/];\n }\n if (!(timeout !== undefined)) return [3 /*break*/, 2];\n return [4 /*yield*/, Promise.race([Promise.all(waitables), new Promise(function (resolve) { return setTimeout(resolve, timeout); })])];\n case 1:\n _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, Promise.all(waitables)];\n case 3:\n _a.sent();\n _a.label = 4;\n case 4: return [2 /*return*/];\n }\n });\n });\n }", "_isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }", "_queue () {\n var _this = this;\n async.whilst(\n function condition () {\n return !!_this._queueTasks.length || _this._break;\n },\n function iterator (next) {\n var task = _this._queueTasks.shift();\n task.consumer(next);\n },\n function end () {\n setTimeout(_this._queue.bind(_this), 100);\n }\n );\n }", "waitForJoiningCompleted() {\n return this.waitingForJoinPromise.promise;\n }", "push(fn, onTimeout, timeout)\n {\n if (this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY)\n {\n // ignore invalid status\n return false;\n }\n\n if (typeof fn !== 'function')\n {\n throw new Error('fn should be a function.');\n }\n this.queue.push({\n fn : fn,\n ontimeout : onTimeout,\n timeout : timeout});\n\n if (this.status === SeqQueueManager.STATUS_IDLE)\n {\n this.status = SeqQueueManager.STATUS_BUSY;\n process.nextTick(this._next.bind(this), this.curId);\n }\n return true;\n }", "get waiting()\n {\n return this.queueLength === 0;\n }", "flush() {\n // Pending Promises for _putMetricData calls\n const promises = []\n\n // Get a CloudWatch client (this will be falsy if we're not\n // really sending)\n const cw = this._setup()\n while (this._queue.length) {\n // Grab a batch of metrics from the queue - the maximum batch\n // size is 20.\n const queue = this._queue.slice(0, 20)\n this._queue = this._queue.slice(20)\n\n // Send the metrics\n promises.push(this._putMetricData(cw, queue))\n }\n\n return Promise.all(promises).catch(\n /* istanbul ignore next */\n (err) => console.warn(`Metrics: error during flush: ${err}`)\n )\n }", "isReady() {\n if (this._ready) { return; }\n\n this._ready = true;\n this._failed = false;\n this._error = null;\n\n while (this._queue.length > 0) {\n const { thunk, resolve, reject } = this._queue.shift();\n thunk().then(resolve).catch(reject);\n }\n }", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "function notifyDrainListeners() {\n var notifiedSomebody = false;\n if (!!drainQueue.length) {\n // As we exhaust priority levels, notify the appropriate drain listeners.\n //\n var drainPriority = currentDrainPriority();\n while (+drainPriority === drainPriority && drainPriority > highWaterMark) {\n pumpingPriority = drainPriority;\n notifyCurrentDrainListener();\n notifiedSomebody = true;\n drainPriority = currentDrainPriority();\n }\n }\n return notifiedSomebody;\n }", "function checkMessageQueue() {\n // If the queue isn't empty\n if($tw.Bob.MessageQueue.length > 0) {\n // Remove messages that have already been sent and have received all\n // their acks and have waited the required amonut of time.\n $tw.Bob.MessageQueue = pruneMessageQueue($tw.Bob.MessageQueue);\n // Check if there are any messages that are more than 500ms old and have\n // not received the acks expected.\n // These are assumed to have been lost and need to be resent\n const oldMessages = $tw.Bob.MessageQueue.filter(function(messageData) {\n if(Date.now() - messageData.time > $tw.settings.advanced.localMessageQueueTimeout || 500) {\n return true;\n } else {\n return false;\n }\n });\n oldMessages.forEach(function (messageData) {\n // If we are in the browser there is only one connection, but\n // everything here is the same.\n const targetConnections = $tw.node?(messageData.wiki?$tw.connections.filter(function(item) {\n return item.wiki === messageData.wiki\n }):[]):[$tw.connections[0]];\n targetConnections.forEach(function(connection) {\n _sendMessage(connection, messageData)\n });\n });\n if(messageQueueTimer) {\n clearTimeout(messageQueueTimer);\n }\n messageQueueTimer = setTimeout(checkMessageQueue, $tw.settings.advanced.localMessageQueueTimeout || 500);\n } else {\n clearTimeout(messageQueueTimer);\n messageQueueTimer = false;\n }\n }", "receive() {\n if(this.receiveDataQueue.length !== 0) return Promise.resolve(this.receiveDataQueue.shift());\n\n if(!this.connected) return Promise.reject(this.closeEvent || new Error('Not connected.'));\n\n const receivePromise = new Promise((resolve, reject) => this.receiveCallbacksQueue.push({ resolve, reject }));\n\n return receivePromise;\n }", "_isClientDoneProcessing(timeout) {\n\t return new SyncPromise(resolve => {\n\t let ticked = 0;\n\t const tick = 1;\n\n\t const interval = setInterval(() => {\n\t if (this._numProcessing == 0) {\n\t clearInterval(interval);\n\t resolve(true);\n\t } else {\n\t ticked += tick;\n\t if (timeout && ticked >= timeout) {\n\t clearInterval(interval);\n\t resolve(false);\n\t }\n\t }\n\t }, tick);\n\t });\n\t }", "function isInQueue() {\n var self = API.getSelf();\n return API.getWaitList().indexOf(self) !== -1 || API.getDJs().indexOf(self) !== -1;\n}", "async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this._pendingCount === 0 && this._queue.size === 0) {\n return;\n }\n\n return new Promise(resolve => {\n const existingResolve = this._resolveIdle;\n\n this._resolveIdle = () => {\n existingResolve();\n resolve();\n };\n });\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "function handleQueue() {\n if (this._is_connected && this._queue.length && !this._emptying_queue) {\n this._emptying_queue = true;\n sendQueueEntry.call(this);\n }\n}", "function Process_Sendq() {\n\tif (!this.empty) {\n\t\tthis.send(this.socket);\n\t}\n}", "_emptyQueue () {\n // create the queue if it doesn't exist\n if (!this.queue) {\n this.queue = []\n return\n }\n if (this.queue.length === 0) return\n if (!this.isConnected()) return\n\n log('Emptying queue (size : %d)', this.queue.length)\n\n // re-send all of the data\n while (this.queue.length > 0) {\n if (!this.isConnected()) return\n let packet = this.queue[0]\n this.send(packet.channel, packet.data)\n this.queue.shift()\n }\n }", "function processQueue() {\n emptyQueue = true;\n drainQueue(true);\n }", "async _trySendBatch(rheaMessage, options = {}) {\n const abortSignal = options.abortSignal;\n const retryOptions = options.retryOptions || {};\n const timeoutInMs = getRetryAttemptTimeoutInMs(retryOptions);\n retryOptions.timeoutInMs = timeoutInMs;\n const sendEventPromise = async () => {\n var _a, _b;\n const initStartTime = Date.now();\n const sender = await this._getLink(options);\n const timeTakenByInit = Date.now() - initStartTime;\n logger.verbose(\"[%s] Sender '%s', credit: %d available: %d\", this._context.connectionId, this.name, sender.credit, sender.session.outgoing.available());\n let waitTimeForSendable = 1000;\n if (!sender.sendable() && timeoutInMs - timeTakenByInit > waitTimeForSendable) {\n logger.verbose(\"%s Sender '%s', waiting for 1 second for sender to become sendable\", this._context.connectionId, this.name);\n await delay(waitTimeForSendable);\n logger.verbose(\"%s Sender '%s' after waiting for a second, credit: %d available: %d\", this._context.connectionId, this.name, sender.credit, (_b = (_a = sender.session) === null || _a === void 0 ? void 0 : _a.outgoing) === null || _b === void 0 ? void 0 : _b.available());\n }\n else {\n waitTimeForSendable = 0;\n }\n if (!sender.sendable()) {\n // let us retry to send the message after some time.\n const msg = `[${this._context.connectionId}] Sender \"${this.name}\", ` +\n `cannot send the message right now. Please try later.`;\n logger.warning(msg);\n const amqpError = {\n condition: ErrorNameConditionMapper.SenderBusyError,\n description: msg\n };\n throw translate(amqpError);\n }\n logger.verbose(\"[%s] Sender '%s', sending message with id '%s'.\", this._context.connectionId, this.name);\n if (timeoutInMs <= timeTakenByInit + waitTimeForSendable) {\n const desc = `${this._context.connectionId} Sender \"${this.name}\" ` +\n `with address \"${this.address}\", was not able to send the message right now, due ` +\n `to operation timeout.`;\n logger.warning(desc);\n const e = {\n condition: ErrorNameConditionMapper.ServiceUnavailableError,\n description: desc\n };\n throw translate(e);\n }\n try {\n const delivery = await sender.send(rheaMessage, {\n format: 0x80013700,\n timeoutInSeconds: (timeoutInMs - timeTakenByInit - waitTimeForSendable) / 1000,\n abortSignal\n });\n logger.info(\"[%s] Sender '%s', sent message with delivery id: %d\", this._context.connectionId, this.name, delivery.id);\n }\n catch (err) {\n throw err.innerError || err;\n }\n };\n const config = {\n operation: sendEventPromise,\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.sendMessage,\n abortSignal: abortSignal,\n retryOptions: retryOptions\n };\n try {\n await retry(config);\n }\n catch (err) {\n const translatedError = translate(err);\n logger.warning(\"[%s] Sender '%s', An error occurred while sending the message %s\", this._context.connectionId, this.name, `${translatedError === null || translatedError === void 0 ? void 0 : translatedError.name}: ${translatedError === null || translatedError === void 0 ? void 0 : translatedError.message}`);\n logErrorStackTrace(translatedError);\n throw translatedError;\n }\n }", "function flushWatcherQueue () {\n flushing = true\n let watcher\n let id\n\n queue.sort((a, b) => a.id - b.id)\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index]\n id = watcher.id\n has[id] = null\n watcher.run()\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production') {\n circular[id] = (circular[id] || 0) + 1\n if (circular[id] > MAX_UPDATE_COUNT) {\n console.error(\n `[MIP warn]:You may have an infinite update loop in watcher with expression \"${watcher.exp}\"`\n )\n break\n }\n }\n }\n\n resetState()\n}", "function waitForMockman(eventType, n) {\n var records = [];\n return Q.Promise(function(resolve) {\n mockman.on(eventType, function(record) {\n records.push(record);\n if(records.length === n) {\n resolve(records);\n }\n });\n });\n }", "function eventNameIsAvailable(eventName) {\n return $q(function(resolve, reject) {\n var count = 0;\n\n for( var i = 0; i < myEvents.length; i++ ) {\n getNameOfEventWithID(myEvents[i]).then(function(name) {\n count++;\n if( name == eventName ) {\n reject();\n }\n if( count == myEvents.length ) {\n resolve();\n }\n });\n }\n\n if(myEvents.length == 0) {\n resolve();\n }\n });\n }", "function drainQueue() {\n\t\trunHandlers(handlerQueue);\n\t\thandlerQueue = [];\n\t}", "flush() {\n var start = Date.now();\n while(this._queue.length > 0) {\n var task = this._queue.shift();\n task.work(task.scheduler, task.state);\n if(this._gap > 0 && Date.now() - start > this._gap) {\n break;\n }\n }\n\n if(this._queue.length > 0) {\n this._flushNext();\n }\n else {\n this.isProcessing = false;\n }\n }", "async drain() {\n let drained = false;\n this.draining = true;\n while (!drained) {\n drained = this.workersAvailable.every(w => w === 0);\n if (!drained) {\n await msleep(this.workerSearchSleepTime);\n }\n }\n this.draining = false;\n }", "function flushTasks() {\n return new Promise(function(resolve, reject) {\n window.setTimeout(resolve, 0);\n });\n }", "function debounceCollect(fn, wait) {\n var timer;\n var queue = {};\n var idx = 0;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new _rxjs.Observable(obs => {\n clearTimeout(timer);\n timer = setTimeout(flush, wait);\n var queueItem = {\n args: args,\n observer: obs,\n completed: false\n };\n var id = idx++;\n queue[id] = queueItem;\n return () => {\n // console.log('completed', queueItem.args)\n queueItem.completed = true;\n };\n });\n };\n\n function flush() {\n var currentlyFlushingQueue = queue;\n queue = {};\n var queueItemIds = Object.keys(currentlyFlushingQueue) // Todo: use debug\n // .map(id => {\n // if (currentlyFlushingQueue[id].completed) {\n // console.log('Dropped', currentlyFlushingQueue[id].args)\n // }\n // return id\n // })\n .filter(id => !currentlyFlushingQueue[id].completed);\n\n if (queueItemIds.length === 0) {\n // nothing to do\n return;\n }\n\n var collectedArgs = queueItemIds.map(id => currentlyFlushingQueue[id].args);\n fn(collectedArgs).subscribe({\n next(results) {\n results.forEach((result, i) => {\n var queueItem = currentlyFlushingQueue[queueItemIds[i]];\n\n if (!queueItem.completed) {\n queueItem.observer.next(results[i]);\n }\n });\n },\n\n complete() {\n queueItemIds.forEach(id => {\n var entry = currentlyFlushingQueue[id];\n\n if (!entry.completed) {\n entry.observer.complete();\n }\n });\n },\n\n error(err) {\n queueItemIds.forEach(id => {\n var entry = currentlyFlushingQueue[id];\n\n if (!entry.completed) {\n entry.observer.error(err);\n }\n });\n }\n\n });\n }\n}", "function playFromQueue(){\n if (!startConsuming) {\n setTimeout(playFromQueue, Math.floor(Math.random() * 1000) + 500);\n return;\n }\n var event = eventQueue.shift();\n if(event != null && event.actor.display_login != null && !shouldEventBeIgnored(event) && svg != null){\n playSound(event.actor.display_login.length*1.1, event.type);\n if(!document.hidden)\n drawEvent(event, svg);\n }else{\n console.log(\"Ignored ex 1\");\n }\n setTimeout(playFromQueue, Math.floor(Math.random() * 1000) + 500);\n $('.events-remaining-value').html(eventQueue.length);\n}", "async consume() {\n if (this.state.consuming) return;\n if (!this.queue.meta.length) return;\n\n this.state.consuming = true;\n console.log('Consuming queue...', 'Orders in queue: ' + this.queue.meta.length);\n\n const filledTransactions = await this.queue.digest();\n\n //repopulate queue with closing (unconfirmed) transactions\n for (let orderId in filledTransactions) {\n const txn = filledTransactions[orderId];\n const price = Number(txn.price);\n if (txn.side === 'BUY') {\n const profit = price + (price * this.config.profitPercentage) + (price * .001);\n this.sell(Number(txn.executedQty), profit);\n }\n if (txn.side === 'SELL') {\n const profit = price - (price * this.config.profitPercentage) - (price * .001);\n this.purchase(Number(txn.executedQty), profit);\n }\n }\n\n console.log('Consumed queue.', 'Orders in queue: ' + this.queue.meta.length);\n this.state.consuming = false;\n }", "async runWaitingTxns() {\n if (this.isLocked) throw new Error(`runWaitingTxns() ran when not actually ready to lock`);\n try {\n console.group('Processing all queued transactions');\n\n // process until there's nothing left\n this.isLocked = true;\n while (this.waitQueue.length) {\n const {args, resolve, reject} = this.waitQueue.shift();\n // pipe result to the original\n const txnPromise = this.immediateTransact(args);\n txnPromise.then(resolve, reject);\n await txnPromise;\n }\n this.isLocked = false;\n\n } finally {\n console.groupEnd();\n if (this.waitQueue.length) {\n console.warn('WARN: still had work queued after runWaitingTxns() completed');\n }\n }\n }", "function drainQueue() {\n\t runHandlers(handlerQueue);\n\t handlerQueue = [];\n\t }", "function drainQueue() {\n runHandlers(handlerQueue);\n handlerQueue = [];\n}", "isEmpty() {\n return this.queue.size() === 0;\n }", "async poll() {\n while (!this.stopping) {\n var messages = await this.queueService.pollClaimQueue();\n debug('Fetched %s messages', messages.length);\n\n await Promise.all(messages.map(async (message) => {\n // Don't let a single task error break the loop, it'll be retried later\n // as we don't remove message unless they are handled\n try {\n await this.handleMessage(message);\n } catch (err) {\n this.monitor.reportError(err, 'warning');\n }\n }));\n\n if (messages.length === 0 && !this.stopping) {\n // Count that the queue is empty, we should have this happen regularly.\n // otherwise, we're not keeping up with the messages. We can setup\n // alerts to notify us if this doesn't happen for say 40 min.\n this.monitor.count('claim-queue-empty');\n await this.sleep(this.pollingDelay);\n }\n }\n }", "function getEventsToQueue(calendar_id, endTimeDate){\n\n var calendar = CalendarApp.getCalendarById(calendar_id)\n var now = new Date();\n\n var raw_events = calendar.getEvents(endTimeDate, now); //gets all events that OCCURED between endTimeDate and now\n\n var res = []\n\n for(var i = 0; i < raw_events.length; i++){\n var title = raw_events[i].getTitle()\n \n if( ~ title.indexOf(\"EMAILED\") || ~ title.indexOf('LOCKED') || ~ title.indexOf(\"TEXTED\")\n || ~ title.indexOf(\"CALLED\")|| ~ title.indexOf(\"FAXED\") || ~ title.indexOf(\"QUEUED\") || ~ title.indexOf(\"FAILED\") || ~ title.indexOf(\"STOPPED\")) continue; //don't reprocess a tagged event\n \n if(raw_events[i].getEndTime().getTime() >= endTimeDate.getTime()){\n console.log('locking event: ' + raw_events[i].getTitle())\n try{\n markLocked(raw_events[i]) //mark it as locked now so we don't touch it again if this run takes more than one minute\n } catch(err){ //if you get an error, then it's the quota of too-fast event manipulation, so stop here and return\n console.log(\"error when locking: \" + JSON.stringify(err))\n MailApp.sendEmail('aminata@sirum.org','HIT THE QUOTA ISSUE','')\n break\n }\n res.push(raw_events[i]) //only take events that STARTED a minute ago\n }\n }\n Logger.log(res)\n return res\n\n}", "fetchQueued() {\n return fetchSoon.fetchSearchRequests(this._myStartableQueued());\n }", "isEmpty () {\n return Boolean(this.queue.length === 0)\n }", "function drainQueue() {\n taskit.runTasks(queue);\n queue = [];\n }", "drain() {\n const tail = this.tail;\n return tail.then(() => {\n if (this.tail === tail) {\n return;\n }\n return this.drain();\n });\n }", "function batchingQueue(\n { max_qty, quiesce_time},\n { current_timestamp, setTimeout, clearTimeout },\n sink,\n) {\n let buf = [];\n let quiescing;\n const toDate = ts => new Date(ts);\n\n function flush() {\n if (buf.length > 0) {\n sink(buf); // ISSUE: async? consume promise?\n buf = [];\n }\n if (quiescing !== undefined) {\n clearTimeout(quiescing);\n quiescing = undefined;\n }\n }\n\n return harden({\n push: (item) => {\n let due = false;\n const t = current_timestamp();\n buf.push(item);\n if (buf.length >= max_qty) {\n console.log({ current: toDate(t), qty: buf.length, max_qty });\n flush();\n } else {\n if (quiescing !== undefined) {\n clearTimeout(quiescing);\n }\n const last_activity = t;\n quiescing = setTimeout(() => {\n const t = current_timestamp();\n console.log({\n quiesce_time,\n current: toDate(t),\n last_activity: toDate(last_activity),\n delta: (t - last_activity) / 1000,\n });\n flush();\n }, quiesce_time);\n }\n },\n finish: () => {\n flush();\n }\n });\n}", "async dispatchAsyncEvent(eventName) {\n // Wait for all the previous blockers before dispatching the event.\n let blockersPromise = this._blockersPromise.catch(() => {});\n return (this._blockersPromise = blockersPromise.then(async () => {\n let blockers = new Set();\n let cancel = this.dispatchCustomEvent(\n eventName,\n {\n addBlocker(promise) {\n // Any exception in the blocker will cancel the operation.\n blockers.add(\n promise.catch(ex => {\n Cu.reportError(ex);\n return true;\n })\n );\n },\n },\n true\n );\n if (blockers.size) {\n let timeoutPromise = new Promise((resolve, reject) => {\n this.window.setTimeout(reject, BLOCKERS_TIMEOUT_MS);\n });\n try {\n let results = await Promise.race([\n Promise.all(blockers),\n timeoutPromise,\n ]);\n cancel = cancel || results.some(result => result === false);\n } catch (ex) {\n Cu.reportError(\n new Error(`One of the blockers for ${eventName} timed out.`)\n );\n return true;\n }\n }\n return cancel;\n }));\n }", "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "function redux_saga_core_esm_flush() {\n release();\n var task;\n\n while (!semaphore && (task = redux_saga_core_esm_queue.shift()) !== undefined) {\n exec(task);\n }\n}", "async function flushPromises() {\n // eslint-disable-next-line @lwc/lwc/no-async-operation\n return new Promise((resolve) => setTimeout(resolve, 0));\n }", "function check_queue_write() {\n\tif (intf.intf.queue_write.length < 1) {\n\t\tintf.intf.writing = false;\n\t\treturn false;\n\t}\n\n\tintf.intf.writing = true;\n\treturn true;\n}", "processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.resetTimer = this.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }" ]
[ "0.6735874", "0.66713154", "0.6627388", "0.6355362", "0.6202156", "0.60480195", "0.6021893", "0.5971303", "0.5971303", "0.59321934", "0.5791965", "0.57021", "0.5651994", "0.5579035", "0.55449414", "0.5516379", "0.5484764", "0.54521686", "0.5447947", "0.5388345", "0.53577274", "0.53565437", "0.53560203", "0.5337452", "0.5337452", "0.53174317", "0.5303718", "0.52775747", "0.5250716", "0.52483803", "0.5219301", "0.52125055", "0.5207465", "0.5192036", "0.5183716", "0.51727676", "0.5171804", "0.5170107", "0.5170107", "0.5164684", "0.51622397", "0.5155921", "0.5134869", "0.5134633", "0.51047444", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5074008", "0.5070748", "0.5068095", "0.5058033", "0.5045205", "0.5036522", "0.50170815", "0.49856654", "0.49825868", "0.49517456", "0.4949879", "0.49430153", "0.4934857", "0.49288973", "0.49280357", "0.4921265", "0.49208227", "0.4920254", "0.49172753", "0.4917222", "0.4915422", "0.49115792", "0.4900087", "0.48943818", "0.4893019", "0.48921818", "0.48831174", "0.48804244", "0.48748755", "0.48740816", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48697346", "0.48668423", "0.48668423", "0.48668423", "0.48668423", "0.48594183", "0.48438746", "0.48434383", "0.4842677" ]
0.0
-1
Wrap code within a try/catch block so the SDK is able to capture errors.
function sdk_wrap(fn) { return wrap(fn)(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run() {\n\t\tthrow new Error;\n\t}", "function executeWithRaygunHandling(fn) {\n try {\n fn();\n } catch (e) {\n Raygun.send(e);\n }\n}", "static try(fn) {\n try {\n return Ok(fn())\n } catch (error) {\n return Err(error)\n }\n }", "function t(fn) { fn().catch(()=>{}); }", "function Catch( onerr, ap ) {\r\n}", "function foo() {\n {\n throw 'error';\n }\n}", "function create_catch_block_1(ctx) {\n var p;\n var t0;\n var t1_value =\n /*err*/\n ctx[18].message + \"\";\n var t1;\n return {\n c: function c() {\n p = element(\"p\");\n t0 = text(\"Error: \");\n t1 = text(t1_value);\n },\n m: function m(target, anchor) {\n insert(target, p, anchor);\n append(p, t0);\n append(p, t1);\n },\n p: function p(ctx, dirty) {\n if (dirty &\n /*postRequest*/\n 64 && t1_value !== (t1_value =\n /*err*/\n ctx[18].message + \"\")) set_data(t1, t1_value);\n },\n i: noop$1,\n o: noop$1,\n d: function d(detaching) {\n if (detaching) detach(p);\n }\n };\n } // (84:0) {:then}", "_recoverySetup() {\n (async () => {\n await this._editorComplex.bodyClient.when_unrecoverableError();\n this._recoverIfPossible();\n })();\n }", "_recoverySetup() {\n (async () => {\n await this._editorComplex.bodyClient.when_unrecoverableError();\n this._recoverIfPossible();\n })();\n }", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn, obj, arg) { // 59\n try { // 60\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 61\n } catch (err) { // 62\n return { type: \"throw\", arg: err }; // 63\n } // 64\n } // 65", "function handleError(code, message) {\n // Process your code here\n // Genramos un mensaje\n throw new Error(message + \". Code: \" + code);\n}", "try() {\n if (this.isOk()) {\n return this.value\n }\n throw this.error\n }", "function tryCatch(fn,obj,arg){try{return {type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return {type:\"throw\",arg:err};}}", "function tryCatch(callback) {\r\n Promise.resolve()\r\n .then(callback)\r\n .catch(function(error) {\r\n // Note: In a production add-in, you'd want to notify the user through your add-in's UI.\r\n console.error(error);\r\n });\r\n}", "run(code) {\n try {\n this.execute(this.parse(code), this);\n return this;\n } catch (e) {\n this.output += `[error][lle:${e.index}] ${e.value}\\n`;\n return this;\n }\n }", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}", "function catch_error(error) {\n console.error(error);\n switch (error.statusCode) {\n case 400: break;\n case 403: break;\n case 404: break;\n case 429: break;\n case 500: break;\n case 502: break;\n case 503: break;\n default:\n auth.tryRefresh();\n break;\n };\n}", "componentDidCatch(error, errorInfo) {\n Raven.captureException(error, { extra: errorInfo });\n }", "function Exception() {\n return;\n}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n requestPhotos(fallBackLocation)\n \n}", "function simpleTryCatch() {\r\n const fs = require('fs');\r\n try {\r\n console.log(a[2])\r\n } catch (error) {\r\n console.log('error', error)\r\n }\r\n\r\n b = null;\r\n try {\r\n b.do(); \r\n } catch (error) {\r\n console.log('error', error) \r\n // recover\r\n }\r\n}", "function tryBlock(action, errorMessage) {\n try {\n return action();\n }\n catch (e) {\n handleError(errorMessage, e);\n }\n }", "function tryBlock(action, errorMessage) {\n try {\n return action();\n }\n catch (e) {\n handleError(errorMessage, e);\n }\n }", "function tryCatch(handler){\n return async (req,res,next)=>{\n try{\n console.log(\"inside handler\");\n await handler(req,res);\n }catch(ex){\n console.log(\"iaide error\");\n handleError(ex ,res); // if exception then calling handleError middleware\n }\n }\n}", "function exception_example_tcf( ) {\n\n\n\t//\n\t//\tTRY Block\n\t//\n\ttry {\n\t\t//\n\t\t// Werfe eine neue Exception vom T yp MyError\n\t\t//\n\t\tthrow new MyError(\"Banane\")\n\t}\n\t\n\t\n\t//\n\t//\tCATCH Block\n\t//\n\tcatch( err ) {\n\t\t\n\t\t//\n\t\t// Teste, ob ein Fehler vom Typ MyError geworfen wurde\n\t\t//\n\t\tif( err instanceof MyError ) {\n\t\t\tconsole.warn(\"A MyError occured\" ,err);\n\t\t}\n\t\t\n\t\t//\n\t\t// War die Exception nicht vom Typ MyError dann werfe die Exception weiter\n\t\t//\n\t\telse {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t\n\t//\n\t//\tFINALLY Block \n\t//\t(Wird immer ausgelöst, egal ob eine Exception geworfen wurde oder nicht)\n\t//\n\tfinally {\n\t\tconsole.info( \"Exception or not.. Diese Ausgabe erfolgt immer\");\n\t}\n}", "function bracketOnError_(acquire, use, release, __trace) {\n return (0, _bracketExit.bracketExit_)(acquire, use, (a, e) => e._tag === \"Success\" ? _core.unit : release(a, e), __trace);\n}", "function runTryCatch(func) {\n try {\n return func()\n }\n catch (e) {\n }\n}", "function _safelyCall(isCatch, fn, ctx) {\n\t if (!fn) return\n\n\t if (isCatch) {\n\t try {\n\t fn.call(ctx)\n\t } catch(e) {\n\t consoler.errorTrace(e)\n\t }\n\t } else {\n\t fn.call(ctx)\n\t }\n\t}", "function exception_example( ) {\n\n\t//\n\t//\tTRY Block\n\t//\n\ttry {\n\t\t//\n\t\t// Werfe eine neue Exception vom Typ MyError\n\t\t//\n\t\tthrow new MyError(\"Banane\")\n\t}\n\t//\n\t//\tCATCH Block\n\t//\n\tcatch( err ) {\n\t\t\n\t\t//\n\t\t// Teste, ob ein Fehler vom Typ MyError geworfen wurde\n\t\t//\t\n\t\tif( err instanceof MyError ) {\n\t\t\tconsole.warn(\"A MyError occured\" ,err);\n\t\t}\n\t\t\n\t\t//\n\t\t// War die Exception nicht vom Typ MyError dann werfe die Exception weiter\n\t\t//\n\t\telse {\n\t\t\tthrow err;\n\t\t}\n\t}\n}", "function tryCatch(fn, obj, arg) { // 63\n try { // 64\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 65\n } catch (err) { // 66\n return { type: \"throw\", arg: err }; // 67\n } // 68\n } // 69", "function fail() {\n try{\n console.log('this works')\n throw new Error('oh no')\n }\n catch(err){\n console.log('we have made an error')\n } finally{\n console.log('I still run')\n }\n console.log('!!!!!!!!!!!!!!') // this would never run, things only run in try catch\n}", "function _safelyCall(isCatch, fn, ctx) {\n if (!fn) return\n\n if (isCatch) {\n try {\n fn.call(ctx)\n } catch(e) {\n consoler.errorTrace(e)\n }\n } else {\n fn.call(ctx)\n }\n}", "handleFailure (error_)\n\t{\n\t\tthrow error_;\n\t}", "function evalWithCatch(code, fileName) {\n try {\n evalWithWrapper(code, fileName);\n } catch (e) {\n // Log it properly.\n GM_util.logError(e, false, fileName, e.lineNumber);\n // Stop the script, in the case of requires, as if it was one big script.\n return false;\n }\n return true;\n }", "function onCatchError(statusMessage) {\n onVisionRequestLoaded();\n errorMessage(statusMessage);\n }", "function onCatchError(statusMessage) {\n onVisionRequestLoaded();\n errorMessage(statusMessage);\n }", "async function callForTroubleDontCatchIt() {\n return await callForTrouble()\n}", "async checkCodeError () {\n\t\tlet codeErrorId;\n\t\tif (this.attributes.codeError) {\n\t\t\t// creating a code error\n\t\t\tthis.creatingCodeError = true;\n\t\t} else if (this.attributes.parentPostId) {\n\t\t\t// is the parent a code error?\n\t\t\tthis.parentPost = await this.data.posts.getById(this.attributes.parentPostId);\n\t\t\tif (!this.parentPost) {\n\t\t\t\tthrow this.errorHandler.error('notFound', { info: 'parent post' });\n\t\t\t}\n\t\t\tif (this.parentPost.get('codeErrorId')) {\n\t\t\t\tcodeErrorId = this.parentPost.get('codeErrorId');\n\t\t\t} else if (this.parentPost.get('parentPostId')) {\n\t\t\t\t// maybe the grandparent is a code error?\n\t\t\t\tthis.grandParentPost = await this.data.posts.getById(this.parentPost.get('parentPostId'));\n\t\t\t\tif (!this.grandParentPost) {\n\t\t\t\t\tthrow this.errorHandler.error('notFound', { info: 'grandparent post' });\n\t\t\t\t}\n\t\t\t\tcodeErrorId = this.grandParentPost.get('codeErrorId');\n\t\t\t}\n\t\t} \n\n\t\t// get the code error if this is a reply to one\n\t\tif (codeErrorId) {\n\t\t\tthis.codeError = await this.data.codeErrors.getById(codeErrorId);\n\t\t\tif (!this.codeError) {\n\t\t\t\tthrow this.errorHandler.error('notFound', { info: 'code error' });\n\t\t\t}\n\n\t\t\t// stream ID of the object must match the stream ID of the post\n\t\t\tif (this.attributes.streamId !== this.codeError.get('streamId')) {\n\t\t\t\tthrow this.errorHandler.error('parentPostStreamIdMismatch');\n\t\t\t}\n\t\t}\n\t}", "function buzz() {\n try {\n Bangle.buzz();\n }\n catch (e) {\n }\n}", "function _catch(body, recover) {\n try {\n var result = body();\n } catch (e) {\n return recover(e);\n }\n\n if (result && result.then) {\n return result.then(void 0, recover);\n }\n\n return result;\n} // Asynchronously await a promise and pass the result to a finally continuation", "function _catch(body, recover) {\n try {\n var result = body();\n } catch (e) {\n return recover(e);\n }\n\n if (result && result.then) {\n return result.then(void 0, recover);\n }\n\n return result;\n} // Asynchronously await a promise and pass the result to a finally continuation", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "function doTryCatch() {\n try {\n var build = 1;\n } catch (e) {\n var f = build;\n }\n}", "function bpException() {}", "function c(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}", "function tryCatch(fn, obj, arg) {\r\n try {\r\n return {\r\n type: 'normal',\r\n arg: fn.call(obj, arg)\r\n };\r\n } catch (err) {\r\n return {\r\n type: 'throw',\r\n arg: err\r\n };\r\n }\r\n }", "function tryCatch(toTry, handleError) {\n try {\n toTry();\n } catch (err) {\n handleError(err);\n }\n}", "onerror() {}", "onerror() {}", "function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg),\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err,\n };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "attempt() {}", "_handleApiCall(apiUrl, errorMessage) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const response = yield this.axios.get(encodeURI(apiUrl));\n return response.data;\n }\n catch (error) {\n console.log(error);\n throw new Error(`Starcraft 2 Game Data Error :: ${errorMessage}`);\n }\n });\n }", "function a() {\n try {\n b()\n\n function b() {\n // let json = '{bad json}'\n // let user = JSON.parse(json); \n\n let user = {\n name: 'abdul'\n }\n console.log(user.name);\n c()\n\n function c() {\n try {\n // let json = '{bad json}'\n // let user = JSON.parse(json); \n\n let user = {\n name: 'majeed'\n }\n console.log(user.name);\n\n } catch (err) {\n console.log(err, \"---3---\")\n }\n d()\n\n function d() {\n try {\n // let json = '{bad json}'\n // let user = JSON.parse(json); \n\n let user = {\n name: 'bruce'\n }\n console.log(user.name);\n } catch (err) {\n console.log(err, \"inside the function err\")\n }\n }\n }\n }\n } catch (err) {\n console.log(err, \"Error caught\")\n }\n}", "logAndThrow(data) {\n console.error(data); // eslint-disable-line no-console\n throw data;\n }", "function handleError(err) {\n\tif (err) throw err;\n}", "async function loginError(err, obj) {\n switch(err.code){\n case \"UserNotConfirmedException\":\n console.log(\"phone not confirmed, going to verify it!\")\n Auth.resendSignUp(obj.state.username).then(\n (user) => {\n obj.setState({ user });\n obj.props.navigation.navigate('PNV',\n {username: obj.state.username, authType: 'signup'})\n }\n ).catch(\n (err) => {\n console.log(err)\n }\n )\n break;\n\n case \"UserNotFoundException\":\n console.log(\"user was not found in aws cognito\");\n Alert.alert(\"Login Error\", \"The username is incorrect. Please try again\");\n\n break;\n default:\n console.log(err)\n Alert.alert(\"Login Error\", \"Username or password was entered incorrectly. Please try again\");\n break;\n }\n}", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }" ]
[ "0.56149614", "0.56072515", "0.5600202", "0.5545256", "0.5490343", "0.53815824", "0.5357493", "0.5329493", "0.5329493", "0.53221285", "0.53221285", "0.53221285", "0.53221285", "0.53221285", "0.5315415", "0.53129834", "0.5312114", "0.52945846", "0.52945644", "0.5266173", "0.5241424", "0.5241424", "0.5241424", "0.5241424", "0.5241424", "0.5241424", "0.5241424", "0.5222347", "0.52144057", "0.5214046", "0.5199944", "0.51968086", "0.5195088", "0.5195088", "0.5180683", "0.5178917", "0.51739186", "0.5166132", "0.5150275", "0.51497424", "0.5145129", "0.5108733", "0.51074123", "0.5098214", "0.5095762", "0.50730515", "0.50730515", "0.50497264", "0.5025231", "0.50238824", "0.5018747", "0.5018747", "0.5013674", "0.5007237", "0.5001508", "0.4999112", "0.49845594", "0.49744776", "0.49667257", "0.49667257", "0.49667153", "0.49665383", "0.49638316", "0.49607298", "0.49582493", "0.4958043", "0.4955669", "0.49551165", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179", "0.4953179" ]
0.0
-1
Enable automatic Session Tracking for the initial page load.
function startSessionTracking() { var window = Object(misc["e" /* getGlobalObject */])(); var hub = hub_getCurrentHub(); /** * We should be using `Promise.all([windowLoaded, firstContentfulPaint])` here, * but, as always, it's not available in the IE10-11. Thanks IE. */ var loadResolved = document.readyState === 'complete'; var fcpResolved = false; var possiblyEndSession = function () { if (fcpResolved && loadResolved) { hub.endSession(); } }; var resolveWindowLoaded = function () { loadResolved = true; possiblyEndSession(); window.removeEventListener('load', resolveWindowLoaded); }; hub.startSession(); if (!loadResolved) { // IE doesn't support `{ once: true }` for event listeners, so we have to manually // attach and then detach it once completed. window.addEventListener('load', resolveWindowLoaded); } try { var po = new PerformanceObserver(function (entryList, po) { entryList.getEntries().forEach(function (entry) { if (entry.name === 'first-contentful-paint' && entry.startTime < firstHiddenTime_1) { po.disconnect(); fcpResolved = true; possiblyEndSession(); } }); }); // There's no need to even attach this listener if `PerformanceObserver` constructor will fail, // so we do it below here. var firstHiddenTime_1 = document.visibilityState === 'hidden' ? 0 : Infinity; document.addEventListener('visibilitychange', function (event) { firstHiddenTime_1 = Math.min(firstHiddenTime_1, event.timeStamp); }, { once: true }); po.observe({ type: 'paint', buffered: true, }); } catch (e) { fcpResolved = true; possiblyEndSession(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startSessionTracking() {\n if (typeof WINDOW$2.document === 'undefined') {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n const hub = getCurrentHub();\n\n // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n // pinned at the same version in package.json, but there are edge cases where it's possible. See\n // https://github.com/getsentry/sentry-javascript/issues/3207 and\n // https://github.com/getsentry/sentry-javascript/issues/3234 and\n // https://github.com/getsentry/sentry-javascript/issues/3278.\n if (!hub.captureSession) {\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSessionOnHub(hub);\n\n // We want to create a session for every navigation as well\n addInstrumentationHandler('history', ({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (!(from === undefined || from === to)) {\n startSessionOnHub(getCurrentHub());\n }\n });\n }", "function startSessionTracking() {\n\t if (typeof WINDOW$1.document === 'undefined') {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n\t logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n\t return;\n\t }\n\n\t const hub = getCurrentHub();\n\n\t // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n\t // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n\t // pinned at the same version in package.json, but there are edge cases where it's possible. See\n\t // https://github.com/getsentry/sentry-javascript/issues/3207 and\n\t // https://github.com/getsentry/sentry-javascript/issues/3234 and\n\t // https://github.com/getsentry/sentry-javascript/issues/3278.\n\t if (!hub.captureSession) {\n\t return;\n\t }\n\n\t // The session duration for browser sessions does not track a meaningful\n\t // concept that can be used as a metric.\n\t // Automatically captured sessions are akin to page views, and thus we\n\t // discard their duration.\n\t startSessionOnHub(hub);\n\n\t // We want to create a session for every navigation as well\n\t addInstrumentationHandler('history', ({ from, to }) => {\n\t // Don't create an additional session for the initial route or if the location did not change\n\t if (!(from === undefined || from === to)) {\n\t startSessionOnHub(getCurrentHub());\n\t }\n\t });\n\t}", "function startSessionTracking() {\n if (typeof helpers.WINDOW.document === 'undefined') {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n utils.logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n const hub = core.getCurrentHub();\n\n // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n // pinned at the same version in package.json, but there are edge cases where it's possible. See\n // https://github.com/getsentry/sentry-javascript/issues/3207 and\n // https://github.com/getsentry/sentry-javascript/issues/3234 and\n // https://github.com/getsentry/sentry-javascript/issues/3278.\n if (!hub.captureSession) {\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSessionOnHub(hub);\n\n // We want to create a session for every navigation as well\n utils.addInstrumentationHandler('history', ({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (!(from === undefined || from === to)) {\n startSessionOnHub(core.getCurrentHub());\n }\n });\n}", "function initializeTracking() {\r\n\t\t\tif (self.options.trackingEnabled && self.options.GAID.length > 0) {\r\n\t\t\t\t// initialize Google Analytics Tracking Code\r\n\t\t\t\tvar _gaq = _gaq || [];\r\n\t\t\t\t_gaq.push(['_setAccount', self.options.GAID]);\r\n\t\t\t\t_gaq.push(['_trackPageview']);\r\n\t\t\t\t\r\n\t\t\t\t(function() {\r\n\t\t\t\t var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r\n\t\t\t\t ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r\n\t\t\t\t var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r\n\t\t\t\t})();\r\n\t\t\t}\r\n\t\t}", "function initiateTracker() {\r\n\t\tvar _gaq = _gaq || [];\r\n\t\t_gaq.push([ '_setAccount', 'UA-29870367-2' ]);\r\n\t\t_gaq.push([ '_trackPageview' ]);\r\n\r\n\t\t(function() {\r\n\t\t\tvar ga = document.createElement('script');\r\n\t\t\tga.type = 'text/javascript';\r\n\t\t\tga.async = true;\r\n\t\t\tga.src = 'https://ssl.google-analytics.com/ga.js';\r\n\t\t\tvar s = document.getElementsByTagName('script')[0];\r\n\t\t\ts.parentNode.insertBefore(ga, s);\r\n\t\t})();\r\n\t}", "function startSessionTracking() {\n var hub = core_1.getCurrentHub();\n hub.startSession();\n // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because\n // The 'beforeExit' event is not emitted for conditions causing explicit termination,\n // such as calling process.exit() or uncaught exceptions.\n // Ref: https://nodejs.org/api/process.html#process_event_beforeexit\n process.on('beforeExit', function () {\n var _a;\n var session = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();\n var terminalStates = [types_1.SessionStatus.Exited, types_1.SessionStatus.Crashed];\n // Only call endSession, if the Session exists on Scope and SessionStatus is not a\n // Terminal Status i.e. Exited or Crashed because\n // \"When a session is moved away from ok it must not be updated anymore.\"\n // Ref: https://develop.sentry.dev/sdk/sessions/\n if (session && !terminalStates.includes(session.status))\n hub.endSession();\n });\n}", "function initializeSession() {}", "function onSessionStarted(sessionStartedRequest, session) {\r\n // add any session init logic here\r\n}", "function SessionStartup() {\n}", "function onSessionStarted(sessionStartedRequest, session) {\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n // add any session init logic here\n}", "async activateTracking () {\n // skip tracking for gatsby builds\n if (typeof document === `undefined`) {\n return false;\n }\n\n // introduce a state for debug option\n window['w_ph_debug'] = [];\n\n this.initializePosthogTracking (posthog => {\n // populate the user details\n this.gatherUserDetails (posthog);\n });\n }", "function init(){\r\n checkSession(); \r\n}", "function init() {\n $(document).on('pageBeforeInit', function (e) {\n var page = e.detail.page;\n\n if (page.name.startsWith(\"smart\")) return;\n\n if (localStorage.getItem('auth-token') == null)\n load('login');\n else\n load(page.name, page.query);\n });\n }", "function startTrackingWebVitals() {\n const performance = getBrowserPerformanceAPI();\n if (performance && browserPerformanceTimeOrigin) {\n if (performance.mark) {\n WINDOW.performance.mark('sentry-tracing-init');\n }\n _trackCLS();\n _trackLCP();\n _trackFID();\n }\n }", "static init() {\n if (!this.isLogged()) {\n this.getSession();\n } \n }", "_enableAutoLogin() {\n this._autoLoginEnabled = true;\n this._pollStoredLoginToken();\n }", "function init() {\n\t\t\tuserId = window.localStorage.getItem(userIdKey);\n\t\t\tsessionId = window.localStorage.getItem(sessionIdKey);\n\t\t\tsessionTime = window.localStorage.getItem(sessionTimeKey);\n\t\t\tisNewUser = false;\n\n\t\t\tpageId = window.apRecommendationPageId;\n\t\t\tpageEnterTime = new Date().getTime();\n\t\t\tvar isSameSession = true;\n\n\t\t\tif (!userId) {\n\t\t\t\tadpushup.utils.log('no userId');\n\t\t\t\tuserId = createUUID();\n\t\t\t\twindow.localStorage.setItem(userIdKey, userId);\n\n\t\t\t\tisNewUser = true;\n\n\t\t\t\t//added\n\t\t\t\tisSameSession = false;\n\t\t\t}\n\t\t\t//if the duration exceeds 30 minutes, a new session is started\n\t\t\tvar minutes30 = 1800000;\n\n\t\t\tif (sessionId) {\n\t\t\t\tif (sessionTime) {\n\t\t\t\t\tvar sessionIdNum = parseInt(sessionTime, 10);\n\t\t\t\t\tif (\n\t\t\t\t\t\tNumber.isNaN(sessionIdNum) ||\n\t\t\t\t\t\tnew Date().getTime() - sessionIdNum > minutes30 ||\n\t\t\t\t\t\tnew Date().getDate() !== new Date(sessionIdNum).getDate()\n\t\t\t\t\t) {\n\t\t\t\t\t\tisSameSession = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!sessionId || !isSameSession || !sessionTime) {\n\t\t\t\tif (pageId) {\n\t\t\t\t\twindow.removeEventListener('scroll', scrollHandler);\n\t\t\t\t\tdocument.removeEventListener('visibilitychange', logData);\n\t\t\t\t}\n\t\t\t\tadpushup.utils.log('no session ID');\n\t\t\t\tsessionId = new Date().getTime();\n\t\t\t\twindow.localStorage.setItem(sessionIdKey, sessionId);\n\t\t\t}\n\t\t\tif (!pageId) {\n\t\t\t\tpageId = createUUID();\n\t\t\t}\n\t\t\tsessionTime = new Date().getTime();\n\t\t\twindow.localStorage.setItem(sessionTimeKey, sessionTime);\n\t\t\twindow.apRecommendationPageId = pageId;\n\t\t}", "startTracking() {\n HyperTrack.onTrackingStart();\n }", "function startSession(){\n cc('startSession','run');\n setupStorage();\n // setSessionID();\n // setSessionTime();\n setDefaultData();\n}", "beginTracking_() {\n this.tracking_ = true;\n }", "function initTracking() {\n\t\tif (!session.mouseTrackingActive) {\n\t\t\tsession.mouseTrackingActive = true;\n\n\t\t\t// grab the current viewport dimensions on load\n\t\t\t$(function getViewportDimensions() {\n\t\t\t\tsession.scrollLeft = $window.scrollLeft();\n\t\t\t\tsession.scrollTop = $window.scrollTop();\n\t\t\t\tsession.windowWidth = $window.width();\n\t\t\t\tsession.windowHeight = $window.height();\n\t\t\t});\n\n\t\t\t// hook mouse move tracking\n\t\t\t$document.on('mousemove', trackMouse);\n\n\t\t\t// hook viewport dimensions tracking\n\t\t\t$window.on({\n\t\t\t\tresize: function trackResize() {\n\t\t\t\t\tsession.windowWidth = $window.width();\n\t\t\t\t\tsession.windowHeight = $window.height();\n\t\t\t\t},\n\t\t\t\tscroll: function trackScroll() {\n\t\t\t\t\tvar x = $window.scrollLeft(),\n\t\t\t\t\t\ty = $window.scrollTop();\n\t\t\t\t\tif (x !== session.scrollLeft) {\n\t\t\t\t\t\tsession.currentX += x - session.scrollLeft;\n\t\t\t\t\t\tsession.scrollLeft = x;\n\t\t\t\t\t}\n\t\t\t\t\tif (y !== session.scrollTop) {\n\t\t\t\t\t\tsession.currentY += y - session.scrollTop;\n\t\t\t\t\t\tsession.scrollTop = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function init() {\n if (!IS_ENABLED) {\n log('Analytics : IS_ENABLED is false, not init\\'ing');\n return;\n }\n if (window.hasOwnProperty('ga')) {\n log('Analytics : init : UA-16821714-5');\n ga('create', 'UA-16821714-5', 'auto');\n ga('send', 'pageview');\n\n bindClickFragments();\n } else {\n log('Analytics : init - no ga!');\n }\n\n _init = true;\n }", "function init() {\n var currentTimestamp = Date.now();\n ensureClientId(currentTimestamp);\n state.onceClientIdIsReady(function (clientId) {\n ensureFirstVisitTimestamp(clientId);\n updateNewVisitState(currentTimestamp);\n\n if (state.isNewVisit) {\n setVisitStartTimestamp(currentTimestamp);\n incrementVisitCount();\n updateVisitDates();\n\n try {\n localStorage.setItem(initialReferrerKey, document.referrer);\n } catch (e) {// the browser failed to setItem, likely due to Private Browsing mode. We don't need to take any action\n }\n }\n\n setPreviousActionTimestamp(currentTimestamp);\n setPublicState(clientId, currentTimestamp);\n executeOnceReadyQueue();\n });\n window.document.addEventListener('click', extendVisit); // todo: might want to extendVisit based on other actions in the future\n} // init on load", "function pageview() {\n if (!IS_ENABLED) {\n return;\n }\n if (!_init) {\n init();\n }\n if (ga) {\n log('Analytics : pageview', window.location);\n ga('send', 'pageview');\n }\n }", "userStartTracking() {\n log.info(logger, \"user clicked start tracking\");\n startTracking((/** boolean */ success) => {\n log.info(\n logger,\n \"start tracking callback from core, success: \" + success\n );\n this.userTracking = success;\n });\n }", "#setupSession() {\n const { value: settings } = appSettings;\n\n this.session.setTabSize(settings.tabSize);\n this.session.setUseSoftTabs(settings.softTab);\n this.session.setUseWrapMode(settings.textWrap);\n this.session.setUseWorker(false);\n\n this.session.on('changeScrollTop', EditorFile.#onscrolltop);\n this.session.on('changeScrollLeft', EditorFile.#onscrollleft);\n this.session.on('changeFold', EditorFile.#onfold);\n }", "function onSessionStarted(sessionStartedRequest, session) {\r\n}", "_initTracking() {\n var _a2, _b2, _c2, _d2;\n if (!this.isLegalAgree()) {\n if (!SEnv2.is(\"production\") && !__isInIframe()) {\n console.log(`<yellow>[SFront]</yellow> You have a <magenta>google tag manager (gtm)</magenta> setted but the <cyan>legal terms</cyan> are not agreed. Tracking <red>disabled</red>.`);\n }\n return;\n }\n if (this._isTrackingInited()) {\n if (!SEnv2.is(\"production\") && !__isInIframe()) {\n console.log(`<yellow>[SFront]</yellow> Tracking <magenta>google tag manager</magenta> already inited.`);\n }\n return;\n }\n if ((_b2 = (_a2 = this.frontspec) === null || _a2 === void 0 ? void 0 : _a2.google) === null || _b2 === void 0 ? void 0 : _b2.gtm) {\n this._initGtm();\n }\n if ((_d2 = (_c2 = this.frontspec) === null || _c2 === void 0 ? void 0 : _c2.partytown) === null || _d2 === void 0 ? void 0 : _d2.enabled) {\n this._initPartytown();\n }\n }", "function onScriptStart() {\n setYTStyleSheet(bodyStyleLoading);\n // Early configuration for settings that cannot wait until configuration is loaded.\n config.timeToMarkAsSeen = localStorage.getItem(\"YTBSP_timeToMarkAsSeen\");\n config.autoPauseVideo = \"0\" !== localStorage.getItem(\"YTBSP_autoPauseVideo\");\n}", "function startTracking(root_site) {\n debugLog('Called startTracking on ' + root_site + '!');\n current_interval = new Interval(new Date(), null);\n current_site_name = root_site;\n}", "requireSession () {\n this._checkToAbortActiveRequest();\n\n return this._resolveSession().then(() => {\n this.mainView.login();\n this.mainView.showNav();\n this.initializeCollections();\n\n if (!SiteMessageMonitor.isStarted()) {\n return SiteMessageMonitor.start($('#banner-container'));\n }\n });\n }", "async init() {\n try {\n const url_params = Object.fromEntries(new URLSearchParams(document.location.search)); \n const session = await fetch(\n \"session\",\n {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(url_params),\n });\n this.session = await session.json();\n } catch(e) {\n throw new Error(\"Unable to fetch session\", e);\n }\n // splice session into metadata (overriding existing values)\n this.metadata = {\n ...this.metadata,\n ...this.session\n };\n\n // set up unload handler\n window.addEventListener('unload', () => {\n const status = this.session.status;\n if (status != \"submitted\" && status != \"assigned\") {\n this.updateStatus(\"abandoned\");\n }\n });\n\n \n }", "function isAutoSessionTrackingEnabled(client) {\n if (client === undefined) {\n return false;\n }\n var clientOptions = client && client.getOptions();\n if (clientOptions && clientOptions.autoSessionTracking !== undefined) {\n return clientOptions.autoSessionTracking;\n }\n return false;\n}", "function firstLoadForTab_Discover()\n{\n //console.log('first load for discover tab');\n \n global_pagesLoaded.discover = true;\n \n //one-off setup to go here\n}", "function initAnalytics(){\n\tvar accountId = 'UA-2764682-9';\n\tjQuery.getScript('http://www.google-analytics.com/ga.js', function(){\n\t\ttry {\n\t\t\tvar pageTracker = _gat._getTracker(accountId);\n\t\t\tpageTracker._trackPageview();\n\t\t} catch(err) {}\n\t});\n}", "function SetUpSession(userUID) {\n // First load jQuery\n CheckLoadJSFile(\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\");\n\n // Then Firebase\n CheckLoadJSFile(\"//cdn.firebase.com/js/client/1.0.6/firebase.js\");\n\n // Load the other JS we need - version numbers to get over irritating caching\n CheckLoadJSFile(\"http://bowsy.co.uk/page-clone/INeedHelp2/INeedHelpFull.js?v=16\");\n\n // Irritatingly the imported JS isn't executable until this call stack is resolved\n // So, call the next function from a timer\n window.setTimeout(\"ConnectSession('\" + userUID + \"')\", 500);\n}", "async function initialise(){\r\n //Set the loader to 1 (on by default)\r\n userSession.loaderVal = 1;\r\n\r\n //Function calls\r\n ///Initialise the user\r\n initialiseAuth(); \r\n\r\n ///If there is question history in the session storage\r\n if(sessionStorage.getItem(\"historyID\"))\r\n {\r\n ///Get the ID from the session storage and remove it from the session storage\r\n var historyID = sessionStorage.getItem(\"historyID\");\r\n sessionStorage.removeItem(\"historyID\");\r\n\r\n ///Get the history for that ID\r\n getHistory(historyID);\r\n } else {\r\n window.location.replace(baseURL + loginLocation);\r\n }\r\n }", "async loadSession() {\n if (this.store) {\n await this.loadFromExtraStore();\n return;\n }\n this.loadFromCookieStore();\n }", "function ExistingHelpSessionCheck() {\n\n var page = location.pathname.substring(1);\n\n // Little hack to remove the cookie if we're loading the first page\n // would need something better to be more generic\n if ((page == \"index.html\") || (page == PageLocation)) {\n SetCookie(CookieName, \"\", 1);\n return;\n }\n\n var userUID = GetCookie(CookieName);\n if (userUID != null) {\n SetUpSession(userUID);\n }\n}", "function startTrackingWebVitals(reportAllChanges = false) {\n\t const performance = getBrowserPerformanceAPI();\n\t if (performance && browserPerformanceTimeOrigin) {\n\t if (performance.mark) {\n\t WINDOW.performance.mark('sentry-tracing-init');\n\t }\n\t _trackCLS();\n\t _trackLCP(reportAllChanges);\n\t _trackFID();\n\t }\n\t}", "function setUsingSession(isUsing){\n\tusingSession = isUsing;\n}", "function initSession() {\r\n ngio.getValidSession(function() {\r\n if (ngio.user) {\r\n /* \r\n * If we have a saved session, and it has not expired, \r\n * we will also have a user object we can access.\r\n * We can go ahead and run our onLoggedIn handler here.\r\n */\r\n onLoggedIn();\r\n } else {\r\n /*\r\n * If we didn't have a saved session, or it has expired\r\n * we should have been given a new one at this point.\r\n * This is where you would draw a 'sign in' button and\r\n * have it execute the following requestLogin function.\r\n */\r\n menuController.onLoggedOut();\r\n }\r\n\r\n });\r\n}", "function init_setup(){\n // TODO: Manage active sessions over different windows\n var init_active = {};\n var last_open = {};\n var init_saved = [];\n\n sessionData = {\n active_session: init_active, \n saved_sessions: init_saved, \n previous_tabs: last_open,\n };\n console.log(JSON.stringify(sessionData));\n\n storage.set({'sessionData': JSON.stringify(sessionData)}, function() {\n console.log(\"Initial data successfully saved.\");\n });\n\n}", "function requireUrlChangeTrackerTrackerWithConditional() {\n ga('require', 'urlChangeTracker', {\n shouldTrackUrlChange: function() {\n return false;\n }\n });\n}", "static loadSession() {\n if (typeof window === 'undefined') return\n idCacheByUserId = parseJSON(window.sessionStorage.idCacheByUserId, {})\n itemCacheByUserId = parseJSON(window.sessionStorage.itemCacheByUserId, {})\n userCache = parseJSON(window.sessionStorage.userCache, {})\n\n }", "function startTrackingWebVitals(reportAllChanges = false) {\n const performance = getBrowserPerformanceAPI();\n if (performance && utils.browserPerformanceTimeOrigin) {\n if (performance.mark) {\n types.WINDOW.performance.mark('sentry-tracing-init');\n }\n _trackCLS();\n _trackLCP(reportAllChanges);\n _trackFID();\n }\n}", "start() {\n Backend.init();\n Sessions.init();\n }", "function trackAnalytics() {\n //noinspection JSUnresolvedVariable\n metaService.trackAnalytics(portal.trackingCode);\n }", "function _onLoad() {\n\t\t// Standard Google Universal Analytics code\n\t\t// noinspection OverlyComplexFunctionJS\n\t\t(function(i, s, o, g, r, a, m) {\n\t\t\ti['GoogleAnalyticsObject'] = r;\n\t\t\t// noinspection CommaExpressionJS\n\t\t\ti[r] = i[r] || function() {\n\t\t\t\t\t(i[r].q = i[r].q || []).push(arguments);\n\t\t\t\t}, i[r].l = 1 * new Date();\n\t\t\t// noinspection CommaExpressionJS\n\t\t\ta = s.createElement(o),\n\t\t\t\tm = s.getElementsByTagName(o)[0];\n\t\t\ta.async = 1;\n\t\t\ta.src = g;\n\t\t\tm.parentNode.insertBefore(a, m);\n\t\t})(window, document, 'script',\n\t\t\t'https://www.google-analytics.com/analytics.js', 'ga');\n\n\t\tga('create', TRACKING_ID, 'auto');\n\t\t// see: http://stackoverflow.com/a/22152353/1958200\n\t\tga('set', 'checkProtocolTask', function() { });\n\t\tga('require', 'displayfeatures');\n\t}", "function alwaysRunOnload () {\n\t\n\t}", "function updateSession(autoCompleteControl) {\n autoCompleteControl.analytics = Object.assign({\n numGetDataAndRunCallbackCalls: 0\n }, autoCompleteControl.analytics);\n\n autoCompleteControl.analytics.numGetDataAndRunCallbackCalls += 1;\n }", "function updateSession(autoCompleteControl) {\n autoCompleteControl.analytics = Object.assign({\n numGetDataAndRunCallbackCalls: 0\n }, autoCompleteControl.analytics);\n\n autoCompleteControl.analytics.numGetDataAndRunCallbackCalls += 1;\n }", "function startTracking( tracker ) {\n var events = [\n \"mouseover\", \"mouseout\", \"mousedown\", \"mouseup\",\n \"click\",\n \"DOMMouseScroll\", \"mousewheel\",\n \"touchstart\", \"touchmove\", \"touchend\",\n \"keypress\",\n \"focus\", \"blur\"\n ],\n delegate = THIS[ tracker.hash ],\n event,\n i;\n\n if ( !delegate.tracking ) {\n for( i = 0; i < events.length; i++ ){\n event = events[ i ];\n $.addEvent(\n tracker.element,\n event,\n delegate[ event ],\n false\n );\n }\n delegate.tracking = true;\n ACTIVE[ tracker.hash ] = tracker;\n }\n }", "startOnboarding () {\n sessionStorage.setItem(REGISTRATION_IN_PROGRESS, true)\n this._openDownloadPage()\n this._openForwarder()\n }", "function updateAnalytics () {\n _gaq.push(['_trackPageview', document.location.href]);\n }", "function _onEveryPage() {\n _updateConfig();\n\t_defineCookieDomain();\n\t_defineAgencyCDsValues();\n}", "function initializeGoogleAnalytics(cb) {\n ga.initialize(cb);\n ga.trackOpen();\n}", "onBeforeLoadPage() {\n\t\t//TODO: Override this as needed;\n\t\treturn true;\n\t}", "onBeforeLoadPage() {\n\t\t//TODO: Override this as needed;\n\t\treturn true;\n\t}", "_isTrackingInited() {\n return document.querySelector(\"script#s-front-gtm\") !== null;\n }", "sessionAuthenticated() {\n const nextURL = this.session.data.nextURL;\n this.session.set(\"data.nextURL\", undefined);\n const idToken = this.session.data.authenticated.id_token;\n this.session.set(\"data.id_token_prev\", idToken);\n\n if (nextURL) {\n this.replaceWith(nextURL);\n } else {\n this._super();\n }\n }", "function startSession () {\n pausedTime = 0;\n secondsPassed = 0;\n timerId = intervalTrigger()\n start = new moment()\n startDate = start._d\n enablePause();\n enableEnd();\n}", "function addStandardPageVars() {\n // Website base url tracking (eg. mydomain.com)\n this.addPageVar(\"site\", window.location.hostname);\n\n // Page URL tracking (eg. home.html)\n this.addPageVar(\"url\", window.location.pathname);\n\n // Page title tracking\n this.addPageVar(\"title\", encodeURI(document.title));\n\n // Current timestamp in seconds\n this.addPageVar(\"time\", parseInt(new Date().getTime() / 1000));\n }", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId + \n \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function setjourney(evt) {\n sessionStorage.setItem(0, \"set\");\n}", "loadSessionManager() {\n window.location.href = mySpace.sessions_ui_url;\n }", "onSessionRecordingStarted() {\n this.set('recordingStarted', true);\n }", "function loadGoogleAnalytics() {\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments);\n }, i[r].l = 1 * new Date();\n a = s.createElement(o), m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m);\n })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');\n\n ga('create', 'UA-71005337-1', 'auto');\n ga('send', 'pageview');\n}", "function initializeActivityMarks() {\n if(sessionStorage.getItem(\"journalLand\") == null) {\n sessionStorage.setItem(\"journalLand\", \"0\");\n sessionStorage.setItem(\"feedbackLand\", \"0\");\n sessionStorage.setItem(\"upvoteLand\", \"0\");\n }\n}", "_recordInitialPageLoad() {\n\t\t\t// Not all browsers (e.g., mobile) support this, but most do.\n\t\t\tif (typeof window.performance === \"undefined\") return;\n\n\t\t\t// Record the time between when the browser was ready to fetch the\n\t\t\t// document, and when the document.readyState was changed to \"complete\".\n\t\t\t// i.e., the time it took to load the page.\n\t\t\tconst startTime = window.performance.timing.fetchStart;\n\t\t\tconst endTime = window.performance.timing.domComplete > 0 ? window.performance.timing.domComplete : new Date().getTime();\n\t\t\tconst routeName = getRouteName(this.state.routes);\n\t\t\trecordSpan({\n\t\t\t\tname: `load page ${routeName}`,\n\t\t\t\tstart: startTime,\n\t\t\t\tend: endTime,\n\t\t\t\tmetadata: {\n\t\t\t\t\tlocation: window.location.href,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t// Update the debug display on the page with the time.\n\t\t\tthis._updateDebugTimer(startTime, endTime);\n\t\t}", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function startTracking( tracker ) {\n var events = [\n \"mouseover\", \"mouseout\", \"mousedown\", \"mouseup\", \"mousemove\",\n \"click\",\n $.MouseTracker.wheelEventName,\n \"touchstart\", \"touchmove\", \"touchend\",\n \"keypress\",\n \"focus\", \"blur\"\n ],\n delegate = THIS[ tracker.hash ],\n event,\n i;\n\n // Add 'MozMousePixelScroll' event handler for older Firefox\n if( $.MouseTracker.wheelEventName == \"DOMMouseScroll\" ) {\n events.push( \"MozMousePixelScroll\" );\n }\n\n if ( !delegate.tracking ) {\n for ( i = 0; i < events.length; i++ ) {\n event = events[ i ];\n $.addEvent(\n tracker.element,\n event,\n delegate[ event ],\n false\n );\n }\n delegate.tracking = true;\n ACTIVE[ tracker.hash ] = tracker;\n }\n }", "function startSession() {\n // HERE: Maybe throw in a quick shuffle here; otherwise the card order will be incredibly predictable :P\n // Alternatively, can randomize where the Next card takes you, but that would involve more convoluted logic, I think.\n setSessionData({...sessionData, startTime: new Date()});\n }", "function onSessionStarted(sessionStartedRequest, session) {\n console.log(\"onSessionStarted requestId=\" + sessionStartedRequest.requestID + \", sessionId=\" + session.sessionId);\n\n // add any session init logic here\n}", "function ssEnabled() {\n try {\n window.sessionStorage.setItem('_t', 1);\n window.sessionStorage.removeItem('_t');\n return true;\n } catch (e) {\n return false;\n } \n }", "addClickTracking(){\n\t\t//This is all from sendgrid -> this is just how it works\n\t\t//if I look at this later do not be confused -> this is just how it works\n\t\tconst trackingSettings = new helper.TrackingSettings();\n\t\tconst clickTracking = new helper.ClickTracking(true, true);\n\n\t\ttrackingSettings.setClickTracking(clickTracking);\n\t\tthis.addTrackingSettings(trackingSettings);\n\t}", "function initGA() {\n if (analyticsTrackingId) {\n ReactGA.initialize(analyticsTrackingId)\n ReactGA.set({\n appName: environment || 'Production',\n appVersion: version\n })\n }\n}", "function startTrackingTime() {\n if (isTrackingTime) return; // if we're already tracking time then do nothing\n isTrackingTime = true;\n // chrome.runtime.sendMessage({action: 'startTrackingTime'}, function(response) {});\n trackingTimePort.postMessage({action: 'START_TRACKING_TIME'});\n // console.log('start tracking time');\n}", "function enableUiTrackingMode(){\n console.log('enableUiTrackingMode'); \n $(\"#browserActionStateDisplay\").show();\n $(\"#toggleStateButton\").show();\n $(\"#toggleTabCategory\").show();\n $(\"#toggleTrackButton\").html(\n \"Stop Tracking\" \n );\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}" ]
[ "0.7250156", "0.7194145", "0.71638817", "0.6897567", "0.6540723", "0.65276074", "0.64314497", "0.6408434", "0.6397561", "0.6355102", "0.6355102", "0.6355102", "0.6355102", "0.629443", "0.6239869", "0.6214304", "0.60800105", "0.6074651", "0.60626525", "0.60545546", "0.60320866", "0.6016204", "0.597954", "0.59347755", "0.58881426", "0.58847034", "0.5865986", "0.583943", "0.58335286", "0.58038354", "0.57961845", "0.5771012", "0.5761518", "0.57607555", "0.57505506", "0.5719679", "0.57003874", "0.566638", "0.5650105", "0.56465846", "0.5609546", "0.5595129", "0.5592975", "0.55911696", "0.55750126", "0.55380076", "0.55281246", "0.5516496", "0.5505161", "0.5503322", "0.54917204", "0.54915756", "0.5487386", "0.5486636", "0.5486636", "0.54837346", "0.546196", "0.5450195", "0.54415095", "0.54303294", "0.5428812", "0.5428812", "0.542213", "0.541347", "0.54090035", "0.5406285", "0.5405096", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.5402073", "0.54018164", "0.53943384", "0.5393792", "0.5380625", "0.53729963", "0.5366482", "0.5359588", "0.534455", "0.5342047", "0.5341395", "0.5337454", "0.533508", "0.531795", "0.5314222", "0.53122216", "0.5306751" ]
0.6291641
14
path.resolve([from ...], to) posix version JSDoc
function path_resolve() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var resolvedPath = ''; var resolvedAbsolute = false; for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = i >= 0 ? args[i] : '/'; // Skip empty entries if (!path) { continue; } resolvedPath = path + "/" + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/'); return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveAsPath() { }", "function resolve(...input) {\n return path.resolve(...input)\n}", "function relative(from, to) {\r\n // tslint:disable:no-parameter-reassignment\r\n from = resolve(from).substr(1);\r\n to = resolve(to).substr(1);\r\n var fromParts = trim(from.split('/'));\r\n var toParts = trim(to.split('/'));\r\n var length = Math.min(fromParts.length, toParts.length);\r\n var samePartsLength = length;\r\n for (var i = 0; i < length; i++) {\r\n if (fromParts[i] !== toParts[i]) {\r\n samePartsLength = i;\r\n break;\r\n }\r\n }\r\n var outputParts = [];\r\n for (var i = samePartsLength; i < fromParts.length; i++) {\r\n outputParts.push('..');\r\n }\r\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\r\n return outputParts.join('/');\r\n}", "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function urlResolve(...segments){var _path$default;const joinedPath=(_path$default=_path.default).join.apply(_path$default,segments);if(_os.default.platform()===`win32`){return joinedPath.replace(/\\\\/g,`/`);}return joinedPath;}", "function resolve$2() {\n var resolvedPath = '',\n resolvedAbsolute = false\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? arguments[i] : '/'\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings')\n } else if (!path) {\n continue\n }\n\n resolvedPath = path + '/' + resolvedPath\n resolvedAbsolute = path.charAt(0) === '/'\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(\n filter(resolvedPath.split('/'), function (p) {\n return !!p\n }),\n !resolvedAbsolute\n ).join('/')\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'\n}", "async function resolveRelativeSpecifier(specifier, modulePath, dependency) {\n const absoluteNodeModulesLocation = await getNodeModulesLocationForPackage(dependency);\n\n // handle WIn v Unix-style path separators and force to /\n return `${dependency}${path.join(path.dirname(modulePath), specifier).replace(/\\\\/g, '/').replace(absoluteNodeModulesLocation.replace(/\\\\/g, '/', ''), '')}`;\n}", "function relative$1(from, to) {\n\t from = resolve$2(from).substr(1);\n\t to = resolve$2(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "function resolve$2() {\n\t var resolvedPath = '',\n\t resolvedAbsolute = false;\n\n\t for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n\t var path = (i >= 0) ? arguments[i] : '/';\n\n\t // Skip empty and invalid entries\n\t if (typeof path !== 'string') {\n\t throw new TypeError('Arguments to path.resolve must be strings');\n\t } else if (!path) {\n\t continue;\n\t }\n\n\t resolvedPath = path + '/' + resolvedPath;\n\t resolvedAbsolute = path.charAt(0) === '/';\n\t }\n\n\t // At this point the path should be resolved to a full absolute path, but\n\t // handle relative paths to be safe (might happen when process.cwd() fails)\n\n\t // Normalize the path\n\t resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n\t return !!p;\n\t }), !resolvedAbsolute).join('/');\n\n\t return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n\t}", "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function pathToFnName (path) {\n if ( 'oomtility/wrap/' === path.slice(0,15) )\n path = path.slice(15)\n if ( '/README.md' === path.slice(-10) ) // eg 'wp/README.md'\n path = path.replace(/\\//g, '-') // eg 'wp-README.md'\n return 'write' + (\n path.split('/').pop().split(/[- .]/g).map(\n w => w ? w[0].toUpperCase() + w.substr(1) : ''\n ).join('')\n )\n}", "static readFromPath(filePath, base, encoding='utf8') {\n return new DocumentationFile({\n path: filePath,\n base,\n encoding,\n stat: fs.lstatSync(filePath),\n contents: fs.readFileSync(filePath),\n });\n }", "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n\n const fromParts = trim(from.split('/'));\n const toParts = trim(to.split('/'));\n\n const length = Math.min(fromParts.length, toParts.length);\n let samePartsLength = length;\n for (let i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n let outputParts = [];\n for (let i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n }", "function relative$1(from, to) {\n from = resolve$2(from).substr(1)\n to = resolve$2(to).substr(1)\n\n function trim(arr) {\n var start = 0\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break\n }\n\n var end = arr.length - 1\n for (; end >= 0; end--) {\n if (arr[end] !== '') break\n }\n\n if (start > end) return []\n return arr.slice(start, end - start + 1)\n }\n\n var fromParts = trim(from.split('/'))\n var toParts = trim(to.split('/'))\n\n var length = Math.min(fromParts.length, toParts.length)\n var samePartsLength = length\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i\n break\n }\n }\n\n var outputParts = []\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..')\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength))\n\n return outputParts.join('/')\n}", "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "function resolveRef(swagger, ref) {\n if (ref.indexOf('#/') != 0) {\n console.error('Resolved references must start with #/. Current: ' + ref);\n process.exit(1);\n }\n var parts = ref.substr(2).split('/');\n var result = swagger;\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n result = result[part];\n }\n return result === swagger ? {} : result;\n}", "function relPath() {\n return '.' + path.sep + path.join.apply(null, arguments);\n}", "function resolveReference(ref, schema) {\n // 2 here is for #/\n var i, ref_path = ref.substr(2, ref.length),\n parts = ref_path.split(\"/\");\n for (i = 0; i < parts.length; i += 1) {\n schema = schema[parts[i]];\n }\n return schema;\n }", "function documentRequiredComponents(documentation, varToFilePath, originObject, opt) {\n return __awaiter(this, void 0, void 0, function () {\n var originalDirName, pathResolver, files, _loop_1, _i, _a, varName, docs;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n originalDirName = path.dirname(opt.filePath);\n pathResolver = makePathResolver_1.default(originalDirName, opt.alias);\n // resolve where components are through immediately exported variables\n return [4 /*yield*/, recursiveResolveIEV_1.default(pathResolver, varToFilePath, opt.validExtends)];\n case 1:\n // resolve where components are through immediately exported variables\n _b.sent();\n files = new ts_map_1.default();\n _loop_1 = function (varName) {\n var _a = varToFilePath[varName], filePath = _a.filePath, exportName = _a.exportName;\n filePath.forEach(function (p) {\n var fullFilePath = pathResolver(p);\n if (opt.validExtends(fullFilePath)) {\n var vars = files.get(fullFilePath) || [];\n vars.push(exportName);\n files.set(fullFilePath, vars);\n }\n });\n };\n for (_i = 0, _a = Object.keys(varToFilePath); _i < _a.length; _i++) {\n varName = _a[_i];\n _loop_1(varName);\n }\n docs = [];\n return [4 /*yield*/, files.keys().reduce(function (_, fullFilePath) { return __awaiter(_this, void 0, void 0, function () {\n var vars, originVar, _a, _b, e_1;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0: return [4 /*yield*/, _];\n case 1:\n _d.sent();\n vars = files.get(fullFilePath);\n if (!(fullFilePath && vars)) return [3 /*break*/, 5];\n _d.label = 2;\n case 2:\n _d.trys.push([2, 4, , 5]);\n originVar = originObject\n ? (_c = {},\n _c[originObject] = {\n name: '-',\n path: fullFilePath\n },\n _c) : {};\n _b = (_a = docs).concat;\n return [4 /*yield*/, parse_1.parseFile(__assign(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: vars }), originVar), documentation)];\n case 3:\n docs = _b.apply(_a, [_d.sent()]);\n if (documentation && originObject && originVar[originObject]) {\n originVar[originObject].name = documentation.get('displayName');\n documentation.set('displayName', null);\n }\n return [3 /*break*/, 5];\n case 4:\n e_1 = _d.sent();\n if (originObject) {\n // eat the error\n }\n else {\n // we still want non extensions errors to show\n throw e_1;\n }\n return [3 /*break*/, 5];\n case 5: return [2 /*return*/];\n }\n });\n }); }, Promise.resolve())];\n case 2:\n _b.sent();\n return [2 /*return*/, docs];\n }\n });\n });\n}", "function whistle_short_path($p) {\n return strcat(substr($p,9,1),\n ydtosdf(substr($p,0,8),3),\n numtosxg(substr($p,10,3)));\n}", "function doclink(section, path, hashOrOverrides) {\n const url = new URL('https://reactnative.dev/');\n\n // Overrides\n const isObj = typeof hashOrOverrides === 'object';\n const hash = isObj ? hashOrOverrides.hash : hashOrOverrides;\n const version = isObj && hashOrOverrides.version ? hashOrOverrides.version : _version;\n const OS = isObj && hashOrOverrides.os ? hashOrOverrides.os : getOS();\n const platform = isObj && hashOrOverrides.platform ? hashOrOverrides.platform : _platform;\n url.pathname = _version ? `${section}/${version}/${path}` : `${section}/${path}`;\n url.searchParams.set('os', OS);\n url.searchParams.set('platform', platform);\n if (isObj) {\n const otherKeys = Object.keys(hashOrOverrides).filter(key => !['hash', 'version', 'os', 'platform'].includes(key));\n for (let key of otherKeys) {\n url.searchParams.set(key, hashOrOverrides[key]);\n }\n }\n if (hash) {\n _assert().default.doesNotMatch(hash, /#/, \"Anchor links should be written withou a '#'\");\n url.hash = hash;\n }\n return url.toString();\n}", "function docuHash(str) {\n if (str === '/') {\n return 'index';\n }\n const shortHash = pathUtils_1.simpleHash(str, 3);\n const parsedPath = `${lodash_1.kebabCase(str)}-${shortHash}`;\n if (pathUtils_1.isNameTooLong(parsedPath)) {\n return `${pathUtils_1.shortName(lodash_1.kebabCase(str))}-${shortHash}`;\n }\n return parsedPath;\n}", "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n }", "function resolvePathname(to) {\n\t var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\t\n\t var toParts = to && to.split('/') || [];\n\t var fromParts = from && from.split('/') || [];\n\t\n\t var isToAbs = to && isAbsolute(to);\n\t var isFromAbs = from && isAbsolute(from);\n\t var mustEndAbs = isToAbs || isFromAbs;\n\t\n\t if (to && isAbsolute(to)) {\n\t // to is absolute\n\t fromParts = toParts;\n\t } else if (toParts.length) {\n\t // to is relative, drop the filename\n\t fromParts.pop();\n\t fromParts = fromParts.concat(toParts);\n\t }\n\t\n\t if (!fromParts.length) return '/';\n\t\n\t var hasTrailingSlash = void 0;\n\t if (fromParts.length) {\n\t var last = fromParts[fromParts.length - 1];\n\t hasTrailingSlash = last === '.' || last === '..' || last === '';\n\t } else {\n\t hasTrailingSlash = false;\n\t }\n\t\n\t var up = 0;\n\t for (var i = fromParts.length; i >= 0; i--) {\n\t var part = fromParts[i];\n\t\n\t if (part === '.') {\n\t spliceOne(fromParts, i);\n\t } else if (part === '..') {\n\t spliceOne(fromParts, i);\n\t up++;\n\t } else if (up) {\n\t spliceOne(fromParts, i);\n\t up--;\n\t }\n\t }\n\t\n\t if (!mustEndAbs) for (; up--; up) {\n\t fromParts.unshift('..');\n\t }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\t\n\t var result = fromParts.join('/');\n\t\n\t if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\t\n\t return result;\n\t}", "function resolvePathname(to) {\n\t var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\t\n\t var toParts = to && to.split('/') || [];\n\t var fromParts = from && from.split('/') || [];\n\t\n\t var isToAbs = to && isAbsolute(to);\n\t var isFromAbs = from && isAbsolute(from);\n\t var mustEndAbs = isToAbs || isFromAbs;\n\t\n\t if (to && isAbsolute(to)) {\n\t // to is absolute\n\t fromParts = toParts;\n\t } else if (toParts.length) {\n\t // to is relative, drop the filename\n\t fromParts.pop();\n\t fromParts = fromParts.concat(toParts);\n\t }\n\t\n\t if (!fromParts.length) return '/';\n\t\n\t var hasTrailingSlash = void 0;\n\t if (fromParts.length) {\n\t var last = fromParts[fromParts.length - 1];\n\t hasTrailingSlash = last === '.' || last === '..' || last === '';\n\t } else {\n\t hasTrailingSlash = false;\n\t }\n\t\n\t var up = 0;\n\t for (var i = fromParts.length; i >= 0; i--) {\n\t var part = fromParts[i];\n\t\n\t if (part === '.') {\n\t spliceOne(fromParts, i);\n\t } else if (part === '..') {\n\t spliceOne(fromParts, i);\n\t up++;\n\t } else if (up) {\n\t spliceOne(fromParts, i);\n\t up--;\n\t }\n\t }\n\t\n\t if (!mustEndAbs) for (; up--; up) {\n\t fromParts.unshift('..');\n\t }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\t\n\t var result = fromParts.join('/');\n\t\n\t if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\t\n\t return result;\n\t}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "_resolveFileSpecifier(specifier, containingFilePath) {\n const importFullPath = containingFilePath !== undefined ? path.join(path.dirname(containingFilePath), specifier) : specifier;\n const stat = getFileStatus(importFullPath);\n if (stat && stat.isFile()) {\n return importFullPath;\n }\n for (const extension of this.extensions) {\n const pathWithExtension = `${importFullPath}.${extension}`;\n const stat = getFileStatus(pathWithExtension);\n if (stat && stat.isFile()) {\n return pathWithExtension;\n }\n }\n // Directories should be considered last. TypeScript first looks for source files, then\n // falls back to directories if no file with appropriate extension could be found.\n if (stat && stat.isDirectory()) {\n return this._resolveFileSpecifier(path.join(importFullPath, 'index'));\n }\n return null;\n }", "function pathfix(t, from=\"src=\\\"\", to=\"src=\\\"/\", offset = 0){\n\tt = t.toString();\n\tlet i = t.slice(offset).indexOf(from);\n\tif (i === -1) return t;\n\tlet pre = t.slice(0, i);\n\tlet pos = t.slice(i);\n\n\tif (pos.slice(5, 12) !== \"http://\" && pos.slice(5, 6) !== \"/\") {\n\t\tpos = pos.replace(from, to);\n\t\treturn pre + pathfix(pos, i + 3);\n\t}\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n }\n else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n if (!fromParts.length)\n return '/';\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n }\n else {\n hasTrailingSlash = false;\n }\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n if (part === '.') {\n spliceOne(fromParts, i);\n }\n else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n }\n else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n if (!mustEndAbs)\n for (; up--; up) {\n fromParts.unshift('..');\n }\n if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0])))\n fromParts.unshift('');\n var result = fromParts.join('/');\n if (hasTrailingSlash && result.substr(-1) !== '/')\n result += '/';\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}" ]
[ "0.561329", "0.5468767", "0.5371159", "0.53127426", "0.53127426", "0.53046995", "0.5275564", "0.52286774", "0.5175212", "0.5140978", "0.5136547", "0.51263016", "0.5103508", "0.50814635", "0.5074827", "0.5045705", "0.50193274", "0.50193274", "0.50193274", "0.50096285", "0.5009379", "0.49974", "0.49906105", "0.499025", "0.49734768", "0.4964601", "0.49600577", "0.4955607", "0.4955607", "0.49325246", "0.49325246", "0.49325246", "0.49325246", "0.49325246", "0.4921413", "0.49183813", "0.48848557", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387", "0.48817387" ]
0.0
-1
path.relative(from, to) posix version JSDoc
function relative(from, to) { /* eslint-disable no-param-reassign */ from = path_resolve(from).substr(1); to = path_resolve(to).substr(1); /* eslint-enable no-param-reassign */ var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "abs (relativePath) {\n return nodePath.resolve(relativePath);\n }", "relativePosix() {\n if (this.sep === '/')\n return this.relative();\n if (this.#relativePosix !== undefined)\n return this.#relativePosix;\n const name = this.name;\n const p = this.parent;\n if (!p) {\n return (this.#relativePosix = this.fullpathPosix());\n }\n const pv = p.relativePosix();\n return pv + (!pv || !p.parent ? '' : '/') + name;\n }", "function relative(source, target) {\n if (!target) {\n target = source;\n source = fsBase.workingDirectory();\n }\n source = absolute(source);\n target = absolute(target);\n source = source.split(SEPARATOR_RE);\n target = target.split(SEPARATOR_RE);\n source.pop();\n while (\n source.length &&\n target.length &&\n target[0] == source[0]) {\n source.shift();\n target.shift();\n }\n while (source.length) {\n source.shift();\n target.unshift(\"..\");\n }\n return target.join(SEPARATOR);\n}", "function relativize(path /*: string */) {\n return path.replace(SHEET_PATH, '').replace(/\\.md$/, '')\n}", "function relative(from, to) {\r\n // tslint:disable:no-parameter-reassignment\r\n from = resolve(from).substr(1);\r\n to = resolve(to).substr(1);\r\n var fromParts = trim(from.split('/'));\r\n var toParts = trim(to.split('/'));\r\n var length = Math.min(fromParts.length, toParts.length);\r\n var samePartsLength = length;\r\n for (var i = 0; i < length; i++) {\r\n if (fromParts[i] !== toParts[i]) {\r\n samePartsLength = i;\r\n break;\r\n }\r\n }\r\n var outputParts = [];\r\n for (var i = samePartsLength; i < fromParts.length; i++) {\r\n outputParts.push('..');\r\n }\r\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\r\n return outputParts.join('/');\r\n}", "function relative(file, ref) {\n return ref.length == 1\n ? dirname(file, 1) // parent\n : ref[1] == '/'\n ? join(dirname(file, 1), ref.slice(2)) // sibling or nephew\n : relativeRegex(file, ref);\n}", "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "static relativePath(targetPath, filePath, posix, removeExt = true) {\n if (!targetPath.endsWith(path.win32.sep) && !targetPath.endsWith(path.posix.sep)) {\n // path.relative splits by fragments, must be dirname w/ trailing to work both down and up\n targetPath = path.win32.dirname(targetPath) + path.sep;\n }\n // use win32 api as it handles both formats\n let relativePath = path.win32.relative(targetPath, filePath);\n if (removeExt) {\n relativePath = relativePath.replace(path.win32.extname(relativePath), \"\");\n }\n if (posix) {\n relativePath = path.posix.join(...relativePath.split(path.win32.sep));\n relativePath = relativePath.startsWith(\".\") ? relativePath : \"./\" + relativePath;\n }\n else {\n relativePath = path.win32.join(...relativePath.split(path.win32.sep));\n relativePath = relativePath.startsWith(\".\") ? relativePath : \".\\\\\" + relativePath;\n }\n return relativePath;\n }", "relative(path) {\n return new URL(path, this.getUrl().href).href;\n }", "static makeRelative(basePath, fullPath) {\n return fullPath.replace(Path.wrapDirectoryPath(basePath), \"\");\n }", "function relPath() {\n return '.' + path.sep + path.join.apply(null, arguments);\n}", "function relative$1(from, to) {\n\t from = resolve$2(from).substr(1);\n\t to = resolve$2(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "static readFromPath(filePath, base, encoding='utf8') {\n return new DocumentationFile({\n path: filePath,\n base,\n encoding,\n stat: fs.lstatSync(filePath),\n contents: fs.readFileSync(filePath),\n });\n }", "relative() {\n if (this.#relative !== undefined) {\n return this.#relative;\n }\n const name = this.name;\n const p = this.parent;\n if (!p) {\n return (this.#relative = this.name);\n }\n const pv = p.relative();\n return pv + (!pv || !p.parent ? '' : this.sep) + name;\n }", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n }", "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "rel (relativePath) {\n let url = this.url(relativePath);\n let relativeURL = url.href.replace(cwd.href, \"\");\n return relativeURL;\n }", "get relativePathName()\n\t{\n\t\treturn true;\n\t}", "function getRelativePath(a, b) {\n return path.relative(a, b).replace(/\\\\/g, \"/\");\n}", "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n\n const fromParts = trim(from.split('/'));\n const toParts = trim(to.split('/'));\n\n const length = Math.min(fromParts.length, toParts.length);\n let samePartsLength = length;\n for (let i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n let outputParts = [];\n for (let i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative$1(from, to) {\n from = resolve$2(from).substr(1)\n to = resolve$2(to).substr(1)\n\n function trim(arr) {\n var start = 0\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break\n }\n\n var end = arr.length - 1\n for (; end >= 0; end--) {\n if (arr[end] !== '') break\n }\n\n if (start > end) return []\n return arr.slice(start, end - start + 1)\n }\n\n var fromParts = trim(from.split('/'))\n var toParts = trim(to.split('/'))\n\n var length = Math.min(fromParts.length, toParts.length)\n var samePartsLength = length\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i\n break\n }\n }\n\n var outputParts = []\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..')\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength))\n\n return outputParts.join('/')\n}", "function relative(filepath, base) {\n const abs = path.isAbsolute(filepath) ? filepath : path.resolve(filepath);\n\n if (base) {\n assert(path.isAbsolute(base), 'expected base to be an absolute path');\n return path.relative(base, abs);\n }\n\n if (abs[0] === '/') {\n return abs.slice(1);\n }\n return abs;\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "function toRelativePath(path) {\n\ttoRelative\n}", "function makePath(relativePath) {\n return path.join(path.dirname(import.meta.url.replace('file:', '')), relativePath)\n}", "processRelativeUrl(relativePath){\n //console.log(relativePath);\n const rootDir = path.resolve(process.cwd(), \"public\"); //current working directory + /public\n //console.log([rootDir, relativePath]);\n const prefix = path.join(\"..\", \"node_modules\");\n \n if(!_.startsWith(relativePath, prefix))\n return relativePath;\n \n const vendorUrl = \"/vendor/\" + relativePath.substring(prefix.length);\n const sourceFile = path.join(rootDir, relativePath);\n const destFile = path.join(rootDir, vendorUrl);\n \n //console.log(`${sourceFile} -> ${destFile}`);\n fse.copySync(sourceFile, destFile); \n \n return vendorUrl;\n }", "function abspath2rel(base_path, target_path) {\n var tmp_str = '';\n base_path = base_path.split('/');\n base_path.pop();\n target_path = target_path.split('/');\n while(base_path[0] === target_path[0]) {\n base_path.shift();\n target_path.shift();\n }\n for (var i = 0; i< base_path.length; i++) {\n tmp_str += '../';\n }\n return tmp_str + target_path.join ('/');\n }", "function relativePathWrapper(original) {\n return function() {\n var args = arguments\n\n // Assumes the first argument is a path string\n if (args[0][0] === '/')\n args[0] = \"..\" + args[0]\n return original.apply(this, args)\n }\n}", "function makeRelative(path) {\n if (!path) {\n return '';\n }\n var a = path.match(/^\\/*(.*)/);\n return a[1];\n }", "function relative(type = 'width') {\n return function (elementDescriptor) {\n if (arguments.length === 3) {\n elementDescriptor = polyfillLegacy.apply(this, arguments);\n }\n\n const {\n descriptor\n } = elementDescriptor;\n descriptor.__relative = type;\n if (arguments.length === 3) return elementDescriptor.descriptor;\n return elementDescriptor;\n };\n}", "relative(path, ancestor) {\n if (!Path.isAncestor(ancestor, path) && !Path.equals(path, ancestor)) {\n throw new Error(\"Cannot get the relative path of [\".concat(path, \"] inside ancestor [\").concat(ancestor, \"], because it is not above or equal to the path.\"));\n }\n\n return path.slice(ancestor.length);\n }", "relative(path, ancestor) {\n if (!Path.isAncestor(ancestor, path) && !Path.equals(path, ancestor)) {\n throw new Error(\"Cannot get the relative path of [\".concat(path, \"] inside ancestor [\").concat(ancestor, \"], because it is not above or equal to the path.\"));\n }\n\n return path.slice(ancestor.length);\n }", "function rel2abs(p) {\n return path.resolve(process.cwd(), p);\n}", "relative(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.relative();\n }", "function whistle_short_path($p) {\n return strcat(substr($p,9,1),\n ydtosdf(substr($p,0,8),3),\n numtosxg(substr($p,10,3)));\n}", "function formatFilePath(filePath, line, column) {\n let relPath = path_1.default.relative(process.cwd(), filePath);\n /* istanbul ignore next: safety check from original implementation */\n if (line && column) {\n relPath += `:${line}:${column}`;\n }\n return kleur_1.default.green(relPath);\n}", "function relativeId (id) {\n if (!isAbsolute(id)) {\n return id\n }\n return relative(process.cwd(), id)\n }", "function node_relative_addr(base, n) {\n return n.substr(base.length + 1);\n }", "function relativeFilename(file)\r\n{\r\n\tif(file == \"./\") return file;\r\n\t\r\n\treturn file.substr(shell.CurrentDirectory.length+1);\r\n}", "function getAbsolutePath(relative) {\n\treturn getBaseURL() + relative\n}", "function formatFilePath(filePath, line, column) {\n let relPath = path__default[\"default\"].relative(process.cwd(), filePath);\n /* istanbul ignore next: safety check from original implementation */\n if (line && column) {\n relPath += `:${line}:${column}`;\n }\n return kleur__default[\"default\"].green(relPath);\n}", "relativePosix(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.relativePosix();\n }", "getMagicCommentMasterFile() {\n const magic = new MagicParser(this.filePath).parse();\n if (!magic || !magic.root) { return null; }\n return path.resolve(this.projectPath, magic.root);\n }", "FindPropertyRelative() {}", "function pathToFnName (path) {\n if ( 'oomtility/wrap/' === path.slice(0,15) )\n path = path.slice(15)\n if ( '/README.md' === path.slice(-10) ) // eg 'wp/README.md'\n path = path.replace(/\\//g, '-') // eg 'wp-README.md'\n return 'write' + (\n path.split('/').pop().split(/[- .]/g).map(\n w => w ? w[0].toUpperCase() + w.substr(1) : ''\n ).join('')\n )\n}", "function resolveRelativePath(to, from) {\r\n if (to.startsWith('/'))\r\n return to;\r\n if (( true) && !from.startsWith('/')) {\r\n warn(`Cannot resolve a relative location without an absolute path. Trying to resolve \"${to}\" from \"${from}\". It should look like \"/${from}\".`);\r\n return to;\r\n }\r\n if (!to)\r\n return from;\r\n const fromSegments = from.split('/');\r\n const toSegments = to.split('/');\r\n let position = fromSegments.length - 1;\r\n let toPosition;\r\n let segment;\r\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\r\n segment = toSegments[toPosition];\r\n // can't go below zero\r\n if (position === 1 || segment === '.')\r\n continue;\r\n if (segment === '..')\r\n position--;\r\n // found something that is not relative path\r\n else\r\n break;\r\n }\r\n return (fromSegments.slice(0, position).join('/') +\r\n '/' +\r\n toSegments\r\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\r\n .join('/'));\r\n}", "function pathfix(t, from=\"src=\\\"\", to=\"src=\\\"/\", offset = 0){\n\tt = t.toString();\n\tlet i = t.slice(offset).indexOf(from);\n\tif (i === -1) return t;\n\tlet pre = t.slice(0, i);\n\tlet pos = t.slice(i);\n\n\tif (pos.slice(5, 12) !== \"http://\" && pos.slice(5, 6) !== \"/\") {\n\t\tpos = pos.replace(from, to);\n\t\treturn pre + pathfix(pos, i + 3);\n\t}\n}", "function resolveRelativePath(to, from) {\n if (to.startsWith('/'))\n return to;\n if (( true) && !from.startsWith('/')) {\n warn(`Cannot resolve a relative location without an absolute path. Trying to resolve \"${to}\" from \"${from}\". It should look like \"/${from}\".`);\n return to;\n }\n if (!to)\n return from;\n const fromSegments = from.split('/');\n const toSegments = to.split('/');\n let position = fromSegments.length - 1;\n let toPosition;\n let segment;\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\n segment = toSegments[toPosition];\n // can't go below zero\n if (position === 1 || segment === '.')\n continue;\n if (segment === '..')\n position--;\n // found something that is not relative path\n else\n break;\n }\n return (fromSegments.slice(0, position).join('/') +\n '/' +\n toSegments\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\n .join('/'));\n}", "function path(relative_path) {\n return _path2.default.resolve(_path2.default.join(root, relative_path));\n}", "function adjustPath(url) {\n if (path.extname(url).length > 0) {\n return url;\n }\n\n var foldlen = url.slice(1).split('/').length\n\n if (foldlen === 2) {\n return url + '/master/README.md';\n } else if (foldlen === 3) {\n return url + '/README.md';\n }\n\n return url;\n}", "async function resolveRelativeSpecifier(specifier, modulePath, dependency) {\n const absoluteNodeModulesLocation = await getNodeModulesLocationForPackage(dependency);\n\n // handle WIn v Unix-style path separators and force to /\n return `${dependency}${path.join(path.dirname(modulePath), specifier).replace(/\\\\/g, '/').replace(absoluteNodeModulesLocation.replace(/\\\\/g, '/', ''), '')}`;\n}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function getRelativeFileName(filename, relTo) {\n if (filename.startsWith(relTo + path.sep)) {\n return filename.slice(relTo.length + 1);\n } else {\n return filename;\n }\n}", "fullpathPosix() {\n if (this.#fullpathPosix !== undefined)\n return this.#fullpathPosix;\n if (this.sep === '/')\n return (this.#fullpathPosix = this.fullpath());\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/');\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`);\n }\n else {\n return (this.#fullpathPosix = p);\n }\n }\n const p = this.parent;\n const pfpp = p.fullpathPosix();\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;\n return (this.#fullpathPosix = fpp);\n }", "function resolveRelativePath(to, from) {\r\n if (to.startsWith('/'))\r\n return to;\r\n if (false) {}\r\n if (!to)\r\n return from;\r\n const fromSegments = from.split('/');\r\n const toSegments = to.split('/');\r\n let position = fromSegments.length - 1;\r\n let toPosition;\r\n let segment;\r\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\r\n segment = toSegments[toPosition];\r\n // can't go below zero\r\n if (position === 1 || segment === '.')\r\n continue;\r\n if (segment === '..')\r\n position--;\r\n // found something that is not relative path\r\n else\r\n break;\r\n }\r\n return (fromSegments.slice(0, position).join('/') +\r\n '/' +\r\n toSegments\r\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\r\n .join('/'));\r\n}", "function _newPath(p){\n return path.join(dcat.root, path.relative(rootTargz, p));\n }", "function getDocTemplatePath() {\n return _path2.default.resolve(__dirname, '..', '..', 'tpl', 'doc.md.mustache');\n}", "static makeUrlRelative(url) {\r\n if (!isUrlAbsolute(url)) {\r\n // already not absolute, just give it back\r\n return url;\r\n }\r\n let index = url.indexOf(\".com/v1.0/\");\r\n if (index < 0) {\r\n index = url.indexOf(\".com/beta/\");\r\n if (index > -1) {\r\n // beta url\r\n return url.substr(index + 10);\r\n }\r\n }\r\n else {\r\n // v1.0 url\r\n return url.substr(index + 9);\r\n }\r\n // no idea\r\n return url;\r\n }", "abs (relativePath) {\n return this.url(relativePath).href;\n }", "function resolveRelativeUrls(srcFilePath, relativePath) {\n\treturn path.join(path.dirname(srcFilePath), relativePath);\n\t}", "function refsPath(base) {\n var basePath = base === undefined ? Object(_page__WEBPACK_IMPORTED_MODULE_5__[\"pagePath\"])() : base || '/';\n return Object(_util__WEBPACK_IMPORTED_MODULE_7__[\"urlRelative\"])(basePath, _page__WEBPACK_IMPORTED_MODULE_5__[\"refsPath\"]);\n}", "function supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n var startPath = dir.slice(protocol.length);\n if (protocol && /^\\/\\w\\:/.test(startPath)) {\n // handle file:///C:/ paths\n protocol += '/';\n return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\\\/g, '/');\n }\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}", "function supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n var startPath = dir.slice(protocol.length);\n if (protocol && /^\\/\\w\\:/.test(startPath)) {\n // handle file:///C:/ paths\n protocol += '/';\n return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\\\/g, '/');\n }\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}", "resolveAsPath() { }", "function documentRequiredComponents(documentation, varToFilePath, originObject, opt) {\n return __awaiter(this, void 0, void 0, function () {\n var originalDirName, pathResolver, files, _loop_1, _i, _a, varName, docs;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n originalDirName = path.dirname(opt.filePath);\n pathResolver = makePathResolver_1.default(originalDirName, opt.alias);\n // resolve where components are through immediately exported variables\n return [4 /*yield*/, recursiveResolveIEV_1.default(pathResolver, varToFilePath, opt.validExtends)];\n case 1:\n // resolve where components are through immediately exported variables\n _b.sent();\n files = new ts_map_1.default();\n _loop_1 = function (varName) {\n var _a = varToFilePath[varName], filePath = _a.filePath, exportName = _a.exportName;\n filePath.forEach(function (p) {\n var fullFilePath = pathResolver(p);\n if (opt.validExtends(fullFilePath)) {\n var vars = files.get(fullFilePath) || [];\n vars.push(exportName);\n files.set(fullFilePath, vars);\n }\n });\n };\n for (_i = 0, _a = Object.keys(varToFilePath); _i < _a.length; _i++) {\n varName = _a[_i];\n _loop_1(varName);\n }\n docs = [];\n return [4 /*yield*/, files.keys().reduce(function (_, fullFilePath) { return __awaiter(_this, void 0, void 0, function () {\n var vars, originVar, _a, _b, e_1;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0: return [4 /*yield*/, _];\n case 1:\n _d.sent();\n vars = files.get(fullFilePath);\n if (!(fullFilePath && vars)) return [3 /*break*/, 5];\n _d.label = 2;\n case 2:\n _d.trys.push([2, 4, , 5]);\n originVar = originObject\n ? (_c = {},\n _c[originObject] = {\n name: '-',\n path: fullFilePath\n },\n _c) : {};\n _b = (_a = docs).concat;\n return [4 /*yield*/, parse_1.parseFile(__assign(__assign(__assign({}, opt), { filePath: fullFilePath, nameFilter: vars }), originVar), documentation)];\n case 3:\n docs = _b.apply(_a, [_d.sent()]);\n if (documentation && originObject && originVar[originObject]) {\n originVar[originObject].name = documentation.get('displayName');\n documentation.set('displayName', null);\n }\n return [3 /*break*/, 5];\n case 4:\n e_1 = _d.sent();\n if (originObject) {\n // eat the error\n }\n else {\n // we still want non extensions errors to show\n throw e_1;\n }\n return [3 /*break*/, 5];\n case 5: return [2 /*return*/];\n }\n });\n }); }, Promise.resolve())];\n case 2:\n _b.sent();\n return [2 /*return*/, docs];\n }\n });\n });\n}", "function docuHash(str) {\n if (str === '/') {\n return 'index';\n }\n const shortHash = pathUtils_1.simpleHash(str, 3);\n const parsedPath = `${lodash_1.kebabCase(str)}-${shortHash}`;\n if (pathUtils_1.isNameTooLong(parsedPath)) {\n return `${pathUtils_1.shortName(lodash_1.kebabCase(str))}-${shortHash}`;\n }\n return parsedPath;\n}", "function normalizePath(p) {\n return fslib_1.npath.toPortablePath(p);\n }", "function getRelativePath(dir) {\n var standardizedDir = dir.replace(SEP_PATT, \"/\");\n //remove the workspace path\n return standardizedDir.replace(\n workspacePath.replace(SEP_PATT, \"/\")\n , \"\"\n )\n //remove the source directory\n .replace(\n defaults.sourceDirectory\n , \"\"\n )\n //remove the left over path separaters from the begining\n .replace(\n LEADING_SEP_PATT\n , \"\"\n );\n }", "function GetNormalizedPath() {\n}", "static relativePath(path, basePath) {\n\t\tif (basePath === undefined || basePath === '/')\n\t\t\treturn path\n\n\t\treturn path.startsWith(basePath) ?\n\t\t\tpath.slice(basePath.length) || '/' :\n\t\t\tfalse // path is not relative to basePath\n\t}", "function relative(from, to) {\n assertPath(from);\n assertPath(to);\n if (from === to)\n return \"\";\n var fromOrig = resolve(from);\n var toOrig = resolve(to);\n if (fromOrig === toOrig)\n return \"\";\n from = fromOrig.toLowerCase();\n to = toOrig.toLowerCase();\n if (from === to)\n return \"\";\n // Trim any leading backslashes\n var fromStart = 0;\n var fromEnd = from.length;\n for (; fromStart < fromEnd; ++fromStart) {\n if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH)\n break;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n for (; fromEnd - 1 > fromStart; --fromEnd) {\n if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH)\n break;\n }\n var fromLen = fromEnd - fromStart;\n // Trim any leading backslashes\n var toStart = 0;\n var toEnd = to.length;\n for (; toStart < toEnd; ++toStart) {\n if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH)\n break;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n for (; toEnd - 1 > toStart; --toEnd) {\n if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH)\n break;\n }\n var toLen = toEnd - toStart;\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n return toOrig.slice(toStart + i + 1);\n }\n else if (i === 2) {\n // We get here if `from` is the device root.\n // For example: from='C:\\\\'; to='C:\\\\foo'\n return toOrig.slice(toStart + i);\n }\n }\n if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n lastCommonSep = i;\n }\n else if (i === 2) {\n // We get here if `to` is the device root.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n lastCommonSep = 3;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === CHAR_BACKWARD_SLASH)\n lastCommonSep = i;\n }\n // We found a mismatch before the first common path separator was seen, so\n // return the original `to`.\n if (i !== length && lastCommonSep === -1) {\n return toOrig;\n }\n var out = \"\";\n if (lastCommonSep === -1)\n lastCommonSep = 0;\n // Generate the relative path based on the path difference between `to` and\n // `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n if (out.length === 0)\n out += \"..\";\n else\n out += \"\\\\..\";\n }\n }\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0) {\n return out + toOrig.slice(toStart + lastCommonSep, toEnd);\n }\n else {\n toStart += lastCommonSep;\n if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH)\n ++toStart;\n return toOrig.slice(toStart, toEnd);\n }\n }", "function relativeURI(uri, base) {\n \n // reduce base and uri strings to just their difference string\n var baseParts = base.split('/');\n baseParts.pop();\n base = baseParts.join('/') + '/';\n i = 0;\n while (base.substr(i, 1) == uri.substr(i, 1))\n i++;\n while (base.substr(i, 1) != '/')\n i--;\n base = base.substr(i + 1);\n uri = uri.substr(i + 1);\n\n // each base folder difference is thus a backtrack\n baseParts = base.split('/');\n var uriParts = uri.split('/');\n out = '';\n while (baseParts.shift())\n out += '../';\n \n // finally add uri parts\n while (curPart = uriParts.shift())\n out += curPart + '/';\n \n return out.substr(0, out.length - 1);\n }", "function relativeURI(uri, base) {\n \n // reduce base and uri strings to just their difference string\n var baseParts = base.split('/');\n baseParts.pop();\n base = baseParts.join('/') + '/';\n i = 0;\n while (base.substr(i, 1) == uri.substr(i, 1))\n i++;\n while (base.substr(i, 1) != '/')\n i--;\n base = base.substr(i + 1);\n uri = uri.substr(i + 1);\n\n // each base folder difference is thus a backtrack\n baseParts = base.split('/');\n var uriParts = uri.split('/');\n out = '';\n while (baseParts.shift())\n out += '../';\n \n // finally add uri parts\n while (curPart = uriParts.shift())\n out += curPart + '/';\n \n return out.substr(0, out.length - 1);\n }", "function relativeURI(uri, base) {\n \n // reduce base and uri strings to just their difference string\n var baseParts = base.split('/');\n baseParts.pop();\n base = baseParts.join('/') + '/';\n i = 0;\n while (base.substr(i, 1) == uri.substr(i, 1))\n i++;\n while (base.substr(i, 1) != '/')\n i--;\n base = base.substr(i + 1);\n uri = uri.substr(i + 1);\n\n // each base folder difference is thus a backtrack\n baseParts = base.split('/');\n var uriParts = uri.split('/');\n out = '';\n while (baseParts.shift())\n out += '../';\n \n // finally add uri parts\n while (curPart = uriParts.shift())\n out += curPart + '/';\n \n return out.substr(0, out.length - 1);\n }", "function relativeURI(uri, base) {\n \n // reduce base and uri strings to just their difference string\n var baseParts = base.split('/');\n baseParts.pop();\n base = baseParts.join('/') + '/';\n i = 0;\n while (base.substr(i, 1) == uri.substr(i, 1))\n i++;\n while (base.substr(i, 1) != '/')\n i--;\n base = base.substr(i + 1);\n uri = uri.substr(i + 1);\n\n // each base folder difference is thus a backtrack\n baseParts = base.split('/');\n var uriParts = uri.split('/');\n out = '';\n while (baseParts.shift())\n out += '../';\n \n // finally add uri parts\n while (curPart = uriParts.shift())\n out += curPart + '/';\n \n return out.substr(0, out.length - 1);\n }", "function relativeURI(uri, base) {\n \n // reduce base and uri strings to just their difference string\n var baseParts = base.split('/');\n baseParts.pop();\n base = baseParts.join('/') + '/';\n i = 0;\n while (base.substr(i, 1) == uri.substr(i, 1))\n i++;\n while (base.substr(i, 1) != '/')\n i--;\n base = base.substr(i + 1);\n uri = uri.substr(i + 1);\n\n // each base folder difference is thus a backtrack\n baseParts = base.split('/');\n var uriParts = uri.split('/');\n out = '';\n while (baseParts.shift())\n out += '../';\n \n // finally add uri parts\n while (curPart = uriParts.shift())\n out += curPart + '/';\n \n return out.substr(0, out.length - 1);\n }", "_fullPath(relativePath) {\n return (0, path_1.join)(this.$root, (0, path_1.join)(path_1.sep, relativePath));\n }", "is_absolute() {\n return this.path.startsWith('/')\n }", "function supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}", "function supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}", "function supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}", "function abbrPath(base) {\n var basePath = base === undefined ? Object(_page__WEBPACK_IMPORTED_MODULE_1__[\"pagePath\"])() : base || '/';\n return Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"urlRelative\"])(basePath, _page__WEBPACK_IMPORTED_MODULE_1__[\"abbrPath\"]);\n}", "function hereDoc(f) {\r\n return f.toString().\r\n replace(/^[^\\/]+\\/\\*!?/, '').\r\n replace(/\\*\\/[^\\/]+$/, '');\r\n}", "function resolveFullURL(relativePath, documentURL) {\n if (relativePath.includes('://')) {\n return relativePath;\n } else if (relativePath.startsWith('/')) {\n // Until before first single slash (\"https://test.com/toast/index.html\" => \"https://test.com\")\n let relativeDocumentURL = documentURL.match(/\\w+:\\/\\/[^\\/]+/);\n return relativeDocumentURL + relativePath;\n } else {\n // Until last slash (\"https://test.com/toast/index.html\" => \"https://test.com/toast/\")\n let relativeDocumentURL = documentURL.match(/.+\\//);\n return relativeDocumentURL + relativePath;\n }\n}", "url (relativePath, hash = \"\") {\n let url = pathToFileURL(relativePath);\n url.hash = hash;\n return url;\n }", "function locationPath(stream, a) {\n return absoluteLocationPath(stream, a) ||\n relativeLocationPath(null, stream, a);\n }", "function locationPath(stream, a) {\n return absoluteLocationPath(stream, a) ||\n relativeLocationPath(null, stream, a);\n }", "function nodePathHelpers () {\n const nodePath = require(\"path\");\n const { pathToFileURL } = require(\"url\");\n\n return {\n /**\n * Returns the relative path, formatted correctly for the current OS\n */\n rel (relativePath) {\n return nodePath.normalize(relativePath);\n },\n\n /**\n * Returns the absolute path\n */\n abs (relativePath) {\n return nodePath.resolve(relativePath);\n },\n\n /**\n * Returns the path as a \"file://\" URL object\n */\n url (relativePath, hash = \"\") {\n let url = pathToFileURL(relativePath);\n url.hash = hash;\n return url;\n },\n\n /**\n * Returns the absolute path of the current working directory\n */\n cwd () {\n return process.cwd();\n }\n };\n}", "path (fileName, { title, published, meta = {} }) {\n if (meta.slug) {\n return meta.slug\n }\n\n const slug = slugify(title || fileName)\n const date = published.toString().split(/\\s+/).slice(1, 4).reverse()\n return `${date[0]}/${date[2].toLowerCase()}/${date[1]}/${slug}/`\n }", "findRelPath(path) {\n /// Are the `prefix_len` bytes pointed to by `prefix` a prefix of `path`?\n function prefixMatches(prefix, path) {\n // Allow an empty string as a prefix of any relative path.\n if (path[0] != '/' && !prefix) {\n return true;\n }\n // Check whether any bytes of the prefix differ.\n if (!path.startsWith(prefix)) {\n return false;\n }\n // Ignore trailing slashes in directory names.\n let i = prefix.length;\n while (i > 0 && prefix[i - 1] == '/') {\n --i;\n }\n // Match only complete path components.\n let last = path[i];\n return last === '/' || last === '\\0';\n }\n // Search through the preopens table. Iterate in reverse so that more\n // recently added preopens take precedence over less recently addded ones.\n let matchLen = 0;\n let foundPre;\n for (let i = this._firstNonPreopenFd - 1; i >= FIRST_PREOPEN_FD; --i) {\n let pre = this.get(i);\n let prefix = pre.path;\n if (path !== '.' && !path.startsWith('./')) {\n // We're matching a relative path that doesn't start with \"./\" and\n // isn't \".\".\n if (prefix.startsWith('./')) {\n prefix = prefix.slice(2);\n }\n else if (prefix === '.') {\n prefix = prefix.slice(1);\n }\n }\n // If we haven't had a match yet, or the candidate path is longer than\n // our current best match's path, and the candidate path is a prefix of\n // the requested path, take that as the new best path.\n if ((!foundPre || prefix.length > matchLen) &&\n prefixMatches(prefix, path)) {\n foundPre = pre;\n matchLen = prefix.length;\n }\n }\n if (!foundPre) {\n throw new Error(`Couldn't resolve the given path via preopened directories.`);\n }\n // The relative path is the substring after the portion that was matched.\n let computed = path.slice(matchLen);\n // Omit leading slashes in the relative path.\n computed = computed.replace(/^\\/+/, '');\n // *at syscalls don't accept empty relative paths, so use \".\" instead.\n computed = computed || '.';\n return {\n preOpen: foundPre,\n relativePath: computed\n };\n }" ]
[ "0.6016257", "0.58232063", "0.57706845", "0.57446754", "0.5674279", "0.5635745", "0.5611134", "0.5571413", "0.5571413", "0.5532752", "0.55225337", "0.5517745", "0.5502026", "0.5496969", "0.5490298", "0.5460884", "0.5430811", "0.54135466", "0.5404939", "0.5404939", "0.5404939", "0.5401732", "0.5385306", "0.53839725", "0.5376166", "0.5344271", "0.53364235", "0.5319872", "0.5319872", "0.5319872", "0.5319872", "0.5319872", "0.5319782", "0.5293221", "0.52850676", "0.52768993", "0.52708346", "0.52370024", "0.52261674", "0.5214465", "0.5214465", "0.52085125", "0.5178432", "0.5171264", "0.5158667", "0.5145921", "0.51386386", "0.5132747", "0.5077375", "0.5067393", "0.5059135", "0.5029405", "0.5020907", "0.50145596", "0.49998975", "0.4992774", "0.49840593", "0.49765792", "0.49602228", "0.49485055", "0.494554", "0.494554", "0.49335974", "0.49258143", "0.49242464", "0.4900644", "0.48755968", "0.48732695", "0.48705444", "0.4804633", "0.479671", "0.4794677", "0.4794677", "0.47914836", "0.4771705", "0.4762657", "0.47599348", "0.47469485", "0.47469425", "0.47370845", "0.47369096", "0.47335052", "0.47335052", "0.47335052", "0.47335052", "0.47335052", "0.47225484", "0.47208712", "0.47018898", "0.47018898", "0.47018898", "0.4701581", "0.46920732", "0.4691975", "0.46753404", "0.46720117", "0.46720117", "0.46526298", "0.46451902", "0.4638253" ]
0.51966155
42
path.normalize(path) posix version JSDoc
function normalizePath(path) { var isPathAbsolute = isAbsolute(path); var trailingSlash = path.substr(-1) === '/'; // Normalize the path var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/'); if (!normalizedPath && !isPathAbsolute) { normalizedPath = '.'; } if (normalizedPath && trailingSlash) { normalizedPath += '/'; } return (isPathAbsolute ? '/' : '') + normalizedPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizePath(p) {\n return fslib_1.npath.toPortablePath(p);\n }", "function normalizePath(path) { return path.replace(/\\\\/g, '/') }", "function GetNormalizedPath() {\n}", "static normalize(path) {\n // Ensure forward slashes\n path = path.replace(/\\\\/g, \"/\");\n // Remove all surrounding quotes\n path = path.replace(/^[\"']+|[\"']+$/g, \"\");\n // Make Windows drive letters upper case\n return path.replace(/^([^:]+):\\//, (_m, m1) => m1.toUpperCase() + \":/\");\n }", "function normalizeStringPosix(path, allowAboveRoot) {\r\n var res = '';\r\n var lastSegmentLength = 0;\r\n var lastSlash = -1;\r\n var dots = 0;\r\n var code;\r\n for (var i = 0; i <= path.length; ++i) {\r\n if (i < path.length)\r\n code = path.charCodeAt(i);\r\n else if (code === 47 /*/*/)\r\n break;\r\n else\r\n code = 47 /*/*/;\r\n if (code === 47 /*/*/) {\r\n if (lastSlash === i - 1 || dots === 1) {\r\n // NOOP\r\n } else if (lastSlash !== i - 1 && dots === 2) {\r\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\r\n if (res.length > 2) {\r\n var lastSlashIndex = res.lastIndexOf('/');\r\n if (lastSlashIndex !== res.length - 1) {\r\n if (lastSlashIndex === -1) {\r\n res = '';\r\n lastSegmentLength = 0;\r\n } else {\r\n res = res.slice(0, lastSlashIndex);\r\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n } else if (res.length === 2 || res.length === 1) {\r\n res = '';\r\n lastSegmentLength = 0;\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n }\r\n if (allowAboveRoot) {\r\n if (res.length > 0)\r\n res += '/..';\r\n else\r\n res = '..';\r\n lastSegmentLength = 2;\r\n }\r\n } else {\r\n if (res.length > 0)\r\n res += '/' + path.slice(lastSlash + 1, i);\r\n else\r\n res = path.slice(lastSlash + 1, i);\r\n lastSegmentLength = i - lastSlash - 1;\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n } else if (code === 46 /*.*/ && dots !== -1) {\r\n ++dots;\r\n } else {\r\n dots = -1;\r\n }\r\n }\r\n return res;\r\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n let res = '';\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n }\n else if (code === 47 /*/*/) {\n break;\n }\n else {\n code = 47 /*/*/;\n }\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n }\n else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 ||\n lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== 46 /*.*/ ||\n res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function normalizeSeparators(fileOrDirPath) { //private\n //if the path separator is NOT the storyteller separator: /\n if(path.sep !== storytellerPathSeparator) {\n //split the path on the non-unix separator (most likely \\ for win)\n const segments = fileOrDirPath.split(path.sep);\n\n //rejoin all of the segments with the unix separator\n fileOrDirPath = segments.join(storytellerPathSeparator);\n }\n\n return fileOrDirPath;\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const start = res.length - 1;\n var j = start;\n for (; j >= 0; --j) {\n if (res.charCodeAt(j) === 47 /*/*/) break;\n }\n if (j !== start) {\n if (j === -1) res = '';else res = res.slice(0, j);\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += '/..';else res = '..';\n }\n } else {\n if (res.length > 0) res += '/' + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n }", "normalizePath(path) {\n if (path === null || path === undefined) {\n return null;\n }\n // Perform the standard path replacement, but also normalize the path\n // to remove the '.' and '..' sections so we have a better representation\n // of the actual requested path.\n return pathModule.normalize(\n pathModule.toNamespacedPath(\n getPathFromURL(path)\n )\n );\n }", "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += '/..';else res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) res += '/' + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n }", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n}", "function unixify(filepath) {\n return filepath.replace(/\\\\/g, '/');\n}", "function normalizeStringPosix(path, allowAboveRoot) {\n\t var res = '';\n\t var lastSegmentLength = 0;\n\t var lastSlash = -1;\n\t var dots = 0;\n\t var code;\n\t for (var i = 0; i <= path.length; ++i) {\n\t if (i < path.length)\n\t code = path.charCodeAt(i);\n\t else if (code === 47 /*/*/)\n\t break;\n\t else\n\t code = 47 /*/*/;\n\t if (code === 47 /*/*/) {\n\t if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {\n\t if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n\t if (res.length > 2) {\n\t var lastSlashIndex = res.lastIndexOf('/');\n\t if (lastSlashIndex !== res.length - 1) {\n\t if (lastSlashIndex === -1) {\n\t res = '';\n\t lastSegmentLength = 0;\n\t } else {\n\t res = res.slice(0, lastSlashIndex);\n\t lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n\t }\n\t lastSlash = i;\n\t dots = 0;\n\t continue;\n\t }\n\t } else if (res.length === 2 || res.length === 1) {\n\t res = '';\n\t lastSegmentLength = 0;\n\t lastSlash = i;\n\t dots = 0;\n\t continue;\n\t }\n\t }\n\t if (allowAboveRoot) {\n\t if (res.length > 0)\n\t res += '/..';\n\t else\n\t res = '..';\n\t lastSegmentLength = 2;\n\t }\n\t } else {\n\t if (res.length > 0)\n\t res += '/' + path.slice(lastSlash + 1, i);\n\t else\n\t res = path.slice(lastSlash + 1, i);\n\t lastSegmentLength = i - lastSlash - 1;\n\t }\n\t lastSlash = i;\n\t dots = 0;\n\t } else if (code === 46 /*.*/ && dots !== -1) {\n\t ++dots;\n\t } else {\n\t dots = -1;\n\t }\n\t }\n\t return res;\n\t}", "function normalize(path) {\n if (path === '') {\n return '';\n }\n return removeSlash(posix.normalize(path));\n }", "function normalize(path) {\n if (path === '') {\n return '';\n }\n return removeSlash(posix.normalize(path));\n }", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function normalizeStringPosix(path, allowAboveRoot) {\r\n var res = '';\r\n var lastSlash = -1;\r\n var dots = 0;\r\n var code;\r\n for (var i = 0; i <= path.length; ++i) {\r\n if (i < path.length)\r\n code = path.charCodeAt(i);\r\n else if (code === 47/*/*/)\r\n break;\r\n else\r\n code = 47/*/*/;\r\n if (code === 47/*/*/) {\r\n if (lastSlash === i - 1 || dots === 1) {\r\n // NOOP\r\n } else if (lastSlash !== i - 1 && dots === 2) {\r\n if (res.length < 2 ||\r\n res.charCodeAt(res.length - 1) !== 46/*.*/ ||\r\n res.charCodeAt(res.length - 2) !== 46/*.*/) {\r\n if (res.length > 2) {\r\n const start = res.length - 1;\r\n var j = start;\r\n for (; j >= 0; --j) {\r\n if (res.charCodeAt(j) === 47/*/*/)\r\n break;\r\n }\r\n if (j !== start) {\r\n if (j === -1)\r\n res = '';\r\n else\r\n res = res.slice(0, j);\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n } else if (res.length === 2 || res.length === 1) {\r\n res = '';\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n }\r\n if (allowAboveRoot) {\r\n if (res.length > 0)\r\n res += '/..';\r\n else\r\n res = '..';\r\n }\r\n } else {\r\n if (res.length > 0)\r\n res += '/' + path.slice(lastSlash + 1, i);\r\n else\r\n res = path.slice(lastSlash + 1, i);\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n } else if (code === 46/*.*/ && dots !== -1) {\r\n ++dots;\r\n } else {\r\n dots = -1;\r\n }\r\n }\r\n return res;\r\n}", "normalize(...variants) {\n\n if (variants.length <= 0)\n return null;\n if (variants.length > 0\n && !Object.usable(variants[0]))\n return null;\n if (variants.length > 1\n && !Object.usable(variants[1]))\n return null;\n\n if (variants.length > 1\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid root: \" + typeof variants[0]);\n let root = \"#\";\n if (variants.length > 1) {\n root = variants[0];\n try {root = Path.normalize(root);\n } catch (error) {\n root = (root || \"\").trim();\n throw new TypeError(`Invalid root${root ? \": \" + root : \"\"}`);\n }\n }\n\n if (variants.length > 1\n && typeof variants[1] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[1]);\n if (variants.length > 0\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[0]);\n let path = \"\";\n if (variants.length === 1)\n path = variants[0];\n if (variants.length === 1\n && path.match(PATTERN_URL))\n path = path.replace(PATTERN_URL, \"$1\");\n else if (variants.length > 1)\n path = variants[1];\n path = (path || \"\").trim();\n\n if (!path.match(PATTERN_PATH))\n throw new TypeError(`Invalid path${String(path).trim() ? \": \" + path : \"\"}`);\n\n path = path.replace(/([^#])#$/, \"$1\");\n path = path.replace(/^([^#])/, \"#$1\");\n\n // Functional paths are detected.\n if (path.match(PATTERN_PATH_FUNCTIONAL))\n return \"###\";\n\n path = root + path;\n path = path.toLowerCase();\n\n // Path will be balanced\n const pattern = /#[^#]+#{2}/;\n while (path.match(pattern))\n path = path.replace(pattern, \"#\");\n path = \"#\" + path.replace(/(^#+)|(#+)$/g, \"\");\n\n return path;\n }", "function normalizePath(contents, root, path) {\n const driveName = contents.driveName(root);\n const localPath = contents.localPath(root);\n const resolved = coreutils_1.PathExt.resolve(localPath, path);\n return driveName ? `${driveName}:${resolved}` : resolved;\n }", "function normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}", "function unixify( filepath ) {\n\t\treturn filepath.replace( /\\\\/g, '/' );\n\t}", "function sanitizePath(path) {\n var path = path.charAt(0) == '/' ? path : \"/\" + path;\n return path.replace(/\\#.*|\\?.*/, '');\n }", "function normalizePaths(path) {\n // @ts-ignore (not sure why this happens)\n return path.map(segment => typeof segment === 'string' ? segment.split('.') : segment);\n} // Supports passing either an id or a value (document/reference/object)", "function pathToFnName (path) {\n if ( 'oomtility/wrap/' === path.slice(0,15) )\n path = path.slice(15)\n if ( '/README.md' === path.slice(-10) ) // eg 'wp/README.md'\n path = path.replace(/\\//g, '-') // eg 'wp-README.md'\n return 'write' + (\n path.split('/').pop().split(/[- .]/g).map(\n w => w ? w[0].toUpperCase() + w.substr(1) : ''\n ).join('')\n )\n}", "function relativize(path /*: string */) {\n return path.replace(SHEET_PATH, '').replace(/\\.md$/, '')\n}", "function normalizeFilePath (x) {\n if (!x || typeof x !== 'string') {\n throw new TypeError(`Invalid file path ${x}`)\n }\n return x.charAt(0) === '/' ? x : path.join(__dirname, '../..', x)\n}", "function removeLeadingSlash(path) {\n return path.replace(/^[/\\\\]+/, '');\n}", "function formatPath(path) {\n // Replace windows style separators\n path = path.replace(/\\\\/g, '/');\n\n // If path starts with 'public', remove that part\n if(path.startsWith('public')) {\n path = path.replace('public', '');\n }\n\n return path;\n}", "async function normalizePath(path) {\n if (Platform.OS === \"ios\" || Platform.OS === \"android\") {\n const filePrefix = \"file://\";\n if (path.startsWith(filePrefix)) {\n path = path.substring(filePrefix.length);\n try {\n path = decodeURI(path);\n } catch (e) {}\n }\n }\n return path;\n }", "async function normalizePath(path) {\n if (Platform.OS === \"ios\" || Platform.OS === \"android\") {\n const filePrefix = \"file://\";\n if (path.startsWith(filePrefix)) {\n path = path.substring(filePrefix.length);\n try {\n path = decodeURI(path);\n } catch (e) {}\n }\n }\n return path;\n }", "function hereDoc(f) {\r\n return f.toString().\r\n replace(/^[^\\/]+\\/\\*!?/, '').\r\n replace(/\\*\\/[^\\/]+$/, '');\r\n}", "function normalizePath(path) {\n return path.split('/')\n .map(normalizeSegment)\n .join('/');\n}", "_stripLeadingSlash(path) {\n if (path[0] === '/') {\n return path.slice(1);\n }\n return path;\n }", "function whistle_short_path($p) {\n return strcat(substr($p,9,1),\n ydtosdf(substr($p,0,8),3),\n numtosxg(substr($p,10,3)));\n}", "static readFromPath(filePath, base, encoding='utf8') {\n return new DocumentationFile({\n path: filePath,\n base,\n encoding,\n stat: fs.lstatSync(filePath),\n contents: fs.readFileSync(filePath),\n });\n }", "function normalize (actual) {\n const dir = path.join(__dirname, '..', '..', '..');\n const reDir = new RegExp(dir.replace(reEscape, '\\\\$1'), 'g');\n const reSep = new RegExp(path.sep.replace(reEscape, '\\\\$1'), 'g');\n\n return actual\n .replace(reDir, '/qunit')\n // Replace backslashes (\\) in stack traces on Windows to POSIX\n .replace(reSep, '/')\n // Convert \"at processModule (/qunit/qunit/qunit.js:1:2)\" to \"at qunit.js\"\n // Convert \"at /qunit/qunit/qunit.js:1:2\" to \"at qunit.js\"\n .replace(/^(\\s+at ).*\\/qunit\\/qunit\\/qunit\\.js.*$/gm, '$1qunit.js')\n // Strip inferred names for anonymous test closures (as Node 10 did),\n // to match the output of Node 12+.\n // Convert \"at QUnit.done (/qunit/test/foo.js:1:2)\" to \"at /qunit/test/foo.js:1:2\"\n .replace(/\\b(at )\\S+ \\((\\/qunit\\/test\\/[^:]+:\\d+:\\d+)\\)/g, '$1$2')\n // Convert sourcemap'ed traces from Node 14 and earlier to the\n // standard format used by Node 15+.\n // https://github.com/nodejs/node/commit/15804e0b3f\n // https://github.com/nodejs/node/pull/37252\n // Convert \"at foo (/min.js:1)\\n -> /src.js:2\" to \"at foo (/src.js:2)\"\n .replace(/\\b(at [^(]+\\s\\()[^)]+(\\))\\n\\s+-> ([^\\n]+)/g, '$1$3$2')\n // CJS-style internal traces:\n // Convert \"at load (internal/modules/cjs/loader.js:7)\" to \"at internal\"\n //\n // ESM-style internal traces from Node 14+:\n // Convert \"at wrap (node:internal/modules/cjs/loader:1)\" to \"at internal\"\n .replace(/^(\\s+at ).+\\([^/)][^)]*\\)$/gm, '$1internal')\n\n // Convert /bin/qunit and /src/cli to internal as well\n // Because there are differences between Node 10 and Node 12 in terms\n // of how much back and forth occurs, so by mapping both to internal\n // we can flatten and normalize across.\n .replace(/^(\\s+at ).*\\/qunit\\/bin\\/qunit\\.js.*$/gm, '$1internal')\n .replace(/^(\\s+at ).*\\/qunit\\/src\\/cli\\/.*$/gm, '$1internal')\n\n // Strip frames from indirect nyc dependencies that are specific\n // to code coverage jobs:\n // Convert \"at load (/qunit/node_modules/append-transform/index.js:6\" to \"at internal\"\n .replace(/ {2}at .+\\/.*node_modules\\/append-transform\\/.*\\)/g, ' at internal')\n // Consolidate subsequent qunit.js frames\n .replace(/^(\\s+at qunit\\.js$)(\\n\\s+at qunit\\.js$)+/gm, '$1')\n // Consolidate subsequent internal frames\n .replace(/^(\\s+at internal$)(\\n\\s+at internal$)+/gm, '$1');\n}", "function normalize(namePath) {\n return namePath.map(function (cell) {\n return \"\".concat((0, _typeof2.default)(cell), \":\").concat(cell);\n }) // Magic split\n .join(SPLIT);\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}", "function dottify(path) {\n return (path || '').replace(/^\\//g, '').replace(/\\//g, '.');\n }", "function normalizeStringWin32(path, allowAboveRoot) {\r\n var res = '';\r\n var lastSlash = -1;\r\n var dots = 0;\r\n var code;\r\n for (var i = 0; i <= path.length; ++i) {\r\n if (i < path.length)\r\n code = path.charCodeAt(i);\r\n else if (code === 47/*/*/ || code === 92/*\\*/)\r\n break;\r\n else\r\n code = 47/*/*/;\r\n if (code === 47/*/*/ || code === 92/*\\*/) {\r\n if (lastSlash === i - 1 || dots === 1) {\r\n // NOOP\r\n } else if (lastSlash !== i - 1 && dots === 2) {\r\n if (res.length < 2 ||\r\n res.charCodeAt(res.length - 1) !== 46/*.*/ ||\r\n res.charCodeAt(res.length - 2) !== 46/*.*/) {\r\n if (res.length > 2) {\r\n const start = res.length - 1;\r\n var j = start;\r\n for (; j >= 0; --j) {\r\n if (res.charCodeAt(j) === 92/*\\*/)\r\n break;\r\n }\r\n if (j !== start) {\r\n if (j === -1)\r\n res = '';\r\n else\r\n res = res.slice(0, j);\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n } else if (res.length === 2 || res.length === 1) {\r\n res = '';\r\n lastSlash = i;\r\n dots = 0;\r\n continue;\r\n }\r\n }\r\n if (allowAboveRoot) {\r\n if (res.length > 0)\r\n res += '\\\\..';\r\n else\r\n res = '..';\r\n }\r\n } else {\r\n if (res.length > 0)\r\n res += '\\\\' + path.slice(lastSlash + 1, i);\r\n else\r\n res = path.slice(lastSlash + 1, i);\r\n }\r\n lastSlash = i;\r\n dots = 0;\r\n } else if (code === 46/*.*/ && dots !== -1) {\r\n ++dots;\r\n } else {\r\n dots = -1;\r\n }\r\n }\r\n return res;\r\n}", "function platformPath(p) {\n return p.split('/').join(path.sep);\n}", "function normalize(dir) {\n return path.normalize(dir);\n}", "getMagicCommentMasterFile() {\n const magic = new MagicParser(this.filePath).parse();\n if (!magic || !magic.root) { return null; }\n return path.resolve(this.projectPath, magic.root);\n }", "function transformDocs(filePath) {\n let data = [];\n\n data.dirName = path.dirname(filePath.replace(path.join(__dirname, 'node_modules/nsis-docs'), 'html'));\n data.prettyName = path.basename(filePath, path.extname(filePath));\n\n data.pageTitle = [];\n data.bundle = \"Nullsoft Scriptable Install System\";\n\n if (data.dirName.endsWith('Callbacks') && data.prettyName.startsWith(\"on\")) {\n data.name = \".\" + data.prettyName;\n data.type = \"Function\";\n } else if (data.dirName.endsWith('Callbacks') && data.prettyName.startsWith(\"un.on\")) {\n data.name = data.prettyName;\n data.type = \"Function\";\n } else if (data.prettyName.startsWith(\"__\") && data.prettyName.endsWith(\"__\")) {\n data.name = \"${\" + data.prettyName + \"}\";\n data.type = \"Constant\";\n } else if (data.prettyName.startsWith(\"NSIS\") && data.dirName.endsWith('Variables')) {\n data.name = \"${\" + data.prettyName + \"}\";\n data.type = \"Constant\";\n } else if (data.dirName.endsWith('Variables')) {\n data.name = \"$\" + data.prettyName;\n data.type = \"Variable\";\n } else if (data.dirName.startsWith('html/Includes')) {\n data.name = \"${\" + data.prettyName + \"}\";\n data.type = \"Library\";\n data.bundle = path.basename(data.dirName + \".nsh\");\n } else {\n data.name = data.prettyName;\n data.type = \"Command\";\n }\n\n data.pageTitle.push(data.bundle);\n data.pageTitle.push(data.name);\n data.pageTitle = data.pageTitle.reverse().join(\" | \");\n\n return data;\n}", "function xnormalize(fpath) {\n if (!fpath) return \"\";\n var parts = fpath.split(/[\\\\\\/]/g);\n var roots = [];\n parts.forEach( function(part) {\n if (!part || part===\".\") {\n /* nothing */\n }\n else if (part===\"..\") {\n if (roots.length > 0 && roots[roots.length-1] !== \".parent\") {\n roots.pop();\n }\n else {\n roots.push(\".parent\");\n }\n }\n else {\n roots.push(part);\n }\n });\n return roots.join(\"/\");\n}", "function normalize(namePath) {\n return namePath\n .map(function (cell) {\n return ''.concat(_typeof(cell), ':').concat(cell);\n }) // Magic split\n .join(SPLIT);\n}", "async function normalizePath(pathToNormalize) {\n if (is_wsl_1.default) {\n return convertUNIXPathToWindows(pathToNormalize);\n }\n return pathToNormalize;\n}", "resolveAsPath() { }", "function normalize(namePath) {\n return namePath.map(function (cell) {\n return \"\".concat(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_typeof__[\"a\" /* default */])(cell), \":\").concat(cell);\n }) // Magic split\n .join(SPLIT);\n}", "function normalizePath(path) {\n return path.split(\"/\")\n .map(normalizeSegment)\n .join(\"/\");\n}", "function normalizeStringWin32(path, allowAboveRoot) {\n var res = '';\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) code = path.charCodeAt(i);else if (code === 47 /*/*/ || code === 92 /*\\*/) break;else code = 47 /*/*/;\n if (code === 47 /*/*/ || code === 92 /*\\*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const start = res.length - 1;\n var j = start;\n for (; j >= 0; --j) {\n if (res.charCodeAt(j) === 92 /*\\*/) break;\n }\n if (j !== start) {\n if (j === -1) res = '';else res = res.slice(0, j);\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += '\\\\..';else res = '..';\n }\n } else {\n if (res.length > 0) res += '\\\\' + path.slice(lastSlash + 1, i);else res = path.slice(lastSlash + 1, i);\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n }", "function normalize(s) {\n s = path.resolve(s);\n if (WIN_BUILD) s = s.toLowerCase();\n return s;\n }", "function posixify_path(str) {\n\treturn str.split(path.sep).join(path.posix.sep);\n}", "function safePath(sectionPath, title) {\n\n sectionPath = sectionPath.replace(/[\\\\\\/]/g, '_').replace(/ > /g, path.sep);\n title = title.replace(/[\\\\\\/]/g, '_').substring(0, 200);\n\n fullPath = path.join(sectionPath, title);\n return fullPath.replace(/[^A-Za-z0-9\\\\\\/]/g, '_');\n}", "function toPortablePath(p) {\n if (process.platform !== `win32`)\n return p;\n let windowsPathMatch, uncWindowsPathMatch;\n if ((windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)))\n p = `/${windowsPathMatch[1]}`;\n else if ((uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)))\n p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`;\n return p.replace(/\\\\/g, `/`);\n}", "function normalize(path) {\n\tvar last = path.length - 1;\n\tvar lastC = path.charAt(last);\n\n\t// If the uri ends with `#`, just return it without '#'\n\tif (lastC === \"#\") {\n\t\treturn path.substring(0, last);\n\t}\n\tvar arr = path.split(\".\");\n\tvar extname = \"js\";\n\tif (arr.length > 1) {\n\t\textname = arr[arr.length - 1];\n\t\tif (indexOf.call(data.extnames, extname) == -1) {\n\t\t\treturn path + \".js\";\n\t\t} else {\n\t\t\treturn path;\n\t\t}\n\t} else {\n\t\treturn path + \".js\";\n\t}\n}", "async protectWhitespace(path) {\n if (!path.startsWith(\" \")) {\n return path;\n }\n // Handle leading whitespace by prepending the absolute path:\n // \" test.txt\" while being in the root directory becomes \"/ test.txt\".\n const pwd = await this.pwd();\n const absolutePathPrefix = pwd.endsWith(\"/\") ? pwd : pwd + \"/\";\n return absolutePathPrefix + path;\n }", "function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath;}path=url.path;}var isAbsolute=exports.isAbsolute(path);var parts=path.split(/\\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==='.'){parts.splice(i,1);}else if(part==='..'){up++;}else if(up>0){if(part===''){// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\nparts.splice(i+1,up);up=0;}else{parts.splice(i,2);up--;}}}path=parts.join('/');if(path===''){path=isAbsolute?'/':'.';}if(url){url.path=path;return urlGenerate(url);}return path;}", "function fromPortablePath(p) {\n if (process.platform !== `win32`)\n return p;\n let portablePathMatch, uncPortablePathMatch;\n if ((portablePathMatch = p.match(PORTABLE_PATH_REGEXP)))\n p = portablePathMatch[1];\n else if ((uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)))\n p = `\\\\\\\\${uncPortablePathMatch[1] ? `.\\\\` : ``}${uncPortablePathMatch[2]}`;\n else\n return p;\n return p.replace(/\\//g, `\\\\`);\n}", "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n }", "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n }", "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n }", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path$1.sep);\n}", "function pathCorrect (filepath) {\n\tpathArray = filepath.split(path.sep);\n\tvar correctedPath = path.normalize(pathArray.join('\\\\\\\\'));\n\tcorrectedPath = correctedPath.replace(/\\\"/g,'');\n\treturn correctedPath;\n}", "function sanitizePath(path) {\n var clean;\n // Handle spaces\n if (path.indexOf(\" \") > -1) {\n if (PLATFORM === \"darwin\" || PLATFORM === \"linux\") {\n clean = replaceAll(path, \" \", \"\\\\ \");\n }\n else {\n clean = '\"' + path + '\"';\n }\n }\n else {\n clean = path;\n }\n return clean;\n}", "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "fullpathPosix() {\n if (this.#fullpathPosix !== undefined)\n return this.#fullpathPosix;\n if (this.sep === '/')\n return (this.#fullpathPosix = this.fullpath());\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/');\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`);\n }\n else {\n return (this.#fullpathPosix = p);\n }\n }\n const p = this.parent;\n const pfpp = p.fullpathPosix();\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;\n return (this.#fullpathPosix = fpp);\n }", "function toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}" ]
[ "0.614444", "0.6134857", "0.600149", "0.59661615", "0.5818625", "0.5758178", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5752494", "0.5723211", "0.5715268", "0.5683008", "0.56735957", "0.5656788", "0.56329983", "0.56329983", "0.56329983", "0.559986", "0.559986", "0.559986", "0.5550409", "0.5502761", "0.5502761", "0.5481819", "0.5481819", "0.5470661", "0.5456932", "0.5387341", "0.5365693", "0.5359618", "0.53377646", "0.533224", "0.53160185", "0.5255063", "0.5251203", "0.5215589", "0.52098185", "0.51870173", "0.51870173", "0.5180884", "0.5157732", "0.51478034", "0.51301444", "0.5128704", "0.51077014", "0.50988925", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.5080443", "0.50802636", "0.50785476", "0.50767124", "0.5075474", "0.5073843", "0.5072401", "0.506053", "0.5059509", "0.5057303", "0.5055273", "0.5053689", "0.50462824", "0.5029344", "0.502254", "0.50222105", "0.5020906", "0.50166583", "0.5015574", "0.50025", "0.4998082", "0.49878272", "0.49828768", "0.49828768", "0.49828768", "0.49775222", "0.4973154", "0.49657992", "0.49553588", "0.49492508", "0.49425182" ]
0.0
-1
Grabs active transaction off scope
function getActiveTransaction(hub) { if (hub && hub.getScope) { var scope = hub.getScope(); if (scope) { return scope.getTransaction(); } } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActiveTransaction(hub) {\r\n if (hub && hub.getScope) {\r\n var scope = hub.getScope();\r\n if (scope) {\r\n return scope.getTransaction();\r\n }\r\n }\r\n return undefined;\r\n}", "function getActiveTransaction(maybeHub) {\n\t const hub = maybeHub || getCurrentHub();\n\t const scope = hub.getScope();\n\t return scope && (scope.getTransaction() );\n\t}", "function getActiveTransaction(maybeHub) {\n const hub = maybeHub || getCurrentHub();\n const scope = hub.getScope();\n return scope && (scope.getTransaction() );\n }", "becomeGlobalTransaction() {\n this.singleton.restoreCurrentTransaction(this);\n }", "function getActiveTransaction(maybeHub) {\n const hub = maybeHub || core.getCurrentHub();\n const scope = hub.getScope();\n return scope && (scope.getTransaction() );\n}", "function getActiveTransaction(hub) {\n if (hub === void 0) { hub = hub_1.getCurrentHub(); }\n var _a, _b;\n return (_b = (_a = hub) === null || _a === void 0 ? void 0 : _a.getScope()) === null || _b === void 0 ? void 0 : _b.getTransaction();\n}", "async beginTransaction() {\n }", "get tr() {\n return new Transaction(this);\n }", "getTransactionContext() {\n return this.transactionContext;\n }", "get transaction() {\n return this._transaction;\n }", "function transact(){\n const tid = transactions.length;\n const transaction = {\n tid: tid,\n timestamp: new Date(),\n user: 0\n };\n\n transactions.push(transaction);\n return transaction;\n }", "constructor(\n transactionContext,\n _idleHub,\n /**\n * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n * there are no active spans on this transaction.\n */\n _idleTimeout = DEFAULT_IDLE_TIMEOUT,\n /**\n * The final value in ms that a transaction cannot exceed\n */\n _finalTimeout = DEFAULT_FINAL_TIMEOUT,\n _heartbeatInterval = DEFAULT_HEARTBEAT_INTERVAL,\n // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n _onScope = false,\n ) {\n super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;IdleTransaction.prototype.__init.call(this);IdleTransaction.prototype.__init2.call(this);IdleTransaction.prototype.__init3.call(this);IdleTransaction.prototype.__init4.call(this);;\n\n if (_onScope) {\n // There should only be one active transaction on the scope\n clearActiveTransaction(_idleHub);\n\n // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);\n _idleHub.configureScope(scope => scope.setSpan(this));\n }\n\n this._startIdleTimeout();\n setTimeout(() => {\n if (!this._finished) {\n this.setStatus('deadline_exceeded');\n this.finish();\n }\n }, this._finalTimeout);\n }", "createTransaction(transaction){\n this.pendingTransactions.push(transaction);\n }", "constructor(\n transactionContext,\n _idleHub,\n /**\n * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n * there are no active spans on this transaction.\n */\n _idleTimeout = DEFAULT_IDLE_TIMEOUT,\n /**\n * The final value in ms that a transaction cannot exceed\n */\n _finalTimeout = DEFAULT_FINAL_TIMEOUT,\n _heartbeatInterval = DEFAULT_HEARTBEAT_INTERVAL,\n // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n _onScope = false,\n ) {\n super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;IdleTransaction.prototype.__init.call(this);IdleTransaction.prototype.__init2.call(this);IdleTransaction.prototype.__init3.call(this);IdleTransaction.prototype.__init4.call(this);\n if (_onScope) {\n // There should only be one active transaction on the scope\n clearActiveTransaction(_idleHub);\n\n // We set the transaction here on the scope so error events pick up the trace\n // context and attach it to the error.\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);\n _idleHub.configureScope(scope => scope.setSpan(this));\n }\n\n this._startIdleTimeout();\n setTimeout(() => {\n if (!this._finished) {\n this.setStatus('deadline_exceeded');\n this.finish();\n }\n }, this._finalTimeout);\n }", "createTransaction(transaction){\n\t\tthis.pendingTransactions.push(transaction);\n\t}", "constructor(\n\t transactionContext,\n\t _idleHub,\n\t /**\n\t * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n\t * there are no active spans on this transaction.\n\t */\n\t _idleTimeout = DEFAULT_IDLE_TIMEOUT,\n\t /**\n\t * The final value in ms that a transaction cannot exceed\n\t */\n\t _finalTimeout = DEFAULT_FINAL_TIMEOUT,\n\t _heartbeatInterval = DEFAULT_HEARTBEAT_INTERVAL,\n\t // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n\t _onScope = false,\n\t ) {\n\t super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;IdleTransaction.prototype.__init.call(this);IdleTransaction.prototype.__init2.call(this);IdleTransaction.prototype.__init3.call(this);IdleTransaction.prototype.__init4.call(this);\n\t if (_onScope) {\n\t // There should only be one active transaction on the scope\n\t clearActiveTransaction(_idleHub);\n\n\t // We set the transaction here on the scope so error events pick up the trace\n\t // context and attach it to the error.\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);\n\t _idleHub.configureScope(scope => scope.setSpan(this));\n\t }\n\n\t this._startIdleTimeout();\n\t setTimeout(() => {\n\t if (!this._finished) {\n\t this.setStatus('deadline_exceeded');\n\t this.finish();\n\t }\n\t }, this._finalTimeout);\n\t }", "getCurrentTransactionIndex() {\n return this.currentTransactionIndex;\n }", "shouldTransactionDispatch(transaction) {\n return transaction.meta.active\n }", "function getFrom(transaction) {\n}", "async transactional(cb, ctx = this.transactionContext) {\n const em = this.fork(false);\n return em.getConnection().transactional(async (trx) => {\n em.transactionContext = trx;\n const ret = await cb(em);\n await em.flush();\n return ret;\n }, ctx);\n }", "function getTransaction(callback) {\n transactionsLib.getTransaction(remote, dbinterface, opts, callback);\n }", "async beginTransaction () {\n await this._db.beginTransaction()\n await this._yarnlockStore.beginTransaction()\n }", "async commitTransaction() {\n }", "async function inTransaction (context, logger, client, fn) {\n return withDefer(async defer => {\n await query(context, logger, client, 'BEGIN')\n\n defer(async recover => {\n const error = recover()\n\n if (error) {\n await query(context, logger, client, 'ROLLBACK')\n\n throw error\n }\n\n await query(context, logger, client, 'COMMIT')\n })\n\n return fn()\n })\n}", "transaction(fun, transaction) {\n const tx = { transaction: transaction };\n if (transaction) {\n return sequelize.transaction(tx, fun)\n .catch(err => Promise.reject(err));\n } else {\n return sequelize.transaction(fun)\n .catch(err => Promise.reject(err));\n }\n }", "function is_transaction_active(tx, store_name) {\n try {\n const request = tx.objectStore(store_name).get(0);\n request.onerror = (e) => {\n e.preventDefault();\n e.stopPropagation();\n };\n return true;\n } catch (ex) {\n assert_equals(\n ex.name,\n \"TransactionInactiveError\",\n \"Active check should either not throw anything, or throw \" +\n \"TransactionInactiveError\",\n );\n return false;\n }\n}", "function tempTransaction(mode, storeNames, fn) {\n // Last argument is \"writeLocked\". But this doesnt apply to oneshot direct db operations, so we ignore it.\n if (!openComplete && !PSD.letThrough) {\n if (!isBeingOpened) {\n if (!autoOpen) return rejection(new exceptions.DatabaseClosed(), dbUncaught);\n db.open().catch(nop); // Open in background. If if fails, it will be catched by the final promise anyway.\n }\n return dbReadyPromise.then(function () {\n return tempTransaction(mode, storeNames, fn);\n });\n } else {\n var trans = db._createTransaction(mode, storeNames, globalSchema);\n return trans._promise(mode, function (resolve, reject) {\n newScope(function () {\n // OPTIMIZATION POSSIBLE? newScope() not needed because it's already done in _promise.\n PSD.trans = trans;\n fn(resolve, reject, trans);\n });\n }).then(function (result) {\n // Instead of resolving value directly, wait with resolving it until transaction has completed.\n // Otherwise the data would not be in the DB if requesting it in the then() operation.\n // Specifically, to ensure that the following expression will work:\n //\n // db.friends.put({name: \"Arne\"}).then(function () {\n // db.friends.where(\"name\").equals(\"Arne\").count(function(count) {\n // assert (count === 1);\n // });\n // });\n //\n return trans._completion.then(function () {\n return result;\n });\n }); /*.catch(err => { // Don't do this as of now. If would affect bulk- and modify methods in a way that could be more intuitive. But wait! Maybe change in next major.\r\n trans._reject(err);\r\n return rejection(err);\r\n });*/\n }\n }", "async checkout() {\n\t\tif (this._canCheckout()) {\n\t\t\tconst action = this.getActionByName(Actions.workingCopy.checkout);\n\t\t\tconst entity = await performSirenAction(this._token, action);\n\t\t\tif (!entity) return;\n\t\t\treturn new ActivityUsageEntity(entity, this._token);\n\t\t}\n\t}", "function clearActiveTransaction(hub) {\n if (hub) {\n var scope = hub.getScope();\n if (scope) {\n var transaction = scope.getTransaction();\n if (transaction) {\n scope.setSpan(undefined);\n }\n }\n }\n}", "function beginTransaction(client, errorCallback) {\n var tx = new Transaction(client);\n tx.on('error', errorCallback);\n tx.begin();\n return tx;\n}", "get txId() { return this._txId }", "function clearActiveTransaction(hub) {\n\t const scope = hub.getScope();\n\t if (scope) {\n\t const transaction = scope.getTransaction();\n\t if (transaction) {\n\t scope.setSpan(undefined);\n\t }\n\t }\n\t}", "commit() {\n if (this.transactions.length === 0) {\n return 'TRANSACTION NOT FOUND';\n }\n \n this.db = this.applyTransactions();\n this.transactions = [];\n this.currentTransactionIndex = -1;\n }", "getTransaction(\n accountId: string,\n transactionId: string,\n keyLevel: string\n ): Promise<Transaction> {\n return this._member.getTransaction(accountId, transactionId, keyLevel);\n }", "function clearActiveTransaction(hub) {\n const scope = hub.getScope();\n if (scope) {\n const transaction = scope.getTransaction();\n if (transaction) {\n scope.setSpan(undefined);\n }\n }\n }", "useTransaction(transaction) {\n this.knexQuery.transacting(transaction.knexClient);\n return this;\n }", "static getActive() {\n\t\t\t\treturn _activeAccount;\n\t\t\t}", "apply(tr) {\n return this.applyTransaction(tr).state;\n }", "async commitTransaction() {\n const sqlStatement = `commit transaction`\n\n\n if (this.activeTransaction === true) {\n if (this.status.sqlTrace) {\n this.status.sqlTrace.write(`${sqlStatement};\\n\\n`);\n }\n this.activeTransaction = false;\n await this.pgClient.query(sqlStatement);\n }\n }", "function clearActiveTransaction(hub) {\n const scope = hub.getScope();\n if (scope) {\n const transaction = scope.getTransaction();\n if (transaction) {\n scope.setSpan(undefined);\n }\n }\n}", "async beginTransaction() {\n await this.executeSQL(sqlBeginTransaction,[]);\n }", "function transactionTable() { }", "function addTransaction(tx) {\n\n\t // Get user's secret key\n\t keychain.requestSecret(id.account, id.username, function (err, secret) {\n\t if (err) {\n\t console.log(\"client: txQueue: error while unlocking wallet: \", err);\n\n\t return;\n\t }\n\n\t var transaction = ripple.Transaction.from_json(tx.tx_json);\n\n\t transaction.remote = network.remote;\n\t transaction.secret(secret);\n\n\t // If account is funded submit the transaction right away\n\t if ($scope.account.Balance) {\n\t transaction.submit();\n\t }\n\n\t // If not, add it to the queue.\n\t // (Will be submitted as soon as account gets funding)\n\t else {\n\t var item = {\n\t tx_json: tx.tx_json,\n\t type: tx.tx_json.TransactionType\n\t };\n\n\t // Additional details depending on a transaction type\n\t if ('TrustSet' === item.type) {\n\t item.details = tx.tx_json.LimitAmount;\n\t }\n\n\t $scope.userBlob.unshift(\"/txQueue\", item);\n\t }\n\t });\n\t }", "function keep_alive(tx, store_name) {\n let completed = false;\n tx.addEventListener(\"complete\", () => {\n completed = true;\n });\n\n let keepSpinning = true;\n\n function spin() {\n if (!keepSpinning) return;\n tx.objectStore(store_name).get(0).onsuccess = spin;\n }\n spin();\n\n return () => {\n assert_false(completed, \"Transaction completed while kept alive\");\n keepSpinning = false;\n };\n}", "applyTransactions() {\n const newDb = Object.assign({}, this.db);\n for (let i = 0; i < this.transactions.length; i++) {\n let transaction = this.transactions[i];\n for (let j = 0; j < transaction.length; j++) {\n if (debug) {\n console.log('Executing command ', this.transactions[j]);\n }\n \n let [command, arg1, arg2] = transaction[j].split(' ');\n this.executeCommand(command, arg1, arg2, newDb);\n }\n }\n \n if (debug) {\n console.log('db after applying transactions: ', newDb);\n }\n \n return newDb;\n }", "doTransaction() {\n this.f(this.oldDes,this.oldAss,this.oldDue,this.oldCom,this.des,this.ass,this.due,this.com,this.whetherCreate);\n }", "function transactionWait(transaction) {\n return new Promise((resolve, reject) => {\n transaction.onerror = e => reject(transaction.error);\n transaction.oncomplete = e => resolve();\n });\n}", "function transaction( a_fun, context, args ){\n\t var notChanging = !this._changing,\n\t options = {};\n\t\n\t this._changing = true;\n\t\n\t\n\t if( notChanging ){\n\t this._previousAttributes = new this.Attributes( this.attributes );\n\t }\n\t\n\t if( this._changed ) this._changed = null;\n\t\n\t this.__begin();\n\t var res = a_fun.apply( context || this, args );\n\t this.__commit();\n\t\n\t if( notChanging ){\n\t while( this._pending ){\n\t options = this._pending;\n\t this._pending = false;\n\t this._changeToken = {};\n\t trigger2( this, 'change', this, options );\n\t }\n\t\n\t this._pending = false;\n\t this._changing = false;\n\t }\n\t\n\t return res;\n\t}", "function transaction() {\n // * CURRENT transaction\n if (AccountType === \"CURRENT\") {\n Accounts[AccountID].current += TransactionValue;\n\n // * SAVINGS transaction\n } else if (AccountType === \"SAVINGS\") {\n // (1) - if withdrawal is made from SAVINGS but the required sum does not exist, only the total available amount is transferred\n // i.e. SAVINGS does not drop below 0\n if (TransactionValue < 0 && Accounts[AccountID].savings < Math.abs(TransactionValue)) {\n Accounts[AccountID].savings -= Accounts[AccountID].savings;\n // (2) - regular SAVINGS transaction\n } else {\n Accounts[AccountID].savings += TransactionValue;\n }\n }\n }", "importTransaction (transaction)\n {\n const proxy = this;\n return new Promise(function (resolver, rejecter)\n {\n return proxy.send(\n {request: \"ImportTransaction\", contextDescription: transaction, onlyOnce: true},\n resolver, \n FIREANDFORGET,\n rejecter\n );\n });\n }", "function addTransaction(tx) {\n if (!$scope.account.Balance) {\n // if account is unfunded, then there is no need to ask user for a key\n // Add transaction to the queue.\n // (Will be submitted as soon as account gets funding)\n var item = {\n tx_json: tx.tx_json,\n type: tx.tx_json.TransactionType\n };\n\n // Additional details depending on a transaction type\n if ('TrustSet' === item.type) {\n item.details = tx.tx_json.LimitAmount;\n }\n\n var saveTx = function(e1, r1) {\n if (e1) {\n console.warn(e1);\n return;\n }\n $scope.userBlob.unshift('/clients/rippletradecom/txQueue', item);\n };\n\n if ($scope.userBlob.data && !$scope.userBlob.data.clients) {\n // there is bug in RippleLib with unshift operation - if \n // there is empty nodes in the path, it tries to create array node,\n // and nothing gets created under it, so create '/clients' explicitly\n $scope.userBlob.set('/clients', { rippletradecom: {} }, saveTx);\n } else if ($scope.userBlob.data && $scope.userBlob.data.clients && _.isArray($scope.userBlob.data.clients)) {\n // if '/clients' already set to array, clear it\n $scope.userBlob.unset('/clients', function(e, r) {\n if (e) return;\n $scope.userBlob.set('/clients', { rippletradecom: {} }, saveTx);\n });\n } else {\n saveTx();\n }\n } else {\n // Get user's secret key\n keychain.requestSecret(id.account, id.username, function(err, secret) {\n if (err) {\n console.log('client: txQueue: error while unlocking wallet: ', err);\n return;\n }\n\n var transaction = ripple.Transaction.from_json(tx.tx_json);\n\n transaction.remote = network.remote;\n transaction.secret(secret);\n\n api.getUserAccess().then(function(res) {\n // If account is funded submit the transaction right away\n transaction.submit();\n }, function(err2) {\n // err\n });\n\n });\n }\n }", "function beginTransaction (callback) {\n workQueue.enqueue(driverCommandEnum.BEGIN_TRANSACTION, () => {\n cppDriver.beginTransaction(err => {\n callback(err || null, false)\n workQueue.nextOp()\n })\n }, [])\n }", "function startIdleTransaction(hub, transactionContext, idleTimeout, onScope, customSamplingContext) {\n var _a, _b;\n var options = ((_a = hub.getClient()) === null || _a === void 0 ? void 0 : _a.getOptions()) || {};\n var transaction = new idletransaction_1.IdleTransaction(transactionContext, hub, idleTimeout, onScope);\n transaction = sample(transaction, options, tslib_1.__assign({ parentSampled: transactionContext.parentSampled, transactionContext: transactionContext }, customSamplingContext));\n if (transaction.sampled) {\n transaction.initSpanRecorder((_b = options._experiments) === null || _b === void 0 ? void 0 : _b.maxSpans);\n }\n return transaction;\n}", "function asyncifyTransaction (tx)\n {\n return new Promise((res, rej) => {\n tx.oncomplete = () => res();\n tx.onerror = () => rej(tx.error);\n tx.onabort = () => rej(tx.error);\n });\n }", "useLastTransaction(transaction) {\n\t\t// Strip the id, primary account, next due date, transaction date, frequency and status\n\t\tdelete transaction.id;\n\t\tdelete transaction.primary_account;\n\t\tdelete transaction.next_due_date;\n\t\tdelete transaction.transaction_date;\n\t\tdelete transaction.frequency;\n\t\tdelete transaction.status;\n\t\tdelete transaction.related_status;\n\n\t\t// Retain the schedule's flag (if any), don't overwrite with the previous transaction's flag\n\t\ttransaction.flag = this.transaction.flag;\n\n\t\t// Merge the last transaction details into the transaction on the scope\n\t\tthis.transaction = angular.extend(this.transaction, transaction);\n\n\t\t// Depending on which field has focus, re-trigger the focus event handler to format/select the new value\n\t\tangular.forEach(angular.element(\"#amount, #category, #subcategory, #account, #quantity, #price, #commission, #memo\"), field => {\n\t\t\tif (field === document.activeElement) {\n\t\t\t\tthis.$timeout(() => angular.element(field).triggerHandler(\"focus\"));\n\t\t\t}\n\t\t});\n\t}", "set transaction(aValue) {\n this._transaction = aValue;\n }", "async rollbackTransaction() {\n }", "async rollbackTransaction() {\n }", "reconcile() {\n let first = this.transactions[0]\n\n if (this.shouldTransactionMerge(first, this.transactions)) {\n this.base = this.dispatch(this.base, first)\n return this.release(first)\n }\n\n return this.rollforward()\n }", "function startBatchTransaction() {}", "getQuotationclientDetails(context) {\n context.commit('getQuotationclientDetails')\n }", "async submitTransaction() {\n return await this.submitWithArguments(this.contracts[this.contractSelector.generateValue()].generateCallArguments());\n }", "existingTransaction(address) {\n return this.transactions.find(t => t.input.address === address);\n }", "existingTransaction(address) {\n return this.transactions.find(t => t.input.address === address);\n }", "function pollForTransactions() {\n\t\t$log.info('About to request transactions');\n\t\tbaseTransactions.getList({filter:$scope.filterOptions.filterText}).then(function(transactions) {\n\t\t\t$log.info('Got transactions');\n\t\t\t$scope.transactions = transactions;\n\t\t\tbaseTransactions = transactions;\n\t\t\tif (!angular.isDefined(polling))\n\t\t\t{\n\t\t\t\tpolling = $interval(pollForTransactions, 1000);\n\t\t\t\t// Cancel interval on page changes\n\t\t\t\t$scope.$on('$destroy', function(){\n\t\t\t\t\tif (angular.isDefined(polling)) {\n\t\t\t\t\t\t$interval.cancel(polling);\n\t\t\t\t\t\tpolling = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "get transactionId() {\n return this._transactionId;\n }", "static associate({ Transaction }) {\n // define association here\n }", "function startIdleTransaction(\n\t hub,\n\t transactionContext,\n\t idleTimeout,\n\t finalTimeout,\n\t onScope,\n\t customSamplingContext,\n\t heartbeatInterval,\n\t) {\n\t const client = hub.getClient();\n\t const options = (client && client.getOptions()) || {};\n\n\t let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n\t transaction = sample(transaction, options, {\n\t parentSampled: transactionContext.parentSampled,\n\t transactionContext,\n\t ...customSamplingContext,\n\t });\n\t if (transaction.sampled) {\n\t transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n\t }\n\t return transaction;\n\t}", "addTransactionToQueue(transaction){\n this.transactionQueue.push(transaction)\n }", "function dispatchInTransaction(action) {\n console.log(\"dispatchInTransaction\",action);\n\n if (currentTransaction) {\n currentTransaction.push(action);\n }\n dispatch(action);\n }", "get scope() {\n return this._scope;\n }", "function startIdleTransaction(\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n) {\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n let transaction = new idletransaction.IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n transaction = sample(transaction, options, {\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n ...customSamplingContext,\n });\n if (transaction.sampled) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n return transaction;\n}", "function globalTargetStore(txn){return SimpleDb.getStore(txn,DbTargetGlobal.store);}", "assignTransactionID() {\r\n this._lastAssignedID += 1; // We start the IDs from 1\r\n return this._lastAssignedID;\r\n }", "existingTransaction(address) {\n\t\treturn this.transactions.find(t => t.input.address === address);\n\t}", "getTransactionHistory(accountId) {\n if (lock.isBusy(accountId)) throwError('Service Unavailable', 503);\n\n this.logger.info('Getting trasaction history...', accountId);\n return { transactionHistory: [accountDatabase[accountId]] };\n }", "checkTransaction(transaction) {\n for (const key in transaction) {\n if (allowedTransactionKeys.indexOf(key) === -1) {\n logger.throwArgumentError(\"invalid transaction key: \" + key, \"transaction\", transaction);\n }\n }\n const tx = Object(lib_esm[\"g\" /* shallowCopy */])(transaction);\n if (tx.from == null) {\n tx.from = this.getAddress();\n }\n else {\n // Make sure any provided address matches this signer\n tx.from = Promise.all([\n Promise.resolve(tx.from),\n this.getAddress()\n ]).then((result) => {\n if (result[0].toLowerCase() !== result[1].toLowerCase()) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n return result[0];\n });\n }\n return tx;\n }", "function repoStartTransaction(repo, path, transactionUpdate, onComplete, unwatcher, applyLocally) {\n repoLog(repo, 'transaction on ' + path);\n // Initialize transaction.\n var transaction = {\n path: path,\n update: transactionUpdate,\n onComplete: onComplete,\n // One of TransactionStatus enums.\n status: null,\n // Used when combining transactions at different locations to figure out\n // which one goes first.\n order: LUIDGenerator(),\n // Whether to raise local events for this transaction.\n applyLocally: applyLocally,\n // Count of how many times we've retried the transaction.\n retryCount: 0,\n // Function to call to clean up our .on() listener.\n unwatcher: unwatcher,\n // Stores why a transaction was aborted.\n abortReason: null,\n currentWriteId: null,\n currentInputSnapshot: null,\n currentOutputSnapshotRaw: null,\n currentOutputSnapshotResolved: null\n };\n // Run transaction initially.\n var currentState = repoGetLatestState(repo, path, undefined);\n transaction.currentInputSnapshot = currentState;\n var newVal = transaction.update(currentState.val());\n if (newVal === undefined) {\n // Abort transaction.\n transaction.unwatcher();\n transaction.currentOutputSnapshotRaw = null;\n transaction.currentOutputSnapshotResolved = null;\n if (transaction.onComplete) {\n transaction.onComplete(null, false, transaction.currentInputSnapshot);\n }\n }\n else {\n validateFirebaseData('transaction failed: Data returned ', newVal, transaction.path);\n // Mark as run and add to our queue.\n transaction.status = 0 /* RUN */;\n var queueNode = treeSubTree(repo.transactionQueueTree_, path);\n var nodeQueue = treeGetValue(queueNode) || [];\n nodeQueue.push(transaction);\n treeSetValue(queueNode, nodeQueue);\n // Update visibleData and raise events\n // Note: We intentionally raise events after updating all of our\n // transaction state, since the user could start new transactions from the\n // event callbacks.\n var priorityForNode = void 0;\n if (typeof newVal === 'object' &&\n newVal !== null &&\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"contains\"])(newVal, '.priority')) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n priorityForNode = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"safeGet\"])(newVal, '.priority');\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(isValidPriority(priorityForNode), 'Invalid priority returned by transaction. ' +\n 'Priority must be a valid string, finite number, server value, or null.');\n }\n else {\n var currentNode = syncTreeCalcCompleteEventCache(repo.serverSyncTree_, path) ||\n ChildrenNode.EMPTY_NODE;\n priorityForNode = currentNode.getPriority().val();\n }\n var serverValues = repoGenerateServerValues(repo);\n var newNodeUnresolved = nodeFromJSON$1(newVal, priorityForNode);\n var newNode = resolveDeferredValueSnapshot(newNodeUnresolved, currentState, serverValues);\n transaction.currentOutputSnapshotRaw = newNodeUnresolved;\n transaction.currentOutputSnapshotResolved = newNode;\n transaction.currentWriteId = repoGetNextWriteId(repo);\n var events = syncTreeApplyUserOverwrite(repo.serverSyncTree_, path, newNode, transaction.currentWriteId, transaction.applyLocally);\n eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events);\n repoSendReadyTransactions(repo, repo.transactionQueueTree_);\n }\n}", "function startIdleTransaction(\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n ) {\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n transaction = sample(transaction, options, {\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n ...customSamplingContext,\n });\n if (transaction.sampled) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n return transaction;\n }", "mineTransactions() {\n //1. Retrieve the transaction pool's valid transaction\n const validTransactions = this.transactionPool.validTransaction();\n\n //2. Miner incentives, Miner rewards\n validTransactions.push(\n Transaction.rewardTransaction({ minerWallet: this.wallet })\n );\n\n //3. Add a block consisting of these transactions to the blockchain \n this.blockchain.addBlock({ transactions: validTransactions });\n\n //4. Broadcast the new updated blockchain\n this.pubsub.broadcastChain();\n\n //5. Clear the transaction pool\n this.transactionPool.clear();\n }", "_signTransaction(raw) {\n raw['from'] = this.address;\n\n return new Promise(function(resolve, reject) {\n web3.eth.sendTransaction(raw, function(err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n });\n });\n }", "async queryTxInclusion({ state }, txHash) {\n let iterations = state.txQueryIterations // 30 * 2s = 60s max waiting time\n while (iterations-- > 0) {\n try {\n await state.node.tx(txHash)\n break\n } catch (err) {\n // tx wasn't included in a block yet\n await new Promise(resolve =>\n setTimeout(resolve, state.txQueryTimeout)\n )\n }\n }\n if (iterations <= 0) {\n throw new Error(\n `The transaction was still not included in a block. We can't say for certain it will be included in the future.`\n )\n }\n }", "async doTransaction(func, allowIdChange = false) {\n if (this.txn) {\n return await this.processTransaction(func);\n }\n else {\n const oldThingStore = this.thingStore;\n const oldUserStore = this.userStore;\n const txn = this.db().transaction([this.storeName, this.users], 'readwrite');\n const txnPromise = promiseFor(txn);\n const oldId = this.nextId;\n const oldThings = this.transactionThings;\n const oldTxnPromise = this.transactionPromise;\n let result = null;\n this.txn = txn;\n this.transactionPromise = txnPromise;\n this.thingStore = txn.objectStore(this.storeName);\n this.userStore = txn.objectStore(this.users);\n this.transactionThings = new Set();\n try {\n result = await this.processTransaction(func);\n }\n finally {\n this.storeDirty(oldThings);\n if (oldId !== this.nextId && !allowIdChange) {\n // tslint:disable-next-line:no-floating-promises\n this.store();\n }\n //await txnPromise\n this.txn = null;\n this.thingStore = oldThingStore;\n this.userStore = oldUserStore;\n this.transactionPromise = oldTxnPromise;\n }\n return txnPromise.then(() => result);\n //return result\n }\n }", "createTransaction(recipient, amount,blockchain, transactionPool){\n\n this.balance = this.calculateBalance(blockchain);\n\n if(amount > this.balance){\n console.log(`Amount: ${amount} exceeds the current balance: ${this.balance}`);\n return;\n }\n\n let transaction = transactionPool.existingTransaction(this.publicKey);\n\n if(transaction){\n // creates more outputs\n transaction.update(this,recipient,amount)\n }\n else{\n // creates a new transaction and updates the transaction pool\n transaction = Transaction.newTransaction(this,recipient,amount);\n transactionPool.updateOrAddTransaction(transaction);\n }\n\n return transaction;\n\n }", "doTransaction() {\n if (this.currentList != undefined)\n this.currentList.items[this.itemIndex] = this.newItem;\n }", "findTenantByIdTransaction(idTransaction, params) {\n return this.request.get(`tenant-transaction/${idTransaction}`, {\n params\n });\n }", "begin() {\n this.transactions.push([]);\n this.currentTransactionIndex++;\n }", "dispatchTransaction(transaction) {\n if (this.isCapturingTransaction) {\n if (!this.capturedTransaction) {\n this.capturedTransaction = transaction;\n return;\n }\n transaction.steps.forEach((step) => {\n var _a;\n return (_a = this.capturedTransaction) === null || _a === void 0 ? void 0 : _a.step(step);\n });\n return;\n }\n const state = this.state.apply(transaction);\n const selectionHasChanged = !this.state.selection.eq(state.selection);\n this.view.updateState(state);\n this.emit(\"transaction\", {\n editor: this,\n transaction\n });\n if (selectionHasChanged) {\n this.emit(\"selectionUpdate\", {\n editor: this,\n transaction\n });\n }\n const focus2 = transaction.getMeta(\"focus\");\n const blur2 = transaction.getMeta(\"blur\");\n if (focus2) {\n this.emit(\"focus\", {\n editor: this,\n event: focus2.event,\n transaction\n });\n }\n if (blur2) {\n this.emit(\"blur\", {\n editor: this,\n event: blur2.event,\n transaction\n });\n }\n if (!transaction.docChanged || transaction.getMeta(\"preventUpdate\")) {\n return;\n }\n this.emit(\"update\", {\n editor: this,\n transaction\n });\n }", "async rollbackTransaction() {\n const sqlStatement = `rollback transaction`\n\n if (this.activeTransaction === true) {\n if (this.status.sqlTrace) {\n this.status.sqlTrace.write(`${sqlStatement};\\n\\n`);\n }\n this.activeTransaction = false;\n await this.pgClient.query(sqlStatement);\n }\n }", "function repoGetAncestorTransactionNode(repo, path) {\n var front;\n // Start at the root and walk deeper into the tree towards path until we\n // find a node with pending transactions.\n var transactionNode = repo.transactionQueueTree_;\n front = pathGetFront(path);\n while (front !== null && treeGetValue(transactionNode) === undefined) {\n transactionNode = treeSubTree(transactionNode, front);\n path = pathPopFront(path);\n front = pathGetFront(path);\n }\n return transactionNode;\n}", "viewTransaction({ commit }, payload){\n return new Promise((resolve, reject) => {\n $axios.get(`/transaction/${payload}/view`)\n .then((res) => {\n commit('DATA_ORDER', res.data.data)\n resolve(res.data)\n })\n })\n }", "populateTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n const tx = yield __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ethersproject_properties__[\"f\" /* resolveProperties */])(this.checkTransaction(transaction));\n if (tx.to != null) {\n tx.to = Promise.resolve(tx.to).then((to) => this.resolveName(to));\n }\n if (tx.gasPrice == null) {\n tx.gasPrice = this.getGasPrice();\n }\n if (tx.nonce == null) {\n tx.nonce = this.getTransactionCount(\"pending\");\n }\n if (tx.gasLimit == null) {\n tx.gasLimit = this.estimateGas(tx).catch((error) => {\n if (forwardErrors.indexOf(error.code) >= 0) {\n throw error;\n }\n return logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", __WEBPACK_IMPORTED_MODULE_1__ethersproject_logger__[\"a\" /* Logger */].errors.UNPREDICTABLE_GAS_LIMIT, {\n error: error,\n tx: tx\n });\n });\n }\n if (tx.chainId == null) {\n tx.chainId = this.getChainId();\n }\n else {\n tx.chainId = Promise.all([\n Promise.resolve(tx.chainId),\n this.getChainId()\n ]).then((results) => {\n if (results[1] !== 0 && results[0] !== results[1]) {\n logger.throwArgumentError(\"chainId address mismatch\", \"transaction\", transaction);\n }\n return results[0];\n });\n }\n return yield __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ethersproject_properties__[\"f\" /* resolveProperties */])(tx);\n });\n }", "updateOrAddTransaction(transaction) {\n //since we support the ability to update existing transactions\n //there is a possibility that we may recieve a transaction object that already exists\n //hence we look at the existing pool to find any redundant transaction\n let transactionWithId = this.transactions.find(t => t.id === transaction.id);\n //if no existing transaction exists in the pool transactionWithId will be undefined\n\n //if the transaction already exists replace the previous transaction with the new one\n if (transactionWithId) {\n this.transactions[this.transactions.indexOf(transactionWithId)] = transaction;\n }else {\n //if the transaction received is completely new append it to the transactions pool\n this.transactions.push(transaction);\n }\n }", "function h$stmCommitTransaction() {\n var t = h$currentThread.transaction;\n var tvs = t.tvars;\n var wtv, i = tvs.iter();\n if(t.parent === null) { // top-level commit\n ;\n // write new value to TVars and collect blocked threads\n var thread, threadi, blockedThreads = new h$Set();\n while((wtv = i.nextVal()) !== null) {\n h$stmCommitTVar(wtv.tvar, wtv.val, blockedThreads);\n }\n // wake up all blocked threads\n threadi = blockedThreads.iter();\n while((thread = threadi.next()) !== null) {\n h$stmRemoveBlockedThread(thread.blockedOn, thread);\n h$wakeupThread(thread);\n }\n // commit our new invariants\n for(var j=0;j<t.invariants.length;j++) {\n h$stmCommitInvariant(t.invariants[j]);\n }\n } else { // commit subtransaction\n ;\n var tpvs = t.parent.tvars;\n while((wtv = i.nextVal()) !== null) tpvs.put(wtv.tvar, wtv);\n t.parent.invariants = t.parent.invariants.concat(t.invariants);\n }\n h$currentThread.transaction = t.parent;\n}", "get state() {\n if (!this._state)\n this.startState.applyTransaction(this);\n return this._state;\n }", "[GET_STATE_STOCKTRANSFERS] (context, params) {\n if (typeof params !== 'undefined') {\n context.state.tablestate = params\n }\n console.log(context.state.tablestate + 'state table state testing')\n \n context.commit('CLEAR_STOCKTRANSFER')\n return new Promise((resolve, reject) => {\n ApiService.setHeader()\n ApiService.query('/api/stocktransfer/state', {\n params: context.state.tablestate,\n type: 0\n })\n .then(result => {\n console.log(result.data)\n context.commit('SET_STOCKTRANSFERS', { results: result.data })\n resolve(result)\n })\n .catch(err => {\n reject(err)\n })\n })\n }", "getScope() {}", "get transactionInProgress() {\n return this._open && !!this._inProgressTransaction;\n }", "function h$stmCommitTransaction() {\n var t = h$currentThread.transaction;\n var tvs = t.tvars;\n var wtv, i = tvs.iter();\n if(t.parent === null) { // top-level commit\n ;\n // write new value to TVars and collect blocked threads\n var thread, threadi, blockedThreads = new h$Set();\n while((wtv = i.nextVal()) !== null) {\n h$stmCommitTVar(wtv.tvar, wtv.val, blockedThreads);\n }\n // wake up all blocked threads\n threadi = blockedThreads.iter();\n while((thread = threadi.next()) !== null) {\n h$stmRemoveBlockedThread(thread.blockedOn, thread);\n h$wakeupThread(thread);\n }\n // commit our new invariants\n for(var j=0;j<t.invariants.length;j++) {\n h$stmCommitInvariant(t.invariants[j]);\n }\n } else { // commit subtransaction\n ;\n var tpvs = t.parent.tvars;\n while((wtv = i.nextVal()) !== null) tpvs.put(wtv.tvar, wtv);\n t.parent.invariants = t.parent.invariants.concat(t.invariants);\n }\n h$currentThread.transaction = t.parent;\n}", "function h$stmCommitTransaction() {\n var t = h$currentThread.transaction;\n var tvs = t.tvars;\n var wtv, i = tvs.iter();\n if(t.parent === null) { // top-level commit\n ;\n // write new value to TVars and collect blocked threads\n var thread, threadi, blockedThreads = new h$Set();\n while((wtv = i.nextVal()) !== null) {\n h$stmCommitTVar(wtv.tvar, wtv.val, blockedThreads);\n }\n // wake up all blocked threads\n threadi = blockedThreads.iter();\n while((thread = threadi.next()) !== null) {\n h$stmRemoveBlockedThread(thread.blockedOn, thread);\n h$wakeupThread(thread);\n }\n // commit our new invariants\n for(var j=0;j<t.invariants.length;j++) {\n h$stmCommitInvariant(t.invariants[j]);\n }\n } else { // commit subtransaction\n ;\n var tpvs = t.parent.tvars;\n while((wtv = i.nextVal()) !== null) tpvs.put(wtv.tvar, wtv);\n t.parent.invariants = t.parent.invariants.concat(t.invariants);\n }\n h$currentThread.transaction = t.parent;\n}" ]
[ "0.71320355", "0.6801526", "0.67532086", "0.66450465", "0.66363716", "0.65982896", "0.64260983", "0.63593644", "0.6305192", "0.6264725", "0.6010928", "0.5956395", "0.59120536", "0.5901681", "0.5845219", "0.5836138", "0.5835769", "0.58170676", "0.5812717", "0.5795866", "0.5762539", "0.5759324", "0.5756263", "0.56976986", "0.56806964", "0.56073135", "0.56055695", "0.5605496", "0.5562726", "0.555272", "0.55481833", "0.5536092", "0.55333674", "0.55260295", "0.55095637", "0.55093926", "0.55024123", "0.55015177", "0.5448921", "0.54417515", "0.5404005", "0.5400926", "0.53864473", "0.53838414", "0.5382207", "0.53757054", "0.5347232", "0.5347086", "0.53419703", "0.5335899", "0.5332511", "0.5315467", "0.52789783", "0.5272426", "0.5265778", "0.5260229", "0.5254759", "0.5254759", "0.5240094", "0.5236787", "0.52285457", "0.5228394", "0.5217584", "0.5217584", "0.5211527", "0.5201385", "0.51988447", "0.5187887", "0.51830155", "0.5179103", "0.51779175", "0.51688814", "0.51548564", "0.51546746", "0.5154666", "0.5148764", "0.5144339", "0.5141992", "0.51383346", "0.513707", "0.51365054", "0.51305306", "0.5128902", "0.51286256", "0.5109068", "0.5101856", "0.5101563", "0.5098757", "0.50955814", "0.5092227", "0.50875354", "0.50837517", "0.5081626", "0.5080311", "0.5074369", "0.5054491", "0.5052645", "0.5051956", "0.5045703", "0.5045703" ]
0.7096723
1
Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.
function escapeHtml(rawText) { return rawText .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&apos;') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "xss(str) {\n const lt = /</g;\n const gt = />/g;\n const ap = /'/g;\n const ic = /\"/g;\n return str.toString().replace(lt, \"&lt;\").replace(gt, \"&gt;\").replace(ap, \"&#39;\").replace(ic, \"&#34;\");\n }", "function sanitizeHTML(strings) {\n const entities = {'&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;'};\n let result = strings[0];\n for (let i = 1; i < arguments.length; i++) {\n result += String(arguments[i]).replace(/[&<>'\"]/g, (char) => {\n return entities[char];\n });\n result += strings[i];\n }\n return result;\n}", "function sanitize (text) {\n return text.split('').map(function (char) {\n return char === '<' ? '&lt;' : char === '>' ? '&gt;' : char\n ;}).join('');\n }", "function sanitize(string) {\n return string.replace(/[&<>]/g, '');\n }", "function _sanitizeInput(str) {\n return str.replace(/[`~!@#$%^&*()|+=?;:'\"<>\\{\\}\\[\\]\\\\\\/]/g, '');\n}", "function sanitize(str) {\n return typeof str === 'string' ? str.replace(/&(?!\\w+;)/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;') : str;\n}", "function unsanitize(input) {\n input = input.replace(/&amp;/g, \"&\");\n input = input.replace(/&lt;/g, \"<\");\n input = input.replace(/&gt;/g, \">\");\n input = input.replace(/&quot;/g, '\"');\n input = input.replace(/&#x27;/g, \"'\");\n input = input.replace(/&#x2F;/g, \"/\");\n return input;\n}", "function sanitize(str){\n return str.replace(\n /([^a-zA-Z0-9`!\\$%\\^\\*\\(\\)\\-_\\+=\\[\\]\\{\\};'#:@~,\\.\\/<>\\?\\|])/g,\n function(a){\n if(a=='\"'||a=='\\\\')\n // This is going into a string with double quotes, so escape those\n return'\\\\'+a;\n else if(a==' ')\n return a;\n else if(a=='\\t')\n return '\\\\t';\n else if(a=='\\r')\n return '\\\\r';\n else if(a=='\\n')\n return '\\\\n';\n else return '\\\\x'+((256+a.charCodeAt(0))&0x1ff).toString(16).slice(1)\n }\n );\n }", "function replaceSpecialCharactersHTML(str) {\r\n\tif (str != \"undefined\" && str != \"\" && str != null) {\r\n\t\tstr = str.replace(/\\'/gi, \"&lsquo;\");\r\n\t\tstr = str.replace(/\\xE9/gi, \"&eacute;\");\r\n\t\tstr = str.replace(/\\`/gi, \"&lsquo;\");\r\n str = str.replace(/\\\"/gi, \"\\\\\\\"\");\r\n\t}\r\n\treturn str;\r\n}", "function htmlSpecialChars(str){\n\t'use strict';\n\tvar map = {\n\t\t'&': '&amp;',\n\t\t'<': '&lt;',\n\t\t'>': '&gt;',\n\t\t'\"': '&quot;',\n\t\t\"'\": '&#039;'\n\t};\n\treturn str.replace(/[&<>\"']/g, function(m) { return map[m]; });\n}", "function unhtmlspecialchars(str)\n{\n\tf = new Array(/&lt;/g, /&gt;/g, /&quot;/g, /&amp;/g);\n\tr = new Array('<', '>', '\"', '&');\n\n\tfor (var i in f)\n\t{\n\t\tstr = str.replace(f[i], r[i]);\n\t}\n\n\treturn str;\n}", "function htmlSpecialChars(str, quote_style)\r\n{\r\n\tstr = str.replace(/&/ig,\"&amp;\");\r\n\tif(!quote_style || quote_style==1)\r\n\t{\r\n\t\tstr = str.replace(/\\\"/ig,\"&quot;\")\r\n\t\tif(quote_style==1)\r\n\t\t\tstr = str.replace(/\\'/ig,\"&#039;\")\r\n\t}\r\n\tstr = str.replace(/\\>/ig,\"&gt;\");\r\n\tstr = str.replace(/\\</ig,\"&lt;\");\r\n\treturn str;\r\n}", "function sanitize(s) {\n return s\n .replaceAll('=E2=80=8A', '')\n .replaceAll('=E2=80=8B', '')\n .replaceAll('=E2=80=8C', '')\n .replaceAll('=C2=A0', '<br>')\n .replaceAll('=E2=80=99', \"'\")\n .replaceAll(/[\\t\\x20]$/gm, '')\n // Remove hard line breaks preceded by `=`. Proper `Quoted-Printable`-\n // encoded data only contains CRLF line endings, but for compatibility\n // reasons we support separate CR and LF too.\n .replaceAll(/=(?:\\r\\n?|\\n|$)/g, '')\n // Decode escape sequences of the form `=XX` where `XX` is any\n // combination of two hexidecimal digits. For optimal compatibility,\n // lowercase hexadecimal digits are supported as well. See\n // https://tools.ietf.org/html/rfc2045#section-6.7, note 1.\n .replaceAll(/=([a-fA-F0-9]{2})/g, function (_match, target) {\n var codePoint = parseInt(target, 16);\n return String.fromCharCode(codePoint);\n });\n}", "function sanitizeText(html) {\n\t\tif (typeof html !== 'string') {\n\t\t\treturn html;\n\t\t}\n\t\tvar value = \"<div>\" + html.replace(/(\\s)(on(?:\\w+))(\\s*=)/, '$1xss-$2$3') + \"</div>\";\n\t\tvar elems = $($.parseHTML(value, null, false));\n\n\t\telems.find('*').each(function() {\n\t\t\tsanitizeElement(this);\n });\n\n\t\treturn elems.html();\n\t}", "function replace_special_chars(str) {\n\tlet new_str = str.replaceAll(\"&quot;\", '\"')\n\t\t.replaceAll(\"&rdquo;\", '\"')\n\t\t.replaceAll(\"&ldquo;\", '\"')\n\t\t.replaceAll(\"&lsquo;\", \"'\")\n\t\t.replaceAll(\"&rsquo;\", \"'\")\n\t\t.replaceAll(\"‘\", \"'\")\n\t\t.replaceAll(\"“\", '\"')\n\t\t.replaceAll(\"”\", '\"')\n\t\t.replaceAll(\"–\", \"-\")\n\t\t.replaceAll(\"&equals;\", \"=\")\n\t\t.replaceAll(\"&minus;\", \"-\")\n\t\t.replaceAll(\"&plus;\", \"+\")\n\t\t.replaceAll(\"&prime;\", \"*\")\n\t\t.replaceAll(\"&times;\", \"×\")\n\t\t.replaceAll(\"&#39;\", \"'\")\n\t\t.replaceAll(\"&#160;\", \"&nbsp;\");\n\treturn new_str;\n}", "function __filter($str) {\r\n $str = $str.replace(/</g,\"&lt;\");\r\n $str = $str.replace(/>/g,\"&gt;\");\r\n $str = $str.replace(/\\\"/g,\"&quot;\");\r\n return $str;\r\n}", "function sanitizeString(str){\n str = str.replace(/[^a-z0-9áéíóúñü \\.,_-]/gim,\"\");\n return str.trim();\n}", "function rhtmlspecialchars(str) {\n if (typeof (str) == \"string\") {\n str = str.replace(/&gt;/ig, \">\");\n str = str.replace(/&lt;/ig, \"<\");\n str = str.replace(/&#039;/g, \"'\");\n str = str.replace(/&quot;/ig, '\"');\n str = str.replace(/&amp;/ig, '&'); /* must do &amp; last */\n }\n return str;\n}", "function formatXSS(string) {\n let tagsToReplace = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;'\n };\n return string.replace(/[&<>]/g, (tag) => tagsToReplace[tag] || tag);\n}", "function htmlFilter(c) {\n /* Used to escape HTML-sensitive characters in a string */\n switch (c) {\n case \"&\":\n return \"&amp;\";\n case \"<\":\n return \"&lt;\";\n case \">\":\n return \"&gt;\";\n case \"\\\"\":\n return \"&quot;\";\n default:\n return c;\n }\n }", "function xkit_htmlspecialchars(str) {\n\t\tif (typeof(str) == \"string\") {\n\t\t\tstr = str.replace(/&/g, \"&amp;\");\n\t\t\tstr = str.replace(/\"/g, \"&quot;\");\n\t\t\tstr = str.replace(/'/g, \"&#039;\");\n\t\t\tstr = str.replace(/</g, \"&lt;\");\n\t\t\tstr = str.replace(/>/g, \"&gt;\");\n\t\t}\n\t\treturn str;\n\t}", "function cleanstringSpecial(str) {\n\tif(str){\n\tvar newStr = str.trim().toLowerCase();\n\tnewStr = newStr.replace(\"é\",\"e\");\n\tnewStr = newStr.replace(\"è\",\"e\");\n\tnewStr = newStr.replace(\"ç\",\"c\");\n\tnewStr = newStr.replace(\"-\",\" \");\n\tnewStr = newStr.replace(\"ë\",\"e\");\n\tnewStr = newStr.replace(\".\",\"\");\n\tnewStr = newStr.replace(/é/g , \"e\");\n\tnewStr = newStr.replace(/è/g , \"e\");\n\tnewStr = newStr.replace(/ç/g , \"c\");\n\tnewStr = newStr.replace(/_/g , \" \");\n\tnewStr = newStr.replace(/ë/g , \"e\");\n\tnewStr = newStr.replace(/\\./g , \"\");\n\tnewStr = newStr.replace(\" \",\" \");\n\treturn newStr;\n\t}\n}", "function safeTagsRegex(str) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}", "function sanitize(unsafe) {\n var filtered = unsafe;\n\n var badPatterns = [\n // javascript:function(); or variants\n /j\\w*a\\w*v\\w*a\\w*s\\w*c\\w*r\\w*i\\w*p\\w*t\\w*:(.*;)?/i,\n // <script> tag, greedy until close >\n /<\\w*s\\w*c\\w*r\\w*i\\w*p\\w*t\\w*.*>/i,\n // </script> tag\n /<\\w*\\/\\w*s\\w*c\\w*r\\w*i\\w*p\\w*t\\w*>/i\n ];\n\n for (var i=0; i < badPatterns.length; ++i) {\n filtered = filtered.replace(badPatterns[i], \"\");\n }\n\n return filtered;\n}", "function escapeSpecialCharacters(str) {\n // Replace \" with two ' b/c \" cannot be escaped properly in output onto DOM\n // Search for special characters \\, ', (, ) globally in string\n // and insert a forward slash \\ to escape those characters\n str = str.replace(/\\\"/gi,'\\'\\'').replace(/[\\\\\\'()]/gi, '\\\\$&');\n return str;\n}", "function cleanUpString(strSpecials) \n{\n strSpecials = stripString(strSpecials, \"%20\", \" \");\n strSpecials = stripString(strSpecials, \"%22\", \"\\\"\");\n strSpecials = stripString(strSpecials, \"%29\", \")\");\n strSpecials = stripString(strSpecials, \"%28\", \"(\");\n strSpecials = stripString(strSpecials, \"%2C\", \",\");\n\n\n var inParens = 0;\n for (var i = 0; i < strSpecials.length; i++)\n {\n if (strSpecials[i]==\"(\")\n inParens++;\n if (strSpecials[i]==\")\")\n inParens--;\n \n if ((inParens > 0) && (strSpecials[i]==\",\"))\n {\n var post = strSpecials.slice(i); \n strSpecials = strSpecials.replace(post,\"\") ;\n post = post.replace(\",\",\" \");\n\n strSpecials = strSpecials + post;\n }\n \n }\n \n\n strSpecials = stripString(strSpecials, \"%3C\", \"<\");\n strSpecials = stripString(strSpecials, \"%3E\", \">\");\n strSpecials = stripString(strSpecials, \"%23\", \"#\");\n strSpecials = stripString(strSpecials, \"%3A\", \":\");\n strSpecials = stripString(strSpecials, \"%3B\", \",\");\n strSpecials = stripString(strSpecials, \"%3D\", \"=\");\n \n strSpecials = stripString(strSpecials, \"</strong>\", \"\");\n strSpecials = stripString(strSpecials, \"<strong>\", \"\");\n strSpecials = stripString(strSpecials, \"</em>\", \"\");\n strSpecials = stripString(strSpecials, \"<em>\", \"\");\n strSpecials = stripString(strSpecials, \"%u2013\", \"-\");\n strSpecials = stripStringRegEx(strSpecials, \"<b\", \">\");\n strSpecials = stripString(strSpecials, \"</b>\", \"\");\n strSpecials = stripStringRegEx(strSpecials, \"<h\", \">\");\n strSpecials = stripStringRegEx(strSpecials, \"</h\", \">\");\n \n strSpecials = stripString(strSpecials, \"</a>\", \"\"); \n \n \n strSpecials = stripStringRegEx(strSpecials, \"<t\", \">\");\n strSpecials = stripStringRegEx(strSpecials, \"</t\", \">\");\n \n \n while (strSpecials.search(/%../) != -1) {\n strSpecials = strSpecials.replace(/%../, \"\");\n }\n \n \n\n return strSpecials;\n}", "function sanitize (str) {\n // Turn characters to lower string, remove space at the beginning and end,\n // replace multiple spaces in the middle by single spaces\n return str.toLowerCase().replace(/\\s+/g, ' ').replace(/^\\s+|\\s+$/g, '')\n}", "function wrapSanitizer(userInputString) {\n\t//Note:\n\t//sanitizer.sanitize('your dirty string'); // Strips unsafe tags and attributes from html.\n\t//sanitizer.escape('your dirty string'); // Escapes HTML special characters in attribute values as HTML entities\n\treturn sanitizer.escape(sanitizer.sanitize(userInputString));\n}", "function escapeHTML(s) {\n return s.split('&').join('&amp;').split('<').join('&lt;').split('\"').join('&quot;');\n}", "function sanitize(string) {\n return string.replace(/[\\u2018\\u2019]/g, \"'\").replace(/[\\u201C\\u201D]/g, '\"');\n}", "function escapeHtml(unsafe) {\n return unsafe.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&#039;\");\n}", "function escapeHtml(unsafe_string) {\n return unsafe_string\n .replace(/&/g, \"&amp;\")\n .replace(/>/g, \"&gt;\")\n .replace(/</g, \"&lt;\")\n .replace(/'/g, \"&#39;\")\n .replace(/\"/g, \"&#34;\");\n}", "function XSSPatcher(texte){\n return texte\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&&#039;\")\n }", "function replaceSpecialChars(string) {\n string = string.replace(/[!\"#%&'()*+,./;<=>@[\\]^`{|}~\\\\]/g, \"\");\n return string.replace(/\\s/g, \"_\");\n }", "function clean_string_no_special(input_object) {\n var input_string = input_object.value;\n\n // remove all non alpha numeric\n var first_pass = input_string.replace(/[^a-zA-Z0-9_\\ \\.\\\\\\#\\-_\\/]/g, \"\");\n var second_pass = first_pass.replace(/\\./g, \"-\");\n input_object.value = second_pass;\n }", "function htmlspecialchars(text) {\r\n return text\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n}", "function replaceHTMLChars(value) {\n\treturn value.replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\\'').replace(/&quot;/gi,'\"');\n}", "function basic_clean(string){\n\n \t// replace nonstandard apostrophes\n \t//string = string.replace(/[\\x93\\x94]+/gi, '\"')\n \tstring = string.replace(/[\\u0093\\u0094\\u201C\\u201D]+/gi, '\"')\n\n \t//string = string.replace(/[\\x91\\x92]+/gi, \"'\")\n \tstring = string.replace(/[\\u0091\\u0092\\u2018\\u2019\\u201B\\u02BC\\uFF07\\u07F4\\u07F5]+/gi, \"'\")\n\n \t// replace non-standard hyphens\n \tstring = string.replace(/\\s*[\\u2013\\u2014\\u2E3A\\u2E3B\\uFE58\\uFE63\\uFF0D]\\s*/gi, ' - ')\n\n\t// replace ellipsis char with '...'\n \tstring = string.replace(/(\\s*\\u2026\\s*)+/gi, '... ')\n\n \t// replace non-standard full stops\n \tstring = string.replace(/\\s*[\\u0701\\u0702\\u2E3C\\uFE52\\uFF0E]+\\s*/gi, '. ')\n\n \t// clean out nonprinting chars except NL, CR, TAB\n \tstring = string.replace(/[^\\x09\\x0A\\x0D\\x20-\\x7E\\x80-\\xFF]+/gi, '')\n\n \t// replace ’S with 's\n \tstring = string.replace(/\\'S\\s*/gi, \"'s \")\n\n \t// replace duplicate spaces\n \tstring = string.replace(/[\\xA0\\x09\\x20]+/gi, ' ')\n \n \treturn string;\n}", "function replaceSpecialChars(value) {\n return value.replace(/[\\&\\:\\(\\)\\[\\\\\\/]/g, ' ').replace(/\\s{2,}/g, ' ').replace(/^\\s/, '').replace(/\\s$/, '').split(' ').join('*');\n }", "function escapeHtml(unsafe) {\n return unsafe\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n}", "function SafeHtml(){}", "function quoteHTML(s) {\r\n\ts = s.replace(/&/g, \"&amp;\");\r\n\ts = s.replace(/</g, \"&lt;\");\r\n\ts = s.replace(/>/g, \"&gt;\");\r\n\treturn s;\r\n }", "function cleanTextInput(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}", "function escapeHtml(string)\n{\n return String(string).replace(/[&<>\"'\\/]/g, function (aChar)\n {\n return entityMap[aChar];\n });\n}", "function escapeHTML(s) {\n return s.split(\"&\").join(\"&amp;\").\n\tsplit(\"<\").join(\"&lt;\").split(\">\").join(\"&gt;\");\n}", "escapeHTML(text) {\n const replacers = {'<': '&lt;', '>': '&gt;', '&': '&amp;', '\"': '&quot;'};\n return String(text || '').replace(/[<>&\"]/g, (x) => { return replacers[x]; });\n }", "async function _sanitizeHtml() {\n user.identifier = sanitizeHtml(user.identifier).toLocaleLowerCase();\n user.password = sanitizeHtml(user.password);\n user.ip = sanitizeHtml(user.ip);\n }", "function clean_string_no_special(input_object) {\n var input_string = input_object.value;\n\n // remove all non alpha numeric\n var first_pass = input_string.replace(/[^a-zA-Z0-9_\\ \\.\\\\\\#\\-_\\/]/g, \"\");\n\n input_object.value = first_pass;\n}", "function escapeHtml(unsafe) {\n return (String(unsafe)).replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\").replace(/'/g, \"&#039;\");\n}", "function htmlspecialchars (string, quote_style) {\n // http://kevin.vanzonneveld.net\n // + original by: Mirek Slugen\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + bugfixed by: Nathan\n // + bugfixed by: Arno\n // + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // - depends on: get_html_translation_table\n // * example 1: htmlspecialchars(\"<a href='test'>Test</a>\", 'ENT_QUOTES');\n // * returns 1: '&lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;'\n\n var histogram = {}, symbol = '', tmp_str = '', i = 0;\n tmp_str = string.toString();\n\n if (false === (histogram = get_html_translation_table('HTML_SPECIALCHARS', quote_style))) {\n return false;\n }\n\n\t// first, do &amp;\n\ttmp_str = tmp_str.split('&').join(histogram['&']);\n\t\n\t// then do the rest\n for (symbol in histogram) {\n\t\tif (symbol != '&') {\n\t\t\tentity = histogram[symbol];\n\t tmp_str = tmp_str.split(symbol).join(entity);\n\t\t}\n }\n\n return tmp_str;\n}", "function escape(s) {\n // this should be safe since there is no CJK contains \"&\", \"<\"\n return s.replace(/<|&/g, escapeRepl);\n}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function sanitize(s) {\n\tvar t = s;\n\tObject.keys(sanitizeReplacements).forEach(function(key) {\n\t\tvar val = sanitizeReplacements[key];\n\t\tt = t.replace(new RegExp(key, 'gmi'), val);\n\t});\n\treturn t;\n}", "function escapeSpecialChar(str){\n var tmp = str.replace(/&/g, \"&amp;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&apos;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/{/g, \"&#123;\").replace(/}/g, \"&#125;\");\n return tmp;\n}", "function deentityfy(inputString) {\n var entities = {\n '<':'&lt;',\n '>':'&gt;',\n '&':'&amp;',\n '\\'':'&quot;',\n '\"':'&dquot;'\n };\n var outputString = '';\n var i;\n for (i = 0; i < inputString.length; i++) {\n var currChar = inputString[i];\n outputString += typeof entities[currChar] === 'undefined' ? currChar : entities[currChar];\n }\n return outputString;\n}", "function initEscHtml() {\r\n var escd = {\"<\":\"&lt;\",\">\":\"&gt;\",\"&\":\"&amp;\",\"'\":\"&#039;\",'\"':\"&quot;\"};\r\n\r\n escHtml = function (s) {\r\n s = s.split(\"\");\r\n var r = \"\";\r\n\r\n for (var i = 0; i < s.length; i++) {\r\n r += escd[s[i]] != null ? escd[s[i]] : s[i];\r\n }\r\n\r\n return r;\r\n };\r\n}", "function sanitise(s){\n s = s.toLowerCase();\n if(!valid.test(s)){ \n s = s.replace(rep,''); \n }\n input.value = s;\n s = s.replace(/\\s/g,'$');\n if(s){\n draw(s);\n }\n }", "function escapeHtml(unsafe) {\n if (unsafe == null) {\n return \"\";\n }\n return unsafe\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n}", "function SafeHtml() { }", "function SafeHtml() { }", "function SafeHtml() { }", "function escapeHTML(s) {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "function replaceSpecialChars(textToChange){\n newText = textToChange.replace('&amp;','&').replace('&gt;','>').replace('&lt;','<');\n return newText;\n}", "function escapeHtml(str){\n str = str.replace(/&/g, '&amp;');\n str = str.replace(/>/g, '&gt;');\n str = str.replace(/</g, '&lt;');\n str = str.replace(/\"/g, '&quot;');\n str = str.replace(/'/g, '&#x27;');\n str = str.replace(/`/g, '&#x60;');\n return str;\n}", "function sanitize(value) {\n value = value || '';\n\n return value\n .replace('ß', 'ss')\n .replace('ä', 'ae')\n .replace('ö', 'oe')\n .replace('ü', 'ue')\n .replace('Ä', 'Ae')\n .replace('Ö', 'Oe')\n .replace('Ü', 'Ue')\n .replace(/\\s/g, '')\n .replace(/\\./g, '');\n}", "function S(a){\n// HTML encode: Replace < > & ' and \" by corresponding entities.\nreturn void 0!=a?ya.test(a)&&(\"\"+a).replace(Aa,P)||a:\"\"}", "function clean( w ){\n\treturn w.replace(/[^\\d\\w\\s,().\\?\\/\\\\n\\\\t{}<>=\\\"\\\":%-]/gi, '') // remove special chars\n\t\t\t.replace(/\\s+/g, \" \") // remove extra spaces\n\t\t\t.trim(); // remove trailing chars\n}", "function replaceSpecialCharacters(str) {\n if (str != \"undefined\" && str != \"\" && str != null) {\n str = str.replace(/\\'/gi, \"&lsquo;\");\n str = str.replace(/\\xE9/gi, \"&eacute;\");\n str = str.replace(/\\`/gi, \"&lsquo;\");\n }\n return str;\n}", "function sanitizeHtml(unsafeHtmlInput) {\n try {\n var containerEl = getInertElement();\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n var unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n var mXSSAttempts = 5;\n var parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n DOM.setInnerHTML(containerEl, unsafeHtml);\n if (DOM.defaultDoc().documentMode) {\n // strip custom-namespaced attributes on IE<=11\n stripCustomNsAttrs(containerEl);\n }\n parsedHtml = DOM.getInnerHTML(containerEl);\n } while (unsafeHtml !== parsedHtml);\n var sanitizer = new SanitizingHtmlSerializer();\n var safeHtml = sanitizer.sanitizeChildren(DOM.getTemplateContent(containerEl) || containerEl);\n // Clear out the body element.\n var parent_1 = DOM.getTemplateContent(containerEl) || containerEl;\n for (var _i = 0, _a = DOM.childNodesAsList(parent_1); _i < _a.length; _i++) {\n var child = _a[_i];\n DOM.removeChild(parent_1, child);\n }\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__[\"isDevMode\"])() && sanitizer.sanitizedSomething) {\n DOM.log('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');\n }\n return safeHtml;\n }\n catch (e) {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n inertElement = null;\n throw e;\n }\n}", "function escapeHTML(s) {\n return ensureString(s).replace(/[<>&\"']/g, c => HTML_ESCAPES[c]);\n}", "function purifyHtml(input, allowed) {\n if (!_.isString(input) || input.indexOf(\"<\") < 0) {\n return input;\n }\n if (allowed === undefined) {\n allowed = default_allowed;\n }\n if (!allowed_split[allowed]) {\n allowed_split[allowed] = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n }\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed_split[allowed].indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n }", "function escapeHtml(string){\n\tvar entityMap = {\n\t\t \"&\": \"&amp;\",\n\t\t \"<\": \"&lt;\",\n\t\t \">\": \"&gt;\",\n\t\t '\"': '&quot;',\n\t\t \"'\": '&apos;',\n\t\t \"/\": '&#x2F;'\n\t\t };\n\t\n\treturn String(string).replace(/[&<>\"'\\/]/g, function (s){\n\t return entityMap[s];\n\t});\n}", "static convertHtml(str) {\n const HtmlConverter = {\n \"&\": \"&​amp;\",\n \"<\": \"&​lt;\", \n \">\": \"&​gt;\", \n '\"': \"&​quot;\",\n \"'\": \"&​apos;\"\n }\n return str.replace(/\\&|<|>|\\\"|\\'/g, specialChar => HtmlConverter[specialChar]);\n\n }", "function sanitizeInput(rawInput) {\n var placeholder = HtmlService.createHtmlOutput(\" \");\n placeholder.appendUntrusted(rawInput);\n\n return placeholder.getContent();\n}", "function sanitize(msg) {\n msg = msg.toString();\n return msg.replace(/[\\<\\>\"'\\/]/g,function(c) { var sanitize_replace = {\n\t\t\"<\" : \"&lt;\",\n\t\t\">\" : \"&gt;\",\n\t\t'\"' : \"&quot;\",\n\t\t\"'\" : \"&#x27;\",\n\t\t\"/\" : \"&#x2F;\"\n\t}\n\treturn sanitize_replace[c]; });\n}", "function escapeHTML(txt)\n{\n return txt.replace(/&/g, '&#0038;')\n .replace(/\"/g, '&#0034;')\n .replace(/'/g, '&#0039;')\n .replace(/</g, '&#0060;')\n .replace(/>/g, '&#0062;');\n}", "function removeSpecialChars(str){\n\treturn str.replace(/[^a-z0-9A-Z ]+/gi, '').replace(/^-*|-*$/g, '').toLowerCase();\t\n}", "function validateSpecialCharacters(sender, args)\n{\n args.IsValid = true;\n\n var iChars = \"!@$%^&*+=[]\\\\\\';.{}|\\\":<>\";\n for (var i = 0; i < args.Value.length; i++)\n {\n if (iChars.indexOf(args.Value.charAt(i)) != -1)\n {\n args.IsValid = false;\n\n return false;\n }\n }\n\n return args.IsValid;\n}", "function sanitize(s, noContext, notredirect) { \r\n\t\r\n for (var j = 0; j < bad.length; j++) { \r\n if(noContext && modifiers[j].indexOf(\"c\") != -1 || notredirect && modifiers[j].indexOf(\"r\") !=-1 ) { \r\n continue;\r\n } \r\n s = s.replace(bad[j], good[j]);\r\n } \r\n return s; \r\n}", "function sanitize(s, noContext, notredirect) { \r\n\t\r\n for (var j = 0; j < bad.length; j++) { \r\n if(noContext && modifiers[j].indexOf(\"c\") != -1 || notredirect && modifiers[j].indexOf(\"r\") !=-1 ) { \r\n continue;\r\n } \r\n s = s.replace(bad[j], good[j]);\r\n } \r\n return s; \r\n}", "function clean_title(string) {\n \tstring = basic_clean(string)\n\n \t// removes newlines, tabs\n \tstring = string.replace(/[\\x09\\x0A\\x0D]+/gi, '') \n\n \t// removes HTML\n \tstring = string.replace(/<.*?>/gi, '') \n \n \t// replace 'and' html entity\n \tstring = string.replace(/&amp;/gi, 'and')\n\n \t// replace 'nonbreaking space' html entity\n \tstring = string.replace(/&nbsp;/gi, ' ')\n\n \treturn string;\n}", "function encodeHTML(s) {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;');\n}", "function convertHTML(str) {\n //split string into character array\n var placeHolder = str.split(\"\");\n //itterate through character array\n for(var i=0; i<placeHolder.length; i++) {\n //check current value of character\n switch(placeHolder[i]) {\n //if case is met, replace with html entity\n case '&':\n placeHolder[i]='&amp;';\n break;\n case '<':\n placeHolder[i]='&lt;';\n break;\n case '>':\n placeHolder[i]='&gt;';\n break;\n case '\"':\n placeHolder[i]='&quot;';\n break;\n case \"'\":\n placeHolder[i]='&apos;';\n break;\n }\n }\n //join character array back into string\n str = placeHolder.join(\"\");\n return str;\n}", "function removeIllegalChar(str)\n{\n\tvar result = str;\n\tif (result == null) return null;\n\tresult = result.trim();\n\tif (result != \"\") \n\t{\n\t\t// result = result.replace(/'/gi,\"\");\n\t\t// result = result.replace(/'|\"|!|%|\\\\|\\/|<|>/gi,\"\");\n\t\t// under repalcing is for web page.\n\t\t// result=result.replace(/&/gi,\"\\\\&amp;\"); \n\t\t// result=result.replace(/</gi,\"\\\\&lt;\");\n\t\t// result=result.replace(/>/gi,\"\\\\&gt;\");\n\t}\n\treturn result;\n}", "function escape(s){var n=s;n = n.replace(/&/g,\"&amp;\");n = n.replace(/</g,\"&lt;\");n = n.replace(/>/g,\"&gt;\");n = n.replace(/\"/g,\"&quot;\");return n;}", "function sanitize(text) {\n return text.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n }", "function removeBadCharacters(string) {\n if (string.replace) {\n string.replace(/[<>\\\"\\'%;\\)\\(&\\+]/, '');\n }\n return string;\n}", "function escapeXmlCharacters(input) {\n const invalidXmlCharactersMapping = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&apos;',\n };\n const invalidXmlCharactersMappingReverse = Object.keys(invalidXmlCharactersMapping).reduce(\n /* eslint-disable-next-line */\n (obj, key) => {\n obj[invalidXmlCharactersMapping[key]] = key;\n return obj;\n }, {});\n // sanitize any already escaped character to ensure they are not escaped more than once\n const sanitizedInput = input.replace(/&amp;|&lt;|&gt;|&quot;|&apos;]/g, (c) => invalidXmlCharactersMappingReverse[c]);\n return sanitizedInput.replace(/[&'\"><]/g, (c) => invalidXmlCharactersMapping[c]);\n}", "function sanitizeInput (text) {\n var regex = /<(?!output| )/g;\n if (!regex.test(text)) {\n return text;\n }\n\n var el = xml.xhtml(text),\n places = {};\n\n function replacer() {\n var id = util.get_guid();\n places[id] = this;\n return \"{\" + id + \"}\";\n }\n el.find('output').replaceWith(replacer);\n return escapeReplace(el.html(), places);\n }", "function escapeHtml(str){\n\t str = toString(str)\n\t .replace(/&/g, '&amp;')\n\t .replace(/</g, '&lt;')\n\t .replace(/>/g, '&gt;')\n\t .replace(/'/g, '&#39;')\n\t .replace(/\"/g, '&quot;');\n\t return str;\n\t }", "function html_unesc_amp_only($s) {\n return str_ireplace('&amp;','&',$s);\n}", "function chgEntities(passedStr)\n{\nvar myStr = repStrs(passedStr,'%22','&quot;') \n myStr = repStrs(myStr,'%26','&amp;') \n myStr = repStrs(myStr,'%3C','&gt;') \n myStr = repStrs(myStr,'%2E','&lt;') \n// myStr = repStrs(myStr,'%27',\"\\\\'\")\n\n\treturn unescape(myStr)\n}", "function sanitizeHtml(html) {\n return defaultHtmlSanitizer.sanitize(html);\n}", "function parseInvalidXmlCharacters(text){\n text = text.replace(\"&\",\"and\");\n text = text.replace(\"<\",\" \");\n text = text.replace(\">\",\" \");\n text = text.replace(\"'\",\" \");\n return text;\n }", "function sanitizeString(s) {\n return s.replace(/['\"]/g, '');\n}", "function escapeHtml (string) {\n\t\n entityMap = {\n \t\t '&': '&amp;',\n \t\t '<': '&lt;',\n \t\t '>': '&gt;',\n \t\t '\"': '&quot;',\n \t\t \"'\": '&#39;',\n \t\t '/': '&#x2F;',\n \t\t '`': '&#x60;',\n \t\t '=': '&#x3D;'\n \t\t};\n\n return String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n return entityMap[s];\n });\n}", "function removeBadCharacters(string) {\n\tif (string.replace) {\n\t\tstring.replace(/[<>\\\"\\'%;\\)\\(&\\+]/, '');\n\t}\n\treturn string;\n}" ]
[ "0.759199", "0.7562956", "0.7422235", "0.7403453", "0.73513234", "0.72910386", "0.72886336", "0.7118319", "0.6977197", "0.6956721", "0.6944392", "0.68856907", "0.6882707", "0.6863947", "0.6841094", "0.6834821", "0.6822679", "0.6810356", "0.6803345", "0.6783052", "0.6728569", "0.66767406", "0.6671992", "0.6653561", "0.6645762", "0.6644704", "0.66339767", "0.6621131", "0.6620582", "0.66200477", "0.6617376", "0.6612338", "0.6610666", "0.659591", "0.6575611", "0.65667695", "0.6561045", "0.65583646", "0.65545", "0.6553103", "0.6550745", "0.6550641", "0.6533172", "0.65316075", "0.6527288", "0.6504853", "0.65026236", "0.6496847", "0.649419", "0.64890254", "0.6466349", "0.6452183", "0.6452183", "0.6452183", "0.6452183", "0.6452183", "0.64458513", "0.64344007", "0.64221376", "0.64091986", "0.6409098", "0.6405396", "0.6394841", "0.6394841", "0.6394841", "0.63946104", "0.6390317", "0.6388852", "0.63888204", "0.63819396", "0.63800466", "0.63742703", "0.63527817", "0.63401145", "0.633203", "0.6327311", "0.6302012", "0.6299104", "0.6298011", "0.6296067", "0.6294947", "0.6293531", "0.6292843", "0.6292843", "0.62848675", "0.6277726", "0.6273246", "0.6261851", "0.6257127", "0.6247982", "0.6239967", "0.6236366", "0.62355167", "0.62238795", "0.6223373", "0.62121177", "0.61969596", "0.6190941", "0.61893684", "0.61764616", "0.6174907" ]
0.0
-1
Strip quotes from a string
function stripQuotes (str) { var a = str.charCodeAt(0); var b = str.charCodeAt(str.length - 1); return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripQuotes(theStr) {\r var theQuote;\r if (theStr.length > 1) { //if possibly quoted\r theQuote = theStr.charAt(0);\r if ((theQuote == \"'\" || theQuote == '\"') &&\r theStr.charAt(theStr.length-1) == theQuote)\r theStr = theStr.substring(1,theStr.length-1);\r }\r return theStr\r}", "function unquote(str) {\n var res = str.trim();\n res = str.replace(/^'(.*)'$/, \"$1\");\n if (res == str) {\n res = str.replace(/^\"(.*)\"$/, \"$1\");\n }\n return res;\n}", "function strip(str) {\n if ('\"' == str[0] || \"'\" == str[0]) return str.slice(1, -1);\n return str;\n}", "function stripQuotes(str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27) ?\n str.slice(1, -1) :\n str;\n}", "function stripQuotes(str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27) ?\n str.slice(1, -1) :\n str;\n}", "function stripQuotes(str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27) ?\n str.slice(1, -1) :\n str;\n}", "function stripQuotes(str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;\n}", "function unquote(string) {\n return string && string.replace(/^['\"]|['\"]$/g, '');\n}", "function stripSingleQuotes(str) {\n if(str[0] == \"'\" && str[str.length-1] == \"'\") {\n return str.substring(1, str.length-1);\n }\n return str;\n }", "function stripQuotes(value) {\n return value.replace(/^[\"']|['\"]$/g, \"\");\n}", "function stripQuotes( value ) {\n return value.replace(/^[\"']|['\"]$/g, \"\");\n}", "function stripQuotes( value ) {\n return value.replace(/^[\"']|['\"]$/g, \"\");\n}", "function stripQuotes( value ) {\n return value.replace(/^[\"']|['\"]$/g, \"\");\n}", "function stripQuotes( value ) {\n if (value) return value.toString().replace(/^[\"']|['\"]$/g, \"\");\n}", "function sanitizeString(s) {\n return s.replace(/['\"]/g, '');\n}", "function unquoteString(string) {\n if (typeof(string) != \"string\") {\n return string;\n }\n else if ((string[0] == '\"' && string.slice(-1) == '\"') || (string[0] == \"'\" && string.slice(-1) == \"'\")) {\n return string.substring(1, (string.length -1));\n }\n else {\n return string;\n }\n}", "function stripQuotes(name) {\n var length = name.length;\n if (length >= 2 &&\n name.charCodeAt(0) === name.charCodeAt(length - 1) &&\n (name.charCodeAt(0) === 34 /* doubleQuote */ || name.charCodeAt(0) === 39 /* singleQuote */)) {\n return name.substring(1, length - 1);\n }\n ;\n return name;\n }", "function cutQuotes(str) {\n if (str.charAt(0) === '\"' && str.charAt(str.length - 1) === '\"') {\n str = str.substring(1, str.length - 1);\n }\n return str;\n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function strip(val) {\n return val.replace(/^['\"]|['\"]$/g, '');\n }", "function strip(val) {\n return val.replace(/^['\"]|['\"]$/g, '');\n }", "function strip(val) {\n return val.replace(/^['\"]|['\"]$/g, '');\n }", "function StripQuotes(str, quotechar) {\n var len = str.length;\n if (str.charAt(0) == quotechar &&\n str.charAt(len - 1) == quotechar) {\n return str.substring(1, len - 1);\n }\n return str;\n}", "function stripOffQuotes(geneParam) {\n const cleanedWord = geneParam.replace(/\"\\B/, '').replace(/\\B\"/, '').trim()\n return cleanedWord\n}", "function strip_quotes_from_literal_string_value(value) {\n return value.substring(1, value.length - 1);\n}", "function clean(input){\n return input.replace('\\'', '');\n \n }", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') return value.substring(1, value.length - 1);\n return value;\n}", "function remove_quotation_marks(input_string){\n\tif(input_string!=undefined){\n\tif(input_string.charAt(0) === '\"') {\n\t\tinput_string = input_string.substr(1);\n\t}\n\tif(input_string.length>0){\n\tif(input_string.charAt(input_string.length-1) === '\"') {\n\t\tinput_string = input_string.substring(0, input_string.length - 1);\n\t}}}\n\treturn (input_string);\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n return value.substring(1, value.length - 1);\n }\n\n return value;\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"')\n return value.substring(1, value.length - 1);\n return value;\n}", "function stripQuotes (str: string): string | boolean {\n const a: number = str.charCodeAt(0)\n const b: number = str.charCodeAt(str.length - 1)\n return a === b && (a === 0x22 || a === 0x27)\n ? str.slice(1, -1)\n : str\n}", "function removeStringExp(str) {\n return str.replace(/\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'/g,\n function(match, pos, full) {\n // this is our lookaround code so that our regex doesn't become so\n // complicated.\n if (pos !== 0 && (match.length + pos) !== full.length &&\n full[pos - 1] === '[' && full[pos + match.length] === ']') {\n return match;\n }\n return '';\n });\n}", "function _trimStartEndQuotes(str){\r\n if(str && str.indexOf('\"') === 0 && str.lastIndexOf('\"') === str.length - 1){\r\n return str.substring(1, str.length - 1);\r\n } else {\r\n return str;\r\n }\r\n }", "function dwscripts_unescServerQuotes(theString)\n{\n var retVal = theString;\n\n var serverObj = dwscripts.getServerImplObject();\n\n if (serverObj != null && serverObj.unescServerQuotes != null)\n {\n retVal = serverObj.unescServerQuotes(theString);\n }\n\n return retVal;\n}", "function replaceSingleQuotes(str){\n\tstr = str.replace(\"'\", \"''\");\n\tconsole.log(str);\n\treturn str;\n}", "function stringparse (str) {\n try {\n if (str.match(/^'.*'$/) || str.match(/^\".*\"$/))\n return str\n .replace(/^['\"]/, '')\n .replace(/['\"]$/, '')\n .replace(/\\\\'/, \"'\")\n .replace(/\\\\\"/, '\"');\n } catch (e) { }\n return str;\n}", "function fixQuote(stru) {\n return stru.split(\"&quot;\").join(\"\\\"\");\n}", "function sanitize(string) {\n return string.replace(/[\\u2018\\u2019]/g, \"'\").replace(/[\\u201C\\u201D]/g, '\"');\n}", "function clean_url_value(str){\n\t\tstr = str.trim();\n\t\tstr = str.replace(/^'/, '');\n\t\tstr = str.replace(/'$/, '');\n\t\tstr = str.replace(/^\"/, '');\n\t\tstr = str.replace(/\"$/, '');\n\t\tstr = str.trim();\n\t\treturn str;\n\t}", "function stripString(string) {\n\t// No idea how it works, but is does the trick.\n\treturn string.replace(/\\(.*\\)/, '').replace(/[^a-zA-Z0-9]/g, '').trim().toLowerCase();\n}", "function cleanUpString(inputS) {\n // preserve newlines, etc - use valid JSON\n inputS = inputS.replace(/\\\\n/g, \"\\\\n\") \n .replace(/\\\\'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\\\\\"')\n .replace(/\\\\&/g, \"\\\\&\")\n .replace(/\\\\r/g, \"\\\\r\")\n .replace(/\\\\t/g, \"\\\\t\")\n .replace(/\\\\b/g, \"\\\\b\")\n .replace(/\\\\f/g, \"\\\\f\");\n // remove non-printable and other non-valid JSON chars\n inputS = inputS.replace(/[\\u0000-\\u0019]+/g,\"\"); \n return inputS;\n}", "function stripParam(s) {\n return s.replace(/^\\s*[\\'\"]?\\s*(.*?)\\s*[\\'\"]?\\s*$/, '$1');\n}", "function _quote_no_esc(str) {\n if (/^\"/.test(str)) return true;\n var match = void 0;\n while (match = /^[\\s\\S]*?([\\s\\S])\"/.exec(str)) {\n if (match[1] !== '\\\\') {\n return true;\n }\n str = str.substr(match[0].length);\n }\n return false;\n}", "function _quote_no_esc(str) {\n if (/^\"/.test(str)) return true;\n let match;\n while (match = /^[\\s\\S]*?([\\s\\S])\"/.exec(str)) {\n if (match[1] !== '\\\\') {\n return true;\n }\n str = str.substr(match[0].length);\n }\n return false;\n}", "function clean(val, justQuotes = false)\n{\n\tif (val == undefined)\n\t\treturn val\n\n\tif (justQuotes)\n\t\treturn val.replace(/[\"']/g, \"\");\n\n\treturn val.replace(/[|&;$%@\"'<>()+,]/g, \"\");\n}", "function sanitize(str){\n return str.replace(\n /([^a-zA-Z0-9`!\\$%\\^\\*\\(\\)\\-_\\+=\\[\\]\\{\\};'#:@~,\\.\\/<>\\?\\|])/g,\n function(a){\n if(a=='\"'||a=='\\\\')\n // This is going into a string with double quotes, so escape those\n return'\\\\'+a;\n else if(a==' ')\n return a;\n else if(a=='\\t')\n return '\\\\t';\n else if(a=='\\r')\n return '\\\\r';\n else if(a=='\\n')\n return '\\\\n';\n else return '\\\\x'+((256+a.charCodeAt(0))&0x1ff).toString(16).slice(1)\n }\n );\n }", "function unquote(value) {\n return (value.\n replace(/&lt;/g, \"<\").\n replace(/&gt;/g, \">\").\n replace(/&amp;/g, \"&\"));\n}", "function cleanString(string) {\n let str = \"\";\n if(string.length > 0) {\n str = JSON.stringify(string);\n str = str.substring(1);\n str = str.substring(0, str.length - 1);\n str = str.replace(/[\\\\]/g, '\\\\\\\\')\n .replace(/[\\\"]/g, '\\\\\\\"')\n .replace(/[\\/]/g, '\\\\/')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/[\\f]/g, '\\\\f')\n .replace(/[\\n]/g, '\\\\n')\n .replace(/[\\r]/g, '\\\\r')\n .replace(/[\\t]/g, '\\\\t');\n }\n return str;\n}", "function escapeQuotes(str) {\n return str.replace(/\\\"/g,'\\\\\"');\n }", "function sanitize(string) {\n return string.replace(/[&<>]/g, '');\n }", "function convert(str)\n {\n if (! /['\"]/.test(str))\n {\n return str;\n } else\n {\n var foo = str.\n // Use [\\s\\S] instead of . to match any characters _including newlines_\n replace(/([\\s\\S])?'/,\n replaceQuotesFromContext(constants.openSingleCurly, constants.closeSingleCurly)).\n replace(/([\\s\\S])?\"/,\n replaceQuotesFromContext(constants.openDoubleCurly, constants.closeDoubleCurly));\n return convert(foo);\n }\n }", "function customWSRemove(val){\n\tvar isQuote = false;\n\tvar output = \"\";\n\tfor (var i = 0; i < val.length; i++) {\n\t\tvar ch = val.charAt(i);\n\t\tif (ch=='\"') {\n\t\t\tisQuote = !isQuote;\n\t\t\toutput = output + ch;\n\t\t}else if (/\\s/.test(ch)) {\n\t\t\tisQuote ? output = output + ch : output = output;\n\t\t} else {\n\t\t\toutput = output + ch;\n\t\t}\n\t}\n\treturn output;\n}", "function ___cleanStrings(json)\t\n\t{\t\n\t\tif (!json) return '';\n\t\t\n\t\tvar jsonShadow = json.replace(/(\\\\['\"])/g, '@@');\t\t//esc embedded quotes e.g. \\\" --> @@\n\t\tjsonShadow = jsonShadow.replace(/(['\"])(.*?)\\1(\\s*)(\\:?)/g,\n\t\tfunction(all, quote, inner, spaces, colon)\t\t\t\t//replace all quoted strings\n\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t//with #...# e.g. \"abc\" --> \"###\"\n\t\t\tif (colon) return all;\t\t\t\t\t\t\t\t//except Object keys\n\t\t\t\n\t\t\tif (quote == '\"' && inner.substr(0,1) == '$')\t\t//except escape marker value(s)\n\t\t\t\treturn all;\n\t\t\t\t\n\t\t\treturn quote + '@'.dup(inner.length) + quote + spaces;\n\t\t});\n\t\treturn jsonShadow;\n\t}", "function _strip(str) {\r\n var A = new Array(); \r\n A = str.split(\"\\n\");\r\n str = A.join(\"\");\r\n A = str.split(\" \");\r\n str = A.join(\"\");\r\n A = str.split(\"\\t\");\r\n str = A.join(\"\"); \r\n return str;\r\n}", "function sanitize(str) {\n return typeof str === 'string' ? str.replace(/&(?!\\w+;)/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;') : str;\n}", "function removeQuotes (identifier) {\n if (identifier.name) identifier.name = identifier.name.replace(/\"/g, '')\n if (identifier.memberof) identifier.memberof = identifier.memberof.replace(/\"/g, '')\n if (identifier.longname) identifier.longname = identifier.longname.replace(/\"/g, '')\n if (identifier.id) identifier.id = identifier.id.replace(/\"/g, '')\n return identifier\n}", "function prepareString(str) {\n\t\tvar result = str.toString();\n\t\tresult = result.replace('&nbsp;', ' ');\n\t\tresult = result.replace(/\"/g, '\"\"');\n\t\tif (result.search(/(\"|,|\\n)/g) >= 0) {\n\t\t\tresult = '\"'+ result +'\"';\n\t\t}\n\t\treturn result;\n\t}", "function quotechange(a){\r\n\tvar stringReplace=\"\";\r\n\tfor (var j=0,aL=a.length; j<aL; ++j){\r\n\t\tif (a.charAt(j) == '\\\"')\r\n\t\t\tstringReplace=stringReplace + \"&quot;\";\r\n\t\telse\r\n\t\t\tstringReplace=stringReplace + a.charAt(j);\r\n\t}\r\n\treturn stringReplace;\r\n}", "function htmlUnescape(str) {\r\n\treturn str.replace(/&quot;/g, '\"')\r\n\t\t.replace(/&#39;/g, \"'\")\r\n\t\t.replace(/&lt;/g, '<')\r\n\t\t.replace(/&gt;/g, '>')\r\n\t\t.replace(/&amp;/g, '&');\r\n}", "function stripString(string) {\n //return x.replace(/{{(.*?)}}/, \"\");\n}", "function cleanUpString(str) {\n return str.replace(/\\(.+\\)/, '').trim();\n }", "function htmlUnescape(str) {\n return str\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&amp;/g, '&');\n }", "function cleanUp (str) {\n\t\treturn str.replace( /[\\s\\n\\r]+/g, '' ).replace(/\\:/g,'\": \"').replace(/\\,/g,'\", \"');\n\t}", "function parseLine(line) {\n return line.replace(/\\s+|\\\"/g, '')\n}", "function unescapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"\"/g, '\"')}`);\n}", "static removeEscapes(string) {\n const buff = []\n var escapeMode = false;\n for (var c of string) {\n if (escapeMode) {\n escapeMode = false;\n if (stringEscapeTable.hasOwnProperty(c)) {\n buff.push(stringEscapeTable[c]);\n } else {\n buff.push(c);\n }\n } else {\n if (c === '\\\\') {\n escapeMode = true;\n continue;\n } else {\n buff.push(c);\n }\n }\n }\n\n return buff.join('');\n }", "function unquote(pattern) {\n if (pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\" || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n return pattern.slice(1, -1);\n }\n\n return pattern;\n }", "function removeNonParsingChars(str) {\n return str.replace(/[() \"/]/g, '');\n}", "function dwscripts_unescSQLQuotes(sql)\n{\n var retVal = sql;\n\n var serverObj = dwscripts.getServerImplObject();\n\n if (serverObj != null && serverObj.unescSQLQuotes != null)\n {\n retVal = serverObj.unescSQLQuotes(sql);\n }\n\n return retVal;\n}", "function uutrimquote(source) { // @param String: ' \"quote string\" '\r\n // @return String: 'quote string'\r\n return source.replace(uutrim._QUOTE, \"\");\r\n}", "function fixQuotes(text) {\n return text.replace(/&(quot|#39|amp);/g,function unEscape(match){\n return entities.decodeHTML(match);\n });\n}", "function escapeString(str) {\n return str.replace('\"', '\\\"');\n }", "function escSglQuote(str) {\r\n return str.toString().replace(/'/g,\"\\\\'\");\r\n}", "function scrub(targetStr)\r\n{\r\n\tvar pieces = targetStr.split(\"'\");\r\n\treturn pieces.join(\"$pos;\");\r\n}", "function deScrub(targetStr)\r\n{\r\n\tvar pieces = targetStr.split(\"$pos;\");\r\n\treturn pieces.join(\"'\");\r\n}", "function trimString(string) {\n return string.toLowerCase().replace(/\\s/g, '-').replace(/[.!_&%/:;')(+?,=]/g, '');\n}", "function wash_SQL_string(str) {\n var toString = \"\" + str;\n return toString.replace(/[\\|&;\\$%\"<>\\(\\)\\+,']/g, \"\");\n}", "_clean(str) {\n // remove spaces from strings\n str = str.replace(/ /g, '')\n\n // remove hashtag\n if (str.charAt(0) == \"#\" || str.charAt(0) == '&#35;') {\n str = str.substr(1)\n }\n\n return str\n }", "function unEscape(str) {\n\tvar re = new RegExp(\"&(.*);\");\n\tvar match = str.match(re);\n\tif (match.length > 1) {\n\t\treturn match[1];\n\t}\n}", "function cleanCookieString(str) {\n return str.trim().replace(/\\x3B+$/, '');\n}", "function cleanCookieString(str) {\n return str.trim().replace(/\\x3B+$/, '');\n}", "function unspace(string) {\n return string.replace(/\\r\\n|\\n| /g, '')\n}", "function trimstring(str) {\n return __WEBPACK_IMPORTED_MODULE_17_shirt__[\"IO\"].of(str).map(splitLines).map(getMinLeadingWhitespace).map(function (n) {\n return makeHeredoc(n)(str);\n }) // See NOTE\n .fold(function () {\n return str;\n }, function (x) {\n return x;\n }); // Just return original object if the operation failed\n}", "function sanitizeString(str){\n str = str.replace(/[^a-z0-9áéíóúñü \\.,_-]/gim,\"\");\n return str.trim();\n}", "function _stringTrimCoerce(obj) {\n return obj.replace(/(\\s+|\\t|\\r\\n|\\n|\\r)/gm, ' ').trim();\n}", "function replaceSmartQuotes(text) {\n text = text.replaceAll( \"[\\u2018\\u2019\\u201A\\u201B\\u2032\\u2035]\", \"'\" );\n text = text.replaceAll(\"[\\u201C\\u201D\\u201E\\u201F\\u2033\\u2036]\",\"\\\"\");\n return text;\n}", "function cleanString(txt){\n return txt.replace(/[\\n\\r\\t]/g,' ').trim().replace(/\\s*$/,\"\").replace(/ +(?= )/g,'');\n}" ]
[ "0.7901178", "0.7812025", "0.780733", "0.7762566", "0.7762566", "0.7762566", "0.77615565", "0.7645416", "0.75609374", "0.75251627", "0.7522459", "0.7522459", "0.7522459", "0.7482644", "0.73682815", "0.7356931", "0.70602924", "0.703072", "0.69941694", "0.6988756", "0.6988756", "0.6988756", "0.6946571", "0.69003534", "0.68584234", "0.68565214", "0.6849583", "0.68407464", "0.6814612", "0.6794554", "0.67376244", "0.6724085", "0.6503925", "0.63746524", "0.63526547", "0.6308602", "0.630561", "0.62843657", "0.62839127", "0.62718034", "0.6245688", "0.6207377", "0.62062615", "0.6202626", "0.616178", "0.6154091", "0.6123564", "0.61111516", "0.60979", "0.6057751", "0.6050168", "0.60491467", "0.6043666", "0.6007394", "0.59994847", "0.5998267", "0.599101", "0.5954842", "0.5945948", "0.5933604", "0.59284353", "0.5913092", "0.5911316", "0.590757", "0.5901289", "0.58851093", "0.5881861", "0.5873342", "0.5868689", "0.5844718", "0.58277184", "0.581781", "0.5801078", "0.5791475", "0.57912457", "0.57776046", "0.57578975", "0.5755827", "0.57404906", "0.573746", "0.573746", "0.5737214", "0.5732399", "0.5711737", "0.5709468", "0.570432", "0.5684002" ]
0.78178227
10
Determine the type of a character in a keypath.
function getPathCharType (ch) { if (ch === undefined || ch === null) { return 'eof' } var code = ch.charCodeAt(0); switch (code) { case 0x5B: // [ case 0x5D: // ] case 0x2E: // . case 0x22: // " case 0x27: // ' return ch case 0x5F: // _ case 0x24: // $ case 0x2D: // - return 'ident' case 0x09: // Tab case 0x0A: // Newline case 0x0D: // Return case 0xA0: // No-break space case 0xFEFF: // Byte Order Mark case 0x2028: // Line Separator case 0x2029: // Paragraph Separator return 'ws' } return 'ident' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPathCharType(ch) {\n if (ch === undefined || ch === null) {\n return 'eof';\n }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x2E: // .\n\n case 0x22: // \"\n\n case 0x27: // '\n\n case 0x30:\n // 0\n return ch;\n\n case 0x5F: // _\n\n case 0x24: // $\n\n case 0x2D:\n // -\n return 'ident';\n\n case 0x20: // Space\n\n case 0x09: // Tab\n\n case 0x0A: // Newline\n\n case 0x0D: // Return\n\n case 0xA0: // No-break space\n\n case 0xFEFF: // Byte Order Mark\n\n case 0x2028: // Line Separator\n\n case 0x2029:\n // Paragraph Separator\n return 'ws';\n } // a-z, A-Z\n\n\n if (code >= 0x61 && code <= 0x7A || code >= 0x41 && code <= 0x5A) {\n return 'ident';\n } // 1-9\n\n\n if (code >= 0x31 && code <= 0x39) {\n return 'number';\n }\n\n return 'else';\n}", "function getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n case 0x30: // 0\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x20: // Space\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n // a-z, A-Z\n if ((code >= 0x61 && code <= 0x7A) || (code >= 0x41 && code <= 0x5A)) {\n return 'ident'\n }\n\n // 1-9\n if (code >= 0x31 && code <= 0x39) { return 'number' }\n\n return 'else'\n}", "function getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n case 0x30: // 0\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x20: // Space\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n // a-z, A-Z\n if ((code >= 0x61 && code <= 0x7A) || (code >= 0x41 && code <= 0x5A)) {\n return 'ident'\n }\n\n // 1-9\n if (code >= 0x31 && code <= 0x39) { return 'number' }\n\n return 'else'\n}", "function getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n case 0x30: // 0\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x20: // Space\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n // a-z, A-Z\n if ((code >= 0x61 && code <= 0x7A) || (code >= 0x41 && code <= 0x5A)) {\n return 'ident'\n }\n\n // 1-9\n if (code >= 0x31 && code <= 0x39) { return 'number' }\n\n return 'else'\n}", "function getPathCharType(ch) {\n if (ch === undefined || ch === null) {return 'eof';}\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch;\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident';\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws';}\n\n\n return 'ident';\n}", "function getPathCharType(ch) {\n if (ch === undefined || ch === null) {return 'eof';}\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch;\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident';\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws';}\n\n\n return 'ident';\n}", "function getPathCharType(ch) {\n if (ch === undefined || ch === null) {return 'eof';}\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch;\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident';\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws';}\n\n\n return 'ident';\n}", "function getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x20: // Space\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}", "function getPathCharType (ch: ?string): string {\n if (ch === undefined || ch === null) { return 'eof' }\n\n const code: number = ch.charCodeAt(0)\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}", "function keyTyped() {\n switch (key) {\n //row: 0 **************************\n case '\\-':\n dKey = '\\[';\n break;\n case '\\=':\n dKey = '\\]';\n break;\n\n //row: 1 **************************\n case 'q':\n dKey = '\\'';\n break;\n case 'w':\n dKey = '\\,';\n break;\n case 'e':\n dKey = '\\.';\n break;\n case 'r':\n dKey = 'p';\n break;\n case 't':\n dKey = 'y';\n break;\n case 'y':\n dKey = 'f';\n break;\n case 'u':\n dKey = 'g';\n break;\n case 'i':\n dKey = 'c';\n break;\n case 'o':\n dKey = 'r';\n break;\n case 'p':\n dKey = 'l';\n break;\n case '\\[':\n dKey = '/';\n break;\n case '\\]':\n dKey = '=';\n break;\n\n //row: 2 ************************************\n case 'a':\n dKey = 'a';\n break;\n case 's':\n dKey = 'o';\n break;\n case 'd':\n dKey = 'e';\n break;\n case 'f':\n dKey = 'u';\n break;\n case 'g':\n dKey = 'i';\n break;\n case 'h':\n dKey = 'd';\n break;\n case 'j':\n dKey = 'h';\n break;\n case 'k':\n dKey = 't';\n break;\n case 'l':\n dKey = 'n';\n break;\n case '\\;':\n dKey = 's';\n break;\n case '\\'':\n dKey = '\\-';\n break;\n case '\\\"': //above shift-case\n dKey = '\\-';\n break;\n\n //row: 3 ****************************************\n case 'z':\n dKey = '\\;';\n break;\n case 'x':\n dKey = 'q';\n break;\n case 'c':\n dKey = 'j';\n break;\n case 'v':\n dKey = 'k';\n break;\n case 'b':\n dKey = 'x';\n break;\n case 'n':\n dKey = 'b';\n break;\n case 'm':\n dKey = 'm';\n break;\n case '\\,':\n dKey = 'w';\n break;\n case '\\.':\n dKey = 'v';\n break;\n case '\\/':\n dKey = 'z';\n break;\n default:\n dKey = key;\n break;\n }\n return false;\n}", "function getCharacterType(charCode) {\n if (isAlphabeticalScript(charCode)) {\n if (isAscii(charCode)) {\n if (isAsciiSpace(charCode)) {\n return CharacterType.SPACE;\n } else if (\n isAsciiAlpha(charCode) ||\n isAsciiDigit(charCode) ||\n charCode === /* UNDERSCORE = */ 0x5f\n ) {\n return CharacterType.ALPHA_LETTER;\n }\n return CharacterType.PUNCT;\n } else if (isThai(charCode)) {\n return CharacterType.THAI_LETTER;\n } else if (charCode === /* NBSP = */ 0xa0) {\n return CharacterType.SPACE;\n }\n return CharacterType.ALPHA_LETTER;\n }\n\n if (isHan(charCode)) {\n return CharacterType.HAN_LETTER;\n } else if (isKatakana(charCode)) {\n return CharacterType.KATAKANA_LETTER;\n } else if (isHiragana(charCode)) {\n return CharacterType.HIRAGANA_LETTER;\n } else if (isHalfwidthKatakana(charCode)) {\n return CharacterType.HALFWIDTH_KATAKANA_LETTER;\n }\n return CharacterType.ALPHA_LETTER;\n }", "function sc_isChar(c) {\n return (c instanceof sc_Char);\n}", "function guessType (key) {\n var type = 'boolean'\n\n if (checkAllAliases(key, flags.strings)) type = 'string'\n else if (checkAllAliases(key, flags.numbers)) type = 'number'\n else if (checkAllAliases(key, flags.arrays)) type = 'array'\n\n return type\n }", "function guessType (key) {\n var type = 'boolean'\n\n if (checkAllAliases(key, flags.strings)) type = 'string'\n else if (checkAllAliases(key, flags.numbers)) type = 'number'\n else if (checkAllAliases(key, flags.arrays)) type = 'array'\n\n return type\n }", "function get_key(stype, ctype) {\r\n return (stype * 65536 + ctype);\r\n}", "function letterValueGetter(char) {\n if (char == '_') {\n return 0;\n } else if (char == 'e' || char == 'a' || char == 'i' || char == 'o' || char == 'n' || char == 'r' || char == 't' || char == 'l' || char == 's' || char == 'u') {\n return 1;\n } else if (char == 'd' || char == 'g') {\n return 2;\n } else if (char == 'b' || char == 'c' || char == 'm' || char == 'p') {\n return 3;\n } else if (char == 'f' || char == 'h' || char == 'v' || char == 'w' || char == 'y') {\n return 4;\n } else if (char == 'k') {\n return 5;\n } else if (char == 'j' || char == 'x') {\n return 8;\n } else {\n return 10;\n }\n}", "function IsSpecialTypeChar(ch, ref) {\n switch (ch) {\n case \":\":\n case \".\":\n case \"$\":\n case \"+\":\n case \"<\":\n case \">\":\n case \"-\":\n case \"[\":\n case \"]\":\n case \",\":\n case \"&\":\n case \"*\":\n ref.nextMustBeStartChar = true;\n return true;\n case \"`\":\n return true;\n }\n return false;\n }", "function typeKeys(keys) {\n\t\tvar keyStr = \"\";\n\t\tif(keys === '') { //Just to be sure.\n\t\t\treturn \"\";\n\t\t}\n\t\tfor(var i = 0; i < keys.length; i++) {\n\t\t\tif(keys.charAt(i) == ' ')\n\t\t\t\tcontinue;\n\t\t\tkeyStr += i != 0 ? \"\\n\" : \"\";\n\t\t\tkeyStr += \"\\n \ttype(\" + keys.charCodeAt(i) + \",true);\";\n\t\t}\n\t\treturn keyStr;\n}", "function easyKey(rawchar){\n lookup={\"`\":\"Backquote\",1:\"Digit1\",2:\"Digit2\",3:\"Digit3\",4:\"Digit4\",5:\"Digit5\",6:\"Digit6\",7:\"Digit7\",8:\"Digit8\",9:\"Digit9\",0:\"Digit0\",\"-\":\"Minus\",\"=\":\"Equal\",q:\"KeyQ\",w:\"KeyW\",e:\"KeyE\",r:\"KeyR\",t:\"KeyT\",y:\"KeyY\",u:\"KeyU\",i:\"KeyI\",o:\"KeyO\",p:\"KeyP\",Q:\"KeyQ\",W:\"KeyW\",E:\"KeyE\",R:\"KeyR\",T:\"KeyT\",Y:\"KeyY\",U:\"KeyU\",I:\"KeyI\",O:\"KeyO\",P:\"KeyP\",\"[\":\"BracketLeft\",\"]\":\"Bracket\",\"\\\\\":\"Backslash\",a:\"KeyA\",s:\"KeyS\",d:\"KeyD\",f:\"KeyF\",g:\"KeyG\",h:\"KeyH\",j:\"KeyJ\",k:\"KeyK\",l:\"KeyL\",A:\"KeyA\",S:\"KeyS\",D:\"KeyD\",F:\"KeyF\",G:\"KeyG\",H:\"KeyH\",J:\"KeyJ\",K:\"KeyK\",L:\"KeyL\",\";\":\"Semicolon\",\"'\":\"Quote\",z:\"KeyZ\",x:\"KeyX\",c:\"KeyC\",v:\"KeyV\",b:\"KeyB\",n:\"KeyN\",m:\"KeyM\",Z:\"KeyZ\",X:\"KeyX\",C:\"KeyC\",V:\"KeyV\",B:\"KeyB\",N:\"KeyN\",M:\"KeyM\",\",\":\"Comma\",\".\":\"Period\",\"/\":\"Slash\"};\n let convert=lookup[rawchar];\n return convert||rawchar;\n}", "function isKeyName(path) {\n return path==='*' || !IS_PATH.test(path);\n}", "function isKeyName(path) {\n return path==='*' || !IS_PATH.test(path);\n}", "function guessType (key, flags) {\n var type = 'boolean'\n\n if (flags.strings && flags.strings[key]) type = 'string'\n else if (flags.arrays && flags.arrays[key]) type = 'array'\n\n return type\n }", "function guessType (key, flags) {\n var type = 'boolean'\n \n if (flags.strings && flags.strings[key]) type = 'string'\n else if (flags.arrays && flags.arrays[key]) type = 'array'\n \n return type\n }", "function whichCharacter(char) {\n switch (char) {\n case '\\u00AC': // negation\n return 'negation';\n case '\\u00B7': // conjunction\n case '\\u007C': // Sheffer stroke\n case '\\u002B': // disjunction\n case '\\u2193': // Pierce arrow\n case '\\u2295': // conclusive disjunction\n case '\\u21D4': // equivalence\n case '\\u21D2': // implication\n return 'operator';\n case '(':\n return 'opening bracket';\n case ')':\n return 'closing bracket';\n default:\n return 'operand';\n }\n }", "function getCharacterType(upper, lower, digits, spec) {\n \n var charType = Math.floor(Math.random()*4);\n var done = false;\n for (;!done;){\n if (charType == 0) {\n if (upper){\n return charType;\n } else {\n charType++;\n }\n }\n if (charType == 1) {\n if (lower) {\n return charType;\n } else {\n charType++;\n }\n }\n if (charType == 2){ \n if (digits){\n return charType;\n }else {\n charType++;\n }\n }\n if (charType == 3){\n if (spec){\n return charType;\n } else {\n charType = 0;\n }\n }\n }\n}", "function guessType (key, flags) {\n var type = 'boolean'\n \n if (checkAllAliases(key, flags.strings)) type = 'string'\n else if (checkAllAliases(key, flags.numbers)) type = 'number'\n else if (checkAllAliases(key, flags.arrays)) type = 'array'\n \n return type\n }", "function guessType (key, flags) {\n var type = 'boolean'\n\n if (checkAllAliases(key, flags.strings)) type = 'string'\n else if (checkAllAliases(key, flags.numbers)) type = 'number'\n else if (checkAllAliases(key, flags.arrays)) type = 'array'\n\n return type\n }", "function guessType (key, flags) {\n var type = 'boolean'\n\n if (checkAllAliases(key, flags.strings)) type = 'string'\n else if (checkAllAliases(key, flags.numbers)) type = 'number'\n else if (checkAllAliases(key, flags.arrays)) type = 'array'\n\n return type\n }", "getKey (path: string): mixed | string {\n return _.at(this.translations[this.locale], path)[0]\n }", "function parse_key(key) {\n var _key = key;\n // Arrow key\n if (key == '\\u001B\\u005B\\u0041') {\n _key = 'up';\n }\n if (key == '\\u001B\\u005B\\u0043') {\n _key = 'right';\n }\n if (key == '\\u001B\\u005B\\u0042') {\n _key = 'down';\n }\n if (key == '\\u001B\\u005B\\u0044') {\n _key = 'left';\n }\n if (key === '\\u0003') {\n // End-of-text, i.e., Ctrl-C\n _key = 'eot';\n }\n return _key;\n}", "getKey(type) {\n if (type === 'rant') {\n return 'favoriteRants'\n } else if (type === 'rave') {\n return 'favoriteRaves'\n }\n }", "function _handle_type_c(option, argv)\r\n{\r\n\tvar strFinal = '';\r\n\tvar nCharCode = 0;\r\n\r\n\tdo \r\n\t{\r\n\t\tif ('number' === typeof argv[0])\r\n\t\t{\r\n\t\t\tnCharCode = argv[0];\r\n\t\t}\r\n\t\telse if ('string' === typeof argv[0])\r\n\t\t{\r\n\t\t\tif (0 === argv[0].length)\r\n\t\t\t{\r\n\t\t\t\tnCharCode = 0;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tnCharCode = argv[0].charCodeAt(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tnCharCode = 0;\r\n\t\t}\r\n\r\n\t\tstrFinal = String.fromCharCode(nCharCode);\r\n\r\n\t\tif ('C' === option.type)\r\n\t\t{\r\n\t\t\tstrFinal = strFinal.toUpperCase();\r\n\t\t}\r\n\r\n\t} while (false);\r\n\r\n\treturn strFinal;\r\n}", "function getChar(keyNum) {\r\n return String.fromCharCode(keyNum);\r\n}", "function atobLookup(chr) {\n if (/[A-Z]/.test(chr)) {\n return chr.charCodeAt(0) - 'A'.charCodeAt(0);\n }\n if (/[a-z]/.test(chr)) {\n return chr.charCodeAt(0) - 'a'.charCodeAt(0) + 26;\n }\n if (/[0-9]/.test(chr)) {\n return chr.charCodeAt(0) - '0'.charCodeAt(0) + 52;\n }\n if (chr == '+') {\n return 62;\n }\n if (chr == '/') {\n return 63;\n }\n // Throw exception; should not be hit in tests\n}", "function getKeyChar(intKeyCode) \r\n{\r\n\treturn String.fromCharCode(intKeyCode);\r\n}", "get keyTypeInput() {\n return this._keyType;\n }", "function Chekkey(value){\n var firstChar = value.substr(0,1);\n if(firstChar.toLowerCase() =='s')\n return true;\n else\n return false;\n}", "function TcKey( aType ) {\n\tthis.keyMapI = { 190:'.', 61:'+',109:'-',\n\t\t\t\t\t\t\t\t\t\t65:'a', 66:'b', 67:'c', 68:'d' ,69 :'e',70 :'f',71 :'g',72 :'h',73 :'i',74 :'j',75:'k',76:'l',77:'m',78:'n',79:'o',80:'p',81:'q',82:'r',83:'s',84:'t',85:'u',86:'v',87:'w',88:'x',89:'y',90:'z',32:' ',\n\t\t\t\t\t\t\t\t\t\t48:'0', 49:'1', 50:'2', 51:'3' ,52 :'4',53 :'5',54 :'6',55 :'7',56 :'8',57 :'9',\n\t\t\t\t\t\t\t\t\t\t96:'0', 97:'1', 98:'2', 99:'3' ,100:'4',101:'5',102:'6',103:'7',104:'8',105:'9',\n\t\t\t\t\t\t\t\t\t\t27:'VK_ESC', 13:'VK_ENTER', 9:'VK_TAB', 19:'VK_PAUSE',\n\t\t\t\t\t\t\t\t\t\t37:'VK_LEFT', 39:'VK_RIGHT', 38:'VK_UP', 40:'VK_DOWN',\n\t\t\t\t\t\t\t\t\t\t36:'VK_HOME', 35:'VK_END', 33:'VK_PGUP', 34:'VK_PGDN',\n\t\t\t\t\t\t\t\t\t\t45:'VK_INS', 46:'VK_DEL', 8:'VK_BKS',\n\t\t\t\t\t\t\t\t\t 112:'VK_F1', 113:'VK_F2', 114:'VK_F3', 115:'VK_F4',\n\t\t\t\t\t\t\t\t\t 116:'VK_F5', 117:'VK_F6', 118:'VK_F7', 119:'VK_F8',\n\t\t\t\t\t\t\t\t\t 120:'VK_F9', 121:'VK_F10', 122:'VK_F11', 123:'VK_F12'};\n\tthis.keyMapC = { '.':190, '+': 61, '-':109,\n\t\t\t\t\t\t\t\t\t 'a': 65, 'b': 66, 'c': 67, 'd': 68, 'e': 69, 'f': 70, 'g': 71, 'h': 72, 'i': 73, 'j': 74, 'k': 75, 'l': 76, 'm': 77, 'n': 78, 'o': 79, 'p': 80, 'q': 81, 'r': 82, 's': 83, 't': 84, 'u': 85, 'v': 86, 'x': 88,'w': 87, 'y': 89, 'z': 90,' ': 32,\n\t\t\t\t\t\t\t\t\t '1': 49, '2': 50, '3': 51, '4': 52, '5': 53, '6': 54, '7': 55, '8': 56, '9': 57, '0': 48,\n\t\t\t\t\t\t\t\t\t 'VK_ESC' : 27, 'VK_ENTER': 13, 'VK_TAB' : 9, 'VK_PAUSE': 19,\n\t\t\t\t\t\t\t\t\t 'VK_LEFT': 37, 'VK_RIGHT': 39, 'VK_UP' : 38, 'VK_DOWN' : 40,\n\t\t\t\t\t\t\t\t\t 'VK_HOME': 36, 'VK_END' : 35, 'VK_PGUP': 33, 'VK_PGDN' : 34,\n\t\t\t\t\t\t\t\t\t 'VK_INS' : 45, 'VK_DEL' : 46, 'VK_BKS' : 8,\n\t\t\t\t\t\t\t\t\t 'VK_F1' :112, 'VK_F2' :113, 'VK_F3' :114, 'VK_F4' :115,\n\t\t\t\t\t\t\t\t\t 'VK_F5' :116, 'VK_F6' :117, 'VK_F7' :118, 'VK_F8' :119,\n\t\t\t\t\t\t\t\t\t 'VK_F9' :120, 'VK_F10' :121, 'VK_F11' :122, 'VK_F12' :123};\n\tthis.ctrl = false;\n\tthis.shift = false;\n\tthis.alt = false;\n\tthis.key = 0;\n\tthis.char = '';\n\t//------------------------------------------------\n\tthis.FShortCut = new Array(); //Eventos que devem ocorrer apos a digitacao de uma tecla\n\t//------------------------------------------------\n\tif( aType )\n\t\tthis.setKey();\n}", "function characterSuitableForNames(char) {\n return /[-_A-Za-z0-9]/.test(char); // notice, there's no dot or hash!\n }", "function getkey (key) {\n var parsedKey = Number(key)\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n ) ? key\n : parsedKey\n }", "function handle_keypress(e) {\n var ch = (typeof e.which == \"number\") ? e.which : e.keyCode\n console.log(\"got char code:\", ch)\n if (ch == 97) { // 'a'\n grow_type_span()\n } else if (ch == 115) { // 's'\n shrink_type_span()\n } else if (ch == 113) { // 'q'\n remove_type_span()\n }\n}", "function getkey (key) {\n const parsedKey = Number(key)\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n ) ? key\n : parsedKey\n }", "static getCharCode(char) {\n if (char.length === 0) {\n return 0;\n }\n const charCode = char.charCodeAt(0);\n switch (charCode) {\n case 768 /* U_Combining_Grave_Accent */: return 96 /* U_GRAVE_ACCENT */;\n case 769 /* U_Combining_Acute_Accent */: return 180 /* U_ACUTE_ACCENT */;\n case 770 /* U_Combining_Circumflex_Accent */: return 94 /* U_CIRCUMFLEX */;\n case 771 /* U_Combining_Tilde */: return 732 /* U_SMALL_TILDE */;\n case 772 /* U_Combining_Macron */: return 175 /* U_MACRON */;\n case 773 /* U_Combining_Overline */: return 8254 /* U_OVERLINE */;\n case 774 /* U_Combining_Breve */: return 728 /* U_BREVE */;\n case 775 /* U_Combining_Dot_Above */: return 729 /* U_DOT_ABOVE */;\n case 776 /* U_Combining_Diaeresis */: return 168 /* U_DIAERESIS */;\n case 778 /* U_Combining_Ring_Above */: return 730 /* U_RING_ABOVE */;\n case 779 /* U_Combining_Double_Acute_Accent */: return 733 /* U_DOUBLE_ACUTE_ACCENT */;\n }\n return charCode;\n }", "function typeCharacter( paramDoc, paramCharCode ) {\t\r\n\t// Local variable to extract information about cursor after operations\r\n\tvar newCursorCoords;\r\n\t// Determine if we typing normally, or overwriting a selected block, and act accordingly\r\n\tif ( paramDoc.isSelection ) {\r\n\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn, String.fromCharCode(paramCharCode) );\r\n\t}\r\n\telse newCursorCoords = paramDoc.insertText( String.fromCharCode(paramCharCode), cursorLine, cursorColumn );\r\n\t\r\n\tcursorColumn = newCursorCoords[1];\r\n}", "function keyTyped() {\n letter = key;\n}", "function getkey (key) {\n var parsedKey = Number(key);\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n ) ? key\n : parsedKey\n }", "getTypeKey(){\n let type = this.get('properties.type') || this.get('type');\n if (type){\n type = TypeKey.getTypeKey(type);\n } else {\n // Use the class hierarchy if type is not defined in the data\n type = TypeKey.getTypeKey.apply(this);\n }\n return type;\n }", "function parseKey() {\n var specialValues = ['null', 'true', 'false'];\n var key = '';\n var c = curr();\n\n var regexp = /[a-zA-Z_$\\d]/; // letter, number, underscore, dollar character\n while (regexp.test(c)) {\n key += c;\n i++;\n c = curr();\n }\n\n if (specialValues.indexOf(key) === -1) {\n chars.push('\"' + key + '\"');\n }\n else {\n chars.push(key);\n }\n }", "_handleKeyPress(input){\n switch (typeof input){\n case 'number': return this._handleNumericalKeyPress(input);\n case 'string': return this._handleOperationKeyPress(input);\n }\n }", "lookupChar(char, category){\n for (let item of json.jsonArray){\n if(item.key === category){\n for(let character of item.value){\n if(character.key === char){\n return character.value;\n }\n }\n }\n }\n }", "function keyCode(keyChar) {\n return keyChar.charCodeAt(0);\n}", "function identifyPemType(rawKey) {\r\n if (rawKey instanceof Buffer) {\r\n rawKey = rawKey.toString(\"utf8\");\r\n }\r\n const match = PEM_TYPE_REGEX.exec(rawKey);\r\n return !match ? undefined : match[2];\r\n}", "function is_path(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95) &&\n !(curr_char > 45 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function validateChar(key) {\r\n var keycode = (key.which) ? key.which : key.keyCode\r\n var phn = document.getElementById(key);\r\n //comparing pressed keycodes\r\n if (!(keycode == 8 || keycode == 46) && (keycode < 64 || keycode > 92) && (keycode < 97 || keycode > 122)) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n}", "function isChar (code) {\n\t// http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes\n\treturn code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145);\n}", "function getChar(c){\n return String.fromCharCode(c)\n}", "function classify(c) {\n\tif (c === \".\") {\n\t\treturn \"dot\";\n\t} else if (isSpace(c)) {\n\t\treturn \"space\";\n\t} else if (isDigit(c)) {\n\t\treturn \"digit\";\n\t} else if (isLetter(c)) {\n\t\treturn \"letter\";\n\t} else if (isBracket(c)) {\n\t\treturn \"bracket\";\n\t}\n\treturn \"op\";\n}", "function isCharacterKeyPress(event) {\n\tif (typeof event.which == \"undefined\") {\n\t\t// This is IE, which only fires keypress events for printable keys\n\t\treturn true;\n\t} else if (typeof event.which == \"number\" && event.which > 0) {\n\t\t// In other browsers except old versions of WebKit, evt.which is\n\t\t// only greater than zero if the keypress is a printable key.\n\t\t// We need to filter out control keys\n\t\tvar control_keys = {\n\t\t\t\"17\": \"control\",\n\t\t\t\"91\": \"meta\",\n\t\t\t\"93\": \"meta\",\n\t\t\t\"18\": \"alt\",\n\t\t\t\"16\": \"shift\",\n\t\t\t\"9\": \"tab\",\n\t\t\t\"8\": \"backspace\",\n\t\t\t\"13\": \"enter\",\n\t\t\t\"27\": \"escape\",\n\t\t\t\"46\": \"delete\",\n\t\t\t\"37\": \"left\",\n\t\t\t\"39\": \"right\",\n\t\t\t\"40\": \"down\",\n\t\t\t\"38\": \"up\",\n\t\t\t\"33\": \"page_up\",\n\t\t\t\"34\": \"page_down\",\n\t\t\t\"36\": \"home\",\n\t\t\t\"35\": \"end\"\n\t\t};\n\t\treturn control_keys[event.which] == null;\n\t}\n\treturn false;\n}", "function atobLookup(chr) {\n if (/[A-Z]/.test(chr)) {\n return chr.charCodeAt(0) - \"A\".charCodeAt(0);\n }\n\n if (/[a-z]/.test(chr)) {\n return chr.charCodeAt(0) - \"a\".charCodeAt(0) + 26;\n }\n\n if (/[0-9]/.test(chr)) {\n return chr.charCodeAt(0) - \"0\".charCodeAt(0) + 52;\n }\n\n if (chr === \"+\") {\n return 62;\n }\n\n if (chr === \"/\") {\n return 63;\n } // Throw exception; should not be hit in tests\n\n\n return undefined;\n}", "function checkAscii(key) {\n if (String(key).length === 1) return key.charCodeAt(0);\n if (String(key) === \"Escape\") return \"27\";\n if (String(key) === \"Delete\") return \"127\";\n else return `---`;\n}", "function charCode(chr) {\n var esc = /^\\\\[xu](.+)/.exec(chr);\n return esc ? dec(esc[1]) : chr.charCodeAt(chr[0] === '\\\\' ? 1 : 0);\n }", "function check_allowed_char(input,type,config){\r\n\tvar filter = eval(config)[type].allowed;\r\n\t//console.log(filter.test(input))\r\n\treturn(!filter.test(input));\r\n}", "function keyCodeForChar(letter) {\n var keyCode = undefined;\n switch (letter) {\n case '.':\n keyCode = _mobiledocKitUtilsKeycodes['default']['.'];\n break;\n case '\\n':\n keyCode = _mobiledocKitUtilsKeycodes['default'].ENTER;\n break;\n default:\n keyCode = letter.charCodeAt(0);\n }\n return keyCode;\n }", "function charCode(chr) {\n const esc = /^\\\\[xu](.+)/.exec(chr);\n return esc ?\n dec(esc[1]) :\n chr.charCodeAt(chr[0] === '\\\\' ? 1 : 0);\n }", "function getPermissionKey(type) {\n return type.replace(new RegExp(\"^\" + constants_1.PREFIX + constants_1.SEPARATOR + \"\\\\w+\" + constants_1.SEPARATOR), '');\n}", "function key(kind, key) {\n \n}", "function keycode(key)\n{\n\treturn key.charCodeAt(0);\n}", "function find(type, key) {\n if (type.includes(\":\")) {\n const split = type.split(\":\");\n type = split[0];\n key = split[1];\n }\n\n let term = dictionary[type] ? dictionary[type].get(key) : null;\n return term;\n}", "function getkey(key) {\n var parsedKey = Number(key)\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1\n ) ? key\n : parsedKey\n }", "function key2Char(key) {\n var s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n if (key >= 97 && key <= 122) return s.charAt(key - 97);\n if (key >= 65 && key <= 90) return s.charAt(key - 65);\n if (key >= 48 && key <= 57) return \"\" + (key - 48);\n return null;\n }", "function isCharKey(evt)\n {\n var charCode = (evt.which) ? evt.which : event.keyCode\n if (charCode > 47 && charCode < 58)\n return false;\n return true;\n }", "function isCorrectCharacter(char) {\r\n switch (char) {\r\n case 'a':\r\n case 'e':\r\n case 'i':\r\n case 'o':\r\n case 'u':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function cr(key) {\n\tswitch (key) {\n\t\tcase 46 : return true;\tbreak; //Delete\n\t\tcase 8 : return true;\tbreak; //Backspace\n\t\tcase 32 : return true;\tbreak; //Barra de espaço\n\t\tcase 37 : return true;\tbreak; //Seta esquerda\n\t\tcase 39 : return true;\tbreak; //Seta direita\n\t}\n}", "function cTypes(identifier) {\n return contains(basicCTypes, identifier) || /.+_t$/.test(identifier);\n }", "function sc_isCharAlphabetic(c)\n { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||\n\t sc_isCharOfClass(c.val, SC_UPPER_CLASS); }", "function keyCode(character) {\n return jsPsych.pluginAPI.convertKeyCharacterToKeyCode(character)\n}", "static _typeToKey(type) {\n if (type.isCollection) {\n let key = this._typeToKey(type.primitiveType());\n if (key) {\n return `list:${key}`;\n }\n } else if (type.isEntity) {\n return type.entitySchema.name;\n } else if (type.isShape) {\n // TODO we need to fix this too, otherwise all handles of shape type will\n // be of the 'same type' when searching by type.\n return type.shapeShape;\n } else if (type.isVariable && type.isResolved()) {\n return Arc._typeToKey(type.resolvedType());\n }\n }", "function isCharacterKeyPress(evt) {\n if (typeof evt.which === 'undefined') {\n // This is IE, which only fires keypress events for printable keys\n return true;\n } else if (typeof evt.which === 'number' && evt.which > 0) {\n // In other browsers except old versions of WebKit, evt.which is\n // only greater than zero if the keypress is a printable key.\n // We need to filter out backspace and ctrl/alt/meta key combinations\n return !evt.ctrlKey && !evt.metaKey && !evt.altKey && evt.which != 8;\n }\n return false;\n}", "function xdtlGetKey(s, c) {\n\tc = c || \":\"; \n\tvar result = '';\n\n\t//Java 1.8 compatible (Javascript way)\n\tvar arr = s.split(c);\t\t\t\t\t \n\tif (arr.length > 0) {\n\t\tresult = arr[0];\n\t}\n\treturn result;\n}", "characterMapping(d) {\n switch (d) {\n case \"percentagea\":\n return \"A\"\n case \"percentaget\":\n return \"U\"\n case \"percentageg\":\n return \"G\"\n default:\n return \"C\"\n }\n }", "function getKey({ pathname }, path, exact) {\n return matchPath(pathname, { exact, path }) ? 'match' : 'no-match';\n}", "function typesMatch(ev,pointer){return ev&&pointer&&ev.type.charAt(0)===pointer.type;}", "isKey(str) {\n return isKeyInternal(this.keys, str);\n }", "function MapUnicodeCharacter(C)\r\n{\r\n\tif(KeyBoardLayout == BIJOY)\r\n\t\treturn bijoy_keyboard_map[C];\r\n\telse if(KeyBoardLayout == UNIJOY)\r\n\t\treturn unijoy_keyboard_map[C];\r\n\telse if(KeyBoardLayout == PROBHAT)\r\n\t\treturn probhat_keyboard_map[C];\r\n\telse if(KeyBoardLayout == SWIPHONETIC)\r\n\t\treturn somewherein_phonetic_keyboard_map [C];\r\n\telse if(KeyBoardLayout == AVROPHONETIC) {\r\n\t\tAvro_Forced = IsAvorForced(C);\r\n\t\treturn avro_phonetic_keyboard_map [C];\r\n\t}\r\n\telse if(KeyBoardLayout == BORNOSOFTACCENT) {\r\n\t\treturn bornosoft_keyboard_map [C];\r\n\t}\r\n\r\n\treturn C;\r\n}", "function checkIfKeyIsSpecial(keyCode) {\n var specialKey = _.find(Keys.VALID_SPECIAL_KEYS, function (specialKey) {\n return keyCode === specialKey.code;\n });\n\n if (specialKey) {\n return specialKey.key\n }\n }", "isCharacterDevice() {\n return (this.#type & IFMT) === IFCHR;\n }", "function char_2_int(c)\n{\n switch (c) {\n case 'R': return 0;\n case 'G': return 1;\n case 'B': return 2;\n\n // shouldn't happen\n default:\n return 3;\n }\n}", "function charMatch(let){\n console.log(\"charMatch\")\n //[char,switch,semantic val]\n //switch vals:\n //0 - regular char\n //1 - paren\n //2 - sub and sup, followed by one char or a curly\n //\n var charTable = [\n [\"{\",1,\"paren\"],\n [\"\\\\{\",1,\"paren\"],\n [\"}\",1,\"paren\"],\n [\"\\\\}\",1,\"paren\"],\n [\")\",1,\"paren\"],\n [\"(\",1,\"paren\"],\n [\"[\",1,\"paren\"],\n [\"]\",1,\"paren\"],\n [\"|\",1,\"func\"],\n [\"^\",2,\"sup\"],\n [\"_\",3,\"sub\"],\n [\"+\",0,\"binOp\"],\n [\"-\",0,\"binOp\"],\n [\"*\",0,\"binOp\"],\n [\"/\",0,\"binOp\"],\n [\"=\",0,\"equiv\"],\n [\"<\",0,\"comp\"],\n [\">\",0,\"comp\"],\n [\"!\",0,\"comb\"],\n [\"\\'\",0,\"prime\"],\n [\",\",0,\"sageS\"],\n [\":\",0,\"sageS\"],\n [\"\\\"\",0,\"sageS\"],\n [\" \",0,\"\"],\n ];\n\n console.log(\" Char lookup: \"+let);\n for(var i=0,len=charTable.length; i<len;i++){\n if(charTable[i][0]==let){\n console.log(\" Char match: \"+charTable[i][0]);\n return charTable[i];\n }\n }\n console.error(\" Unknown letter or symbol: \"+let);\n errors.push(\"Unknown letter or symbol: '\"+let+\"'.\");\n return([let,0,\"err\"]);\n}", "function sc_char2string(c) { return c.val; }", "charValue(character){\n if(BadBoggle.isAVowel(character)) return 3;\n if(character === 'y') return -10;\n return -2;\n }", "function getType() {\n if (result.Koopprijs && !result.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }" ]
[ "0.6661384", "0.6553067", "0.6553067", "0.6553067", "0.6520842", "0.6520842", "0.6520842", "0.6509395", "0.64543176", "0.5893024", "0.5843903", "0.5683862", "0.5586334", "0.5586334", "0.55530554", "0.5509329", "0.5456027", "0.5448259", "0.54441583", "0.54234093", "0.54234093", "0.5411509", "0.5410774", "0.53531635", "0.5327981", "0.53039676", "0.52908397", "0.52908397", "0.5276861", "0.52544767", "0.52459604", "0.523178", "0.51703507", "0.51256514", "0.5124794", "0.5120816", "0.51116884", "0.5104367", "0.51016843", "0.5048711", "0.50483954", "0.5041421", "0.50399023", "0.5028645", "0.5015481", "0.50085795", "0.50025594", "0.4991249", "0.4989847", "0.49891666", "0.49733627", "0.49658707", "0.49612615", "0.49585938", "0.4947708", "0.4947334", "0.49412954", "0.49374652", "0.49272493", "0.49237382", "0.49010193", "0.4899358", "0.48964807", "0.48809046", "0.48750672", "0.4874844", "0.48746702", "0.48614994", "0.48608404", "0.48531762", "0.48509073", "0.48298973", "0.48291713", "0.482244", "0.48170274", "0.47845", "0.47818074", "0.47771847", "0.47717994", "0.47688276", "0.4764932", "0.4755705", "0.47538912", "0.47516018", "0.474762", "0.47446117", "0.47395837", "0.47380197", "0.4731494", "0.47241586", "0.4714871" ]
0.6530318
10
Format a subPath, return its plain form if it is a literal string or number. Otherwise prepend the dynamic indicator ().
function formatSubPath (path) { var trimmed = path.trim(); // invalid leading 0 if (path.charAt(0) === '0' && isNaN(path)) { return false } return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatSubPath(path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) {return false;}\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;\n}", "function formatSubPath(path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) {return false;}\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;\n}", "function formatSubPath(path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) {return false;}\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;\n}", "function formatSubPath(path) {\n var trimmed = path.trim(); // invalid leading 0\n\n if (path.charAt(0) === '0' && isNaN(path)) {\n return false;\n }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;\n}", "function formatSubPath (path: string): boolean | string {\n const trimmed: string = path.trim()\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}", "function changeFormat2(value) {\n var d1 = value ? value.split('/') : null;\n return value ? d1[1] + '-' + d1[0] + '-' + d1[2] : \"\";\n}", "function changeFormat(value) {\n var d1 = value ? value.split('/') : null;\n return value ? d1[1] + '/' + d1[0] + '/' + d1[2] : \"\";\n}", "function getPositionalPathType(self, path) {\n const subpaths = path.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);\n if (subpaths.length < 2) {\n return self.paths.hasOwnProperty(subpaths[0]) ?\n self.paths[subpaths[0]] :\n 'adhocOrUndefined';\n }\n\n let val = self.path(subpaths[0]);\n let isNested = false;\n if (!val) {\n return 'adhocOrUndefined';\n }\n\n const last = subpaths.length - 1;\n\n for (let i = 1; i < subpaths.length; ++i) {\n isNested = false;\n const subpath = subpaths[i];\n\n if (i === last && val && !/\\D/.test(subpath)) {\n if (val.$isMongooseDocumentArray) {\n val = val.$embeddedSchemaType;\n } else if (val instanceof MongooseTypes.Array) {\n // StringSchema, NumberSchema, etc\n val = val.caster;\n } else {\n val = undefined;\n }\n break;\n }\n\n // ignore if its just a position segment: path.0.subpath\n if (!/\\D/.test(subpath)) {\n // Nested array\n if (val instanceof MongooseTypes.Array && i !== last) {\n val = val.caster;\n }\n continue;\n }\n\n if (!(val && val.schema)) {\n val = undefined;\n break;\n }\n\n const type = val.schema.pathType(subpath);\n isNested = (type === 'nested');\n val = val.schema.path(subpath);\n }\n\n self.subpaths[path] = val;\n if (val) {\n return 'real';\n }\n if (isNested) {\n return 'nested';\n }\n return 'adhocOrUndefined';\n}", "function prettyPath(path) {\n return path.length ? path.join('.') : '[]';\n}", "function escapePathElement(s) {\n var e = \"\"\n var i = 0\n for (i = 0; i< s.length; ++i) {\n var c = s.charAt(i)\n if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c == '-')) {\n e += c\n\n } else if (c == ' ') {\n e += '.'\n\n } else if (c == '.') {\n e += '~.'\n\n } else if (c == '~') {\n e += '~~'\n\n } else {\n e += \"~\" + s.charCodeAt(i).toString(16) + \".\"\n }\n }\n\n return e\n}", "function formatPath(basePath, path) {\n var formattedPath = removeTrailingSlashes(path.trim());\n return '' + removeTrailingSlashes(basePath) + formattedPath;\n}", "function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (isPathSeparator(code))\n break;\n else\n code = CHAR_FORWARD_SLASH;\n\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== CHAR_DOT ||\n res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) {\n res += `${separator}..`;\n\t }\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += separator + path.slice(lastSlash + 1, i); \n\t }\n else {\n res = path.slice(lastSlash + 1, i);\n\t }\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === CHAR_DOT && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function pathString(path){\n var result = '';\n for (var s in path){\n var val = path[s] * display.scale;\n if (!(s % 2)){\n result += (s == 0 ? \"M\" : \"L\");\n }\n result += val + \" \";\n }\n return result;\n}", "function replacePathInField(path) {\n\t return `${splitAccessPath(path)\n .map(p => p.replace('.', '\\\\.'))\n .join('\\\\.')}`;\n\t}", "function formatPath(path) {\n return path.substr(1).split('?')[0];\n}", "function interpolatePath (path) {\n if (!isNotEmptyString(path) && !isArray(path)) throw new TypeError('No Path was given');\n if (isArray(path)) return [...path];\n return path.replace('[', '.').replace(']', '').split('.');\n}", "function getPositionalPathType(self, path) {\n const subpaths = path.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);\n if (subpaths.length < 2) {\n return self.paths.hasOwnProperty(subpaths[0]) ?\n self.paths[subpaths[0]] :\n 'adhocOrUndefined';\n }\n\n let val = self.path(subpaths[0]);\n let isNested = false;\n if (!val) {\n return 'adhocOrUndefined';\n }\n\n const last = subpaths.length - 1;\n\n for (let i = 1; i < subpaths.length; ++i) {\n isNested = false;\n const subpath = subpaths[i];\n\n if (i === last && val && !/\\D/.test(subpath)) {\n if (val.$isMongooseDocumentArray) {\n const oldVal = val;\n val = new SchemaType(subpath, {\n required: get(val, 'schemaOptions.required', false)\n });\n val.cast = function(value, doc, init) {\n return oldVal.cast(value, doc, init)[0];\n };\n val.$isMongooseDocumentArrayElement = true;\n val.caster = oldVal.caster;\n val.schema = oldVal.schema;\n } else if (val instanceof MongooseTypes.Array) {\n // StringSchema, NumberSchema, etc\n val = val.caster;\n } else {\n val = undefined;\n }\n break;\n }\n\n // ignore if its just a position segment: path.0.subpath\n if (!/\\D/.test(subpath)) {\n // Nested array\n if (val instanceof MongooseTypes.Array && i !== last) {\n val = val.caster;\n }\n continue;\n }\n\n if (!(val && val.schema)) {\n val = undefined;\n break;\n }\n\n const type = val.schema.pathType(subpath);\n isNested = (type === 'nested');\n val = val.schema.path(subpath);\n }\n\n self.subpaths[path] = val;\n if (val) {\n return 'real';\n }\n if (isNested) {\n return 'nested';\n }\n return 'adhocOrUndefined';\n}", "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n}", "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n}", "function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n var res = \"\";\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0, len = path.length; i <= len; ++i) {\n if (i < len)\n code = path.charCodeAt(i);\n else if (isPathSeparator(code))\n break;\n else\n code = CHAR_FORWARD_SLASH;\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) ;\n else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 ||\n lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== CHAR_DOT ||\n res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n else if (res.length === 2 || res.length === 1) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += separator + \"..\";\n else\n res = \"..\";\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0)\n res += separator + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === CHAR_DOT && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n }", "function dottify(path) {\n return (path || '').replace(/^\\//g, '').replace(/\\//g, '.');\n }", "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}", "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n }", "function replacePathInField(path) {\n return \"\".concat(splitAccessPath(path).map(escapePathAccess).join('\\\\.'));\n }", "function subs_filter_within_path(subSet) {\n var\n subInst = subSet.inst,\n currentNode = subInst.nodes[subInst.tank.currentIndex]\n ;\n if (~currentNode.parentIndex) {\n return subInst.nodes[currentNode.parentIndex].path;\n }\n return '';\n }", "function $coerce_to_path(path) {\n if ($truthy((path)['$respond_to?'](\"to_path\"))) {\n path = path.$to_path();\n }\n\n path = $$($nesting, 'Opal')['$coerce_to!'](path, $$($nesting, 'String'), \"to_str\");\n\n return path;\n }", "function formatPath(input) {\n if (input && input.lastIndexOf('/') !== input.length - 1) {\n input = input + '/';\n }\n if (input && input.substr(0, 2) === '//') {\n input = document.location.protocol + input;\n }\n }", "function subtypeName() {\n return containsSuffix() ? name.split('+')[0] : name;\n }", "function collapseLeadingSlashes(str){for(var i=0;i<str.length;i++){if(str[i]!=='/'){break;}}return i>1?'/'+str.substr(i):str;}", "toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }", "toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }", "toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }", "toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }", "toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }", "toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }", "function formatPathname(urlobj)\n{\n\tvar pathname = joinDirs(urlobj.extra.directory, urlobj.extra.directoryLeadingSlash);\n\t\n\tif (urlobj.extra.filename !== null)\n\t{\n\t\tpathname += urlobj.extra.filename;\n\t}\n\t\n\treturn pathname;\n}", "function removePathFromField(path) {\n return \"\" + splitAccessPath(path).join('.');\n }", "function replacePathInField(path) {\n return \"\" + splitAccessPath(path).map(function (p) { return p.replace('.', '\\\\.'); }).join('\\\\.');\n }", "function escapeJsonPath(str) {\n return str.replace(/~/g, \"~1\").replace(/\\//g, \"~0\")\n}", "function fixPath(path) {\n \n \n if(path.startsWith('\\\\\\\\') === false) {\n \n console.log('Path does not starts with \\\\\\\\. Throw error');\n throw \"Path does not starts with \\\\\\\\\";\n \n } else {\n \n // storing path slash into variable\t \n var result = '\\\\\\\\';\n for(var i = 0; i < path.length; i++) {\n \n // Current character is back slash or not\n if(path.charAt(i) === '\\\\') {\n \n // Is result ends with back slash?\n if(result.endsWith('\\\\') === false) {\n result += '\\\\';\n }\n } else {\n result += path.charAt(i);\n }\n }\n return result;\n \n }\n \n}", "function formatPath(urlobj)\n{\n\tvar path = urlobj.pathname;\n\t\n\tif (urlobj.search !== null)\n\t{\n\t\tpath += urlobj.search;\n\t}\n\t\n\treturn path;\n}", "static _materializePath(path) {\n let parts = path.split('.');\n let leaf = parts.slice(-1);\n //dereference the parent path so that its materialized.\n let parent_path = ApplicationState._dereferencePath(parts.slice(0, -1).join('.'));\n return parent_path + '.' + leaf;\n }", "function isec2path(isec) {\n return (+isec <=2) ? `c.${isec}` : `a.${isec}`;\n }", "function formatPath(path) {\n // Replace windows style separators\n path = path.replace(/\\\\/g, '/');\n\n // If path starts with 'public', remove that part\n if(path.startsWith('public')) {\n path = path.replace('public', '');\n }\n\n return path;\n}", "function rawPathToString(rawPath) {\n if (_isNumber(rawPath[0])) {\n //in case a segment is passed in instead\n rawPath = [rawPath];\n }\n\n var result = \"\",\n l = rawPath.length,\n sl,\n s,\n i,\n segment;\n\n for (s = 0; s < l; s++) {\n segment = rawPath[s];\n result += \"M\" + _round(segment[0]) + \",\" + _round(segment[1]) + \" C\";\n sl = segment.length;\n\n for (i = 2; i < sl; i++) {\n result += _round(segment[i++]) + \",\" + _round(segment[i++]) + \" \" + _round(segment[i++]) + \",\" + _round(segment[i++]) + \" \" + _round(segment[i++]) + \",\" + _round(segment[i]) + \" \";\n }\n\n if (segment.closed) {\n result += \"z\";\n }\n }\n\n return result;\n}", "function rawPathToString(rawPath) {\n if (_isNumber(rawPath[0])) {\n //in case a segment is passed in instead\n rawPath = [rawPath];\n }\n\n var result = \"\",\n l = rawPath.length,\n sl,\n s,\n i,\n segment;\n\n for (s = 0; s < l; s++) {\n segment = rawPath[s];\n result += \"M\" + _round(segment[0]) + \",\" + _round(segment[1]) + \" C\";\n sl = segment.length;\n\n for (i = 2; i < sl; i++) {\n result += _round(segment[i++]) + \",\" + _round(segment[i++]) + \" \" + _round(segment[i++]) + \",\" + _round(segment[i++]) + \" \" + _round(segment[i++]) + \",\" + _round(segment[i]) + \" \";\n }\n\n if (segment.closed) {\n result += \"z\";\n }\n }\n\n return result;\n}", "function rawPathToString(rawPath) {\n if (_isNumber(rawPath[0])) {\n //in case a segment is passed in instead\n rawPath = [rawPath];\n }\n\n var result = \"\",\n l = rawPath.length,\n sl,\n s,\n i,\n segment;\n\n for (s = 0; s < l; s++) {\n segment = rawPath[s];\n result += \"M\" + _round(segment[0]) + \",\" + _round(segment[1]) + \" C\";\n sl = segment.length;\n\n for (i = 2; i < sl; i++) {\n result += _round(segment[i++]) + \",\" + _round(segment[i++]) + \" \" + _round(segment[i++]) + \",\" + _round(segment[i++]) + \" \" + _round(segment[i++]) + \",\" + _round(segment[i]) + \" \";\n }\n\n if (segment.closed) {\n result += \"z\";\n }\n }\n\n return result;\n}", "function pathToString(pp) {\n var s = \"\"\n for ( var aa = 0 ; aa < pp.length ; aa ++ ) {\n if (isNaN(parseInt(pp[aa]))) {\n s += pp[aa]\n } else {\n s += \"[]\"\n }\n if (aa < pp.length -1) {\n s += \".\"\n }\n }\n return s\n }", "function collapseLeadingSlashes(str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function encode(path){var result='';for(var i=0;i<path.length;i++){if(result.length>0){result=encodeSeparator(result);}result=encodeSegment(path.get(i),result);}return encodeSeparator(result);}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "function GetProperFileNameWithFormat(materialSub, selectedFileName) {\n var currentDate = $filter('date')(new Date(), \"dd-MM-yyyy\");\n return $scope.newMaterialRegisterHeader.CTNumber.replace(\"/\", \"\") + \"_\" +\n materialSub.SubSeriesNumber.replace(\"/\", \"\") + \"_\" +\n currentDate + \"_\" + selectedFileName;\n }", "buildPathFromArray(pathArray, subFolder) {\n return pathArray.join(\"/\") + \"/\";\n }", "function removePathFromField(path) {\n return \"\".concat(splitAccessPath(path).join('.'));\n }", "function SPResourcePath(value) {\r\n if (value === void 0) { value = ''; }\r\n var rootDelimeter = '//';\r\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\r\n var indexOfPathDelimeter = value.indexOf('/');\r\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\r\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\r\n indexOfRootDelimeter + rootDelimeter.length :\r\n -1;\r\n var authority = getAuthority(value, endIndexOfRootDelimeter);\r\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\r\n // By definition, everything after the authority is the path\r\n var path = value.slice(authority.length);\r\n var format = authority ?\r\n 0 /* absolute */ :\r\n path[0] === '/' ?\r\n 2 /* serverRelative */ :\r\n 1 /* relative */;\r\n var segments = path.split('/');\r\n this.authority = authority;\r\n this.domain = domain;\r\n this.format = format;\r\n this.path = path;\r\n this.segments = segments;\r\n this.value = value;\r\n }", "function format(x)\n\t\t{\n\t\t\tvar x = x.split('-').reverse().join('/');\n\t\t\treturn x;\n\t\t}", "function modifyTex(tex) {\n function isNestedFraction(tex) {\n return tex.indexOf(\"\\\\frac\") > -1 || tex.indexOf(\"\\\\dfrac\") > -1;\n }\n\n var handler = function handler(exp1, exp2) {\n var prefix;\n\n if (isNestedFraction(exp1) || isNestedFraction(exp2)) {\n prefix = \"\\\\dfrac\";\n } else {\n prefix = \"\\\\frac\";\n }\n\n return prefix + \" {\" + exp1 + \"}{\" + exp2 + \"}\";\n };\n\n return walkTex(tex, handler);\n}", "function unescapePathComponent(path) {\r\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\r\n}", "function unescapePathComponent(path) {\r\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\r\n}", "function nodeExpansionIdentifier(path) {\n const splitPath = path.split('/');\n if (splitPath.length > 1) {\n return `G:${splitPath[splitPath.length - 1]}`;\n }\n return '';\n}", "function render_path(path, params) {\n\tparams = params || {};\n\treturn ARRAY( is.array(path) ? path : [path] ).map(function(p) {\n\t\treturn p.replace(/:([a-z0-9A-Z\\_]+)/g, function(match, key) {\n\t\t\tif(params[key] === undefined) {\n\t\t\t\treturn ':'+key;\n\t\t\t}\n\t\t\treturn ''+fix_object_ids(params[key]);\n\t\t});\n\t}).valueOf();\n}", "function whistle_short_path($p) {\n return strcat(substr($p,9,1),\n ydtosdf(substr($p,0,8),3),\n numtosxg(substr($p,10,3)));\n}", "function _get(obj,path){\n\t \n\t //Split the path into it's seperate components\n\t\tvar _path = path.split(\".\");\n\t\t\n\t\t//Set the object we use to query for this name to be the original object\n\t\tvar subObj = obj;\n\t \n\t\t//Parse the object properties\n\t\tvar c_len = _path.length;\n\t\tfor (var i=0;i<c_len;++i) {\n \n //Skip if we don't have this part of the path\n\t\t\tif( _path[i].length > 0 ) {\n\t\t\t \n\t\t\t //Get the sub object using the path\n\t\t\t\tsubObj = subObj[_path[i]];\n\t\t\t\t\n\t\t\t\t//Break if we don't have this sub object\n\t\t\t\tif(subObj === null || subObj === undefined) break;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return an empty string if we don't have a value\n\t\tif(subObj === null || subObj === undefined) return(\"\");\n\t\t\n\t\treturn(subObj);\n\t}", "function lengthToPath(length) {\n if (length < 100) return '0-100'\n else if (length < 200) return '100-200'\n else if (length < 500) return '200-500'\n else if (length < 1000) return '500-1000'\n else if (length < 1500) return '1000-1500'\n else return '1500-'\n}", "function accessPathWithDatum(path) {\n var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'datum';\n var pieces = splitAccessPath(path);\n var prefixes = [];\n\n for (var i = 1; i <= pieces.length; i++) {\n var prefix = \"[\".concat(pieces.slice(0, i).map($).join(']['), \"]\");\n prefixes.push(\"\".concat(datum).concat(prefix));\n }\n\n return prefixes.join(' && ');\n }", "function rawGetParentPath(str, separator, allow_empty)\n{\n\tif(!rawIsSafeString(str)){\n\t\treturn '';\n\t}\n\tif(!rawIsSafeEntity(allow_empty)){\n\t\tallow_empty = false;\n\t}else if('boolean' !== typeof allow_empty){\n\t\treturn '';\n\t}\n\tif(!rawIsSafeString(separator)){\n\t\tseparator = '/';\n\t}\n\tvar\ttmp;\n\tvar\tcnt;\n\n\t// escape if allow empty\n\tif(allow_empty){\n\t\t// escape '\\' --> '\\\\'\n\t\tstr = str.replace(/\\\\/g, '\\\\\\\\');\n\t\t// last word is '/' --> add '\\'\n\t\tif('/' === str[str.length - 1]){\n\t\t\tstr += '\\\\';\n\t\t}\n\t\t// if '//' --> '/\\/'\n\t\ttmp = '';\n\t\tfor(cnt = 0; cnt < str.length; ++cnt){\n\t\t\ttmp += str[cnt];\n\t\t\tif('/' === str[cnt] && (cnt + 1) < str.length && '/' === str[cnt + 1]){\n\t\t\t\ttmp += '\\\\';\n\t\t\t}\n\t\t}\n\t\tstr = tmp;\n\t}\n\n\t// parse by separator\n\tvar\tparts = str.split(separator);\n\n\t// remove last elements until it is not empty\n\twhile(0 < parts.length && !rawIsSafeString(parts[parts.length - 1])){\n\t\tparts.pop();\n\t}\n\n\t// remove last element\n\tif(0 < parts.length){\n\t\tparts.pop();\n\t}\n\n\t// remove last elements until it is not empty\n\twhile(0 < parts.length && !rawIsSafeString(parts[parts.length - 1])){\n\t\tparts.pop();\n\t}\n\n\t// join with separator\n\tvar\tparent = parts.join(separator);\n\n\t// unescape if allow empty\n\tif(allow_empty && rawIsSafeString(parent)){\n\t\t// '\\' --> '' or '\\\\' --> '\\'\n\t\ttmp = '';\n\t\tfor(cnt = 0; cnt < parent.length; ++cnt){\n\t\t\tif('\\\\' === parent[cnt]){\n\t\t\t\t++cnt;\n\t\t\t\tif(cnt < parent.length && '\\\\' === parent[cnt]){\n\t\t\t\t\ttmp += parent[cnt];\t// = '\\'\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\ttmp += parent[cnt];\n\t\t\t}\n\t\t}\n\t\tparent = tmp;\n\t}\n\treturn parent;\n}", "buildPath({ resource, type, extra}) {\n if (_.isString(type)) return type\n if (resource && _.isFunction(resource.constructor.path)) {\n return resource.constructor.path(extra)\n }\n if (!type) return this.inferType(resource)\n if (_.isFunction(type.path)) return type.path(extra)\n if (this.models.includes(type)) return this.inferType(new type())\n return ''\n }", "function generatePath(path,params){if(path===void 0){path=\"/\";}if(params===void 0){params={};}return path===\"/\"?path:compilePath(path)(params,{pretty:true});}", "function appendSubHtml(subheader, data, id, pathBase) {\n\tvar sectionBg = (useAltColor1 ? 'altColor1' : 'altColor2');\n\tvar runningHtml = '<tr class=\\\"' + sectionBg + '\\\"><td><h4>&nbsp;&nbsp;' + subheader + '</h4></td><td><table>';\n\n\tfor (let key in data) {\n\t\tlet label = formatWords(key);\n\t\tlet value = escapeSingleQuotes(data[key]);\n\t\tlet path = pathBase + '/' + key;\n\t\tconsole.log('path in appendHTML: ' + path);\n\n\t\trunningHtml += \"<tr><td>\" + label + \":</td><td><input id='\" + path + \"' value='\" + value + \"' readonly></input></td></tr>\";\n\t}\n\n\treturn runningHtml + '</table></td></tr>';\n}", "function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n }", "function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n}", "function SPResourcePath(value) {\r\n if (value === void 0) { value = ''; }\r\n var rootDelimeter = '//';\r\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\r\n var indexOfPathDelimeter = value.indexOf('/');\r\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\r\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\r\n indexOfRootDelimeter + rootDelimeter.length :\r\n -1;\r\n var authority = getAuthority(value, endIndexOfRootDelimeter);\r\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\r\n // By definition, everything after the authority is the path\r\n var path = value.slice(authority.length);\r\n var format = authority ?\r\n SPResourcePathFormat.absolute :\r\n path[0] === '/' ?\r\n SPResourcePathFormat.serverRelative :\r\n SPResourcePathFormat.relative;\r\n var segments = path.split('/');\r\n this.authority = authority;\r\n this.domain = domain;\r\n this.format = format;\r\n this.path = path;\r\n this.segments = segments;\r\n this.value = value;\r\n }", "function SPResourcePath(value) {\r\n if (value === void 0) { value = ''; }\r\n var rootDelimeter = '//';\r\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\r\n var indexOfPathDelimeter = value.indexOf('/');\r\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\r\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\r\n indexOfRootDelimeter + rootDelimeter.length :\r\n -1;\r\n var authority = getAuthority(value, endIndexOfRootDelimeter);\r\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\r\n // By definition, everything after the authority is the path\r\n var path = value.slice(authority.length);\r\n var format = authority ?\r\n SPResourcePathFormat.absolute :\r\n path[0] === '/' ?\r\n SPResourcePathFormat.serverRelative :\r\n SPResourcePathFormat.relative;\r\n var segments = path.split('/');\r\n this.authority = authority;\r\n this.domain = domain;\r\n this.format = format;\r\n this.path = path;\r\n this.segments = segments;\r\n this.value = value;\r\n }", "function SPResourcePath(value) {\n if (value === void 0) { value = ''; }\n var rootDelimeter = '//';\n var indexOfRootDelimeter = value.indexOf(rootDelimeter);\n var indexOfPathDelimeter = value.indexOf('/');\n // The root delimeter is the first instance of '//', unless preceded by a lone '/'\n var endIndexOfRootDelimeter = indexOfRootDelimeter > -1 && indexOfRootDelimeter <= indexOfPathDelimeter ?\n indexOfRootDelimeter + rootDelimeter.length :\n -1;\n var authority = getAuthority(value, endIndexOfRootDelimeter);\n var domain = authority && authority.slice(endIndexOfRootDelimeter);\n // By definition, everything after the authority is the path\n var path = value.slice(authority.length);\n var format = authority ?\n SPResourcePathFormat.absolute :\n path[0] === '/' ?\n SPResourcePathFormat.serverRelative :\n SPResourcePathFormat.relative;\n var segments = path.split('/');\n this.authority = authority;\n this.domain = domain;\n this.format = format;\n this.path = path;\n this.segments = segments;\n this.value = value;\n }", "get path() { // TODO: rename this to path and this.path to this.uninterpolatedPath\n\n if ( !( 'uid' in this.definedProps ) ) {\n this._define_user();\n }\n\n let path = parseTpl(this.templatePath, this.definedProps)\n\n let undefinedFields = analyzeTpl( path );\n\n if ( undefinedFields.length > 0 ) { // this might be ok in some cases?\n throw new Error('Not all template id\\'s are defined. Required fields are ' + undefinedFields.join(', '))\n }\n\n /* remove * if it is the last character, otherwise replace * by {id} so it\n can be interpolated by this.define. */\n /*\n if ( !this.isSuffixed ) {\n return path.slice(0, -1)\n } else {\n return path.replace(/\\*----/, '{id}')\n }*/\n\n return path.replace(/\\*/g, '{id}')\n }", "function normalizeKeypath (key) {\n return key.indexOf('[') < 0\n ? key\n : key.replace(BRACKET_RE_S, '.$1')\n .replace(BRACKET_RE_D, '.$1')\n}", "function accessPathWithDatum(path, datum) {\n if (datum === void 0) { datum = 'datum'; }\n var pieces = splitAccessPath(path);\n var prefixes = [];\n for (var i = 1; i <= pieces.length; i++) {\n var prefix = \"[\" + pieces.slice(0, i).map($).join('][') + \"]\";\n prefixes.push(\"\" + datum + prefix);\n }\n return prefixes.join(' && ');\n }", "function flatAccessWithDatum(path, datum = 'datum') {\n\t return `${datum}[${$(splitAccessPath(path).join('.'))}]`;\n\t}", "function a(e,t){return\"\".concat(t.base,t.size,\"/\",e,t.ext)}", "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return fromDotSeparatedString(path)._internalPath;\n } catch (e) {\n var message = errorMessage(e);\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + methodName + \"() called with invalid data. \" + message);\n }\n }", "function toPackagePath(loader, pkgName, pkg, basePath, subPath, sync, isPlugin) {\n // skip if its a plugin call already, or we have boolean / interpolation conditional syntax in subPath\n var skipExtension = !!(isPlugin || subPath.indexOf('#?') != -1 || subPath.match(interpolationRegEx));\n\n // exact meta or meta with any content after the last wildcard skips extension\n if (!skipExtension && pkg.modules)\n getMetaMatches(pkg.modules, pkgName, subPath, function(metaPattern, matchMeta, matchDepth) {\n if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1)\n skipExtension = true;\n });\n\n var normalized = pkgName + '/' + basePath + subPath + (skipExtension ? '' : getDefaultExtension(pkg, subPath));\n\n return sync ? normalized : booleanConditional.call(loader, normalized, pkgName + '/').then(function(name) {\n return interpolateConditional.call(loader, name, pkgName + '/');\n });\n }", "function s(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");// XXX: It is possible to remove this block, and the tests still pass!\nvar n=r(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "toPathString(path) {\n if (path.length === 0) {\n return '';\n }\n else {\n return `${this.separator}${path.join(this.separator)}`;\n }\n }", "normalize(...variants) {\n\n if (variants.length <= 0)\n return null;\n if (variants.length > 0\n && !Object.usable(variants[0]))\n return null;\n if (variants.length > 1\n && !Object.usable(variants[1]))\n return null;\n\n if (variants.length > 1\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid root: \" + typeof variants[0]);\n let root = \"#\";\n if (variants.length > 1) {\n root = variants[0];\n try {root = Path.normalize(root);\n } catch (error) {\n root = (root || \"\").trim();\n throw new TypeError(`Invalid root${root ? \": \" + root : \"\"}`);\n }\n }\n\n if (variants.length > 1\n && typeof variants[1] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[1]);\n if (variants.length > 0\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[0]);\n let path = \"\";\n if (variants.length === 1)\n path = variants[0];\n if (variants.length === 1\n && path.match(PATTERN_URL))\n path = path.replace(PATTERN_URL, \"$1\");\n else if (variants.length > 1)\n path = variants[1];\n path = (path || \"\").trim();\n\n if (!path.match(PATTERN_PATH))\n throw new TypeError(`Invalid path${String(path).trim() ? \": \" + path : \"\"}`);\n\n path = path.replace(/([^#])#$/, \"$1\");\n path = path.replace(/^([^#])/, \"#$1\");\n\n // Functional paths are detected.\n if (path.match(PATTERN_PATH_FUNCTIONAL))\n return \"###\";\n\n path = root + path;\n path = path.toLowerCase();\n\n // Path will be balanced\n const pattern = /#[^#]+#{2}/;\n while (path.match(pattern))\n path = path.replace(pattern, \"#\");\n path = \"#\" + path.replace(/(^#+)|(#+)$/g, \"\");\n\n return path;\n }" ]
[ "0.7757966", "0.7757966", "0.7757966", "0.77383876", "0.75277257", "0.5522842", "0.545122", "0.5359274", "0.5325281", "0.5295737", "0.52854866", "0.5267375", "0.5253298", "0.5253298", "0.5248702", "0.51918644", "0.5165298", "0.5164079", "0.51384604", "0.51203215", "0.51203215", "0.5114135", "0.50814617", "0.50691193", "0.5066721", "0.50636977", "0.502227", "0.5019381", "0.5006297", "0.4984166", "0.4974817", "0.4971903", "0.4971903", "0.4971903", "0.4971903", "0.4971903", "0.4971903", "0.49697793", "0.49601087", "0.49514675", "0.49492246", "0.49449468", "0.49415514", "0.49262258", "0.49122283", "0.4911783", "0.4901765", "0.4901765", "0.4901765", "0.4869131", "0.4862509", "0.4859959", "0.4854092", "0.4854092", "0.48519823", "0.48351222", "0.48216844", "0.4819981", "0.48110777", "0.4807692", "0.478095", "0.478095", "0.47775468", "0.47616017", "0.47576174", "0.47467855", "0.4743633", "0.4734914", "0.47338516", "0.47271353", "0.4726018", "0.4725429", "0.47181827", "0.4714816", "0.4714675", "0.4714675", "0.4711996", "0.4711525", "0.4696762", "0.469452", "0.46811277", "0.46779317", "0.46717906", "0.46575537", "0.4648158", "0.46297175", "0.4614875" ]
0.77525383
12
Parse a string path into an array of segments
function parse$1 (path) { var keys = []; var index = -1; var mode = BEFORE_PATH; var subPathDepth = 0; var c; var key; var newChar; var type; var transition; var action; var typeMap; var actions = []; actions[PUSH] = function () { if (key !== undefined) { keys.push(key); key = undefined; } }; actions[APPEND] = function () { if (key === undefined) { key = newChar; } else { key += newChar; } }; actions[INC_SUB_PATH_DEPTH] = function () { actions[APPEND](); subPathDepth++; }; actions[PUSH_SUB_PATH] = function () { if (subPathDepth > 0) { subPathDepth--; mode = IN_SUB_PATH; actions[APPEND](); } else { subPathDepth = 0; if (key === undefined) { return false } key = formatSubPath(key); if (key === false) { return false } else { actions[PUSH](); } } }; function maybeUnescapeQuote () { var nextChar = path[index + 1]; if ((mode === IN_SINGLE_QUOTE && nextChar === "'") || (mode === IN_DOUBLE_QUOTE && nextChar === '"')) { index++; newChar = '\\' + nextChar; actions[APPEND](); return true } } while (mode !== null) { index++; c = path[index]; if (c === '\\' && maybeUnescapeQuote()) { continue } type = getPathCharType(c); typeMap = pathStateMachine[mode]; transition = typeMap[type] || typeMap['else'] || ERROR; if (transition === ERROR) { return // parse error } mode = transition[0]; action = actions[transition[1]]; if (action) { newChar = transition[2]; newChar = newChar === undefined ? c : newChar; if (action() === false) { return } } if (mode === AFTER_PATH) { return keys } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parsePath(path) {\n const paths = path.split('.');\n return paths.length > 1 ? paths : [paths[0]];\n}", "function getPathSegments(path) {\n var pathArray = path.split(\".\");\n var parts = [];\n for (var i = 0; i < pathArray.length; i++) {\n var p = pathArray[i];\n while (p[p.length - 1] === \"\\\\\" && pathArray[i + 1] !== undefined) {\n p = p.slice(0, -1) + \".\";\n p += pathArray[++i];\n }\n parts.push(p);\n }\n var disallowedKeys = [\"__proto__\", \"prototype\", \"constructor\"];\n var isValidPath = function (pathSegments) { return !pathSegments.some(function (segment) { return disallowedKeys.includes(segment); }); };\n if (!isValidPath(parts)) {\n return [];\n }\n return parts;\n}", "function normalizePaths(path) {\n // @ts-ignore (not sure why this happens)\n return path.map(segment => typeof segment === 'string' ? segment.split('.') : segment);\n} // Supports passing either an id or a value (document/reference/object)", "function split(path) {\n if (!path) {\n return [];\n }\n return String(path).split(SEPARATOR_RE);\n}", "function parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n if (is_array_default()(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0,\n };\n var data = [];\n String(pathString).replace(PATH_COMMAND, function (a, b, c) {\n var params = [];\n var name = b.toLowerCase();\n c.replace(PATH_VALUES, function (a, b) {\n b && params.push(+b);\n });\n if (name === 'm' && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = 'l';\n b = b === 'm' ? 'l' : 'L';\n }\n if (name === 'o' && params.length === 1) {\n data.push([b, params[0]]);\n }\n if (name === 'r') {\n data.push([b].concat(params));\n }\n else {\n while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n }\n return '';\n });\n return data;\n}", "function tokenizePath(path) {\n if (!path)\n return [[]];\n if (path === '/')\n return [[ROOT_TOKEN]];\n if (!path.startsWith('/')) {\n throw new Error(( true)\n ? `Route paths should start with a \"/\": \"${path}\" should be \"/${path}\".`\n : 0);\n }\n // if (tokenCache.has(path)) return tokenCache.get(path)!\n function crash(message) {\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\n }\n let state = 0 /* Static */;\n let previousState = state;\n const tokens = [];\n // the segment will always be valid because we get into the initial state\n // with the leading /\n let segment;\n function finalizeSegment() {\n if (segment)\n tokens.push(segment);\n segment = [];\n }\n // index on the path\n let i = 0;\n // char at index\n let char;\n // buffer of the value read\n let buffer = '';\n // custom regexp for a param\n let customRe = '';\n function consumeBuffer() {\n if (!buffer)\n return;\n if (state === 0 /* Static */) {\n segment.push({\n type: 0 /* Static */,\n value: buffer,\n });\n }\n else if (state === 1 /* Param */ ||\n state === 2 /* ParamRegExp */ ||\n state === 3 /* ParamRegExpEnd */) {\n if (segment.length > 1 && (char === '*' || char === '+'))\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\n segment.push({\n type: 1 /* Param */,\n value: buffer,\n regexp: customRe,\n repeatable: char === '*' || char === '+',\n optional: char === '*' || char === '?',\n });\n }\n else {\n crash('Invalid state to consume buffer');\n }\n buffer = '';\n }\n function addCharToBuffer() {\n buffer += char;\n }\n while (i < path.length) {\n char = path[i++];\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\n previousState = state;\n state = 4 /* EscapeNext */;\n continue;\n }\n switch (state) {\n case 0 /* Static */:\n if (char === '/') {\n if (buffer) {\n consumeBuffer();\n }\n finalizeSegment();\n }\n else if (char === ':') {\n consumeBuffer();\n state = 1 /* Param */;\n }\n else {\n addCharToBuffer();\n }\n break;\n case 4 /* EscapeNext */:\n addCharToBuffer();\n state = previousState;\n break;\n case 1 /* Param */:\n if (char === '(') {\n state = 2 /* ParamRegExp */;\n }\n else if (VALID_PARAM_RE.test(char)) {\n addCharToBuffer();\n }\n else {\n consumeBuffer();\n state = 0 /* Static */;\n // go back one character if we were not modifying\n if (char !== '*' && char !== '?' && char !== '+')\n i--;\n }\n break;\n case 2 /* ParamRegExp */:\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\n // it already works by escaping the closing )\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\n // is this really something people need since you can also write\n // /prefix_:p()_suffix\n if (char === ')') {\n // handle the escaped )\n if (customRe[customRe.length - 1] == '\\\\')\n customRe = customRe.slice(0, -1) + char;\n else\n state = 3 /* ParamRegExpEnd */;\n }\n else {\n customRe += char;\n }\n break;\n case 3 /* ParamRegExpEnd */:\n // same as finalizing a param\n consumeBuffer();\n state = 0 /* Static */;\n // go back one character if we were not modifying\n if (char !== '*' && char !== '?' && char !== '+')\n i--;\n customRe = '';\n break;\n default:\n crash('Unknown state');\n break;\n }\n }\n if (state === 2 /* ParamRegExp */)\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\n consumeBuffer();\n finalizeSegment();\n // tokenCache.set(path, tokens)\n return tokens;\n}", "function parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n if (is_array_1.default(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0,\n };\n var data = [];\n String(pathString).replace(PATH_COMMAND, function (a, b, c) {\n var params = [];\n var name = b.toLowerCase();\n c.replace(PATH_VALUES, function (a, b) {\n b && params.push(+b);\n });\n if (name === 'm' && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = 'l';\n b = b === 'm' ? 'l' : 'L';\n }\n if (name === 'o' && params.length === 1) {\n data.push([b, params[0]]);\n }\n if (name === 'r') {\n data.push([b].concat(params));\n }\n else {\n while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n }\n return '';\n });\n return data;\n}", "function tokenizePath(path) {\r\n if (!path)\r\n return [[]];\r\n if (path === '/')\r\n return [[ROOT_TOKEN]];\r\n if (!path.startsWith('/')) {\r\n throw new Error(( true)\r\n ? `Route paths should start with a \"/\": \"${path}\" should be \"/${path}\".`\r\n : undefined);\r\n }\r\n // if (tokenCache.has(path)) return tokenCache.get(path)!\r\n function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }\r\n let state = 0 /* Static */;\r\n let previousState = state;\r\n const tokens = [];\r\n // the segment will always be valid because we get into the initial state\r\n // with the leading /\r\n let segment;\r\n function finalizeSegment() {\r\n if (segment)\r\n tokens.push(segment);\r\n segment = [];\r\n }\r\n // index on the path\r\n let i = 0;\r\n // char at index\r\n let char;\r\n // buffer of the value read\r\n let buffer = '';\r\n // custom regexp for a param\r\n let customRe = '';\r\n function consumeBuffer() {\r\n if (!buffer)\r\n return;\r\n if (state === 0 /* Static */) {\r\n segment.push({\r\n type: 0 /* Static */,\r\n value: buffer,\r\n });\r\n }\r\n else if (state === 1 /* Param */ ||\r\n state === 2 /* ParamRegExp */ ||\r\n state === 3 /* ParamRegExpEnd */) {\r\n if (segment.length > 1 && (char === '*' || char === '+'))\r\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\r\n segment.push({\r\n type: 1 /* Param */,\r\n value: buffer,\r\n regexp: customRe,\r\n repeatable: char === '*' || char === '+',\r\n optional: char === '*' || char === '?',\r\n });\r\n }\r\n else {\r\n crash('Invalid state to consume buffer');\r\n }\r\n buffer = '';\r\n }\r\n function addCharToBuffer() {\r\n buffer += char;\r\n }\r\n while (i < path.length) {\r\n char = path[i++];\r\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\r\n previousState = state;\r\n state = 4 /* EscapeNext */;\r\n continue;\r\n }\r\n switch (state) {\r\n case 0 /* Static */:\r\n if (char === '/') {\r\n if (buffer) {\r\n consumeBuffer();\r\n }\r\n finalizeSegment();\r\n }\r\n else if (char === ':') {\r\n consumeBuffer();\r\n state = 1 /* Param */;\r\n }\r\n else {\r\n addCharToBuffer();\r\n }\r\n break;\r\n case 4 /* EscapeNext */:\r\n addCharToBuffer();\r\n state = previousState;\r\n break;\r\n case 1 /* Param */:\r\n if (char === '(') {\r\n state = 2 /* ParamRegExp */;\r\n }\r\n else if (VALID_PARAM_RE.test(char)) {\r\n addCharToBuffer();\r\n }\r\n else {\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n }\r\n break;\r\n case 2 /* ParamRegExp */:\r\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\r\n // it already works by escaping the closing )\r\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\r\n // is this really something people need since you can also write\r\n // /prefix_:p()_suffix\r\n if (char === ')') {\r\n // handle the escaped )\r\n if (customRe[customRe.length - 1] == '\\\\')\r\n customRe = customRe.slice(0, -1) + char;\r\n else\r\n state = 3 /* ParamRegExpEnd */;\r\n }\r\n else {\r\n customRe += char;\r\n }\r\n break;\r\n case 3 /* ParamRegExpEnd */:\r\n // same as finalizing a param\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n customRe = '';\r\n break;\r\n default:\r\n crash('Unknown state');\r\n break;\r\n }\r\n }\r\n if (state === 2 /* ParamRegExp */)\r\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\r\n consumeBuffer();\r\n finalizeSegment();\r\n // tokenCache.set(path, tokens)\r\n return tokens;\r\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}", "function parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n\n if ((0, _util.isArray)(pathString)) {\n return pathString;\n }\n\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0\n };\n var data = [];\n String(pathString).replace(PATH_COMMAND, function (a, b, c) {\n var params = [];\n var name = b.toLowerCase();\n c.replace(PATH_VALUES, function (a, b) {\n b && params.push(+b);\n });\n\n if (name === 'm' && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = 'l';\n b = b === 'm' ? 'l' : 'L';\n }\n\n if (name === 'o' && params.length === 1) {\n data.push([b, params[0]]);\n }\n\n if (name === 'r') {\n data.push([b].concat(params));\n } else {\n while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n\n if (!paramCounts[name]) {\n break;\n }\n }\n }\n\n return '';\n });\n return data;\n}", "function parsePathString$1(pathString) {\n if (!pathString) {\n return null;\n }\n if (isArray$4(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0,\n };\n var data = [];\n String(pathString).replace(PATH_COMMAND$1, function (a, b, c) {\n var params = [];\n var name = b.toLowerCase();\n c.replace(PATH_VALUES$1, function (a, b) {\n b && params.push(+b);\n });\n if (name === 'm' && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = 'l';\n b = b === 'm' ? 'l' : 'L';\n }\n if (name === 'o' && params.length === 1) {\n data.push([b, params[0]]);\n }\n if (name === 'r') {\n data.push([b].concat(params));\n }\n else {\n while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n }\n return '';\n });\n return data;\n}", "function pathSplit(path) {\n return path.split(\"/\");\n}", "function splitPath(e){var t=new Array,n={},r=e.split(/[/?&#]/);for(var i=0;i<r.length;i++){var s=r[i].split(\"=\");s.length==1?t.push(s[0]):n[s[0]]=s[1]}return t.push(n),t}", "static splitPath(path) {\n\t\treturn path.slice(1).split('/')\n\t}", "static split(path) {\n if (!path || typeof path !== \"string\") {\n throw new Error(\"Path.split() - Invalid path.\");\n }\n\n const result = path.split(\"/\").map((s, i, arr) => {\n return i < arr.length - 1 ? s + \"/\" : s;\n });\n\n return path.endsWith(\"/\") ? result.slice(0, -1) : result;\n }", "function tokenizePath(path) {\r\n if (!path)\r\n return [[]];\r\n if (path === '/')\r\n return [[ROOT_TOKEN]];\r\n if (!path.startsWith('/')) {\r\n throw new Error(( false)\r\n ? undefined\r\n : `Invalid path \"${path}\"`);\r\n }\r\n // if (tokenCache.has(path)) return tokenCache.get(path)!\r\n function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }\r\n let state = 0 /* Static */;\r\n let previousState = state;\r\n const tokens = [];\r\n // the segment will always be valid because we get into the initial state\r\n // with the leading /\r\n let segment;\r\n function finalizeSegment() {\r\n if (segment)\r\n tokens.push(segment);\r\n segment = [];\r\n }\r\n // index on the path\r\n let i = 0;\r\n // char at index\r\n let char;\r\n // buffer of the value read\r\n let buffer = '';\r\n // custom regexp for a param\r\n let customRe = '';\r\n function consumeBuffer() {\r\n if (!buffer)\r\n return;\r\n if (state === 0 /* Static */) {\r\n segment.push({\r\n type: 0 /* Static */,\r\n value: buffer,\r\n });\r\n }\r\n else if (state === 1 /* Param */ ||\r\n state === 2 /* ParamRegExp */ ||\r\n state === 3 /* ParamRegExpEnd */) {\r\n if (segment.length > 1 && (char === '*' || char === '+'))\r\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\r\n segment.push({\r\n type: 1 /* Param */,\r\n value: buffer,\r\n regexp: customRe,\r\n repeatable: char === '*' || char === '+',\r\n optional: char === '*' || char === '?',\r\n });\r\n }\r\n else {\r\n crash('Invalid state to consume buffer');\r\n }\r\n buffer = '';\r\n }\r\n function addCharToBuffer() {\r\n buffer += char;\r\n }\r\n while (i < path.length) {\r\n char = path[i++];\r\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\r\n previousState = state;\r\n state = 4 /* EscapeNext */;\r\n continue;\r\n }\r\n switch (state) {\r\n case 0 /* Static */:\r\n if (char === '/') {\r\n if (buffer) {\r\n consumeBuffer();\r\n }\r\n finalizeSegment();\r\n }\r\n else if (char === ':') {\r\n consumeBuffer();\r\n state = 1 /* Param */;\r\n }\r\n else {\r\n addCharToBuffer();\r\n }\r\n break;\r\n case 4 /* EscapeNext */:\r\n addCharToBuffer();\r\n state = previousState;\r\n break;\r\n case 1 /* Param */:\r\n if (char === '(') {\r\n state = 2 /* ParamRegExp */;\r\n }\r\n else if (VALID_PARAM_RE.test(char)) {\r\n addCharToBuffer();\r\n }\r\n else {\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n }\r\n break;\r\n case 2 /* ParamRegExp */:\r\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\r\n // it already works by escaping the closing )\r\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\r\n // is this really something people need since you can also write\r\n // /prefix_:p()_suffix\r\n if (char === ')') {\r\n // handle the escaped )\r\n if (customRe[customRe.length - 1] == '\\\\')\r\n customRe = customRe.slice(0, -1) + char;\r\n else\r\n state = 3 /* ParamRegExpEnd */;\r\n }\r\n else {\r\n customRe += char;\r\n }\r\n break;\r\n case 3 /* ParamRegExpEnd */:\r\n // same as finalizing a param\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n customRe = '';\r\n break;\r\n default:\r\n crash('Unknown state');\r\n break;\r\n }\r\n }\r\n if (state === 2 /* ParamRegExp */)\r\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\r\n consumeBuffer();\r\n finalizeSegment();\r\n // tokenCache.set(path, tokens)\r\n return tokens;\r\n}", "function pathToArray(pathname) {\n let pathParts = pathname.split(\"/\");\n return pathParts;\n}", "function parse (path: Path): ?Array<string> {\n const keys: Array<string> = []\n let index: number = -1\n let mode: number = BEFORE_PATH\n let subPathDepth: number = 0\n let c: ?string\n let key: any\n let newChar: any\n let type: string\n let transition: number\n let action: Function\n let typeMap: any\n const actions: Array<Function> = []\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key)\n key = undefined\n }\n }\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar\n } else {\n key += newChar\n }\n }\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]()\n subPathDepth++\n }\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--\n mode = IN_SUB_PATH\n actions[APPEND]()\n } else {\n subPathDepth = 0\n if (key === undefined) { return false }\n key = formatSubPath(key)\n if (key === false) {\n return false\n } else {\n actions[PUSH]()\n }\n }\n }\n\n function maybeUnescapeQuote (): ?boolean {\n const nextChar: string = path[index + 1]\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++\n newChar = '\\\\' + nextChar\n actions[APPEND]()\n return true\n }\n }\n\n while (mode !== null) {\n index++\n c = path[index]\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c)\n typeMap = pathStateMachine[mode]\n transition = typeMap[type] || typeMap['else'] || ERROR\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0]\n action = actions[transition[1]]\n if (action) {\n newChar = transition[2]\n newChar = newChar === undefined\n ? c\n : newChar\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\nexport type PathValue = PathValueObject | PathValueArray | Function | string | number | boolean | null\nexport type PathValueObject = { [key: string]: PathValue }\nexport type PathValueArray = Array<PathValue>\n\nexport default class I18nPath {\n _cache: Object\n\n constructor () {\n this._cache = Object.create(null)\n }\n\n /**\n * External parse that check for a cache hit first\n */\n parsePath (path: Path): Array<string> {\n let hit: ?Array<string> = this._cache[path]\n if (!hit) {\n hit = parse(path)\n if (hit) {\n this._cache[path] = hit\n }\n }\n return hit || []\n }\n\n /**\n * Get path value from path string\n */\n getPathValue (obj: mixed, path: Path): PathValue {\n if (!isObject(obj)) { return null }\n\n const paths: Array<string> = this.parsePath(path)\n if (paths.length === 0) {\n return null\n } else {\n const length: number = paths.length\n let last: any = obj\n let i: number = 0\n while (i < length) {\n const value: any = last[paths[i]]\n if (value === undefined || value === null) {\n return null\n }\n last = value\n i++\n }\n\n return last\n }\n }\n}", "function __splitPath(path) {\n \n var count = 0;\n var result = [], tmp = [];\n for ( var i = 0; i < path.length; i++) {\n //log(i+\") \"+path[i]);\n if (i && path[i][0] === 'M') {\n var tmpClone = tmp.slice(0);\n result.push(tmpClone);\n tmp = [];\n }\n tmp.push(path[i]); \n }\n var tmpClone = tmp.slice(0);\n result.push(tmpClone);\n \n //log(\"found \"+result.length+\" paths\");\n //for ( var i = 0; i < result.length; i++) \n // log(result[i]);\n return result;\n}", "function parsePath (pathstr, fileScope) {\n if (!pathstr)\n return [ [ ] ];\n var pathMatch;\n var path = [];\n var offset = 0;\n while (\n offset < pathstr.length\n && (pathMatch = Patterns.word.exec (pathstr.slice (offset)))\n ) {\n if (!pathMatch[0]) {\n if (!pathMatch.length)\n path.push ([]);\n break;\n }\n offset += pathMatch[0].length;\n\n var fragName = pathMatch[2];\n if (fragName[0] == '`') {\n path.push ([\n pathMatch[1],\n fragName\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)\\\\`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ]);\n continue;\n }\n if (fragName[0] != '[') {\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n path.push ([ delimit, fragName ]);\n continue;\n }\n\n // Symbol\n path.push ((function parseSymbol (symbolName) {\n var symbolPath = [];\n var symbolMatch;\n var symbolRegex = new RegExp (Patterns.word);\n var symbolOffset = 0;\n while (\n symbolOffset < symbolName.length\n && (symbolMatch = symbolRegex.exec (symbolName.slice (symbolOffset)))\n ) {\n if (!symbolMatch[0])\n break;\n symbolOffset += symbolMatch[0].length;\n var symbolFrag = symbolMatch[2];\n\n if (symbolFrag[0] == '[') {\n // recurse!\n var innerLevel = parseSymbol (symbolFrag.slice (1, -1));\n if (innerLevel[0] === undefined)\n innerLevel[0] = '.';\n symbolPath.push (innerLevel);\n continue;\n }\n if (symbolFrag[0] == '`')\n symbolFrag = symbolFrag\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ;\n var delimit = symbolMatch[1];\n if (delimit == ':')\n delimit = '/';\n symbolPath.push ([ delimit, symbolFrag ]);\n }\n\n if (!symbolPath.length)\n symbolPath.push ([ '.', undefined ]);\n else if (symbolPath[0][0] === undefined)\n symbolPath[0][0] = '.';\n else\n symbolPath = fileScope.concat (symbolPath);\n // symbolPath = concatPaths (fileScope, symbolPath);\n\n var fullPathName = symbolPath\n .map (function (item) { return item[0] + item[1]; })\n .join ('')\n ;\n\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n return [ delimit, '['+fullPathName.slice (1)+']', symbolPath ];\n }) (fragName.slice (1, -1)));\n }\n if (!path.length)\n path.push ([]);\n return path;\n}", "function parseRequestStringWithSegment(inputString){\n\t\n\tif (inputString == null)\n\t\treturn null;\n\t\n\tvar retArray = new Array();\t\t\t\t\n\tvar segmentArray = inputString.split(SEGMENT_SEP);\t\t\t\t\t\n\tfor (var i=0; i<segmentArray.length; i++){\n\t\tvar segmentString = segmentArray[i];\n\t\tvar recordArray = parseRequestString(segmentString);\n\t\tconsole.log(\"parseRequestStringWithSegment, seg = \"+recordArray);\n\t\tretArray.push(recordArray);\n\t}\n\n\t// log for test\n\tconsole.log(\"parseRequestStringWithSegment, result = \" + retArray);\t\n\treturn retArray;\t\n}", "function parse (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function getPathNames(pathName) {\n if (pathName === '/' || pathName.trim().length === 0) return [pathName];\n if (pathName.slice(-1) === '/') {\n pathName = pathName.slice(0, -1);\n }\n if (pathName[0] === '/') {\n pathName = pathName.slice(1);\n }\n\n return pathName.split('/');\n }", "function getPathSegment(path, index) {\n\n return path.split(\"?\")[0].split(\"/\")[index];\n }", "function splitPath(p) {\n for (i=1;i<2;i++) {}\n \n if (!p)\n return [];\n \n if (common.platform === 'win')\n return p.split(';');\n else\n return p.split(':');\n }", "function splitPath(p) {\n for (i=1;i<2;i++) {}\n\n if (!p)\n return [];\n\n if (common.platform === 'win')\n return p.split(';');\n else\n return p.split(':');\n}", "function parse(route, names, types, shouldDecodes) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\");\n var results = new Array(segments.length);\n\n for (var i=0; i<segments.length; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results[i] = new DynamicSegment(match[1]);\n names.push(match[1]);\n shouldDecodes.push(true);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results[i] = new StarSegment(match[1]);\n names.push(match[1]);\n shouldDecodes.push(false);\n types.stars++;\n } else if(segment === \"\") {\n results[i] = new EpsilonSegment();\n } else {\n results[i] = new StaticSegment(segment);\n types.statics++;\n }\n }\n\n return results;\n}", "function parsePath(url) {\n\tvar vars = [];\n\n\treturn url.match(/\\{(\\w+)\\}/g);\n}", "toPathArray(pathString) {\n return pathString.split(this.separator)\n .slice(1) // remove the empty\n .map((key) => isNaN(parseInt(key, 10)) ? key : parseInt(key, 10));\n }", "function getPathNames(pathName) {\n if (pathName === \"/\" || pathName.trim().length === 0) return [pathName];\n if (pathName.slice(-1) === \"/\") {\n pathName = pathName.slice(0, -1);\n }\n if (pathName[0] === \"/\") {\n pathName = pathName.slice(1);\n }\n\n return pathName.split(\"/\");\n }", "function getPathElements(filePath) {\n return filePath.split(sep);\n}", "function getSplitPath(path) {\n \n path = path.replace(/([mMcClL])([0-9])/g, '$1 $2').replace(/[ \\n\\t]+/g, ' ');\n \n r = path.split(/[,\\s]+/);\n \n if ($.trim(r[0]) == '') {\n r.shift();\n }\n \n // let's change the values to integers if possible\n for (var i=0; i<r[i].length; i++) {\n var num = parseInt(r[i]);\n if (!isNaN(num)) {\n r[i] = num;\n }\n }\n return r;\n }", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" || mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ? c : newChar;\n\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parsePath (path) {\n var hit = pathCache[path];\n if (!hit) {\n hit = parse(path);\n if (hit) {\n pathCache[path] = hit;\n }\n }\n return hit || []\n}", "function pathSplit(inPath) {\n\t\tvar sep = process.platform == \"win32\" ? \"\\\\\" : \"/\";\n\t\treturn inPath.split(sep);\n\t}", "function pathSplit(inPath) {\n\t\tvar sep = process.platform == \"win32\" ? \"\\\\\" : \"/\";\n\t\treturn inPath.split(sep);\n\t}", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) {return false;}\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" ||\n mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ?\n c :\n newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) {return false;}\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" ||\n mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ?\n c :\n newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) {return false;}\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" ||\n mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ?\n c :\n newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "function splitPath(filepath){\n\treturn splitFromBack(filepath, '\\\\');\n}", "parseSegment() {\n const path = matchSegments(this.remaining);\n\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "function _splitKeyPath(path) {\n return Array.isArray(path) ? path : path.split('.');\n}", "function parseCd (path, cd) {\n\n cdA = cd.split(\"/\");\n\n console.log(cdA);\n\n for (x in cdA) {\n\n console.log(cdA[x]+'\\n');\n\n if (cdA[x] == '..') {\n\n return;\n\n // saw = 0;\n\n // while (saw == 0){\n\n // if (path[-1] == '/') saw = 1;\n\n // path = path.slice(0, -1);\n\n // }\n\n }\n\n\n\n else path += (cdA[x] + '/');\n\n }\n\n\n\n return path;\n\n}", "function getPathNames(pathName) {\n if (pathName === '/' || pathName.trim().length === 0) return [pathName]\n\n pathName = removeSlash(pathName, 'both');\n\n return pathName.split('/')\n }", "function normalizePath(path) {\n return path.split('/')\n .map(normalizeSegment)\n .join('/');\n}", "function splitPath(path)\n{\n var parts = path.split(\"/\");\n var idx = -1;\n for (var i = parts.length - 2; i >= 0; --i)\n {\n var lcpath = parts[i].toLowerCase();\n if (lcpath.endsWith(\".zip\") ||\n lcpath.endsWith(\".tgz\"))\n {\n idx = i;\n break;\n }\n }\n \n if (idx != -1)\n {\n var outerPath = parts.slice(0, idx + 1).join(\"/\");\n var innerPath = parts.slice(idx + 1).join(\"/\");\n //console.log(\"vfs.splitPath: \" + path + \" -> \" + outerPath + \"#\" + innerPath);\n return [outerPath, innerPath];\n }\n else\n {\n return [\"\", \"\"];\n }\n}", "splitPath(path) {\n if (!path || typeof path !== \"string\") return undefined\n if (spellCore.PATH_REGISTRY[path]) return spellCore.PATH_REGISTRY[path]\n const steps = path.trim().split(PATH_PATTERN)\n let step\n try {\n for (let i = steps.length - 1; i >= 0; i--) {\n step = steps[i].trim()\n // eliminate `..`\n if (!step || step === \".\") {\n steps.splice(i, 1)\n continue\n }\n // convert bracket\n if (step[0] === \"[\") {\n if (step.substr(-1) !== \"]\") throw \"missing end ]\"\n step = step.slice(1, -1).trim()\n if (step[0] === '\"' || step[0] === '\"') {\n if (step.substr(-1) !== step[0]) throw `missing end ${step[0]}`\n step = step.slice(1, -1).trim()\n }\n }\n // if we got exactly a number, return a number instead\n const stepAsInt = parseInt(step, 10)\n if (`${stepAsInt}` === step) {\n steps[i] = stepAsInt\n } else {\n steps[i] = step\n }\n }\n } catch (msg) {\n console.error(\"splitPath('\" + path + \"'): invalid step '\" + step + \"': \" + msg)\n steps = undefined\n }\n spellCore.PATH_REGISTRY[path] = steps\n return steps\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "parseSegment() {\n const path = matchSegments(this.remaining);\n if (path === '' && this.peekStartsWith(';')) {\n throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);\n }\n this.capture(path);\n return new UrlSegment(decode(path), this.parseMatrixParams());\n }", "function normalizePath(path) {\n return path.split(\"/\")\n .map(normalizeSegment)\n .join(\"/\");\n}", "function subs_filter_from_pathParts(subSet) {\n var captureNode = subSet.cap;\n if (captureNode.index > 1) {\n return captureNode.path.slice(2, -1).split('/');\n }\n return staticUnusedArray;\n }", "forPathString(path) {\n const pathArray = this.pathUtilService.toPathArray(path);\n return this.forPathArray(pathArray);\n }", "parse() {\n let array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [['M', 0, 0]];\n // if it's already a patharray, no need to parse it\n if (array instanceof PathArray) return array; // prepare for parsing\n\n var s;\n var paramCnt = {\n 'M': 2,\n 'L': 2,\n 'H': 1,\n 'V': 1,\n 'C': 6,\n 'S': 4,\n 'Q': 4,\n 'T': 2,\n 'A': 7,\n 'Z': 0\n };\n\n if (typeof array === 'string') {\n array = array.replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\n .replace(hyphen, '$1 -') // add space before hyphen\n .trim() // trim\n .split(delimiter); // split into array\n } else {\n array = array.reduce(function (prev, curr) {\n return [].concat.call(prev, curr);\n }, []);\n } // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\n\n\n var result = [];\n var p = new Point_Point();\n var p0 = new Point_Point();\n var index = 0;\n var len = array.length;\n\n do {\n // Test if we have a path letter\n if (isPathLetter.test(array[index])) {\n s = array[index];\n ++index; // If last letter was a move command and we got no new, it defaults to [L]ine\n } else if (s === 'M') {\n s = 'L';\n } else if (s === 'm') {\n s = 'l';\n }\n\n result.push(pathHandlers[s].call(null, array.slice(index, index = index + paramCnt[s.toUpperCase()]).map(parseFloat), p, p0));\n } while (len > index);\n\n return result;\n }", "function getInSegment(path, time) {\n\tlet index,\n\t\tpair = [];\n\n\tindex = path.findIndex(([locationTime]) => {\n\t\treturn (locationTime >= time);\n\t});\n\n\t// Ensure there are always two coordinates. Return empty otherwise.\n\tif (index < path.length - 1) {\n\t\tpair = [path[index][1], path[index + 1][1]];\n\t}\n\n\treturn pair;\n}", "function interpolatePath (path) {\n if (!isNotEmptyString(path) && !isArray(path)) throw new TypeError('No Path was given');\n if (isArray(path)) return [...path];\n return path.replace('[', '.').replace(']', '').split('.');\n}", "function stringWithSplit(input) {\n return input.split('/')\n}", "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n }", "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n }", "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n }", "function parse(segments, route, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) {\n route = route.substr(1);\n }\n var parts = route.split(\"/\");\n var names = undefined;\n var shouldDecodes = undefined;\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n var flags = 0;\n var type = 0;\n if (part === \"\") {\n type = 4 /* Epsilon */;\n }\n else if (part.charCodeAt(0) === 58 /* COLON */) {\n type = 1 /* Dynamic */;\n }\n else if (part.charCodeAt(0) === 42 /* STAR */) {\n type = 2 /* Star */;\n }\n else {\n type = 0 /* Static */;\n }\n flags = 2 << type;\n if (flags & 12 /* Named */) {\n part = part.slice(1);\n names = names || [];\n names.push(part);\n shouldDecodes = shouldDecodes || [];\n shouldDecodes.push((flags & 4 /* Decoded */) !== 0);\n }\n if (flags & 14 /* Counted */) {\n types[type]++;\n }\n segments.push({\n type: type,\n value: normalizeSegment(part)\n });\n }\n return {\n names: names || EmptyArray,\n shouldDecodes: shouldDecodes || EmptyArray,\n };\n}", "function keysFromPath(path) {\n // from http://codereview.stackexchange.com/a/63010/8176\n /**\n * Repeatedly capture either:\n * - a bracketed expression, discarding optional matching quotes inside, or\n * - an unbracketed expression, delimited by a dot or a bracket.\n */\n var re = /\\[(\"|')(.+)\\1\\]|([^.\\[\\]]+)/g;\n\n var elements = [];\n var result;\n while ((result = re.exec(path)) !== null) {\n elements.push(result[2] || result[3]);\n }\n return elements;\n}", "function processPath(path) {\n var query;\n if (path && path.pop && path.length) {\n if (typeof path[path.length-1] === 'object') {\n path.query = path.pop();\n }\n return path;\n } else if (typeof path === \"object\") { // options\n var empty = [];\n empty.query = path;\n return empty;\n } else if (path) { // string\n return [path];\n } else {\n return [];\n }\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function isoSplit(isoString) {\n return isoString.split('/');\n}", "function tokensToParser(segments, extraOptions) {\r\n const options = vue_router_esm_bundler_assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\r\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\r\n const score = [];\r\n // the regexp as a string\r\n let pattern = options.start ? '^' : '';\r\n // extracted keys\r\n const keys = [];\r\n for (const segment of segments) {\r\n // the root segment needs special treatment\r\n const segmentScores = segment.length ? [] : [90 /* Root */];\r\n // allow trailing slash\r\n if (options.strict && !segment.length)\r\n pattern += '/';\r\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\r\n const token = segment[tokenIndex];\r\n // resets the score if we are inside a sub segment /:a-other-:b\r\n let subSegmentScore = 40 /* Segment */ +\r\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\r\n if (token.type === 0 /* Static */) {\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n pattern += '/';\r\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\r\n subSegmentScore += 40 /* Static */;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional, regexp } = token;\r\n keys.push({\r\n name: value,\r\n repeatable,\r\n optional,\r\n });\r\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\r\n // the user provided a custom regexp /:id(\\\\d+)\r\n if (re !== BASE_PARAM_PATTERN) {\r\n subSegmentScore += 10 /* BonusCustomRegExp */;\r\n // make sure the regexp is valid before using it\r\n try {\r\n new RegExp(`(${re})`);\r\n }\r\n catch (err) {\r\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\r\n err.message);\r\n }\r\n }\r\n // when we repeat we must take care of the repeating leading slash\r\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n subPattern =\r\n // avoid an optional / if there are more segments e.g. /:p?-static\r\n // or /:p?-:p2\r\n optional && segment.length < 2\r\n ? `(?:/${subPattern})`\r\n : '/' + subPattern;\r\n if (optional)\r\n subPattern += '?';\r\n pattern += subPattern;\r\n subSegmentScore += 20 /* Dynamic */;\r\n if (optional)\r\n subSegmentScore += -8 /* BonusOptional */;\r\n if (repeatable)\r\n subSegmentScore += -20 /* BonusRepeatable */;\r\n if (re === '.*')\r\n subSegmentScore += -50 /* BonusWildcard */;\r\n }\r\n segmentScores.push(subSegmentScore);\r\n }\r\n // an empty array like /home/ -> [[{home}], []]\r\n // if (!segment.length) pattern += '/'\r\n score.push(segmentScores);\r\n }\r\n // only apply the strict bonus to the last score\r\n if (options.strict && options.end) {\r\n const i = score.length - 1;\r\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\r\n }\r\n // TODO: dev only warn double trailing slash\r\n if (!options.strict)\r\n pattern += '/?';\r\n if (options.end)\r\n pattern += '$';\r\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\r\n else if (options.strict)\r\n pattern += '(?:/|$)';\r\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\r\n function parse(path) {\r\n const match = path.match(re);\r\n const params = {};\r\n if (!match)\r\n return null;\r\n for (let i = 1; i < match.length; i++) {\r\n const value = match[i] || '';\r\n const key = keys[i - 1];\r\n params[key.name] = value && key.repeatable ? value.split('/') : value;\r\n }\r\n return params;\r\n }\r\n function stringify(params) {\r\n let path = '';\r\n // for optional parameters to allow to be empty\r\n let avoidDuplicatedSlash = false;\r\n for (const segment of segments) {\r\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\r\n path += '/';\r\n avoidDuplicatedSlash = false;\r\n for (const token of segment) {\r\n if (token.type === 0 /* Static */) {\r\n path += token.value;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional } = token;\r\n const param = value in params ? params[value] : '';\r\n if (Array.isArray(param) && !repeatable)\r\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\r\n const text = Array.isArray(param) ? param.join('/') : param;\r\n if (!text) {\r\n if (optional) {\r\n // if we have more than one optional param like /:a?-static we\r\n // don't need to care about the optional param\r\n if (segment.length < 2) {\r\n // remove the last slash as we could be at the end\r\n if (path.endsWith('/'))\r\n path = path.slice(0, -1);\r\n // do not append a slash on the next iteration\r\n else\r\n avoidDuplicatedSlash = true;\r\n }\r\n }\r\n else\r\n throw new Error(`Missing required param \"${value}\"`);\r\n }\r\n path += text;\r\n }\r\n }\r\n }\r\n return path;\r\n }\r\n return {\r\n re,\r\n score,\r\n keys,\r\n parse,\r\n stringify,\r\n };\r\n}", "function parse(segments, route, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) {\n route = route.substr(1);\n }\n var parts = route.split(\"/\");\n var names = undefined;\n var shouldDecodes = undefined;\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n var flags = 0;\n var type = 0;\n if (part === \"\") {\n type = 4 /* Epsilon */;\n } else if (part.charCodeAt(0) === 58 /* COLON */) {\n type = 1 /* Dynamic */;\n } else if (part.charCodeAt(0) === 42 /* STAR */) {\n type = 2 /* Star */;\n } else {\n type = 0 /* Static */;\n }\n flags = 2 << type;\n if (flags & 12 /* Named */) {\n part = part.slice(1);\n names = names || [];\n names.push(part);\n shouldDecodes = shouldDecodes || [];\n shouldDecodes.push((flags & 4 /* Decoded */) !== 0);\n }\n if (flags & 14 /* Counted */) {\n types[type]++;\n }\n segments.push({\n type: type,\n value: normalizeSegment(part)\n });\n }\n return {\n names: names || EmptyArray,\n shouldDecodes: shouldDecodes || EmptyArray\n };\n }", "function parse(segments, route, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) {\n route = route.substr(1);\n }\n var parts = route.split(\"/\");\n var names = undefined;\n var shouldDecodes = undefined;\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n var flags = 0;\n var type = 0;\n if (part === \"\") {\n type = 4 /* Epsilon */;\n } else if (part.charCodeAt(0) === 58 /* COLON */) {\n type = 1 /* Dynamic */;\n } else if (part.charCodeAt(0) === 42 /* STAR */) {\n type = 2 /* Star */;\n } else {\n type = 0 /* Static */;\n }\n flags = 2 << type;\n if (flags & 12 /* Named */) {\n part = part.slice(1);\n names = names || [];\n names.push(part);\n shouldDecodes = shouldDecodes || [];\n shouldDecodes.push((flags & 4 /* Decoded */) !== 0);\n }\n if (flags & 14 /* Counted */) {\n types[type]++;\n }\n segments.push({\n type: type,\n value: normalizeSegment(part)\n });\n }\n return {\n names: names || EmptyArray,\n shouldDecodes: shouldDecodes || EmptyArray\n };\n }", "function parse(segments, route, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.length > 0 && route.charCodeAt(0) === 47 /* SLASH */) {\n route = route.substr(1);\n }\n var parts = route.split(\"/\");\n var names = undefined;\n var shouldDecodes = undefined;\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n var flags = 0;\n var type = 0;\n if (part === \"\") {\n type = 4 /* Epsilon */;\n } else if (part.charCodeAt(0) === 58 /* COLON */) {\n type = 1 /* Dynamic */;\n } else if (part.charCodeAt(0) === 42 /* STAR */) {\n type = 2 /* Star */;\n } else {\n type = 0 /* Static */;\n }\n flags = 2 << type;\n if (flags & 12 /* Named */) {\n part = part.slice(1);\n names = names || [];\n names.push(part);\n shouldDecodes = shouldDecodes || [];\n shouldDecodes.push((flags & 4 /* Decoded */) !== 0);\n }\n if (flags & 14 /* Counted */) {\n types[type]++;\n }\n segments.push({\n type: type,\n value: normalizeSegment(part)\n });\n }\n return {\n names: names || EmptyArray,\n shouldDecodes: shouldDecodes || EmptyArray\n };\n }", "function stringToStringTuples(str) {\n const tuples = [];\n const parts = str.split('/').slice(1); // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return [];\n }\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p];\n const proto = protocols_1.protocols(part);\n if (proto.size === 0) {\n tuples.push([part]);\n continue;\n }\n p++; // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str);\n }\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/')),\n ]);\n break;\n }\n tuples.push([part, parts[p]]);\n }\n return tuples;\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function removeDotSegments(path) {\n var ib = path.split(/\\/+/); // input buffer (array of segments)\n var ob = []; // output buffer\n var n = ib.length;\n for (var i = 0; i < n; i++) {\n var s = ib[i];\n if (s === '..') {\n // preserve leading slash (ob[0] is empty == false)\n if ((ob.length > 1) || (ob.length > 0 && ob[0])) {\n ob.pop();\n }\n }\n else if (s !== '.') {\n ob.push(s);\n }\n }\n return ob.join('/');\n }", "function tokensToParser(segments, extraOptions) {\n const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\n let score = [];\n // the regexp as a string\n let pattern = options.start ? '^' : '';\n // extracted keys\n const keys = [];\n for (const segment of segments) {\n // the root segment needs special treatment\n const segmentScores = segment.length ? [] : [90 /* Root */];\n // allow trailing slash\n if (options.strict && !segment.length)\n pattern += '/';\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\n const token = segment[tokenIndex];\n // resets the score if we are inside a sub segment /:a-other-:b\n let subSegmentScore = 40 /* Segment */ +\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\n if (token.type === 0 /* Static */) {\n // prepend the slash if we are starting a new segment\n if (!tokenIndex)\n pattern += '/';\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\n subSegmentScore += 40 /* Static */;\n }\n else if (token.type === 1 /* Param */) {\n const { value, repeatable, optional, regexp } = token;\n keys.push({\n name: value,\n repeatable,\n optional,\n });\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\n // the user provided a custom regexp /:id(\\\\d+)\n if (re !== BASE_PARAM_PATTERN) {\n subSegmentScore += 10 /* BonusCustomRegExp */;\n // make sure the regexp is valid before using it\n try {\n new RegExp(`(${re})`);\n }\n catch (err) {\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\n err.message);\n }\n }\n // when we repeat we must take care of the repeating leading slash\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\n // prepend the slash if we are starting a new segment\n if (!tokenIndex)\n subPattern = optional ? `(?:/${subPattern})` : '/' + subPattern;\n if (optional)\n subPattern += '?';\n pattern += subPattern;\n subSegmentScore += 20 /* Dynamic */;\n if (optional)\n subSegmentScore += -8 /* BonusOptional */;\n if (repeatable)\n subSegmentScore += -20 /* BonusRepeatable */;\n if (re === '.*')\n subSegmentScore += -50 /* BonusWildcard */;\n }\n segmentScores.push(subSegmentScore);\n }\n // an empty array like /home/ -> [[{home}], []]\n // if (!segment.length) pattern += '/'\n score.push(segmentScores);\n }\n // only apply the strict bonus to the last score\n if (options.strict && options.end) {\n const i = score.length - 1;\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\n }\n // TODO: dev only warn double trailing slash\n if (!options.strict)\n pattern += '/?';\n if (options.end)\n pattern += '$';\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\n else if (options.strict)\n pattern += '(?:/|$)';\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\n function parse(path) {\n const match = path.match(re);\n const params = {};\n if (!match)\n return null;\n for (let i = 1; i < match.length; i++) {\n const value = match[i] || '';\n const key = keys[i - 1];\n params[key.name] = value && key.repeatable ? value.split('/') : value;\n }\n return params;\n }\n function stringify(params) {\n let path = '';\n // for optional parameters to allow to be empty\n let avoidDuplicatedSlash = false;\n for (const segment of segments) {\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\n path += '/';\n avoidDuplicatedSlash = false;\n for (const token of segment) {\n if (token.type === 0 /* Static */) {\n path += token.value;\n }\n else if (token.type === 1 /* Param */) {\n const { value, repeatable, optional } = token;\n const param = value in params ? params[value] : '';\n if (Array.isArray(param) && !repeatable)\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\n const text = Array.isArray(param) ? param.join('/') : param;\n if (!text) {\n if (optional) {\n // remove the last slash as we could be at the end\n if (path.endsWith('/'))\n path = path.slice(0, -1);\n // do not append a slash on the next iteration\n else\n avoidDuplicatedSlash = true;\n }\n else\n throw new Error(`Missing required param \"${value}\"`);\n }\n path += text;\n }\n }\n }\n return path;\n }\n return {\n re,\n score,\n keys,\n parse,\n stringify,\n };\n}", "function URLSplit(){\n var array = [];\n if($scope.newPath.indexOf(\"\\\\\")>= 0) {\n array = $scope.newPath.split(\"\\\\\");\n }\n else {\n array = $scope.newPath.split(\"/\");\n }\n var path = \"\";\n for(var i=0; i<=array.length-1; i++){\n path = path + array[i] + \">\"\n }\n $scope.pathXml = path.replace(/\\>$/, '');\n }", "function tokensToParser(segments, extraOptions) {\r\n const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\r\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\r\n const score = [];\r\n // the regexp as a string\r\n let pattern = options.start ? '^' : '';\r\n // extracted keys\r\n const keys = [];\r\n for (const segment of segments) {\r\n // the root segment needs special treatment\r\n const segmentScores = segment.length ? [] : [90 /* Root */];\r\n // allow trailing slash\r\n if (options.strict && !segment.length)\r\n pattern += '/';\r\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\r\n const token = segment[tokenIndex];\r\n // resets the score if we are inside a sub segment /:a-other-:b\r\n let subSegmentScore = 40 /* Segment */ +\r\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\r\n if (token.type === 0 /* Static */) {\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n pattern += '/';\r\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\r\n subSegmentScore += 40 /* Static */;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional, regexp } = token;\r\n keys.push({\r\n name: value,\r\n repeatable,\r\n optional,\r\n });\r\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\r\n // the user provided a custom regexp /:id(\\\\d+)\r\n if (re !== BASE_PARAM_PATTERN) {\r\n subSegmentScore += 10 /* BonusCustomRegExp */;\r\n // make sure the regexp is valid before using it\r\n try {\r\n new RegExp(`(${re})`);\r\n }\r\n catch (err) {\r\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\r\n err.message);\r\n }\r\n }\r\n // when we repeat we must take care of the repeating leading slash\r\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n subPattern =\r\n // avoid an optional / if there are more segments e.g. /:p?-static\r\n // or /:p?-:p2\r\n optional && segment.length < 2\r\n ? `(?:/${subPattern})`\r\n : '/' + subPattern;\r\n if (optional)\r\n subPattern += '?';\r\n pattern += subPattern;\r\n subSegmentScore += 20 /* Dynamic */;\r\n if (optional)\r\n subSegmentScore += -8 /* BonusOptional */;\r\n if (repeatable)\r\n subSegmentScore += -20 /* BonusRepeatable */;\r\n if (re === '.*')\r\n subSegmentScore += -50 /* BonusWildcard */;\r\n }\r\n segmentScores.push(subSegmentScore);\r\n }\r\n // an empty array like /home/ -> [[{home}], []]\r\n // if (!segment.length) pattern += '/'\r\n score.push(segmentScores);\r\n }\r\n // only apply the strict bonus to the last score\r\n if (options.strict && options.end) {\r\n const i = score.length - 1;\r\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\r\n }\r\n // TODO: dev only warn double trailing slash\r\n if (!options.strict)\r\n pattern += '/?';\r\n if (options.end)\r\n pattern += '$';\r\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\r\n else if (options.strict)\r\n pattern += '(?:/|$)';\r\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\r\n function parse(path) {\r\n const match = path.match(re);\r\n const params = {};\r\n if (!match)\r\n return null;\r\n for (let i = 1; i < match.length; i++) {\r\n const value = match[i] || '';\r\n const key = keys[i - 1];\r\n params[key.name] = value && key.repeatable ? value.split('/') : value;\r\n }\r\n return params;\r\n }\r\n function stringify(params) {\r\n let path = '';\r\n // for optional parameters to allow to be empty\r\n let avoidDuplicatedSlash = false;\r\n for (const segment of segments) {\r\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\r\n path += '/';\r\n avoidDuplicatedSlash = false;\r\n for (const token of segment) {\r\n if (token.type === 0 /* Static */) {\r\n path += token.value;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional } = token;\r\n const param = value in params ? params[value] : '';\r\n if (Array.isArray(param) && !repeatable)\r\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\r\n const text = Array.isArray(param) ? param.join('/') : param;\r\n if (!text) {\r\n if (optional) {\r\n // if we have more than one optional param like /:a?-static we\r\n // don't need to care about the optional param\r\n if (segment.length < 2) {\r\n // remove the last slash as we could be at the end\r\n if (path.endsWith('/'))\r\n path = path.slice(0, -1);\r\n // do not append a slash on the next iteration\r\n else\r\n avoidDuplicatedSlash = true;\r\n }\r\n }\r\n else\r\n throw new Error(`Missing required param \"${value}\"`);\r\n }\r\n path += text;\r\n }\r\n }\r\n }\r\n return path;\r\n }\r\n return {\r\n re,\r\n score,\r\n keys,\r\n parse,\r\n stringify,\r\n };\r\n}", "function segmentStringsByMatch(segments, match)\n\t{\n\t\tvar newValues = [];\n\n\t\tfor (var i = 0; i < segments.length; i++)\n\t\t{\n\t\t\tvar value = segments[i];\n\t\t\tvar pos = value.indexOf(match);\n\t\t\tvar len = match.length;\n\t\t\tvar beforeText = value.substr(0, pos);\n\t\t\tvar afterText = value.substr(pos + len);\n\n\t\t\tif (pos === -1)\n\t\t\t{\n\t\t\t\tnewValues.push(value);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (beforeText.length !== 0) newValues.push(beforeText);\n\n\t\t\tnewValues.push(match);\n\n\t\t\tif (afterText.length !== 0) newValues.push(afterText);\n\t\t}\n\n\t\treturn newValues;\n\t}" ]
[ "0.65657526", "0.6555807", "0.654861", "0.6486956", "0.6282637", "0.6269213", "0.62553126", "0.62264353", "0.6216586", "0.6216586", "0.6216586", "0.6214373", "0.6189918", "0.6161804", "0.61454546", "0.61372876", "0.61096174", "0.60890704", "0.60795474", "0.6030243", "0.6008474", "0.5999425", "0.5986727", "0.59361345", "0.5934869", "0.5920805", "0.59097916", "0.58971095", "0.58413535", "0.5840664", "0.5823506", "0.5818985", "0.5818812", "0.58114475", "0.57859486", "0.5774668", "0.5774668", "0.5774668", "0.5774668", "0.5774668", "0.576483", "0.5752531", "0.5752531", "0.57464623", "0.57464623", "0.57464623", "0.5745735", "0.56765527", "0.5671091", "0.5660102", "0.5652657", "0.56332237", "0.562874", "0.56130576", "0.5609916", "0.5609916", "0.5609916", "0.5609916", "0.5609916", "0.55845284", "0.55265903", "0.55193573", "0.5516794", "0.5514077", "0.5500717", "0.54682", "0.5467934", "0.5467934", "0.5467934", "0.5441764", "0.5434948", "0.5400631", "0.53857", "0.53857", "0.53857", "0.53857", "0.53857", "0.5368336", "0.53559786", "0.53370315", "0.53370315", "0.53370315", "0.53167117", "0.5301299", "0.5301299", "0.5301299", "0.5301299", "0.5301299", "0.53003687", "0.530006", "0.5273872", "0.526932", "0.52342516" ]
0.57493114
50
CONCATENATED MODULE: ./src/views/ChartPanel/components/dataPanel.vue?vue&type=template&id=ea8bbf24&scoped=true& CONCATENATED MODULE: ./src/api/source.js
function addSource(data) { return fetch({ url: 'source/create', method: 'POST', data }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "updateComponents(opts) {\nreturn this.generateUpdatedSource(opts);\n}", "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}", "clientDynamicModules() {\n return {\n name: 'constants.js',\n content: `export const sidebar = ${JSON.stringify(sidebar(ctx.sourceDir))}`,\n }\n }", "registerSourceModuleChange() {\n\t\t\tlet select = this.container.find('#inputSourceModule');\n\t\t\tlet blocks = this.container.find('.js-dynamic-blocks');\n\t\t\tselect.on('change', (e) => {\n\t\t\t\tthis.sourceModule = select.find('option:selected').data('module');\n\t\t\t\tblocks.html('');\n\t\t\t\tAppConnector.request({\n\t\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\t\tparent: app.getParentModuleName(),\n\t\t\t\t\tview: 'Edit',\n\t\t\t\t\tmode: 'dynamic',\n\t\t\t\t\tselectedModule: this.sourceModule\n\t\t\t\t}).done((data) => {\n\t\t\t\t\tblocks.html(data);\n\t\t\t\t\tApp.Fields.Picklist.changeSelectElementView(blocks);\n\t\t\t\t\tthis.loadConditionBuilderView();\n\t\t\t\t});\n\t\t\t});\n\t\t}", "renderFromModule() {\n if (this.data) {\n let data = this.data;\n for (let i = 0; i < this.data.length; i++) {\n this.addEasyLine(data[i][\"value\"], data[i][\"label\"], data[i][\"color\"], data[i][\"symbol\"], data[i][\"size\"], data[i][\"rounded\"], data[i][\"hideValue\"]);\n }\n }\n let parentModule = $(this).closest('flx-module');\n let wcModule = parentModule[0];\n if (parentModule && wcModule) {\n wcModule.moduleLoaded(this);\n }\n }", "function getComponentData(sourceData, callback) {\n let app = new typedoc.Application(options),\n files_array = ['./node_modules/carte-blanche-angular2/tmp/component.ts'];\n try {\n var content = fs.writeFileSync('./node_modules/carte-blanche-angular2/tmp/component.ts', sourceData);\n } catch (exception) {\n console.error(exception);\n }\n // lauch typedoc\n app.generateJson(files_array, './node_modules/carte-blanche-angular2/tmp/out.json');\n return fs.readFileSync('./node_modules/carte-blanche-angular2/tmp/out.json', 'utf8');\n}", "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 __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 reactDocgenLoader(source) {\n const componentInfo = reactDocs.parse(source, findAllComponentDefinitions);\n return `module.exports = ${JSON.stringify(componentInfo)};`;\n}", "make_modules() {\n let s = ``\n for (var id in se.mods) {\n if (!se.mods[id].api) continue\n s += `const ${id} = se.mods['${id}'].api[self.id]`\n s += '\\n'\n }\n return s\n }", "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}", "extend (config, { isDev, isClient }) {\n config.resolve.alias['fetch'] = path.join(__dirname, 'utils/fetch.js')\n config.resolve.alias['api'] = path.join(__dirname, 'api')\n config.resolve.alias['layouts'] = path.join(__dirname, 'layouts')\n config.resolve.alias['components'] = path.join(__dirname, 'components')\n config.resolve.alias['utils'] = path.join(__dirname, 'utils')\n config.resolve.alias['static'] = path.join(__dirname, 'static')\n config.resolve.alias['directive'] = path.join(__dirname, 'directive')\n config.resolve.alias['filters'] = path.join(__dirname, 'filters')\n config.resolve.alias['styles'] = path.join(__dirname, 'assets/styles')\n config.resolve.alias['element'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['@element-ui'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['e-ui'] = path.join(__dirname, 'node_modules/h666888')\n config.resolve.alias['@e-ui'] = path.join(__dirname, 'plugins/e-ui')\n config.resolve.alias['areaJSON'] = path.join(__dirname, 'static/area.json')\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\n config.plugins.push(\n new BundleAnalyzerPlugin({\n openAnalyzer: true\n })\n )\n */\n /**\n *全局引入scss文件\n */\n const sassResourcesLoader = {\n loader: 'sass-resources-loader',\n options: {\n resources: [\n 'assets/styles/var.scss'\n ]\n }\n }\n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \n config.module.rules.forEach((rule) => {\n if (rule.test.toString() === '/\\\\.vue$/') {\n rule.options.loaders.sass.push(sassResourcesLoader)\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (['/\\\\.sass$/', '/\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }", "function executeWidgetCode() {\n\n require.config({\n paths: {\n vue: \"./BTWWLibrairies/vue/vue\", //Need this with \"vue\" all lower case, else Vuetify can't load correctly\n Vuetify: \"./BTWWLibrairies/vuetify/vuetify\",\n CSSRoboto: \"./BTWWLibrairies/fonts/Roboto\", //\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700\",\n CSSMaterial: \"./BTWWLibrairies/MaterialDesign/material-icons\",\n vueloader: \"./BTWWLibrairies/requirejs-vue\", //\"https://unpkg.com/requirejs-vue@1.1.5/requirejs-vue\",\n current: \"./UM5ZipDocuments\"\n }\n });\n\n require([\"vue\",\n \"Vuetify\",\n \"UM5Modules/DocumentsWS\",\n \"css!BTWWLibrairies/vuetify/vuetify.min.css\",\n \"css!CSSRoboto\",\n \"css!CSSMaterial\",\n \"vueloader!current/vue/drop-zone\",\n \"vueloader!current/vue/list-eno-objects\",\n \"BTWWLibrairies/zipJS/zip\", //Will create a global object \"zip\"\n \"BTWWLibrairies/FileSaver/FileSaver\" //Will create a global object \"saveAs\"\n ], function (Vue, Vuetify, DocumentsWS) {\n\n Vue.use(Vuetify); //To plug vuetify components\n\n var myWidget = {\n // Widget Events\n onLoadWidget: function () {\n var wdgUrl = widget.getUrl();\n wdgUrl = wdgUrl.substring(0, wdgUrl.lastIndexOf(\"/\"));\n\n widget.setIcon(wdgUrl + \"/../UM5Modules/assets/icons/custom-widget-icon.png\");\n\n var wdgTitlePref = widget.getValue(\"wdgTitle\");\n if (wdgTitlePref) {\n widget.setTitle(wdgTitlePref);\n }\n\n widget.setBody(\n `<div id='appVue'>\n <v-app style='height:100%;'>\n <v-progress-linear v-show='actionProgress>=0' height='4' style='margin:0em;position:absolute;' :indeterminate='actionProgress===0' v-model='actionProgress'></v-progress-linear>\n <drop-zone @drop-on='dropOnWidget' style='height:100%;overflow:auto;width:calc(100% - 2em);'>\n <div v-if='listOfDocuments.length===0'>Drop some objects here</div>\n <list-eno-objects v-else :items='listOfDocuments' @remove-item='removeDoc'></list-eno-objects>\n </drop-zone>\n <div id=\"toolbarRight\">\n <v-icon @click='clearList' title='Clear list'>delete</v-icon>\n <v-icon @click.prevent='downloadAll' title='Download all the documents in a zip'>archive</v-icon>\n </div>\n </v-app>\n </div>`\n );\n\n //Init vue App\n new Vue({\n el: \"#appVue\",\n data: {\n listOfDocuments: [],\n actionProgress: -1\n },\n computed: {\n\n },\n methods: {\n clearList: function () {\n this.listOfDocuments = [];\n },\n removeDoc: function (index) {\n this.listOfDocuments.splice(index, 1);\n },\n dropOnWidget: function (dataTxt) {\n let listOfPIDs = [];\n try {\n //Get the list of documents' physicalid in the dropped data\n let dataJson = JSON.parse(dataTxt);\n if (dataJson.protocol === \"3DXContent\") {\n let arrItems = dataJson.data.items;\n for (let i = 0; i < arrItems.length; i++) {\n const item = arrItems[i];\n if (item.objectType === \"Document\") {\n const pid = item.objectId;\n listOfPIDs.push(pid);\n }\n }\n }\n } catch (err) {\n console.trace(err);\n\n }\n\n let that = this;\n //Load the Object infos based on there physicalid to find the attached files\n //Leverage the OOTB Documents Web Services to find the Documents files infos\n for (let i = 0; i < listOfPIDs.length; i++) {\n const pidDoc = listOfPIDs[i];\n DocumentsWS.getDocInfos(pidDoc, {\n onOk: (data) => {\n for (let j = 0; j < data.length; j++) {\n const dataItem = data[j];\n let objDoc = {\n id: dataItem.id,\n type: dataItem.type\n };\n for (const key in dataItem.dataelements) {\n if (dataItem.dataelements.hasOwnProperty(key)) {\n const value = dataItem.dataelements[key];\n objDoc[key] = value;\n }\n }\n objDoc.files = dataItem.relateddata.files;\n\n //Check if not already there in the list, if there remove the old info so we have the updated one\n for (let k = 0; k < that.listOfDocuments.length; k++) {\n const loadedDoc = that.listOfDocuments[k];\n if (loadedDoc.id === objDoc.id) {\n that.listOfDocuments.splice(k, 1);\n k--;\n }\n }\n //Put the documents infos in the list used for the display\n that.listOfDocuments.push(objDoc);\n }\n },\n onError: (errType, errMsg) => {\n console.error(\"getDocInfosErr\", errType, errMsg);\n }\n });\n }\n },\n downloadAll: function () {\n let that = this;\n that.actionProgress = 0; //Display the progress bar to show to the user that something is running\n\n //Download all the files, zip them and propose it as download for the user\n let zipFileName = widget.getValue(\"zipName\") + \".zip\";\n\n let wdgUrl = widget.getUrl();\n wdgUrl = wdgUrl.substring(0, wdgUrl.lastIndexOf(\"/\"));\n zip.workerScriptsPath = wdgUrl + \"/../BTWWLibrairies/zipJS/\"; //Configure zipJS to point to the right folder with z-worker.js, deflate.js and inflate.js\n\n let writer = new zip.BlobWriter();\n let zipWriter;\n\n //https://gildas-lormeau.github.io/zip.js/core-api.html#zip-writing\n\n zip.createWriter(writer, (writerZip) => {\n zipWriter = writerZip;\n processFiles();\n }, (err) => {\n //Error\n console.error(\"Impossible to create the zip Writter\", err);\n });\n\n //Called when the zipWritter in ok\n let processFiles = () => {\n\n let currentDocIndex = 0;\n let filesInfosPreDownload = [];\n\n //For each Documents get the list of files to download and add in the zip\n for (let i = 0; i < this.listOfDocuments.length; i++) {\n const docItem = this.listOfDocuments[i];\n if (docItem.files && docItem.files.length > 0) {\n for (let f = 0; f < docItem.files.length; f++) {\n const fileItem = docItem.files[f];\n let fName = fileItem.dataelements.title;\n let docId = docItem.id;\n let fileId = fileItem.id;\n filesInfosPreDownload.push({\n docId: docId,\n fileId: fileId,\n fileName: fName\n });\n }\n }\n }\n\n let nextFile = () => {\n if (currentDocIndex < filesInfosPreDownload.length) {\n\n that.actionProgress = 100 * (currentDocIndex + 1) / filesInfosPreDownload.length;\n\n\n //Get next file infos for the download\n let docObj4Download = filesInfosPreDownload[currentDocIndex];\n\n //Get the FCS Download ticket\n DocumentsWS.getDocFileDownloadTicket(docObj4Download.docId, docObj4Download.fileId, {\n onOk: (dataFile) => {\n let fileURL = dataFile[0].dataelements.ticketURL;\n\n //Download the file as a blob (application-octet/stream) by doing a direct call to the given url that is valid only once\n var req = new XMLHttpRequest();\n req.open(\"GET\", fileURL, true);\n req.responseType = \"blob\";\n\n req.onload = function (e) {\n if (this.status === 200) {\n\n //We have the file in the response\n let fileBlob = new Blob([req.response], {\n type: 'octet/stream'\n });\n\n //Add the file in the zip\n zipWriter.add(docObj4Download.fileName, new zip.BlobReader(fileBlob), () => {\n //When done process the next file\n currentDocIndex++;\n nextFile();\n }, (current, total) => {\n //On Progress\n console.debug(\"Zip Write progress : \", current, \"/\", total);\n });\n\n } else {\n console.error(\"Error will getting the file from FCS\", e);\n }\n };\n\n req.send(); //Send the XHR\n\n },\n onError: (errType, errMsg) => {\n console.error(\"getDocFileDownloadTicket\", errType, errMsg);\n }\n });\n } else {\n //All done, download the zip file\n zipWriter.close(function (blob) {\n //Use FileSaver.js to manage all lot of fallbacks possibilities\n saveAs(blob, zipFileName);\n\n setTimeout(() => {\n that.actionProgress = -1; //Remove the progress bar\n }, 100);\n\n //Clean the reference to zipWriter\n zipWriter = null;\n });\n }\n };\n\n nextFile(); //Process the 1st file\n\n };\n\n }\n }\n });\n },\n onRefreshWidget: function () {\n //Do Nothing here\n }\n };\n\n widget.addEvent(\"onLoad\", myWidget.onLoadWidget);\n widget.addEvent(\"onRefresh\", myWidget.onRefreshWidget);\n });\n}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function 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}", "extend(config) {\n const vueLoader = config.module.rules.find(\n (rule) => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-card-img-lazy': ['src', 'blank-src'],\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src',\n }\n }", "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}", "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === \"vue-loader\"\n );\n vueLoader.options.transformToRequire = {\n img: \"src\",\n image: \"xlink:href\",\n \"b-img\": \"src\",\n \"b-img-lazy\": [\"src\", \"blank-src\"],\n \"b-card\": \"img-src\",\n \"b-card-img\": \"img-src\",\n \"b-carousel-slide\": \"img-src\",\n \"b-embed\": \"src\"\n };\n }", "function componentsAsUmdModules(){\n const componentsDir = path.join(PROJECT_SRC_DIR, 'components')\n const r = {}\n\n glob.sync(componentsDir + '/**/*.vue').forEach(file => {\n if (!shouldIgnoreFile(file)){\n r[fileToModuleEntryName(file)] = {\n ...defaultBaseEntry, \n\n // the component will be packed into AMD module\n libTarget: 'amd',\n\n // the js template\n js: require('./src/template/component.script'),\n\n // components has no html and css, all will be packed into a .js file\n html: false,\n css: false,\n extractCssFromJs: false,\n }\n }\n })\n\n return r\n}", "getModuleName() {\n return 'QRCodeGenerator';\n }", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function baseCompile(component, target) {\n\n const importVueTemp = () => `import _${uppercamelize(component)} from './${component}';`;\n const importStyleTemp = () => `import './style';`;\n const exportTemp = () => `export default _${uppercamelize(component)};`;\n\n const content = `${utils.tips(packageJson.author)}\n \n${importVueTemp()}\n\n${importStyleTemp()}\n\n${exportTemp()}`;\n\n fs.writeFileSync(target, content);\n}", "getDatavisualPlugins(params) {\n return axios({\n method: 'get',\n url: 'v1/mindinsight/datavisual/plugins',\n params: params,\n });\n }", "getModuleName() {\n return 'DataMatrixGenerator';\n }", "getModuleName() {\n return 'barcode';\n }", "extend(config, ctx) {\n ctx.loaders.less.javascriptEnabled = true\n config.resolve.alias.vue = 'vue/dist/vue.common'\n }", "_getData(source) {\n return __awaiter(this, void 0, void 0, function* () {\n let data;\n try {\n if (source.startsWith('{')) {\n data = JSON.parse(source);\n }\n else if (source.startsWith('/') ||\n source.match(/^https?\\:\\/\\//)) {\n data = yield fetch(source).then((response) => response.json());\n }\n else {\n const $template = document.querySelector(`template#${source}, template${source}`);\n if ($template) {\n // @ts-ignore\n data = JSON.parse($template.content.textContent);\n }\n }\n }\n catch (e) { }\n // warn if no data\n if (!data) {\n throw new Error(`[SCarpenterAppComponent] The passed source \"${source}\" does not provide any valid data...`);\n }\n // filter the \"ghosts\"\n if (!this.props.ghostSpecs && data.specs) {\n data.specs = __filterObject(data.specs, (key, item) => {\n return !item.ghost;\n });\n }\n data.specsByTypes = {};\n for (let [namespace, specObj] of Object.entries(data.specs)) {\n const parts = namespace.split('.');\n let type;\n parts.forEach((part) => {\n if (type)\n return;\n if (part !== 'views') {\n type = part;\n }\n });\n if (!data.specsByTypes[type]) {\n data.specsByTypes[type] = {};\n }\n data.specsByTypes[type][namespace] = specObj;\n }\n return data;\n });\n }", "function extension(module, filename) {\n\t var fs = __webpack_require__(35);\n\t var templateString = fs.readFileSync(filename, 'utf8');\n\t module.exports = handlebars.compile(templateString);\n\t}", "function load (component) {\n // '@' is aliased to src/components\n return () => import(`src/views/${component}.vue`)\n}", "function DI(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}", "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src'\n }\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.node = {\n fs: 'empty'\n }\n // Add markdown loader\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader'\n })\n }", "getDatavisualPlugins(params) {\n return axios({\n method: 'get',\n url: 'v1/mindinsight/datavisual/plugins',\n params: params,\n });\n }", "createComponentList () {\n this.transformedContent = this.transformedContent.replace(\n utils.regExp.exportStatement,\n '$1\\n' \n + this.componentsIndentSpace \n + 'components: {\\n' \n + this.componentsIndentSpace + ' ' \n + this.quasarComponents.join(',\\n' + this.componentsIndentSpace + ' ') \n + '\\n' \n + this.componentsIndentSpace \n + '},\\n'\n );\n }", "function extension(module, filename) {\n\t var fs = __webpack_require__(2);\n\t var templateString = fs.readFileSync(filename, 'utf8');\n\t module.exports = handlebars.compile(templateString);\n\t}", "onMapModule(desc) {\n\n if (desc.type !== 'VueComponent') {\n return;\n }\n super.onMapModule(desc);\n\n if (desc.template) {\n this.parseTemplate(desc);\n }\n\n if (desc.component.trigger) {\n\n _.forEach(desc.component.trigger, trigger => {\n\n trigger.resource = desc.resource;\n trigger.template = 'function';\n trigger.simpleName = trigger.name;\n const {params, tables} = util.mapParams(trigger.params);\n\n trigger.params = params;\n trigger.tables = tables;\n\n });\n\n }\n\n return Promise.resolve();\n\n }", "function extension(module, filename) {\n var fs = __webpack_require__(5747);\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function extension(module, filename) {\n var fs = __webpack_require__(5747);\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "name(module, chunks, cacheGroupKey) {\n const moduleFileName = module.identifier().split('/').reduceRight(item => item);\n const allChunksNames = chunks.map((item) => item.name).join('~');\n return `${cacheGroupKey}-${allChunksNames}-${moduleFileName}`;\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n const vueLoader = config.module.rules.find((loader) => loader.loader === 'vue-loader')\n vueLoader.options.transformToRequire = {\n video: 'src',\n source: 'src'\n };\n\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n }\n }", "uploadUrl(app, module, x, y, url) {\n var filename = url.toString().split('/').pop();\n var extension = filename.toString().split('.').pop();\n filename = filename.toString().split('.').shift();\n if (extension == \"dsp\") {\n Utilitary.getXHR(url, (codeFaust) => {\n var dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + codeFaust + \"}.process);\";\n if (module == null) {\n app.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { app.createModule(factory); } });\n }\n else {\n module.update(filename, dsp_code);\n }\n }, Utilitary.errorCallBack);\n }\n else if (extension == \"polydsp\") {\n Utilitary.getXHR(url, (codeFaust) => {\n var dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + codeFaust + \"}.process);\";\n if (module == null) {\n app.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { app.createModule(factory); } });\n }\n else {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }, Utilitary.errorCallBack);\n }\n else if (extension == \"json\") {\n Utilitary.getXHR(url, (codeFaust) => {\n let moduleJson = JSON.parse(codeFaust);\n app.compileFaust({ isMidi: false, name: filename, sourceCode: \"process=_,_;\", x: x, y: y, callback: (factory) => { app.createNonFaustModule(factory, moduleJson); } });\n //app.createNonFaustModule({ name:filename, sourceCode:codeFaust, x:x, y:y})\n }, Utilitary.errorCallBack);\n }\n }", "function extension(module, filename) {\n var fs = __webpack_require__(747);\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function extension(module, filename) {\n var fs = __webpack_require__(747);\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "initializeModuleDependencyProvider () {\n this.moduleDependencyProvider = (editor) => {\n let memory = new WebAssembly.Memory({initial: 64});\n return {\n imports: {\n WebBS: {\n memory,\n log: (number) => editor.logOutput(number),\n logStr: (index, size) => {\n let str = \"\";\n let memView = new Uint8Array(memory.buffer);\n for (let i = index; i < index + size; i++) {\n str += String.fromCharCode(memView[i]);\n }\n editor.logOutput(str);\n }\n }\n },\n\n onInit: (instance) => {}\n };\n }; \n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // muse设置\n config.resolve.alias['muse-components'] = 'muse-ui/src'\n config.resolve.alias['vue$'] = 'vue/dist/vue.esm.js'\n config.module.rules.push({\n test: /muse-ui.src.*?js$/,\n loader: 'babel-loader'\n })\n }", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }", "GetModule() {\n\n }", "function extension(module, filename) {\n \n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "recompileSource(event, module) {\n // Utilitary.showFullPageLoading();\n // var dsp_code: string = this.moduleView.textArea.value;\n // this.moduleView.textArea.style.display = \"none\";\n // Connector.redrawOutputConnections(this, this.drag);\n // Connector.redrawInputConnections(this, this.drag)\n // module.update(this.moduleView.fTitle.textContent, dsp_code);\n // module.recallInterfaceParams();\n // module.moduleView.fEditImg.style.backgroundImage = \"url(\" + Utilitary.baseImg + \"edit.png)\";\n // module.moduleView.fEditImg.addEventListener(\"click\", this.eventOpenEditHandler);\n // module.moduleView.fEditImg.addEventListener(\"touchend\", this.eventOpenEditHandler);\n // module.moduleView.fEditImg.removeEventListener(\"click\", this.eventCloseEditHandler);\n // module.moduleView.fEditImg.removeEventListener(\"touchend\", this.eventCloseEditHandler);\n }", "constructor() {\n super(moduleDirectory);\n }", "function extension(module, filename) {\n var fs = require$$1;\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars$2.compile(templateString);\n}", "extend(config, ctx) {\n vendor: [\n 'vuex',\n ]\n\n /*\n ** Import Audio Files\n */\n config.module.rules.push({\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n use: 'file-loader',\n exclude: /(node_modules)/\n });\n\n /*\n ** Build electron \n */\n config.output.publicPath = './_nuxt/'\n if (process.env.NODE_ENV == 'development') {\n config.target = 'electron-renderer'\n }\n }", "static get moduleName() {\n return undefined;\n }", "hugJSON(string) {\n// Parse data....\n let modules = JSON.parse(string)\n// Go through modules...... If we find a module with a .json ext.....\n for (const module of modules) {\n if (this.jsonFileRE.test(module.file)) {\n// Wrap the source code (json) with parens.....\n module.source = `(${module.source})`\n }\n }\n// Return altered json.....\n return modules\n }", "extend(config, { isDev, isClient }) {\n\n // Resolve vue2-google-maps issues (server-side)\n // - an alternative way to solve the issue\n // -----------------------------------------------------------------------\n // config.module.rules.splice(0, 0, {\n // test: /\\.js$/,\n // include: [path.resolve(__dirname, './node_modules/vue2-google-maps')],\n // loader: 'babel-loader',\n // })\n }", "extend (config, { isDev, isClient }) {\n /*\n // questo linta ogni cosa ad ogni salvataggio\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }*/\n }", "extend(config, ctx) {\n // Load SVG files as components\n // https://vue-svg-loader.js.org/\n\n // Replace all existing rules which include SVG files\n const svgRule = config.module.rules.find(rule => rule.test.test('.svg'))\n svgRule.test = /\\.(png|jpe?g|gif|webp)$/\n\n // Create new rule for SVG loading\n config.module.rules.push({\n test: /\\.svg$/,\n oneOf: [\n {\n resourceQuery: /inline/,\n use: ['babel-loader', 'vue-svg-loader'],\n },\n {\n loader: 'file-loader',\n query: {\n name: 'assets/[name].[hash:8].[ext]',\n },\n },\n ],\n // loader: 'vue-svg-loader',\n // options: {\n // svgo: {\n // plugins: [{ removeDimensions: true }, { removeViewBox: false }],\n // },\n // },\n })\n }", "loadModules(passphrase) {\n return this.httpService({\n method: 'GET',\n url: `${this.rootURL}microAnalytics`,\n headers: {Authorization: `basic ${passphrase}`}\n });\n }", "resolveId ( source ) {\n if (source === 'virtual-module') {\n return source; // this signals that rollup should not ask other plugins or check the file system to find this id\n }\n return null; // other ids should be handled as usually\n }", "function getModuleSource(moduleName, type) {\n var shaderModule = Object(__WEBPACK_IMPORTED_MODULE_0__shader_modules__[\"a\" /* getShaderModule */])(moduleName);\n var moduleSource = void 0;\n switch (type) {\n case VERTEX_SHADER:\n moduleSource = shaderModule.vs || shaderModule.vertexShader;\n break;\n case FRAGMENT_SHADER:\n moduleSource = shaderModule.fs || shaderModule.fragmentShader;\n break;\n default:\n __WEBPACK_IMPORTED_MODULE_3_assert___default()(false);\n }\n\n if (typeof moduleSource !== 'string') {\n return '';\n }\n\n return '#define MODULE_' + moduleName.toUpperCase() + '\\n' + moduleSource + '// END MODULE_' + moduleName + '\\n\\n';\n}", "function extension(module, filename) {\n var fs = __nccwpck_require__(57147);\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }", "moduleFile() {\n\t\tconst jsonFileName = config.theme_path.replace( /\\\\/g, '/' ) + modulesFolder + this.directory.replace( this.cssName + '/', '' ) + this.cssName + '.json';\n\t\tfse.outputJsonSync( jsonFileName, this.json );\n\t}", "apiUrl() {\n return process.env.VUE_APP_ROOT_API;\n }", "function getGlobDataAPI(){\n\n}", "extend(config, { isClient, isDev }) {\n // Run ESLint on save\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue|ts)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n\n // stylelint\n config.plugins.push(\n new StylelintPlugin({\n files: ['**/*.vue'],\n }),\n )\n\n config.devtool = '#source-map'\n }\n\n // glsl\n config.module.rules.push({\n test: /\\.(glsl|vs|fs)$/,\n use: ['raw-loader', 'glslify-loader'],\n exclude: /(node_modules)/,\n })\n\n config.module.rules.push({\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n loader: 'file-loader',\n options: {\n name: '[path][name].[ext]',\n },\n })\n\n config.output.globalObject = 'this'\n\n config.module.rules.unshift({\n test: /\\.worker\\.ts$/,\n loader: 'worker-loader',\n })\n config.module.rules.unshift({\n test: /\\.worker\\.js$/,\n loader: 'worker-loader',\n })\n\n // import alias\n config.resolve.alias.Sass = path.resolve(__dirname, './assets/sass/')\n config.resolve.alias.Js = path.resolve(__dirname, './assets/js/')\n config.resolve.alias.Images = path.resolve(__dirname, './assets/images/')\n config.resolve.alias['~'] = path.resolve(__dirname)\n config.resolve.alias['@'] = path.resolve(__dirname)\n }", "_configureHTTP() {\n let source\n\n// Configuring express to serve from example directory...\n app.use('/', express.static(this.options.watchOpts.serve))\n// Setting the port...\n app.set('port', process.env.PORT || this.options.watchOpts.port)\n\n// HMR endpoint...\n app.get('/hot-module', (req, res)=> {\n/// Isolate the updated module....\n // console.log('MODULEDEPSJSON');console.log(this.moduleDepsJSON);\n let hotMod = this.moduleDepsJSON.filter(\n dep=> dep.id.includes(req.query.file)\n )[0]\n // console.log('HOTMOD');console.log(hotMod);\n// Get module id....\n let moduleId = hotMod.id\n// wrap the module code around JSONP callback function\n let hotModuleScript = `hotModule({ \"${moduleId}\": [function(require, module, exports) {`\n\n// if User is using valence UI library, remove 'use strict'...\n if (this.options.valence || this.options.strict) {\n// Remove code....\n source = this._loosyGoosy(hotMod.source)\n }\n\n// Add the updated module's source to the hotModuleScript text....\n hotModuleScript += source\n // log('hotMod.source', ['yellow', 'bold']);log(source, ['yellow', 'bold'])\n// Finish up the script....\n hotModuleScript += `},`\n// Append dependencies....\n hotModuleScript += JSON.stringify(hotMod.deps)\n// Add finishing touches, brackets and parens....\n hotModuleScript += `]});`\n\n// Send the script...\n res.send(hotModuleScript)\n })\n }", "extend(config, ctx) {\n const vueLoader = config.module.rules.find((loader) => loader.loader === 'vue-loader')\n vueLoader.options.transformToRequire = {\n 'vue-h-zoom': ['image', 'image-full']\n }\n }", "extend(config, ctx) {\n config.resolve.alias['vue'] = 'vue/dist/vue.common'}", "extend (config, ctx) {\n // if (ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, ctx) {\n config.resolve.alias[\"vue\"] = \"vue/dist/vue.common\";\n }", "replacePublicPath(compiler) {\n const { mainTemplate } = compiler\n this.getHook(mainTemplate, 'require-extensions')((source, chunk, hash) => {\n const buildCode = [\n 'try {',\n ` return '${this.LOCAL_WEBPACK_SERVER.URI}/';`,\n '} catch (e) {',\n `console.error(\"${\n this.PLUGIN_NAME\n }: There was a problem with the public path.\")`,\n '}',\n ].join('\\n')\n\n return [\n source,\n `// ProxyPackDynamicUrl`,\n 'Object.defineProperty(' + mainTemplate.requireFn + ', \"p\", {',\n ' get: function () {',\n buildCode,\n ' }',\n '})',\n ].join('\\n')\n })\n }", "function buildModule(data, settings, container) {\n settings = $.extend({}, defaultSettings, settings, container.getData());\n if (\n typeof settings.showForAnonym !== \"boolean\" || \n typeof settings.showServerName !== \"boolean\" || \n typeof settings.showGuideline !== \"boolean\" || \n typeof settings.useSvg !== \"boolean\" || \n typeof settings.customDescription !== \"string\" ||\n typeof settings.refreshClass !== 'string' ||\n typeof settings.showRefresh !== 'boolean'\n ) {\n return container.showError(\"Configuration Error: wrong type\");\n }\n if (settings.showForAnonym === false && !cfg.wgUserName) {\n container.remove();\n return;\n }\n \n function loadModule(description) {\n var image = !settings.useSvg ? \n '<div class=\"discord-icon\"></div>' : \n '<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"discord-svg\" width=\"20\" height=\"20\" viewBox=\"0 0 240 245\">' + \n '<path d=\"M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z\"/>' +\n '<path d=\"M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z\"/>' +\n '</svg>';\n \n var $module = $('<div class=\"discord-content\">' +\n '<h2 class=\"discord-header has-icon\">' +\n image + \n (settings.showServerName ? mw.html.escape(data.name) : 'Discord') + \n '</h2>' +\n (description || '') +\n '<div class=\"discord-connect\">' +\n (data.instant_invite ? \n '<a class=\"discord-join wds-is-squished wds-button wds-is-secondary\">(join)</a>' : \n '') +\n '<a class=\"discord-online\">(online) <span class=\"discord-counter\">?</span></a>' +\n '</div>' +\n '</div>'),\n $refresh = $('<a>', {\n href: '#',\n class: 'discord-refresh ' + (settings.refreshClass || ''),\n text: translate('(refresh)'),\n title: translate('(refreshTitle)'),\n style: 'float:right'\n });\n $('body').off('click.discordrefresh');\n if (settings.showRefresh) {\n $('body').on('click.discordrefresh', '.discord-refresh', function (e) {\n e.preventDefault();\n getData(settings, container);\n return false;\n });\n $module.find('.discord-connect').append($refresh);\n }\n $module.find('.discord-join').attr('onclick', \"window.open('\" + data.instant_invite + \"','_blank')\");\n $module.find('.discord-counter').text(data.presence_count || data.members.length);\n $module.html(translate( $module[0].innerHTML ));\n \n var avatarsLoaded = false,\n $members = $('<ul class=\"discord-list\"></ul>');\n data.members.forEach(function (v) {\n var memberName = v.username.replace(/\\s/g, '_'),\n memberNick = v.nick ? v.nick.replace(/\\s/g, '_') : memberName;\n var $member = $('<li>', {\n 'class': 'discord-member discord-member-' + (userSettings.usenick ? memberNick : memberName)\n }).append(\n $('<div>', { 'class': 'discord-avatar' }).append(\n $('<img>')\n )\n );\n $member.append(\n mw.html.escape(userSettings.usenick ? v.nick || v.username : v.username)\n + (v.bot ? '<span class=\"discord-bot\">BOT</span>' : '')\n );\n // add title to member\n if (v.nick) {\n $member.attr('title', userSettings.usenick ? v.username : v.nick);\n }\n $member.find('.discord-avatar').addClass(\"discord-\" + v.status);\n //$member.find('img').attr(\"src\", v.avatar_url);\n $member.attr('data-avatar', v.avatar_url);\n if (v.game) {\n $member.append(\n $('<span>', {\n class: 'discord-member-game',\n text: v.game.name,\n })\n );\n }\n \n $members.append($member);\n });\n \n $module.find('.discord-online').click(function(e) {\n e.preventDefault();\n uiFactory.init(['modal']).then(function(uiModal) {\n // add avatars\n if (!avatarsLoaded) {\n avatarsLoaded = true;\n $members.find('.discord-member').each(function () {\n var $member = $(this);\n $member.find('img').attr('src', $member.attr('data-avatar'));\n });\n }\n uiModal.createComponent({\n type: 'default',\n vars: {\n id: 'discord-list-modal',\n title: translate('(onlinelist)'),\n content: $members.html(),\n size: 'small'\n }\n }, function(modal) {\n modal.$element.keydown(function(e) {\n if (e.which == 27) {\n e.preventDefault();\n modal.trigger(\"close\");\n }\n });\n modal.bind(\"reset\", function(e) {\n e.preventDefault();\n modal.trigger(\"close\");\n });\n modal.show();\n mw.hook('discordmodule.modal.show').fire(modal.$content);\n });\n });\n });\n \n container.fill($module, settings.railPosition);\n }\n \n if (settings.showGuideline) {\n var description = '<p class=\"discord-guideline\">' +\n (settings.customDescription || translate(\"(description)\")) +\n '</p>';\n parseWikitext(description, loadModule);\n } else {\n loadModule(false);\n }\n }", "extend(config, ctx) {\n config.resolve.alias.vue = 'vue/dist/vue.common';\n }", "extendWebpack (cfg) {\n cfg.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|quasar)/\n })\n cfg.resolve.alias = {\n ...(cfg.resolve.alias || {}),\n '@components': path.resolve(__dirname, './src/components'),\n '@layouts': path.resolve(__dirname, './src/layouts'),\n '@pages': path.resolve(__dirname, './src/pages'),\n '@utils': path.resolve(__dirname, './src/utils'),\n '@store': path.resolve(__dirname, './src/store'),\n '@config': path.resolve(__dirname, './src/config'),\n '@errors': path.resolve(__dirname, './src/errors'),\n '@api': path.resolve(__dirname, './src/api')\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n config.module.rules.push({\n resourceQuery: /blockType=i18n/,\n type: \"javascript/auto\",\n loader: [\"@kazupon/vue-i18n-loader\", \"yaml-loader\"]\n });\n }", "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA',\n meta_conntype: 'mondrian.jndi',\n meta_datype: 'mdx'\n },\n sourceName = $('.' + config + ' .sourceName')[0].value,\n jndi = $('.' + config + ' .sourceConnect')[0].value,\n cubes = $('.' + config + ' .dataCubes')[0].value,\n query = $('.' + config + ' .sqlStatement')[0].value,\n queryType = $('.' + config + ' .queryType')[0].value,\n stringCubes = 'mondrian:/',\n catalog = (queryType === 'mdx') ? stringCubes + cubes : cubes;\n let dataRows = {\n name: sourceName,\n jndi: jndi,\n access: 'pubilc',\n catalog: catalog,\n query: query,\n bandedMode: 'compact',\n parameters: [],\n cdacalculatedcolumns: [],\n cdacolumns: [],\n output: [],\n outputMode: 'include',\n cacheKeys: [],\n cacheDuration: 3600,\n cache: true\n };\n\n d3.entries(dataRows).map(d=>{\n let row = {\n 'name': d.key,\n 'value': d.value\n };\n\n source.properties.push(row);\n });\n data.push(source);\n this.chartDataSource(data, sourceName, random);\n this.dataSourceNames.push(sourceName);\n this.selectDataSource(data, sourceName, random);\n return source;\n }", "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 extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function extension(module, filename) {\n var fs = require('fs');\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function definition1() {\n\t\t\t\t\t\t\tlog('provide', '/app/js/example1', 'resolved', 'module');\n\n\t\t\t\t\t\t\treturn function appJsExample1() {\n\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}", "function _import(file) {\n return require('@/' + file + '.vue').default\n}", "function _import(file) {\n return require('@/' + file + '.vue').default\n}", "function _import(file) {\n return require('@/' + file + '.vue').default\n}", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n ** For including scss variables file\n */\n config.module.rules.forEach((rule) => {\n if (isVueRule(rule)) {\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (isSASSRule(rule)) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }", "function extension(module, filename) {\n var fs = fs__default['default'];\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars$1.compile(templateString);\n}", "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 extension(module, filename) {\n var fs = require('fs');\n\n var templateString = fs.readFileSync(filename, 'utf8');\n module.exports = handlebars.compile(templateString);\n}", "extend (config, ctx) {\n config.devtool = ctx.isClient ? \"eval-source-map\" : \"inline-source-map\";\n\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: \"pre\",\n // test: /\\.(js|vue)$/,\n // loader: \"eslint-loader\",\n // exclude: /(node_modules)/,\n // });\n // }\n }", "extend(configuration, { isDev, isClient }) {\n configuration.resolve.alias.vue = 'vue/dist/vue.common'\n\n configuration.node = {\n fs: 'empty',\n }\n\n configuration.module.rules.push({\n test: /\\.worker\\.js$/,\n use: { loader: 'worker-loader' },\n })\n\n if (isDev && isClient) {\n configuration.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n }", "function buildSxcRoot() {\n var rootApiV2 = Object(_sxc_root__WEBPACK_IMPORTED_MODULE_4__[\"getRootPartsV2\"])();\n var urlManager = new _tools_url_param_manager__WEBPACK_IMPORTED_MODULE_1__[\"UrlParamManager\"]();\n var debug = new ___WEBPACK_IMPORTED_MODULE_5__[\"Debug\"]();\n // {\n // load: (urlManager.get('debug') === 'true'),\n // uncache: urlManager.get('sxcver'),\n // };\n var stats = new _Stats__WEBPACK_IMPORTED_MODULE_2__[\"Stats\"]();\n var addOn = {\n _controllers: {},\n beta: {},\n _data: {},\n // this creates a full-screen iframe-popup and provides a close-command to finish the dialog as needed\n totalPopup: new _tools_total_popup__WEBPACK_IMPORTED_MODULE_0__[\"TotalPopup\"](),\n urlParams: urlManager,\n // note: I would like to remove this from $2sxc, but it's currently\n // used both in the inpage-edit and in the dialogs\n // debug state which is needed in various places\n debug: debug,\n stats: stats,\n insights: function (partName, index, start, length) { return ___WEBPACK_IMPORTED_MODULE_5__[\"Insights\"].show(partName, index, start, length); },\n _insights: ___WEBPACK_IMPORTED_MODULE_5__[\"Insights\"],\n // mini-helpers to manage 2sxc parts, a bit like a dependency loader\n // which will optimize to load min/max depending on debug state\n parts: {\n getUrl: function (url, preventUnmin) {\n // let r = url;// (preventUnmin || !debug.load) ? url : url.replace('.min', ''); // use min or not\n if (debug.uncache && url.indexOf('sxcver') === -1)\n return url + ((url.indexOf('?') === -1) ? '?' : '&') + 'sxcver=' + debug.uncache;\n return url;\n },\n },\n jq: function () { return $2sxc_jQSuperlight; },\n };\n var merged = addOn.jq().extend(FindSxcInstance, addOn, rootApiV2);\n merged.log.add('sxc controller built');\n console.log(\"$2sxc \" + ___WEBPACK_IMPORTED_MODULE_5__[\"SxcVersion\"] + \" with insights-logging - see https://r.2sxc.org/insights\");\n return merged; //FindSxcInstance as SxcRoot & SxcRootInternals;\n}", "function adjustImports(source) {\n return source.replace('from \"svelte/internal\";', 'from \"svelte/internal/index.mjs\";')\n}", "function components() {\n console.log(\"Generating manager/components.py\");\n\n const json = fs.readFileSync(\n path.join(\n require.resolve(\"@stencila/components\"),\n \"..\",\n \"..\",\n \"package.json\"\n ),\n \"utf8\"\n );\n const version = JSON.parse(json).version;\n\n fs.writeFileSync(\n path.join(__dirname, \"manager\", \"components.py\"),\n `# Generated by ${path.basename(\n __filename\n )}. Commit this file, but do not edit it.\n\n# The version of @stencila/components to use\nversion = \"${version}\"\n`\n );\n}", "extend (config, ctx) {\n // inject `compilerModules` to vue-loader options\n config.module.rules.forEach(rule => {\n if (rule.loader === 'vue-loader') {\n rule.options.compilerModules = [i18nExtensions.module(i18n)]\n }\n })\n }", "extend (config, ctx) {\n config.resolve.alias['class-component'] = '~plugins/class-component'\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\n })\n ]\n }\n }", "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader.readAsText(file);\n }\n else if (ext == \"json\") {\n type = \"json\";\n reader.readAsText(file);\n }\n else if (ext == \"jfaust\") {\n type = \"jfaust\";\n reader.readAsText(file);\n }\n else if (ext == \".polydsp\") {\n type = \"poly\";\n reader.readAsText(file);\n }\n else {\n throw new Error(Utilitary.messageRessource.errorObjectNotFaustCompatible);\n }\n reader.onloadend = (e) => {\n dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + reader.result + \"}.process);\";\n if (!module) {\n if (type == \"dsp\") {\n this.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n this.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n }\n else {\n if (type == \"dsp\") {\n module.isMidi = false;\n module.update(filename, dsp_code);\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }\n };\n }" ]
[ "0.58857095", "0.57021075", "0.56790245", "0.5672658", "0.5602884", "0.5599977", "0.5513555", "0.55087477", "0.54444987", "0.5416769", "0.5388699", "0.5381284", "0.537469", "0.5358846", "0.53166306", "0.5296982", "0.5293724", "0.5263554", "0.52481985", "0.52404064", "0.52328825", "0.51677126", "0.5166459", "0.5166138", "0.5143678", "0.5113512", "0.5110868", "0.51059556", "0.5078298", "0.50770605", "0.5075652", "0.50721526", "0.5071389", "0.50693446", "0.5060171", "0.5052826", "0.50517493", "0.50322604", "0.50322604", "0.5021298", "0.5011977", "0.50060844", "0.49995163", "0.49995163", "0.4994195", "0.4974674", "0.49715814", "0.49607036", "0.49431568", "0.494053", "0.49404347", "0.49345005", "0.49329132", "0.49193996", "0.4917784", "0.49149293", "0.4900496", "0.48993748", "0.48961943", "0.48960444", "0.48955065", "0.48945257", "0.48878098", "0.4887549", "0.4884639", "0.48821968", "0.48757923", "0.48640642", "0.486005", "0.48401597", "0.48330036", "0.48326245", "0.48324016", "0.48188496", "0.48184252", "0.4817016", "0.4811757", "0.48104006", "0.48070017", "0.48049325", "0.48049325", "0.48049325", "0.48049325", "0.48049325", "0.480343", "0.4798134", "0.4797298", "0.4797298", "0.4797298", "0.47960678", "0.47910288", "0.47899795", "0.47867563", "0.4780456", "0.47772074", "0.47741023", "0.47711426", "0.47708637", "0.47705355", "0.47695923", "0.47678083" ]
0.0
-1
TODO Draggable for group FIXME Draggable on element which has parent rotation or scale
function Draggable() { this.on('mousedown', this._dragStart, this); this.on('mousemove', this._drag, this); this.on('mouseup', this._dragEnd, this); // `mosuemove` and `mouseup` can be continue to fire when dragging. // See [Drag outside] in `Handler.js`. So we do not need to trigger // `_dragEnd` when globalout. That would brings better user experience. // this.on('globalout', this._dragEnd, this); // this._dropTarget = null; // this._draggingTarget = null; // this._x = 0; // this._y = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "_applyPosition() {\n if (!this.element || !this.$()) { return; }\n\n const groupDirection = this.get('group.direction');\n\n if (groupDirection === 'x') {\n let x = this.get('x');\n let dx = x - this.element.offsetLeft + parseFloat(this.$().css('margin-left'));\n\n this.$().css({\n transform: `translateX(${dx}px)`\n });\n }\n if (groupDirection === 'y') {\n let y = this.get('y');\n let dy = y - this.element.offsetTop;\n\n this.$().css({\n transform: `translateY(${dy}px)`\n });\n }\n }", "onDrop( event ) {\n event.preventDefault()\n\n let svg = document.getElementById( \"svg-el\" )\n let point = svg.createSVGPoint()\n\n // translate the screen point to svg's point\n point.x = event.clientX\n point.y = event.clientY;\n point = point.matrixTransform( svg.getScreenCTM().inverse() )\n\n ////////////////////////////////////////////\n // adjust the point to accomadate svgRotation\n ////////////////////////////////////////////\n\n let data = this.props.draggingComponent\n let rotate = this.props.svgRotation\n let x = 0\n let y = 0\n let multX = 1\n let multY = 1\n\n switch( rotate ) {\n case 90:\n multX = -1\n multY = 1\n y = point.x * multX\n x = point.y * multY\n break\n case 180:\n multX = -1\n multY = -1\n x = point.x * multX - data.width\n y = point.y * multY\n break\n case 270:\n multX = 1\n multY = -1\n y = point.x * multX + data.height\n x = point.y * multY - data.width\n break\n default:\n x = point.x\n y = point.y + data.height\n }\n\n // create the component\n var newComponent = { type: data.type, left: x, bottom: y,\n width: data.width, height:data.height,\n uuid: UUID.create(1).toString() }\n\n // dispatch event adding new component\n this.props.dispatch( addDockComponent( newComponent ))\n }", "function dragging(evt) {\n \n //don't move the object if dragging using color circle\n// if (![\"plant\", \"garden\"].some(clsName => evt.target.classList.contains(clsName))){\n// return;\n// }\n if (clickedGroup) {\n \n hideDropDown();\n \n //mobile\n if (evt.touches) evt = evt.touches[0];\n \n event.preventDefault();\n coord = getMousePosition(evt);\n\n \n //RESIZING (garden only)\n if (resize) {\n \n //adjustments to width and height: the X and Y of the point of click/touch minus starting X and Y point of click\n let adjustedW = evt.clientX - clickPos.x;\n let adjustedH = evt.clientY - clickPos.y;\n\n \n //remove any dropdown menus within the garden\n hideDropDown();\n\n //the resize object is the garden rectangle\n const resizeObj = clickedGroup.getElementsByTagName(\"rect\")[0];\n\n //the new width and height are stored in newW & newH so that they can be checked for sensibility\n let newW = Number(resizeObj.getAttribute(\"width\")) + adjustedW;\n let newH = Number(resizeObj.getAttribute(\"height\"))+ adjustedH;\n\n //the width & height can't be negative, and shouldn't be less than 1'x1' (12*6);\n const minSize = 12 * size;\n if (newW < minSize) {\n newW = minSize;\n adjustedW = 0;\n }\n if (newH < minSize) {\n newH = minSize;\n adjustedH = 0;\n }\n\n //update the width and height of the rectangle\n resizeObj.setAttribute(\"width\", newW);\n resizeObj.setAttribute(\"height\", newH);\n\n //keep garden name centered or above, if not enough room for it\n const gName = clickedGroup.getElementsByClassName(\"editable\")[0];\n gName.setAttributeNS(\n null, \n \"x\", \n Number(resizeObj.getAttribute(\"x\")) +\n Number(resizeObj.getAttribute(\"width\"))/2 -\n Number(gName.getAttribute(\"width\"))/2);\n\n //check if enough room: new width newW minus the widths of sun and tools gears, from gName.desc, compared to number of characters in the garden name times munit/2 (approximate size of a letter, ~7.11)\n if ((newW - Number(gName.getAttribute(\"desc\"))) < \n Number(gName.getAttribute(\"width\"))) {\n gName.setAttribute(\"y\", Number(resizeObj.getAttribute(\"y\")) - munit * 2.7);\n } else {\n gName.setAttribute(\"y\", Number(resizeObj.getAttribute(\"y\")) - munit / 2);\n }\n\n //adjust the tools gear position, when its garden is resized\n const toolGear = clickedGroup.getElementsByClassName(\"ulTools\")[0];\n toolGear.setAttribute(\"x\", Number(toolGear.getAttribute(\"x\"))+adjustedW);\n\n //adjust the soil selector position, when its garden is resized\n const soilGear = clickedGroup.getElementsByClassName(\"ulSoil\")[0];\n soilGear.setAttribute(\"y\", Number(soilGear.getAttribute(\"y\"))+adjustedH);\n\n //update the size indicators\n const elts = clickedGroup.getElementsByClassName(\"sizeInd\");\n\n //height\n elts[0].setAttributeNS(\n null, \n \"x\", \n Number(elts[0].getAttribute(\"x\"))+adjustedW);\n //update the text of the height indicators\n elts[0].textContent = formatSizeDisplay(Number(resizeObj.getAttribute(\"height\"))/size);\n\n //width\n elts[1].setAttributeNS(\n null, \n \"y\", \n Number(elts[1].getAttribute(\"y\"))+adjustedH);\n //update the text of the width indicators\n elts[1].textContent = formatSizeDisplay(Number(resizeObj.getAttribute(\"width\"))/size);\n\n //update the position of the resizing triangle\n clickedGroup.getElementsByClassName(\"resize\")[0].setAttributeNS(\n null, \n \"points\",\n createTriPts(Number(resizeObj.getAttribute(\"x\"))+newW, \n Number(resizeObj.getAttribute(\"y\"))+newH));\n //the sizing clickPos x & y need to be continuously updated \n //so that the size change is not cumulative\n clickPos.x = evt.clientX;\n clickPos.y = evt.clientY;\n }\n\n //MOVING\n else {\n \n if (offset === \"NoMove\") return;\n \n moving = true;\n\n if (clickedGroup.id[0] === \"p\" ||\n coord.x - offset.x + parseFloat(clickedGroup.children[0].getAttribute(\"x\")) > 0 && \n coord.x - offset.x + parseFloat(clickedGroup.children[0].getAttribute(\"x\")) + \n parseFloat(clickedGroup.children[0].getAttribute(\"width\")) <\n Number(svgPlace.getAttribute(\"width\")) && \n coord.y - offset.y + parseFloat(clickedGroup.children[0].getAttribute(\"y\")) > \n parseFloat(window.getComputedStyle(document.querySelector(\".navbar\")).height) && \n coord.y - offset.y + parseFloat(clickedGroup.children[0].getAttribute(\"y\")) + \n parseFloat(clickedGroup.children[0].getAttribute(\"height\")) <\n Number(svgPlace.getAttribute(\"height\"))\n ){\n transform.setTranslate(coord.x - offset.x, coord.y - offset.y);\n //the line below does the same as the line above\n //clickedGroup.transform.baseVal[0].setTranslate(coord.x - offset.x, coord.y - offset.y);\n } \n }\n }\n}", "updateContainerDrag(event) {\n const me = this,\n context = me.context;\n\n if (!context.started || !context.targetElement) return;\n\n const containerElement = DomHelper.getAncestor(context.targetElement, me.containers, 'b-grid'),\n willLoseFocus = context.dragging && context.dragging.contains(document.activeElement);\n\n if (containerElement && DomHelper.isDescendant(context.element, containerElement)) {\n // dragging over part of self, do nothing\n return;\n }\n\n // The dragging element contains focus, and moving it within the DOM\n // will cause focus loss which might affect an encapsulating autoClose Popup.\n // Prevent focus loss handling during the DOM move.\n if (willLoseFocus) {\n GlobalEvents.suspendFocusEvents();\n }\n if (containerElement && context.valid) {\n me.moveNextTo(containerElement, event);\n } else {\n // dragged outside of containers, revert position\n me.revertPosition();\n }\n if (willLoseFocus) {\n GlobalEvents.resumeFocusEvents();\n }\n\n event.preventDefault();\n }", "updateContainerDrag(event) {\n const me = this,\n context = me.context;\n if (!context.started || !context.targetElement) return;\n const containerElement = DomHelper.getAncestor(context.targetElement, me.containers, 'b-grid'),\n willLoseFocus = context.dragging && context.dragging.contains(document.activeElement);\n\n if (containerElement && DomHelper.isDescendant(context.element, containerElement)) {\n // dragging over part of self, do nothing\n return;\n } // The dragging element contains focus, and moving it within the DOM\n // will cause focus loss which might affect an encapsulating autoClose Popup.\n // Prevent focus loss handling during the DOM move.\n\n if (willLoseFocus) {\n GlobalEvents.suspendFocusEvents();\n }\n\n if (containerElement && context.valid) {\n me.moveNextTo(containerElement, event);\n } else {\n // dragged outside of containers, revert position\n me.revertPosition();\n }\n\n if (willLoseFocus) {\n GlobalEvents.resumeFocusEvents();\n }\n\n event.preventDefault();\n }", "arrange(desiredSize) {\n this.outerBounds = new Rect();\n if (this.hasChildren()) {\n let y;\n let x;\n y = this.offsetY - desiredSize.height * this.pivot.y;\n x = this.offsetX - desiredSize.width * this.pivot.x;\n for (let child of this.children) {\n if ((child.transform & RotateTransform.Parent) !== 0) {\n child.parentTransform = this.parentTransform + this.rotateAngle;\n let childSize = child.desiredSize.clone();\n let topLeft;\n let center = { x: 0, y: 0 };\n let childX = x;\n let childY = y;\n if (child.relativeMode === 'Point') {\n let position = child.getAbsolutePosition(desiredSize);\n if (position !== undefined) {\n childX += position.x;\n childY += position.y;\n }\n }\n if (child.relativeMode === 'Object') {\n topLeft = this.alignChildBasedOnParent(child, childSize, desiredSize, childX, childY);\n }\n else {\n topLeft = this.alignChildBasedOnaPoint(child, childX, childY);\n }\n center = { x: topLeft.x + childSize.width / 2, y: topLeft.y + childSize.height / 2 };\n if (child.rotateValue) {\n let rotateValue = {\n x: this.offsetX + (child.rotateValue.x || 0),\n y: this.offsetY + (child.rotateValue.y || 0)\n };\n let centerPoint = { x: this.offsetX, y: this.offsetY };\n let angle = child.rotateValue.angle | 0;\n let matrix = identityMatrix();\n rotateMatrix(matrix, angle, centerPoint.x, centerPoint.y);\n center = transformPointByMatrix(matrix, rotateValue);\n }\n super.findChildOffsetFromCenter(child, center);\n }\n if ((child.horizontalAlignment === 'Stretch' || child.verticalAlignment === 'Stretch')) {\n child.arrange(desiredSize);\n }\n else {\n if (child instanceof TextElement && child.canMeasure) {\n child.arrange(child.desiredSize);\n this.outerBounds.uniteRect(child.outerBounds);\n }\n else if (!(child instanceof TextElement)) {\n child.arrange(child.desiredSize);\n this.outerBounds.uniteRect(child.outerBounds);\n }\n }\n }\n }\n this.actualSize = desiredSize;\n this.updateBounds();\n this.outerBounds.uniteRect(this.bounds);\n return desiredSize;\n }", "updateTransform() {\n if (this.sortableChildren && this.sortDirty) {\n this.sortChildren();\n }\n this._boundsID++;\n this.transform.updateTransform(this.parent.transform);\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n for (var i = 0, j = this.children.length; i < j; ++i) {\n var child = this.children[i];\n if (child.visible) {\n child.updateTransform();\n }\n }\n }", "measure(availableSize) {\n // measure the element and find the desired size\n this.desiredBounds = undefined;\n let desired = undefined;\n let child;\n let childBounds;\n if (this.hasChildren()) {\n //Measuring the children\n for (let i = 0; i < this.children.length; i++) {\n child = this.children[i];\n if (child.horizontalAlignment === 'Stretch' && !availableSize.width) {\n availableSize.width = child.bounds.width;\n }\n if (child.verticalAlignment === 'Stretch' && !availableSize.height) {\n availableSize.height = child.bounds.height;\n }\n let force = child.horizontalAlignment === 'Stretch' || child.verticalAlignment === 'Stretch';\n if (this.measureChildren || force || (child instanceof Container && child.measureChildren !== undefined)) {\n child.measure(availableSize);\n }\n childBounds = this.GetChildrenBounds(child);\n if (child.horizontalAlignment !== 'Stretch' && child.verticalAlignment !== 'Stretch') {\n if (this.desiredBounds === undefined) {\n this.desiredBounds = childBounds;\n }\n else {\n this.desiredBounds.uniteRect(childBounds);\n }\n }\n else if (this.actualSize && !this.actualSize.width && !this.actualSize.height &&\n !child.preventContainer && child.horizontalAlignment === 'Stretch' && child.verticalAlignment === 'Stretch') {\n if (this.desiredBounds === undefined) {\n this.desiredBounds = child.bounds;\n }\n else {\n this.desiredBounds.uniteRect(child.bounds);\n }\n }\n }\n if (this.desiredBounds !== undefined && this.rotateAngle !== 0) {\n let offsetPt = {\n x: this.desiredBounds.x + this.desiredBounds.width * this.pivot.x,\n y: this.desiredBounds.y + this.desiredBounds.height * this.pivot.y\n };\n let newPoint = rotatePoint(this.rotateAngle, undefined, undefined, offsetPt);\n this.desiredBounds.x = newPoint.x - this.desiredBounds.width * this.pivot.x;\n this.desiredBounds.y = newPoint.y - this.desiredBounds.height * this.pivot.y;\n }\n if (this.desiredBounds) {\n desired = new Size(this.desiredBounds.width, this.desiredBounds.height);\n }\n }\n desired = this.validateDesiredSize(desired, availableSize);\n this.stretchChildren(desired);\n this.desiredSize = desired;\n return desired;\n }", "drag(x=global.rootX+this.xOffset, y=global.rootY+this.yOffset){\n let ele = document.getElementById(this.id)\n ele.style.left = x+'px'\n console.log(ele.style.left)\n ele.style.top = y+'px'\n //call the on drag function, which can be defined to keep children in check if needed\n this.onDrag()\n }", "function D_D (main_el,par,pos_x,pos_y,def_el,fdfex) {\n//main_el is a trigger, elemet that start drag&drop\n//par is for collision, so element can't go out of parent\n//with pos_x and pos_y you can set position for element\n//with def_el you can move another element\n//*fdfex is a function definition expression. And a function definition expression it is a function is passed as an argument to another function\n\nlet el = main_el;\nel.setAttribute('onselectstart',\"return false\");\n\nel.addEventListener('mousedown',mdD_D);\n\nif (def_el !== undefined && def_el != 0 && def_el != \"\"){\n\tel = def_el;\n}\n\nif (pos_x !== undefined && !isNaN(pos_x)) {\n\tel.style.left = Number(pos_x)+\"px\";\n}\nif (pos_y !== undefined && !isNaN(pos_x)) {\n\tel.style.top = Number(pos_y)+\"px\";\n}\n\nfunction mdD_D (e) {\n\twindow.addEventListener('mousemove',mvD_D);\n\twindow.addEventListener('mouseup',muD_D);\n\n\tlet elCrd = {\n\t\tx:el.offsetLeft,\n\t\ty:el.offsetTop,\n\t\tw:el.offsetWidth,\n\t\th:el.offsetHeight\n\t}\n\n\tlet mouse = {\n\t\tx:e.x,\n\t\ty:e.y\n\t}\n\n\tif (e.target != this & e.target.tagName != \"svg\" & e.target.tagName != \"line\") {\n\t\twindow.removeEventListener('mousemove',mvD_D);\n\n\t}else {\n\t\tel.style.boxShadow = \"0 0 5px 2px #b3e0f9\";\n\t}\n\n\tfunction mvD_D (e) {\n\nif (!isResizing){\n\nmouse.x = e.x - mouse.x;\nmouse.y = e.y - mouse.y;\n\nif (par) {\n//this if is for collision with parent\nlet speed = internalColision (el,mouse.x,mouse.y,par);\n//and this for change coords of element\nelCrd.x += speed.x;\nelCrd.y += speed.y;\n\n}else {\n\telCrd.x += mouse.x;\n\telCrd.y += mouse.y;\n}\n\n\t\telCrd.X = getCoords(el).left;\n\t\telCrd.Y = getCoords(el).top;\n\n//here I set another position of element with css\n\t\tif (fdfex !== undefined && fdfex !== \"\" && fdfex !== 0) {\n\t\t\tlet status = 1;\n\t\t\tif (typeof fdfex == \"function\") {\n\t\t\t\tfdfex(e,status);\n\t\t\t}\n\t\t\tif (typeof fdfex == \"object\") {\n\t\t\t\tlet move = fdfex.f(e,fdfex.arg,status,elCrd.X,elCrd.Y);\n\t\t\t}\n\t\t}\n\n\t\tel.style.left = elCrd.x + \"px\";\n\t\tel.style.top = elCrd.y + \"px\";\n\t\tmouse.x = e.x;\n\t\tmouse.y = e.y;\n}\n\n\t}\n\nfunction muD_D (e) {\n\twindow.removeEventListener('mousemove',mvD_D);\n\twindow.removeEventListener('mouseup',muD_D);\n\n//here I set another position of element with css\n\n\tif (fdfex !== undefined && fdfex !== \"\" && fdfex !== 0) {\n\t\tlet status = 0;\n\t\tif (typeof fdfex == \"function\") {\n\t\t\tfdfex(e,status);\n\t\t}\n\t\tif (typeof fdfex == \"object\") {\n\t\t\tlet change = fdfex.f(e,fdfex.arg,status,e.x,e.y);\n\t\t}\n\t}\n\n\tel.style.boxShadow = \"none\";\n\tisDraging = false;\n\t}\n}\n\nel.ondragstart = function() {\n return false;\n};\n\n}", "makeDraggable() {\n const svg = d3.event.target; // The main SVG element\n const self = this // Connectogram Reference\n svg.addEventListener('mousedown', startDrag);\n svg.addEventListener('mousemove', drag);\n svg.addEventListener('mouseup', endDrag);\n svg.addEventListener('mouseleave', endDrag);\n \n let selectedHTMLElement = null; // Keeps track of the DOM element\n let offset = null; // Offset the center coordinates if a rectangle is dragged\n let selectedBlob = null; // A reference to the Blob element that is dragged\n // On mouse down\n function startDrag(evt) {\n const target = evt.target;\n let group = null;\n // Get the main group element based on what is being clicked on\n if (target.nodeName === \"foreignObject\" || target.nodeName === \"rect\" || target.nodeName === \"ellipse\" || target.nodeName === \"circle\") {\n group = target.parentElement;\n }\n else {\n group = null;\n }\n // Check if the Blob is draggable\n if (group && group.classList.contains(\"cg-draggable\")) {\n // Get the Blob DOM element\n selectedBlob = getBlobFromDOM(group.firstChild);\n if (selectedBlob) {\n selectedHTMLElement = group.firstChild;\n }\n // Set the offset based on mouse coordinates\n offset = getMousePosition(evt);\n offset.x -= parseFloat(selectedHTMLElement.getAttributeNS(null, \"x\"));\n offset.y -= parseFloat(selectedHTMLElement.getAttributeNS(null, \"y\"));\n }\n }\n\n // Main Drag Function\n function drag(evt) {\n // Only if dragged element is valid\n if (selectedHTMLElement && selectedBlob) {\n evt.preventDefault(); // Prevents highlighting\n // Get Mouse coordinates\n const coord = getMousePosition(evt);\n // Set new X and Y coordinates based on offset (or not)\n let newX = null;\n let newY = null; \n if (selectedBlob.shape === \"rectangle\") {\n newX = coord.x - offset.x;\n newY = coord.y - offset.y\n }\n else if (selectedBlob.shape === \"circle\" || selectedBlob.shape === \"ellipse\" || selectedBlob.shape === \"anchor\") {\n newX = coord.x;\n newY = coord.y;\n }\n // Update Blob DOM element\n selectedHTMLElement.setAttributeNS(null, \"x\", newX);\n selectedHTMLElement.setAttributeNS(null, \"y\", newY);\n // Update Blob properties and Edge & Text DOM elements\n selectedBlob.setPosition(newX, newY)\n }\n }\n\n // Reset selected elements to null\n function endDrag(evt) {\n selectedHTMLElement = null;\n selectedBlob = null;\n }\n\n // Get a reference to the Blob based on its DOM element\n function getBlobFromDOM(blobDOM) {\n const blobs = self.blobs.filter((blob) => {\n return blob.html.node() === blobDOM\n })\n if (blobs.length > 0) {\n return blobs[0]\n }\n const anchors = self.anchors.filter((anchor) => {\n return anchor.html.node() === blobDOM\n })\n if (anchors.length > 0) {\n return anchors[0]\n } else {\n return null;\n }\n }\n\n // Gets Mouse coordinates\n function getMousePosition(evt) {\n const CTM = svg.getScreenCTM();\n return {\n x: (evt.clientX - CTM.e) / CTM.a,\n y: (evt.clientY - CTM.f) / CTM.d\n };\n }\n }", "arrange(desiredSize) {\n let child;\n let childBounds = this.desiredBounds;\n if (childBounds) {\n let x = this.offsetX;\n let y = this.offsetY;\n this.offsetX = childBounds.x + childBounds.width * this.pivot.x;\n this.offsetY = childBounds.y + childBounds.height * this.pivot.y;\n // container has rotateAngle\n if (this.hasChildren()) {\n //Measuring the children\n for (let i = 0; i < this.children.length; i++) {\n child = this.children[i];\n let arrange = false;\n if (child.horizontalAlignment === 'Stretch') {\n child.offsetX = this.offsetX;\n child.parentTransform = this.parentTransform + this.rotateAngle;\n arrange = true;\n }\n if (child.verticalAlignment === 'Stretch') {\n child.offsetY = this.offsetY;\n child.parentTransform = this.parentTransform + this.rotateAngle;\n arrange = true;\n }\n if (arrange || this.measureChildren || (child instanceof Container && child.measureChildren !== undefined)) {\n child.arrange(child.desiredSize);\n }\n }\n }\n }\n this.actualSize = desiredSize;\n this.updateBounds();\n this.prevRotateAngle = this.rotateAngle;\n return desiredSize;\n }", "_initMoving() {\n if (document.getElementById('sortableGroupFirst')) {\n Sortable.create(document.getElementById('sortableGroupFirst'), {\n animation: 100,\n group: {\n name: 'groupFirst',\n put: ['groupSecond'],\n },\n });\n }\n if (document.getElementById('sortableGroupSecond')) {\n Sortable.create(document.getElementById('sortableGroupSecond'), {\n animation: 100,\n group: {\n name: 'groupSecond',\n put: ['groupFirst'],\n },\n });\n }\n }", "function makeDraggable() {\n\n moveable.draggable({\n revert: 'invalid',\n helper:\"clone\",\n containment:\"document\",\n });\n}", "setDraggable(blobDOM) {\n d3.select((blobDOM.node().parentNode)).classed('cg-draggable', true)\n }", "function Group(parent) {\n var _this = this;\n\n this.visualElement = sf.base.createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px',\n attrs: {\n action: 'grouping'\n }\n });\n\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target : parentsUntil(target, 'e-groupheadercell');\n\n if (!element || !target.classList.contains('e-drag') && _this.parent.options.groupReordering) {\n return false;\n }\n\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n\n document.body.classList.add('e-prevent-select');\n e.bindEvents(e.dragElement);\n };\n\n this.drag = function (e) {\n // if (this.groupSettings.allowReordering) {\n // this.animateDropper(e);\n // }\n var target = e.target;\n\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties'); // this.parent.trigger(events.columnDrag, { target: target, draggableType: 'headercell', column: this.column });\n\n\n if (!_this.parent.options.groupReordering) {\n sf.base.classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n sf.base.classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n }\n };\n\n this.dragStop = function (e) {\n document.body.classList.remove('e-prevent-select');\n\n _this.parent.element.classList.remove('e-ungroupdrag');\n\n var preventDrop = !(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader')); // if (this.groupSettings.allowReordering && preventDrop) { //TODO: reordering\n // remove(e.helper);\n // if (parentsUntil(e.target, 'e-groupdroparea')) {\n // this.rearrangeGroup(e);\n // } else if (!(parentsUntil(e.target, 'e-grid'))) {\n // let field: string = this.parent.getColumnByUid(e.helper.getAttribute('e-mappinguid')).field;\n // if (this.groupSettings.columns.indexOf(field) !== -1) {\n // this.ungroupColumn(field);\n // }\n // }\n // return;\n // } else\n\n if (preventDrop) {\n sf.base.remove(e.helper);\n return;\n }\n }; //TODO: reordering\n // private animateDropper: Function = (e: { target: HTMLElement, event: MouseEventArgs, helper: Element }) => {\n // let uid: string = this.parent.element.querySelector('.e-cloneproperties').getAttribute('e-mappinguid');\n // let dragField: string = this.parent.getColumnByUid(uid).field;\n // let parent: Element = parentsUntil(e.target, 'e-groupdroparea');\n // let dropTarget: Element = parentsUntil(e.target, 'e-group-animator');\n // // tslint:disable-next-line\n // let grouped: string[] = [].slice.call(this.element.querySelectorAll('.e-groupheadercell'))\n // .map((e: Element) => e.querySelector('div').getAttribute('ej-mappingname'));\n // let cols: string[] = JSON.parse(JSON.stringify(grouped));\n // if (dropTarget || parent) {\n // if (dropTarget) {\n // let dropField: string = dropTarget.querySelector('div[ej-mappingname]').getAttribute('ej-mappingname');\n // let dropIndex: number = +(dropTarget.getAttribute('index'));\n // if (dropField !== dragField) {\n // let dragIndex: number = cols.indexOf(dragField);\n // if (dragIndex !== -1) {\n // cols.splice(dragIndex, 1);\n // }\n // let flag: boolean = dropIndex !== -1 && dragIndex === dropIndex;\n // cols.splice(dropIndex + (flag ? 1 : 0), 0, dragField);\n // }\n // } else if (parent && cols.indexOf(dragField) === -1) {\n // cols.push(dragField);\n // }\n // this.element.innerHTML = '';\n // if (cols.length && !this.element.classList.contains('e-grouped')) {\n // this.element.classList.add('e-grouped');\n // }\n // this.reorderingColumns = cols;\n // for (let c: number = 0; c < cols.length; c++) {\n // this.addColToGroupDrop(cols[c]);\n // }\n // } else {\n // this.addLabel();\n // this.removeColFromGroupDrop(dragField);\n // }\n // }\n // private rearrangeGroup(e: { target: HTMLElement, event: MouseEventArgs, helper: Element }): void {\n // this.sortRequired = false;\n // this.updateModel();\n // }\n\n\n this.preventTouchOnWindow = function (e) {\n e.preventDefault();\n };\n\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n gObj.element.querySelector('.e-groupdroparea').classList.remove('e-hover');\n sf.base.remove(e.droppedElement);\n\n if (gObj.options.allowGrouping) {\n sf.base.EventHandler.remove(window, 'touchmove', _this.preventTouchOnWindow);\n }\n\n _this.parent.element.querySelector('.e-groupdroparea').removeAttribute(\"aria-dropeffect\");\n\n _this.parent.element.querySelector('[aria-grabbed=true]').setAttribute(\"aria-grabbed\", 'false');\n\n if (sf.base.isNullOrUndefined(column) || column.allowGrouping === false || parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !== gObj.element.getAttribute('id')) {\n return;\n }\n\n gObj.dotNetRef.invokeMethodAsync(\"GroupColumn\", column.field, 'Group');\n };\n\n this.parent = parent;\n\n if (this.parent.options.allowGrouping && this.parent.options.showDropArea) {\n this.initDragAndDrop();\n }\n }", "makeDragProxy() {\n // create a div to hold the first five blocks at most\n const div = document.createElement('div');\n div.style.display = 'inline-block';\n div.style.position = 'relative';\n const nodes = this.selectedElements.map(elem => this.layout.nodeFromElement(elem));\n const limit = Math.min(5, nodes.length);\n let x = 0;\n let width = 0;\n let height = 0;\n for (let i = 0; i < limit; i += 1) {\n const node = nodes[i].el;\n const clone = node.cloneNode(true);\n clone.style.position = 'absolute';\n clone.style.left = `${x}px`;\n clone.style.top = `0px`;\n clone.style.transform = null;\n clone.style.opacity = (1 / limit) * (limit - i);\n div.appendChild(clone);\n width += node.clientWidth;\n height = Math.max(height, node.clientHeight);\n x += node.clientWidth;\n }\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n return div;\n }", "_drag(event, direction) {\n const that = this;\n\n if (!event || that.pinned || that.maximized) {\n return;\n }\n\n let distanceX, distanceY;\n\n if (!that._dragDetails || !that._dragDetails.started) {\n that._setDragDetails('drag', event);\n }\n\n //Disables animatied movement\n that.$.addClass('no-transition');\n\n if (typeof (event) === 'object') {\n distanceX = event.pageX - that._dragDetails.x;\n distanceY = event.pageY - that._dragDetails.y;\n }\n else {\n distanceX = distanceY = event;\n }\n\n //Safari, EDGE have a different with the height of the viewport depending on the elemnets on the page\n const totalParentHeight = Math.max(that._windowParent.element.clientHeight, that._windowParent.scrollElement.scrollHeight),\n totalParentWidth = Math.max(that._windowParent.element.clientWidth, that._windowParent.scrollElement.scrollWidth);\n\n switch (direction) {\n case 'horizontal':\n that._dragDetails.windowX = Math.max(0, Math.min(that._dragDetails.windowX + distanceX, totalParentWidth - that.offsetWidth));\n that.style.left = that._dragDetails.windowX + 'px';\n break;\n case 'vertical':\n that._dragDetails.windowY = Math.max(0, Math.min(that._dragDetails.windowY + distanceY, totalParentHeight - that.offsetHeight));\n that.style.top = that._dragDetails.windowY + 'px';\n break;\n case 'both':\n that._dragDetails.windowX = Math.max(0, Math.min(that._dragDetails.windowX + distanceX, totalParentWidth - that.offsetWidth));\n that._dragDetails.windowY = Math.max(0, Math.min(that._dragDetails.windowY + distanceY, totalParentHeight - that.offsetHeight));\n that.style.left = that._dragDetails.windowX + 'px';\n that.style.top = that._dragDetails.windowY + 'px';\n break;\n }\n\n that._dragDetails.top = that.offsetTop;\n that._dragDetails.left = that.offsetLeft;\n }", "function _maybeUpdateDraggable(el) {\n var parent = el.parentNode, container = instance.getContainer();\n while(parent != null && parent !== container) {\n if (instance.hasClass(parent, \"jtk-managed\")) {\n instance.recalculateOffsets(parent);\n return\n }\n parent = parent.parentNode;\n }\n }", "function mouseup() {\n var currentNode,\n elementIndexToAdd, elementIndexToRemove,\n addAfterElement,\n parentScopeData,\n deferred = $q.defer(),\n newCopyOfNode = {},\n promise = deferred.promise;\n\n if (isMoving) {\n // take actions if valid drop happened\n if (target.isDroppable) {\n // Scope where element should be dropped\n target.scope = target.treeview.scope();\n\n // Element where element should be dropped\n target.node = target.scope.treeData || target.scope.subnode;\n\n // Dragged element\n currentNode = scope.treedata;\n\n // Get Parent scope for element\n parentScopeData = scope.$parent.$parent.treedata;\n elementIndexToRemove = parentScopeData.subnodes.indexOf(currentNode);\n\n // Dragged element can be dropped directly to directory (via node label)\n if (target.dropToDir) {\n elementIndexToAdd = target.node.subnodes.length;\n\n // Expand directory if user want to put element to it\n if (!target.node.expanded) {\n target.node.expanded = true;\n }\n } else {\n addAfterElement = target.el.scope().treedata;\n\n // Calculate new Index for dragged node (it's different for dropping node before or after target)\n if (target.addAfterEl) {\n elementIndexToAdd = target.node.subnodes.indexOf(addAfterElement) + 1;\n } else {\n elementIndexToAdd = target.node.subnodes.indexOf(addAfterElement);\n }\n }\n target.elementIndexToAdd = elementIndexToAdd;\n\n // \"Resolve\" promise - rearrange nodes\n promise.then(function (passedObj) {\n var newElementIndex = passedObj.index || 0,\n newId;\n\n if (target.node.subnodes === parentScopeData.subnodes && newElementIndex < elementIndexToRemove) {\n parentScopeData.subnodes.splice(elementIndexToRemove, 1);\n target.node.subnodes.splice(newElementIndex, 0, currentNode);\n } else {\n // Check if node is comming from another treeview\n if (currentNode.getScope().treeid !== target.node.getScope().treeid) {\n // If node was selected and is comming from another tree we need to select parent node in old tree\n if (currentNode.selected) {\n TreeviewManager.selectNode(currentNode.getParent(), currentNode.getScope().treeid);\n currentNode.selected = false;\n }\n\n // Assigning new id for node to avoid duplicates\n // Developer can provide his own id and probably should\n newId = passedObj.newId || TreeviewManager.makeNewNodeId();\n\n if (TreeviewManager.trees[scope.treeid].scope.treeAllowCopy) {\n // makes copy of node\n newCopyOfNode = angular.copy(currentNode);\n newCopyOfNode.id = newId;\n newCopyOfNode.level = ++target.node.level;\n newCopyOfNode.getParent = function () {\n return target.node;\n };\n\n target.node.subnodes.splice(newElementIndex, 0, newCopyOfNode);\n } else {\n // cut node from one tree and put into another\n currentNode.id = newId;\n\n target.node.subnodes.splice(newElementIndex, 0, currentNode);\n parentScopeData.subnodes.splice(elementIndexToRemove, 1);\n\n currentNode.setParent(target.node);\n }\n } else {\n target.node.subnodes.splice(newElementIndex, 0, currentNode);\n parentScopeData.subnodes.splice(elementIndexToRemove, 1);\n }\n }\n });\n\n /* Custom method for DRAG END\n If there is no any custom method for Drag End - resolve promise and finalize dropping action\n */\n if (typeof scope.settings.customMethods !== 'undefined' && angular.isFunction(scope.settings.customMethods.dragEnd)) {\n scope.settings.customMethods.dragEnd(target.isDroppable, TreeviewManager.trees[scope.treeid].element, scope, target, deferred);\n } else {\n deferred.resolve({index: elementIndexToAdd});\n }\n } else {\n if (typeof scope.settings.customMethods !== 'undefined' && angular.isFunction(scope.settings.customMethods.dragEnd)) {\n scope.settings.customMethods.dragEnd(target.isDroppable, TreeviewManager.trees[scope.treeid].element, scope, target, deferred);\n }\n }\n\n // reset positions\n startX = startY = 0;\n\n // remove ghost\n elementCopy.remove();\n elementCopy = null;\n\n // remove drop area indicator\n if (typeof dropIndicator !== 'undefined') {\n dropIndicator.remove();\n }\n\n // Remove styles from old drop to directory indicator (DOM element)\n if (typeof dropToDirEl !== 'undefined') {\n dropToDirEl.removeClass('dropToDir');\n }\n\n // reset droppable\n target.isDroppable = false;\n\n // remove styles for whole treeview\n TreeviewManager.trees[scope.treeid].element.removeClass('dragging');\n\n // reset styles for dragged element\n element\n .removeClass('dragged')\n .removeAttr('style');\n }\n\n // remove events from $document\n $document\n .off('mousemove', mousemove)\n .off('mouseup', mouseup);\n\n firstMove = true;\n }", "getDraggable() {\n return false;\n }", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function _onDragStart(item, container, _super)\n{\n var offset = item.offset(),\n pointer = container.rootGroup.pointer;\n\n adjustment = {\n left: pointer.left - offset.left,\n top: pointer.top - offset.top\n };\n\n _super(item, container);\n}", "setupTarget(el, draggable = '.element', sort = true, group = 'somegroup') {\n new sortable(el, {\n draggable: draggable,\n sort: sort,\n group: group,\n onAdd: evt => {\n this.eventAggregator.publish('dragTarget.onAdd', evt);\n },\n onUpdate: evt => {\n this.eventAggregator.publish('dragTarget.onUpdate', evt);\n }\n });\n }", "function do_draggable(){\n $(\".draggable\").draggable({ containment: \".palette\" });\n}", "isElementDraggable(el, event) {\n throw new Error('Implement in subclass');\n }", "isElementDraggable(el, event) {\n throw new Error('Implement in subclass');\n }", "startDrag(e) {\n const selectedElement = e.target.parentElement,\n offset = this.getMousePosition(e, selectedElement);\n if ($(selectedElement).hasClass( \"sticker\" )) {\n offset.x -= parseFloat(selectedElement.getAttributeNS(null, \"x\")),\n offset.y -= parseFloat(selectedElement.getAttributeNS(null, \"y\"));\n this.setState({\n selectedElement:selectedElementom ,\n offset: offset\n })\n }\n }", "function drags(dragElement, resizeElement, container, labelContainer, labelResizeElement) {\n dragElement.on(\"mousedown vmousedown\", function(e) {\n dragElement.addClass('draggable');\n resizeElement.addClass('resizable');\n\n var dragWidth = dragElement.outerWidth(),\n xPosition = dragElement.offset().left + dragWidth - e.pageX,\n containerOffset = container.offset().left,\n containerWidth = container.outerWidth(),\n minLeft = containerOffset + 10,\n maxLeft = containerOffset + containerWidth - dragWidth - 10;\n \n dragElement.parents().on(\"mousemove vmousemove\", function(e) {\n if( !dragging) {\n dragging = true;\n ( !window.requestAnimationFrame )\n ? setTimeout(function(){animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement);}, 100)\n : requestAnimationFrame(function(){animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement);});\n }\n }).on(\"mouseup vmouseup\", function(e){\n dragElement.removeClass('draggable');\n resizeElement.removeClass('resizable');\n });\n e.preventDefault();\n }).on(\"mouseup vmouseup\", function(e) {\n dragElement.removeClass('draggable');\n resizeElement.removeClass('resizable');\n });\n }", "panMoveStroke(event){\n var that = this; \n var transform = getTransformation(d3.select('#item-'+that.panStroke.id).attr('transform')); \n var offsetX = event.srcEvent.x - that.lastPosition.x;\n var offsetY = event.srcEvent.y - that.lastPosition.y;\n var X = offsetX + transform.translateX;\n var Y = offsetY + transform.translateY;\n d3.select('#item-'+that.panStroke.id).attr('transform', 'translate('+X+','+Y+')') \n if (that.allBoundingBox) findIntersectionRecursive(that.allBoundingBox, event, this.lastPosition, that.panStroke.id, this.props.groupLines);\n that.lastPosition = {'x': event.srcEvent.x, 'y':event.srcEvent.y}\n }", "function drop_handler(ev) {\n\n ev.preventDefault();\n\n const data = ev.dataTransfer.getData(\"application/my-app\");\n let el;\n // console.log(\"document.getElementById(data).parentNode.id \" + document.getElementById(data))\n const clone = document.getElementById(data).parentNode.parentNode.id == \"library\" ? true : false;\n if (clone) {\n el = document.getElementById(data).cloneNode([true]);\n el.id = \"clone\" + numClones;\n numClones ++ ;\n el.classList.add('clone');\n // el.style.left = (((el.dataset.roomwidth - parseInt(el.style.width))/2) * -1) + \"px\";\n // el.style.top = (((el.dataset.roomheight - parseInt(el.style.height))/2) * -1) + \"px\";\n el.style.width = el.dataset.roomwidth + \"px\";\n el.style.height = el.dataset.roomheight + \"px\";\n el.style.transition = \"height .5s\";\n\n\n // console.log('el.dataset.roomwidth ' + el.dataset.roomwidth);\n el.addEventListener(\"dragstart\", dragstart_handler);\n el.addEventListener(\"mouseover\", setRotatePiece);\n el.addEventListener(\"mouseout\", clearRotatePiece);\n // console.log (\"clone \" + el)\n // const tr = el.querySelector(\".trash\");\n // tr.addEventListener('click', deleteChord);\n // tr.insertAdjacentHTML(\"beforeend\", '<div class=\"delete-chord\"><i class=\"fas fa-trash\"></i></div> ')\n } else {\n el = document.getElementById(data);\n }\n\n rotatePiece = el;\n\n if (el.id != dragPiece.id) {\n ev.target.appendChild(el);\n }\n el.style.position = 'absolute';\n let newX = ((ev.screenX - window.screenX) - document.getElementById('target-area1').parentNode.offsetLeft)\n - document.getElementById('target-area1').offsetLeft - offX;\n let newY = ev.pageY - document.getElementById('target-area1').getBoundingClientRect().y - offY;\n if (newX < 0) {\n newX = 0;\n }\n if (newY < 0) {\n newY = 0;\n }\n if (newX + parseFloat(el.style.width) > document.getElementById('target-area1').getBoundingClientRect().width) {\n newX = document.getElementById('target-area1').getBoundingClientRect().width - parseFloat(el.style.width) - 2;\n }\n if (newY + parseFloat(el.style.height) > document.getElementById('target-area1').getBoundingClientRect().height) {\n newY = document.getElementById('target-area1').getBoundingClientRect().height - parseFloat(el.style.height) - 2;\n }\n\n el.style.left = newX + \"px\";\n el.style.top = newY + \"px\";\n }", "dragStart(e) {\n var dragImage = document.createElement('img');\n dragImage.width = 1;\n e.originalEvent.dataTransfer.setDragImage(dragImage, 0, 0);\n\n e.originalEvent.dataTransfer.effectsAllowed = 'none';\n e.originalEvent.dataTransfer.dropEffect = 'none';\n\n // Response the position of this component e.g.: {top: 5, left: 5}\n const pos = this.$().position();\n\n const clientX = parseInt(e.originalEvent.clientX);\n const clientY = parseInt(e.originalEvent.clientY);\n\n // Calculate distance between mouse pointer and\n // the corner position of this div component.\n const offsetX = clientX - pos.left;\n const offsetY = clientY - pos.top;\n\n this.set('offsetX', offsetX);\n this.set('offsetY', offsetY);\n }", "function drag(e) {\n splitter.resizeChildren(e ? e : window.event);\n return false;\n }", "function startDragTankLevel(evt)\r\n{\r\n\r\n\tif(!DraggingObjTankLevel &&addElemTankLevelViz==true) //---prevents dragging conflicts on other draggable elements---\r\n\t{\r\n\r\n if(evt.target.parentNode.getAttribute(\"class\")==\"dragTargetObj\") //---text elem w/ tspan--\r\n \tobjDragTargetTankLevel = evt.target.parentNode\r\n\r\n if(objDragTargetTankLevel)\r\n\t {\r\n addNoSelectAtText()\r\n\r\n\r\n \t\tvar pnt = objDragTargetTankLevel.ownerSVGElement.createSVGPoint();\r\n\t\tpnt.x = evt.clientX;\r\n\t\tpnt.y = evt.clientY;\r\n\t\t//---elements in different(svg) viewports, and/or transformed ---\r\n\t\tvar sCTM = objDragTargetTankLevel.getScreenCTM();\r\n\t\tvar Pnt = pnt.matrixTransform(sCTM.inverse());\r\n\r\n\r\n\r\n\r\n\t\t\tobjTransformRequestObjTankLevel = objDragTargetTankLevel.ownerSVGElement.createSVGTransform()\r\n\r\n\t\t\t//---attach new or existing transform to element, init its transform list---\r\n\t\t\tvar myTransListAnim=objDragTargetTankLevel.transform\r\n\t\t\tobjTransListTankLevel=myTransListAnim.baseVal\r\n\r\n\t\t\tObjStartXTankLevel = Pnt.x\r\n\t\t\tObjStartYTankLevel = Pnt.y\r\n\r\n\r\n\r\n\t\t\tDraggingObjTankLevel=true\r\n\r\n\r\n\r\n\t\t}\r\n }\r\n\telse\r\n \tDraggingObjTankLevel=false\r\n\r\n}", "function dragPath()\n{\n var thisID = d3.select(this).attr(\"id\");\n var startX = $(this).parent().prop(\"transform\").baseVal.getItem(0).matrix.e;\n var startY = $(this).parent().prop(\"transform\").baseVal.getItem(0).matrix.f;\n d3.select(\"#\" + thisID + \"container\").attr(\"transform\", function()\n {\n var moveX = d3.event.x + startX;\n var moveY = d3.event.y + startY;\n return \"translate(\" + moveX + \",\" + moveY + \")\";\n });\n}", "onMouseDown(event) {\n let object = event.currentTarget;\n \n if(!Draggable.enabled(object)) {\n return;\n }\n \n event.preventDefault();\n\n Draggable.cacheProperties(object);\n Draggable.cacheProperties(this.container);\n Draggable.cacheProperties(this.container);\n\n let cursorPosRelativeToContainer = Draggable.getCursorPositionRelativeTo(event, this.container),\n cursorPosRelativeToObject = Draggable.getCursorPositionRelativeTo(event, object),\n matrixString = window.getComputedStyle(object).transform,\n matrix = Draggable.parseMatrix(matrixString),\n position = {\n X: 0,\n Y: 0\n };\n\n ['X', 'Y'].forEach(axis => position[axis] = cursorPosRelativeToContainer[axis] - cursorPosRelativeToObject[axis]);\n\n Object.assign(object.__draggable_cache, {\n initialCursorPosRelativeToObject: cursorPosRelativeToObject,\n objectBounds: Draggable.getBoundsRelativeTo(object, this.container),\n time: Date.now(),\n velocity: {\n X: 0,\n Y: 0\n },\n hasMoved: false,\n position,\n matrix\n });\n\n let stackIndex = this.decelerationStack.indexOf(object);\n\n if(stackIndex !== -1) {\n this.decelerationStack.splice(stackIndex, 1);\n\n --this.stackLength;\n }\n\n object.__draggable_mouseIsDown = true;\n\n this.currentObject = object;\n\n this.trigger('drag-start', [object, position]);\n }", "panStartGroup(ev){\n var that = this;\n this.startPosition = {'x': ev.srcEvent.x, 'y':ev.srcEvent.y, 'time': Date.now()};\n this.lastPosition = {'x': ev.srcEvent.x, 'y':ev.srcEvent.y}\n // console.log(that.panGroup)\n var getPan = getTransformation(d3.select('#panItems').attr('transform'));\n _getBBoxPromise('group-' + that.panGroup.id).then((BB)=> {\n // showBboxBB(BB, 'red')\n that.allBoundingBox = BB;\n // that.allBoundingBox.x += getPan.translateX - 20;\n // that.allBoundingBox.y += getPan.translateY - 20;\n that.allBoundingBox.width += 40;\n that.allBoundingBox.height += 40;\n })\n }", "function folderlElement(el, position){\n\t\n\t// Largeur desiree !!\n\tvar width \t\t= mySlider.slider(\"value\");\n\tvar height\t\t= width * factor;\n\t\n\t// Objet a insert (image + fonction)\n\tvar\tinsert\t\t= {'src':'','class':''};\n\n\t// Tous les objects utilises dans e\n\tvar container = $('<div id=\"'+el.name+'\" class=\"e dragme clearfix imgResize '+el.tag+' '+viewMode+'\"/>');\n\t\tcontainer.bind({\n\t\t\t'mouseenter' : function(e) {$(this).addClass('colored')},\n\t\t\t'mouseleave' : function(e) {$(this).removeClass('colored')}\n\t\t});\n\t\n\tvar content = $('<div class=\"cnt\" />').appendTo(container);\n\tvar top = $('<div class=\"top clearfix\">&nbsp;</div>').prependTo(content);\n\tvar icone = $('<div class=\"icone loader\"/>').appendTo(content).bind({\n\t\t'mouseenter' : function(e) {\n\t\t\tif(typeof iconeaction != 'undefined' && viewMode == 'icon')\t$(this).find('.iconeaction').css('opacity', 1);\n\t\t},\n\t\t'mouseleave' : function(e) {\n\t\t\tif(typeof iconeaction != 'undefined' && viewMode == 'icon') $(this).find('.iconeaction').css('opacity', 0);\n\t\t}\n\t});\n\t\n\tvar tools = $('<div class=\"tools\" />').appendTo(content);\n\tvar name = $('<div class=\"name\" />').insertAfter(icone);\n\tvar nameField = $('<input type=\"text\" class=\"field\" value=\"'+el.name+'\" readonly=\"readonly\" />').appendTo(name).bind({\n\t\t'click' : function() {actionRename(position);},\n\t\t'focus' : function(e) {$(this).addClass('fieldFocus');}\n\t});\n\n\tif(viewMode == 'icon' && el.type == 'file'){\n\t\t\n\t\tvar iconeaction = $('<div class=\"iconeaction\" style=\"display:none;opacity:0\" />').appendTo(icone).fadeTo()\n\t\t/*var iconeaction = new Element('div', {\n\t\t\t'class'\t\t: 'iconeaction',\n\t\t\t'styles'\t: {\n\t\t\t\t'display' : 'none',\n\t\t\t\t'opacity' : '0'\n\t\t\t}\n\t\t}).set('morph', {duration:150}).inject(icone);*/\n\t\t\n\t}else\n\tif(viewMode == 'list'){\n\t\tvar iconeaction = $('<div class=\"iconeaction\" />').prependTo(name);\n\t}\n\t\n\tvar remove = $('<img src=\"'+myMedia+'/media-delete.png\" class=\"remove\" title=\"supprimer\" />').appendTo(tools).bind({\n\t\t'click' : function() {actionDelete(position)}\n\t})\n\n\tif(el.type == 'dir'){\n\n\t\tif(el.locked){\n\t\t\tcontainer.addClass('isLocked');\n\t\t\tvar lockSrc = myMedia+'/media-locked.png';\n\t\t}else{\n\t\t\tcontainer.removeClass('isLocked');\n\t\t\tvar lockSrc = myMedia+'/media-unlocked.png';\n\t\t}\n\n\t\tvar locked = $('<img src=\"'+lockSrc+'\" class=\"lock\" title=\"Protection contre la suppression\" />').appendTo(tools).bind({\n\t\t\t'click' : function() {actionLock(position);}\n\t\t});\n\t}\n\n\t// Fixer a la main la largeur et hauteur de CONTAINER\n\ticone.css({'width':width, 'height':height});\n\t\n\tif(viewMode == 'icon'){\n\t\tcontainer.css({'width':(width+8)+'px'});\n\t}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n\t// Si l'element est un dossier\n\tif(el.type == 'dir'){\n\t\tcontainer.addClass('dropme');\n\t\t\n\t\tif(viewMode == 'icon'){\n\t\t\ttop.css('background', 'url('+myMedia+'/media-nano-folder.png) no-repeat 4px center');\n\t\t}\n\n\t\tif(field != '' && method != ''){\n\t\t\t\n\t\t\tvar _select = $('<img src=\"'+myMedia+'/media-select.png\" />').appendTo(tools).bind({\n\t\t\t\t'click' : function() {selectFile(el.url, 'folder');}\n\t\t\t});\n\t\t}\n\t\t\n\t\tvar insert = $('<img src=\"'+myMedia+'/media-folder.png\" height=\"32\" width=\"32\" />');\n\t\t\n\t}else\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n\tif(el.type == 'file'){\n\n\t\tif(viewMode == 'icon'){\n\t\t\ttop.css('background', 'url('+myMedia+'/media-nano-file.png) no-repeat 4px center');\n\t\t}\n\n\t\t// Ajouter l'action en ajout 'ajouter'\n\t\t$('<a>Insérer</a>').bind('click', function() {\n\t\t\tselectFile(el.url);\n\t\t}).appendTo(top);\n\n\t\t// Legende\n\t\tvar _meta = $('<img src=\"'+myMedia+'/media-t.png\" title=\"Légende\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\tactionMetadata(el.url);\n\t\t});\n\n\t\t// Url\n\t\tvar _link = $('<img src=\"'+myMedia+'/media-copy.png\" title=\"Afficher le chemin d\\'accès\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\tactionClipBoard(el.url);\n\t\t});\n\n\t\tvar _dup = $('<img src=\"'+myMedia+'/media-duplicate.png\" title=\"Dupliquer l\\'image\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\tactionDuplicate(el.url);\n\t\t});\n\n\t\t/******************************/\n\t\t// PDF\n\t\tif(el.kind == 'pdf'){\n\n\t\t\tif(viewMode == 'icon'){\n\t\t\t\ttop.css('background', 'url('+myMedia+'/media-nano-pdf.png) no-repeat 4px center');\n\t\t\t}\n\n\t\t\t// Full Size Pop Up\n\t\t\tvar _full = $('<img src=\"'+myMedia+'/media-fullsize.png\" title=\"Afficher le fichier\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\twindow.open(el.url);\n\t\t\t});\n\t\t\t\n\t\t\tvar _play = $('<img src=\"'+myMedia+'/media-flip.png\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\tactionPdfToImage(el.url);\n\t\t\t});\n\t\t}else\n\n\t\t/******************************/\n\t\t// AUDIO\n\t\tif(el.kind == 'audio'){\n\n\t\t\tif(viewMode == 'icon'){\n\t\t\t\ttop.css('background', 'url('+myMedia+'/media-nano-audio.png) no-repeat 4px center');\n\t\t\t}\n\n\t\t\tvar _play = $('<img src=\"'+myMedia+'/media-play.png\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\tactionViewAudio(el.url);\n\t\t\t});\n\n\t\t}else\n\n\t\t/******************************/\n\t\t// VIDEO\n\t\tif(el.kind == 'video'){\n\n\t\t\tif(viewMode == 'icon'){\n\t\t\t\ttop.css('background', 'url('+myMedia+'/media-nano-video.png) no-repeat 4px center');\n\t\t\t}\n\n\t\t\tvar _play = $('<img src=\"'+myMedia+'/media-play.png\" title=\"Lire la vid&eacute;o\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\tmodal.open({ type : 'video', url : el.url });\n\t\t\t});\n\n\t\t\tvar _nfo = $('<img src=\"'+myMedia+'/media-nano-info.png\" title=\"Voir les infos techniques\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\twindow.open('/admin/media/helper/player-video?url='+el.url, '', '');\n\t\t\t});\n\n\t\t\tvar _poster = $('<img src=\"'+myMedia+'/media-flip.png\" title=\"Gerer le poster de la video\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\tvar url = el.url;\n\t\t\t\twindow.open('helper/video-poster?url='+url, '', '');\n\t\t\t});\n\n\t\t}else\n\n\t\t/******************************/\n\t\t// PICTURE\n\t\tif(el.kind == 'picture'){\n\t\t\t\n\t\t\tif(viewMode == 'icon'){\n\t\t\t\ttop.css('background', 'url('+myMedia+'/media-nano-image.png) no-repeat 4px center');\n\t\t\t}\n\t\t\t\n\t\t\tcontainer.addClass('isPicture');\n\t\t//\tif(el.height > minH || el.width > minW) container.addClass('imgResize');\n\t\t\tif(el.thumbnail.exists){\n\t\t\t\tvar insert = $('<img src=\"'+decodeURIComponent(el.thumbnail.url)+'\" height=\"'+el.thumbnail.height+'\" width=\"'+el.thumbnail.width+'\" />'); \n\t\t\t}else{\n\t\t\t\tparentHeight = icone.height();\n\t\t\t\t//var insert = $('<img src=\"'+el.url+'\" height=\"'+el.height+'\" width=\"'+el.width+'\" />');\n\t\t\t\tvar insert = $('<img src=\"'+el.url+'\" height=\"'+parentHeight+'\" />');\n\t\t\t}\n\t\t\tvar _class = ((el.height > el.width) ? 'portrait' : 'landscape');\n\t\t\tinsert.attr('class', _class);\n\n\t\t\t// Full Size Pop Up\n\t\t\tvar _full = $('<img src=\"'+myMedia+'/media-fullsize.png\" title=\"Afficher en grand\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\twindow.open(el.url);\n\t\t\t});\n\n\t\t\t// Size\n\t\t\tvar _size = $('<img src=\"'+myMedia+'/media-size.png\" title=\"Manipuler la taille\" />').appendTo(iconeaction).bind('click', function() {\n\t\t\t\tvar url = el.url;\n\t\t\t\twindow.open('helper/crop?url='+url, '', '');\n\t\t\t});\n\t\t} \n\n\n\t\t/******************************/\n\n\t\t// GENERIQUE\n\t\tif(insert.src == ''){\n\n\t\t\tvar insert = $('<img src=\"'+myMedia+'/media-file_'+el.kind+'.png\" height=\"128\" width=\"128\" />');\n\n\t\t}\n\t}\n\n\n\t//\n\t// Insertion de l'image de l'element (generique, dossier ou autre)\n\t//\n\tif(insert.attr('src') != ''){\n\n\t\tvar _image = $('<img />');\n\t\t\n\t\t_image.attr('src', insert.attr('src'));\n\t\t\n\t\t_image.css('display', 'none');\n\t\t_image.addClass('img');\n\t\t\n\t\t_image.load(function(){\n\t\t\t// Pffff (hack ie?)\n\t\t\t//\tthis.alt = insert.src;\n\n\t\t\tvar ratio = (insert.width() > insert.height())\n\t\t\t\t? (insert.width() < 140) ? 1 : (140 / insert.width())\n\t\t\t\t: (insert.height() < 140) ? 1 : (140 / insert.height());\n\n\t\t\t// Ajouter les evenement relies a cette image\n\t\t\t//if(typeof insert.events == 'object') $(this).click(folderNavFromPosition(position));\n\t\t\tif(insert.length > 0 && el.type == 'dir') $(this).click(function(){folderNavFromPosition(position)});\n\n\t\t\t// Injection de l'image\n\t\t\tif (typeof iconeaction != 'undefined') {\n\t\t\t\t$(this).appendTo(icone, 'bottom')\n\t\t\t} else {\n\t\t\t\t$(this).appendTo(icone);\n\t\t\t}\n\t\t\t// Remettre la bonne taille\n\t\t\t//console.log(this);\n\t\t\t$(this).css('display', '');\n\t\t\tfolderElementSize(mySlider.slider(\"value\"), (mySlider.slider(\"value\") * factor), container);\n\t\t\t$(this).parent('div.e').find('.loader').removeClass('loader');\n\n\t\t\t// Ajouter le class\n\t\t\tif(typeof insert.attr('class') != 'undefined') $(this).addClass(insert.attr('class'));\n\t\t});\n\t}\n\n\treturn container;\n}", "function drag(event) {\n // if the dragged element is a imgcontainer, highlight it\n if (event.target.tagName === 'DIV' && event.target.classList.contains(\"imgcontainer\")) {\n highlight(event.target);\n }\n // save id and type in dataTransfer\n event.dataTransfer.setData('id', event.target.id);\n event.dataTransfer.setData('type', event.target.tagName);\n}", "function drags(dragElement, resizeElement, container, labelContainer, labelResizeElement) {\n dragElement.on(\"mousedown vmousedown touchstart\", function(e) {\n dragElement.addClass('draggable');\n resizeElement.addClass('resizable');\n\n var dragWidth = dragElement.outerWidth(),\n xPosition = dragElement.offset().left + dragWidth - e.pageX,\n containerOffset = container.offset().left,\n containerWidth = container.outerWidth(),\n minLeft = containerOffset + 10,\n maxLeft = containerOffset + containerWidth - dragWidth - 10;\n \n dragElement.parents().on(\"mousemove vmousemove touchmove\", function(e) {\n if( !dragging) {\n dragging = true;\n ( !window.requestAnimationFrame )\n ? setTimeout(function(){animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement);}, 100)\n : requestAnimationFrame(function(){animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement);});\n }\n }).on(\"mouseup vmouseup touchend touchcancel\", function(e){\n dragElement.removeClass('draggable');\n resizeElement.removeClass('resizable');\n });\n e.preventDefault();\n }).on(\"mouseup vmouseup\", function(e) {\n dragElement.removeClass('draggable');\n resizeElement.removeClass('resizable');\n });\n }", "zoomTo(element) {\n //calculate the zooming and panning parameters needed\n let bounds = element.node().getBBox();\n let parent = element.node().parentElement;\n let width = bounds.width,\n height = bounds.height;\n let midX = bounds.x + width / 2,\n midY = bounds.y + height / 2;\n if (width == 0 || height == 0) return; // nothing to fit\n let scale = Math.max(.01, Math.min(5, 0.85 / Math.max(width / this.width, height / this.height)));\n let translate = [this.width / 2 - scale * midX, this.height / 2 - scale * midY];\n\n //if the element is empty, don't zoom or pan\n if(bounds.width == 0 || bounds.height == 0) {\n return;\n }\n\n //perform the zooming and panning\n this.svg.transition().duration(750).call(this.zoom.transform, d3.zoomIdentity.translate(translate[0], translate[1]).scale(scale));\n }", "function setEvent() {\r\n $('.MosContainer').draggable({revert : 'invalid', zIndex : '2700', refreshPositions: true, cursor: \"crosshair\"});\r\n $('.MosContainer').draggable({\r\n\tstart : function () {\r\n\t idDrag = $(this).data('id');\r\n\t $(this).css('z-index', '100');\r\n\t},\r\n\tend : function () {\r\n\t $(this).css('z-index', '1');\r\n\t},\r\n });\r\n\r\n $('.grill').droppable({\r\n\t'over' : function (event, ui) {\r\n\t var buffer = 'grill-can-drop';\r\n\t var x = $(this).data('x') - 1;\r\n\t var y = 0;\r\n\r\n\t if (!$(this).data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\tbuffer = 'grill-cant-drop';\r\n\t }\r\n\t for (id in $(this).data('parent').fence) {\r\n\t\tif ($(this).data('parent').fence[id].data('x') >= $(this).data('x') && $(this).data('parent').fence[id].data('x') < (ui.draggable.data('important') + $(this).data('x'))) {\r\n\t\t if ($(this).data('parent').fence[id].data('y') >= $(this).data('y') && $(this).data('parent').fence[id].data('y') < (ui.draggable.data('important') + $(this).data('y'))) {\r\n\t\t\t$(this).data('parent').fence[id].addClass(buffer);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t},\r\n\t'out' : function () {\r\n\t $('.grill').removeClass('grill-can-drop');\r\n\t $('.grill').removeClass('grill-cant-drop');\r\n\t},\r\n\tdrop : function (event, ui) {\r\n\t if ($(this).data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\t//ui.draggable.data('parent').container.splice(ui.draggable.data('id'), 1);\r\n\t\tui.draggable.data('parent').removeContainer(ui.draggable.data('id'));\r\n\t\t//ui.draggable.css('top', $(this).css('top'));\r\n\t\t//ui.draggable.css('left', $(this).css('left'));\r\n\t\tui.draggable.data('x', $(this).data('x'));\r\n\t\tui.draggable.data('y', $(this).data('y'));\r\n\t\t$(this).data('parent').addContainer(ui.draggable.data('me'));\r\n\r\n\t } else {\r\n\t\t$('.Mosaique').trigger('mosaiqueResize');\r\n\t }\r\n\t $('.grill').removeClass('grill-can-drop');\r\n\t $('.grill').removeClass('grill-cant-drop');\r\n\t $('.Mosaique').trigger('mosaiqueResize');\r\n\t}\r\n });\r\n $('.MosContainer').droppable({\r\n\tdrop : function (event, ui) {\r\n\t if (ui.draggable.data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\tvar x = $(this).data('x');\r\n\t\tvar y = $(this).data('y');\r\n\t\tvar id = parseInt($(this).data('id'));\r\n\t\tvar container = ui.draggable.data('parent').container[id];\r\n\r\n\t\tui.draggable.data('x', x);\r\n\t\tui.draggable.data('y', y);\r\n\r\n\t\tui.draggable.data('parent').removeContainer(id);\r\n\t\t/*if (ui.draggable.data('id') > $(this).data('id')) {\r\n\t\t//ui.draggable.data('parent').container[id] = ui.draggable.data('parent').container[ui.draggable.data('id')];\r\n\t\t//ui.draggable.data('parent').container[ui.draggable.data('id')] = container;\r\n\r\n\t\t//$(this).data('id', ui.draggable.data('id'));\r\n\t\t//ui.draggable.data('id', id);\r\n\t\t}*/\r\n\t\t$('.Mosaique').trigger('mosaiqueResize');\r\n\t }\r\n\t}\r\n });\r\n $('.videoClass, .streamClass').on({\r\n\tclick : function (event, ui) {\r\n\t var t = new One_tabs();\r\n\t var tchat = new Tchat(user, new Connect(), $(this).data(\"me\").tchat_id, $(this).data(\"me\").id);\r\n\r\n\t var i = tab.add_tabs(t);\r\n\t t.tab.add_content($(this).data('me').displayContent());\r\n\t t.tab.add_content(tchat.getHtml())\r\n\t t.onglet.icon = $(this).data(\"me\").name;\r\n\t tab.displayAll();\r\n\t tab.action['moins'].html.children('a').trigger('click');\r\n\t tchat.setPos(\"70%\", \"10%\");\r\n\t tchat.setSize(\"80%\", \"28%\");\r\n\t}\r\n });\r\n $('.folderClass').click(function () {\r\n\tgoInFolder($(this).data(\"me\").id);\r\n });\r\n}", "render() {\n const draggable = this.dragDropProvider ? 'true' : 'false';\n this.renderRoot.host.setAttribute('draggable', draggable);\n\n const isRoot = !(this.model.parent != null);\n const siblings = isRoot ? [] : this.model.parent.children; // should never be empty\n const isLast = this.model.id === siblings[siblings.length - 1]?.id;\n return html`\n ${isRoot || !this.dragDropProvider\n ? nothing\n : html`<div part=\"drop-before-target\" data-drop-mode=\"before\"></div>`\n }\n <kds-expander part=\"expander\" exportparts=\"content: expander-content, expander: expander-expander\"\n class=\"${this.model.children.length ? 'has-children' : ''}\"\n data-drop-mode=\"inside\"\n >\n <div slot=\"expander\">\n ${this.dragDropProvider ? html`<slot name=\"expander-grip\"></slot>` : nothing}\n <slot name=\"expander-icon\"></slot>\n </div>\n <div slot=\"header\">\n <slot name=\"content\"></slot>\n </div>\n <div slot=\"content\">\n <slot name=\"children\"></slot>\n </div>\n </kds-expander>\n ${isLast && !isRoot && this.dragDropProvider\n ? html`<div part=\"drop-after-target\" data-drop-mode=\"after\"></div>`\n : nothing\n }\n `;\n }", "function initDrag(){\r\n var dragAmm = 0;\r\n var dex = 0;\r\n var dey = 0;\r\n var cx = 0;\r\n var cy = 0;\r\n var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;\r\n\r\n // dragElement( o.container );\r\n dragElement( o.dragEl );\r\n\r\n function dragElement(elmnt) {\r\n elmnt.onmousedown = dMouseDown;\r\n // var el = o.container;\r\n var el = elmnt;\r\n el.ontouchstart = dTouchDown;\r\n\r\n function dMouseDown(e){\r\n e = e || _window.event;\r\n e.preventDefault();\r\n gsap.to(o.sc_wrapper, 0.2, {scale: 1.1, ease: Power1.easeOut})\r\n\r\n pos3 = e.clientX;\r\n pos4 = e.clientY;\r\n\r\n dragMouseDown(e);\r\n }\r\n function dTouchDown(e){\r\n e = e || _window.event;\r\n e.preventDefault();\r\n\r\n gsap.to(o.sc_wrapper, 0.2, {scale: 1.1, ease: Power1.easeOut})\r\n\r\n pos3 = e.touches[0].clientX;\r\n pos4 = e.touches[0].clientY;\r\n\r\n dragMouseDown(e);\r\n }\r\n\r\n function dragMouseDown(e) {\r\n dragAmm = 0;\r\n _document.onmouseup = closeDragElement;\r\n _document.ontouchend = closeDragElement;\r\n _document.onmousemove = mouseDrag;\r\n _document.ontouchmove = touchDrag;\r\n }\r\n\r\n function mouseDrag(e){\r\n e = e || _window.event;\r\n // e.preventDefault();\r\n elementDrag(e, true);\r\n }\r\n\r\n function touchDrag(e){\r\n e.stopImmediatePropagation();\r\n \r\n elementDrag(e, false);\r\n\r\n }\r\n\r\n var sPos = {x: 0, y: 0};\r\n var cPos = {x: 0, y: 0};\r\n\r\n function elementDrag(e, isMouse) {\r\n dragAmm++;\r\n var clientX = (isMouse) ? e.clientX : e.touches[0].clientX;\r\n var clientY = (isMouse) ? e.clientY : e.touches[0].clientY;\r\n\r\n pos1 = pos3 - clientX;\r\n pos2 = pos4 - clientY;\r\n pos3 = clientX;\r\n pos4 = clientY;\r\n\r\n cPos.x += sPos.x - pos1;\r\n cPos.y += sPos.y - pos2;\r\n\r\n var x = cPos.x;\r\n var y = cPos.y;\r\n\r\n ddef.drag.x = x;\r\n ddef.drag.y = y;\r\n var yy = ddef.topY;\r\n o.container.style.right = 14-x + \"px\";\r\n o.container.style.top = yy+y + \"px\";\r\n }\r\n\r\n function closeDragElement(e) {\r\n if(dragAmm <= 2 && click == 0){\r\n // console.log(\"CTA\")\r\n\r\n ddef.box.cur++;\r\n \tctaFunction();\r\n\r\n click = 1;\r\n setTimeout(function(){ click = 0 }, 1000)\r\n } else {\r\n \tif(click == 0){\r\n \t\t// startEvent(\"drag\");\r\n \t}\r\n }\r\n\r\n gsap.to(o.sc_wrapper, 0.25, {scale: 1, ease: Power1.easeOut})\r\n _document.onmouseup = null;\r\n _document.onmousemove = null;\r\n _document.ontouchend = null;\r\n _document.ontouchmove = null;\r\n\r\n }\r\n var click = 0;\r\n\r\n }\r\n }", "function make_element_zoomable({ containerEl, scaleEl, zoomEl, toggleEl }) {\n assert(containerEl && scaleEl && zoomEl);\n toggleEl = toggleEl || zoomEl;\n\n DEBUG && console.log(\"[zoom] setup\", { zoomEl, scaleEl, containerEl });\n if (DEBUG && window.location.hostname === \"localhost\") {\n // Show cursor position\n document.onmousemove = function (e) {\n var x = e.pageX;\n var y = e.pageY;\n e.target.title = \"X is \" + x + \" and Y is \" + y;\n };\n }\n\n scaleEl.classList.add(\"zooming__scaler\");\n containerEl.classList.add(\"zooming__overflow-container\");\n zoomEl.classList.add(\"zooming__zoomable-element\");\n\n scaleEl.addEventListener(\n \"transitionstart\",\n (ev) => {\n ev.propertyName === \"transform\" && on_transition_start();\n },\n { passive: true }\n );\n scaleEl.addEventListener(\n \"transitionend\",\n (ev) => {\n ev.propertyName === \"transform\" && on_transition_end();\n },\n { passive: true }\n );\n\n toggleEl.addEventListener(\"click\", on_click, { passive: true });\n window.addEventListener(\"resize\", on_resize, { passive: true });\n\n assert(is_zoomed === null, \"multiple zoomable elements are not supported.\");\n is_zoomed = false;\n\n _toggle_zoom = toggle_zoom;\n\n return;\n\n function set_zoom() {\n if (is_zoomed === true) {\n zoomIn({ zoomEl, scaleEl, containerEl });\n } else {\n zoomOut({ scaleEl, containerEl });\n }\n }\n\n function toggle_zoom({ auto_scroll = false } = {}) {\n on_transition_start();\n\n is_zoomed = !is_zoomed;\n\n track_event({ name: is_zoomed ? \"zoom_in\" : \"zoom_out\" });\n\n if (auto_scroll && is_zoomed) {\n scrollToHideScrollElement();\n }\n\n set_zoom();\n }\n\n function on_click() {\n toggle_zoom({ auto_scroll: true });\n }\n\n var last_size;\n function on_resize() {\n last_size = last_size || { x: null, y: null };\n const size = { x: window.innerWidth, y: window.innerHeight };\n if (last_size.x === size.x && last_size.y === size.y) {\n return;\n }\n last_size = size;\n set_zoom();\n }\n\n function on_transition_start() {\n containerEl.classList.add(\"zoom-transition\");\n }\n function on_transition_end() {\n containerEl.classList.remove(\"zoom-transition\");\n call_zoom_state_listeners();\n }\n}", "function pan(domNode, direction) {\n var speed = panSpeed;\n if (panTimer) {\n clearTimeout(panTimer);\n var translateCoords = d3.transform(svgGroup.attr(\"transform\"));\n var translateX = 0, translateY = 0;\n if (direction == 'left' || direction == 'right') {\n translateX = direction == 'left' ? translateCoords.translate[0] + speed : translateCoords.translate[0] - speed;\n translateY = translateCoords.translate[1];\n } else if (direction == 'up' || direction == 'down') {\n translateX = translateCoords.translate[0];\n translateY = direction == 'up' ? translateCoords.translate[1] + speed : translateCoords.translate[1] - speed;\n }\n // scaleX = translateCoords.scale[0];\n // scaleY = translateCoords.scale[1];\n var scale = zoomListener.scale();\n svgGroup.transition().attr(\"transform\", \"translate(\" + translateX + \",\" + translateY + \")scale(\" + scale + \")\");\n d3.select(domNode).select('g.node').attr(\"transform\", \"translate(\" + translateX + \",\" + translateY + \")\");\n zoomListener.scale(zoomListener.scale());\n zoomListener.translate([translateX, translateY]);\n var panTimer = setTimeout(function() {\n pan(domNode, speed, direction);\n }, 50);\n }\n }", "moving() {\r\n d3.select(this).attr(\"transform\", d3.event.transform);\r\n }", "function startDragging(e) {\n if ($('.selected').length != 0) {\n $('.selected').removeClass('selected');\n }\n $(this).addClass('selected');\n\n // set this image as the current one to be dragged\n movingElement = $(this);\n\n // set the degrees for this object if it isn't already set, to 0\n if (!movingElement[0].degree)\n movingElement[0].degree = 0;\n\n}", "function initDraggableGroup(draggable, group) {\n draggable.inputEnabled = true;\n draggable.input.enableDrag();\n draggable.origin = new Phaser.Point(draggable.x, draggable.y);\n draggable.events.onDragUpdate.add((obj, pointer, x, y, snapPoint, isFirstUpdate) => {\n if (isFirstUpdate){\n group.startDragPos = new Phaser.Point(group.x, group.y);\n draggable.startDragPos = new Phaser.Point(draggable.x, draggable.y);\n }\n group.x = group.startDragPos.x - draggable.origin.x + x;\n group.y = group.startDragPos.y - draggable.origin.y + y;\n draggable.x = draggable.startDragPos.x;\n draggable.y = draggable.startDragPos.y;\n });\n}", "panMoveGroup(event){\n var that = this; \n var transform = getTransformation(d3.select('#group-'+that.panGroup.id).attr('transform')); \n var offsetX = event.srcEvent.x - that.lastPosition.x;\n var offsetY = event.srcEvent.y - that.lastPosition.y;\n var X = offsetX + transform.translateX;\n var Y = offsetY + transform.translateY;\n d3.select('#group-'+that.panGroup.id).attr('transform', 'translate('+X+','+Y+')')\n var linesAttached = that.panGroup['lines'];\n\n // console.log(linesAttached)\n linesAttached.forEach((groupLine)=>{\n groupLine.forEach((lineId)=>{\n var id = 'item-'+lineId;\n var transform = getTransformation(d3.select('#'+id).attr('transform'));\n var X = offsetX + transform.translateX;\n var Y = offsetY + transform.translateY;\n d3.select('#'+id).attr('transform', 'translate('+X+','+Y+')')\n })\n })\n\n if (that.allBoundingBox) findIntersectionRecursive(that.allBoundingBox, event, this.lastPosition, that.panGroup.id, this.props.groupLines);\n\n\n\n that.lastPosition = {'x': event.srcEvent.x, 'y':event.srcEvent.y}\n }", "register(editor){\n super.register(editor);\n\n let getActive = function(){\n return editor.$editable.find('.grapple-image.active');\n };\n\n let updatePanelPosition = ($image) =>{\n let $panel = this.$panel;\n $panel.css($image.offset()).outerWidth($image.width());\n if($panel.offset().left + $panel.outerWidth() > editor.$editable.width()){\n $panel.css('left', editor.$editable.width() - $panel.outerWidth());\n }\n\n return $panel;\n };\n\n let helperGetSizeClass = (current_class, is_increase) =>{\n let arr_ordered_classes = [\n \"size-ico\",\n \"size-xs\",\n \"size-sm\",\n \"size-md\",\n \"size-lg\",\n \"size-full\"\n ];\n\n let current_index = arr_ordered_classes.indexOf(current_class);\n let new_index = current_index;\n\n if (is_increase){\n if (current_index < arr_ordered_classes.length - 1)\n new_index = current_index + 1;\n }else{\n if (current_index > 0)\n new_index = current_index - 1;\n }\n\n return arr_ordered_classes[new_index];\n };\n\n $(editor.doc).on('click', (evt) =>{\n let $target = $(evt.target);\n\n getActive().removeClass('active');\n\n if($target.hasClass('grapple-image')) {\n $target.addClass('active');\n updatePanelPosition($target).addClass('active');\n\n } else {\n this.$panel.removeClass('active');\n }\n });\n\n $(editor.doc).on('drop', function(){\n updatePanelPosition(getActive());\n });\n\n this.$panel = $('<ul class=\"image-pane\">' +\n '<li class=\"align align-left\" data-class=\"align-left\"></li>' +\n '<li class=\"align align-center\" data-class=\"align-center\"></li>' +\n '<li class=\"align align-right\" data-class=\"align-right\"></li>' +\n '<li class=\"size size-decrease\" data-type=\"decrease\"></li>' +\n '<li class=\"size size-increase\" data-type=\"increase\"></li>' +\n '<li class=\"remove\"></li></ul>')\n .prependTo(editor.doc.body);\n\n this.$panel.on('click', 'li.remove', (evt) =>{\n evt.stopPropagation();\n\n getActive().remove();\n this.$panel.removeClass('active');\n editor.checkChange();\n });\n\n this.$panel.on('click', 'li.align', (evt) =>{\n let $active = getActive();\n evt.stopPropagation();\n\n $active.removeClass('align-left align-right align-center').addClass(evt.target.getAttribute('data-class'));\n editor.checkChange();\n updatePanelPosition($active);\n });\n\n this.$panel.on('click', 'li.size', (evt) =>{\n let $active = getActive();\n evt.stopPropagation();\n\n let action_type = evt.target.getAttribute('data-type');\n let current_class = $active.attr('data-size');\n let new_class = helperGetSizeClass(current_class, (action_type==\"increase\"));\n \n $active.removeClass('size-ico size-xs size-sm size-md size-lg size-full').addClass(new_class);\n $active.attr('data-size', new_class);\n\n editor.checkChange();\n editor.updateHeight();\n updatePanelPosition($active);\n });\n }", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.position.x = newPosition.x;\n this.position.y = newPosition.y;\n }\n}", "function drop_zone(clusterNumber) {\n //when drag is over, prevent default event\n $(\"#cluster_\" + clusterNumber).on(\"dragover\", function (e) {\n e.preventDefault();\n });\n\n $(\"#cluster_\" + clusterNumber).on(\"drop\", function (e) {\n e.preventDefault();\n\n //activate nestable2 function\n $(\".dd\").nestable({\n\n onDragStart: function (l, e) {\n // get type of dragged element\n // var type = $(e).children(\".dd-handle\").attr(\"class\").split(\" \")[0];\n // console.log(type);\n //when start dragging, trigger addNoChildrenClass method\n addNoChildrenClass();\n },\n\n callback: function (l, e) {\n // l is the main container\n // e is the element that was moved\n //when finish dropping, trigger these methods to make \"dd-empty\" is always one\n appendCluster();\n removeCluster();\n },\n //enable auto scrolling method while dragging\n scroll: true\n });\n\n //console.log(nowCopying);\n\n //only when the input of the goal is not empty\n if (nowCopying) {\n //whether the dropping element is from the goal list or the cluster\n let fromGoalList = $(nowCopying.parentNode.parentNode).hasClass(\n \"goal-list\"\n );\n //create new goal element in the cluster\n let draggableWrapper = '<ol class=\"dd-list\">';\n draggableWrapper += '<li class=\"dd-item\">';\n //copy the id, class, and value from the original dragged goal\n let newNode = document.createElement(\"div\");\n newNode.className = $(nowCopying).children(\"input\")[0].className;\n //set new element's id with \"C_\" prefix\n newNode.setAttribute(\"id\", \"C_\" + $($(nowCopying).children(\"input\")[0]).attr(\"id\"));\n //console.log($(newNode).attr(\"id\"));\n //add \"onmouseenter\" and \"onmouseleave\" to the new element\n newNode.setAttribute(\"onmouseenter\", 'showButton(this)');\n newNode.setAttribute(\"onmouseleave\", 'hideButton(this)');\n //add font weight, class name to the new goal element\n $(newNode).css(\"font-weight\", \"bold\");\n //add classes to make it draggable and droppable\n newNode.classList.add(\"dd-handle\");\n newNode.classList.add(\"dd-handle-style\");\n\n //based on the type of the goal, show different images\n let type = getType($($(nowCopying).children(\"input\")[0]));\n\n let imagePath = getTypeIconPath(type);\n\n //set new element's inner elements, including an image showing the goal type,\n //goal's content and edit and delete button\n $(newNode).html('<img src=' + imagePath + ' class=\"mr-1 typeIcon\" > ' +\n '<div class=\"goal-content\" tabindex=\"-1\" ' +\n 'onblur=\"finishEditGoalInCluster($(this));\"' + '>' +\n $(nowCopying).children(\"input\")[0].value + '</div><img class=\"editButton non-draggable dragger\" style=\"display: none\" src=\"/img/edit-solid.svg\"' +\n 'onclick=\"event.stopImmediatePropagation(); editGoalInCluster(this)\" ' +\n 'onmousemove=\"event.stopImmediatePropagation()\" onmouseup=\"event.stopImmediatePropagation()\"' +\n 'onmousedown=\"event.stopImmediatePropagation()\"/><img class=\"deleteButton non-draggable dragger\" style=\"display: none\"' +\n 'src=\"/img/trash-alt-solid.svg\" onclick=\"event.stopImmediatePropagation(); handleDeleteGoalInCluster(this)\"' +\n 'onmousemove=\"event.stopImmediatePropagation()\" onmouseup=\"event.stopImmediatePropagation()\"' +\n 'onmousedown=\"event.stopImmediatePropagation()\"/>');\n\n draggableWrapper += newNode.outerHTML;\n\n draggableWrapper += \"</li></ol>\";\n let node = createElementFromHTML(draggableWrapper);\n\n //console.log(node);\n //if the drag element comes from the goal list\n if (fromGoalList) {\n //if there is dd-empty (first time drag to here)\n if ($(this).children(\".dd-empty\")[0]) {\n $(this)\n .children(\".dd-empty\")[0]\n .replaceWith(node);\n\n //adding one new cluster after dropping\n appendCluster();\n }\n //if no dd-empty, already not first time to drag here, there is ol (already has one element)\n else {\n $(this)\n .children(\"ol\")[0]\n .appendChild(\n createElementFromHTML(\n '<li class=\"dd-item\">' + newNode.outerHTML + \"</li>\"\n )\n );\n }\n //before start dragging, trigger addNoChildrenClass method\n addNoChildrenClass();\n }\n\n //after dropping finished, change font style of the dragged element\n $(nowCopying).children(\"input\").css(\"font-weight\", \"normal\");\n }\n });\n}", "onMouseDrag(e) {}", "onElementTouchStart(event) {\n const me = this,\n target = event.target,\n header = DomHelper.up(target, '.b-grid-header'),\n column = header && me.grid.getColumnFromElement(header); // If it's a multi touch, group.\n\n if (event.touches.length > 1 && column && column.groupable !== false && !me.disabled) {\n me.store.group(column.field);\n }\n }", "function pan(domNode, direction) {\n var speed = panSpeed;\n if (panTimer) {\n clearTimeout(panTimer);\n translateCoords = d3.transform(svgGroup.attr(\"transform\"));\n if (direction == \"left\" || direction == \"right\") {\n translateX = direction == \"left\" ? translateCoords.translate[0] + speed : translateCoords.translate[0] - speed;\n translateY = translateCoords.translate[1];\n } else if (direction == \"up\" || direction == \"down\") {\n translateX = translateCoords.translate[0];\n translateY = direction == \"up\" ? translateCoords.translate[1] + speed : translateCoords.translate[1] - speed; \n }\n scaleX = translateCoords.scale[0];\n scaleY = translateCoords.scale[1];\n scale = zoomListener.scale();\n svgGroup.transition().attr(\"transform\", \"translate(\" + translateX + \",\" + translateY + \")scale(\" + scale + \")\");\n d3.select(domNode).select('g.node').attr(\"transform\", \"translate(\" + translateX + \",\" + translateY + \")\");\n zoomListener.scale(zoomListener.scale());\n zoomListener.translate([translateX, translateY]) \n panTimer = setTimeout(function() {\n pan(domNode, speed, direction);\n }, 50);\n }\n }", "render() {\n return (\n <DragDropContext onDragEnd={this.onDragEnd}>\n <Droppable droppableId=\"droppable\">\n {(provided, snapshot) => (\n <div\n ref={provided.innerRef}\n // style={this.getListStyle(snapshot.isDraggingOver)}\n >\n {this.props.layers.map((item, index) => (\n <Draggable key={index} draggableId={item.img} index={index}>\n {(provided, snapshot) => (\n <div\n ref={provided.innerRef}\n {...provided.draggableProps}\n {...provided.dragHandleProps}\n // style={this.getItemStyle(\n // snapshot.isDragging,\n // provided.draggableProps.style\n // )}\n >\n <div className=\"settings-elements\">\n <i className=\"fas fa-ellipsis-v\" />\n </div>\n <div className=\"settings-elements\">\n <img\n className=\"img-settings\"\n src={item.img}\n alt=\"eachimg\"\n />\n </div>\n <div className=\"settings-elements\">\n <div style={{ color: \"#ccc\", paddingBottom: \"4px\" }}>\n Layer {index + 1}\n </div>\n <div className=\"input-group mb-3\">\n <div className=\"input-group-prepend\">\n <button\n style={{ borderRight: \"none\" }}\n type=\"button\"\n className=\"btn layer-btns\"\n onClick={this.handleMinus.bind(this, index)}\n >\n -\n </button>\n </div>\n <input\n className=\"number-input\"\n type=\"number\"\n pattern=\"[0-9]*\"\n value={item.val}\n onChange={this.handleChange.bind(this, index)}\n />\n <div className=\"input-group-append\">\n <button\n style={{ borderLeft: \"none\" }}\n type=\"button\"\n className=\"btn layer-btns\"\n onClick={this.handlePlus.bind(this, index)}\n >\n +\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </Draggable>\n ))}\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n );\n }", "function enableDragOnSVGElement(element) {\n element.on('mousedown.drag', startDrag);\n element.on('touchstart.drag', startDrag);\n\n var grabPoint = 0;\n\n\n function startDrag(e) {\n\n // check for left button\n if ((e.type == 'click' || e.type == 'mousedown' || e.type == 'mousemove')\n && ((e.which || e.buttons) != 1)) {\n return;\n }\n\n // Prevent default behaviour\n e.preventDefault();\n e.stopPropagation();\n\n // Find the position of the mouse relative to the block\n grabPoint = relativePoint(e, element);\n\n // Bring the block to the forground\n element.front();\n\n // apply draggable css\n element.addClass('elementBeingDragged');\n\n // add drag and end events to window\n SVG.on(window, 'mousemove.drag', captureDrag);\n SVG.on(window, 'touchmove.drag', captureDrag);\n SVG.on(window, 'mouseup.drag', endDrag);\n SVG.on(window, 'touchend.drag', endDrag);\n\n element.fire('drag-started');\n }\n\n function captureDrag(e) {\n var newPoint = relativePoint(e, element);\n var delx = newPoint.x - grabPoint.x;\n var dely = newPoint.y - grabPoint.y;\n element.dmove(delx, dely);\n element.fire('drag-moved', { e, element, grabPoint, newPoint });\n }\n\n function endDrag(e) {\n captureDrag(e);\n\n // unbind events\n SVG.off(window, 'mousemove.drag')\n SVG.off(window, 'touchmove.drag')\n SVG.off(window, 'mouseup.drag')\n SVG.off(window, 'touchend.drag')\n\n element.removeClass('elementBeingDragged');\n element.fire('drag-finished', { e, element, grabPoint });\n }\n\n return element;\n}", "updateTransform()\n {\n\n this._boundsID++;\n \n this.transform.updateTransform(this.parent.transform);\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n \n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n if (child.visible)\n {\n \n child.updateTransform();\n \n\n \n }\n }\n\n if(this._filters){\n // this._filters.forEach(filter=>filter.worldTransform =this.transform.worldTransform)\n const bounds = this._bounds;\n const width = this.width || this.style.width || bounds.maxX - bounds.minX;\n const height = this.height || this.style.height || bounds.maxY - bounds.minY;\n /**\n * if check on cliip bug on scroll after setState from App.js scrollHeight !!!!!!\n */\n // if(this._clip){\n\n // console.log(this.transform.worldTransform.ty)\n this.filterArea = new PIXI.Rectangle(\n this.transform.worldTransform.tx,\n this.transform.worldTransform.ty,\n width,\n height\n )\n // / }\n \n }\n \n }", "function base_resizeToBoundingBox( parent_id, ele_id ){\n\t/*\n\tif ( !parent_id || !ele_id ){ return false; }\n\tif ( !document.getElementById(parent_id) || !document.getElementById(ele_id) ){ return false; }\n\t*/\n\tvar el = document.getElementById(parent_id);\n\tvar img = document.getElementById(ele_id);\n\tvar w = el.offsetWidth;\n\tvar h = el.offsetHeight;\n\n\tvar angle_a = getCurrentRotation(el);\n\tvar angle_img = getCurrentRotation(el)*-1;\n\t\n\n\tvar angle = angle_a * Math.PI / 180,\n\t sin = Math.sin(angle),\n\t cos = Math.cos(angle);\n\n\tvar x1 = cos * w,\n\t y1 = sin * w;\n\n\tvar x2 = -sin * h,\n\t y2 = cos * h;\n\n\tvar x3 = cos * w - sin * h,\n\t y3 = sin * w + cos * h;\n\n\tvar minX = Math.min(0, x1, x2, x3),\n\t maxX = Math.max(0, x1, x2, x3),\n\t minY = Math.min(0, y1, y2, y3),\n\t maxY = Math.max(0, y1, y2, y3);\n\n\tvar rotatedWidth = maxX - minX,\n\t rotatedHeight = maxY - minY;\n\n\tvar pimgl = ( (rotatedWidth-w)/2 )*-1;\n\tvar pimgt = ( (rotatedHeight-h)/2 )*-1;\n\t\n\timg.style.width=rotatedWidth+\"px\";\n\t\n\timg.style.left=pimgl+\"px\";\n\timg.style.top=pimgt+\"px\";\n\n\timg.style.height=rotatedHeight+\"px\";\n\n\timg.style.transform=\"rotate(\"+angle_img+\"deg)\";\n}", "function dragUpdate() {\n if (isDragging) {\n requestAnimationFrame(dragUpdate);\n }\n // Limit to the boundaries\n if (\n transformX <= 0 ||\n transformX + parent.clientWidth >= window.innerWidth ||\n transformY <= 0 ||\n transformY + parent.clientHeight >= window.innerHeight\n ) {\n return;\n }\n parent.style.transform = `translate(${transformX}px, ${transformY}px)`;\n }", "GetChildrenBounds(child) {\n let childSize;\n childSize = child.desiredSize.clone();\n let diffAngle = child.rotateAngle - this.rotateAngle;\n let refPoint = { x: child.offsetX, y: child.offsetY };\n let left = refPoint.x - childSize.width * child.pivot.x;\n let top = refPoint.y - childSize.height * child.pivot.y;\n let right = left + childSize.width;\n let bottom = top + childSize.height;\n let topLeft = { x: left, y: top };\n let topRight = { x: right, y: top };\n let bottomLeft = { x: left, y: bottom };\n let bottomRight = { x: right, y: bottom };\n topLeft = rotatePoint(child.rotateAngle, child.offsetX, child.offsetY, topLeft);\n topRight = rotatePoint(child.rotateAngle, child.offsetX, child.offsetY, topRight);\n bottomLeft = rotatePoint(child.rotateAngle, child.offsetX, child.offsetY, bottomLeft);\n bottomRight = rotatePoint(child.rotateAngle, child.offsetX, child.offsetY, bottomRight);\n if (this.rotateAngle !== 0) {\n topLeft = rotatePoint(-this.rotateAngle, undefined, undefined, topLeft);\n topRight = rotatePoint(-this.rotateAngle, undefined, undefined, topRight);\n bottomLeft = rotatePoint(-this.rotateAngle, undefined, undefined, bottomLeft);\n bottomRight = rotatePoint(-this.rotateAngle, undefined, undefined, bottomRight);\n }\n return Rect.toBounds([topLeft, topRight, bottomLeft, bottomRight]);\n }", "onDragOver(e) {\n\t\tif (this.props.children) {return;}\n\t\te.preventDefault();\n\t}", "unsetDraggable(blobDOM) {\n d3.select((blobDOM.node().parentNode)).classed('cg-draggable', false)\n }", "function makeInteractive( _group, _type ){\n\tif( typeof _group == 'string' ){\n\t\t_group = master.canvas.stage.find( '#' + _group )[0];\n\t}\n\t\n\tif( _group == undefined )\n\t\treturn;\n\t\t\n\tvar nw = false, sw = false, se = false, ne = false;\n\tvar children = _group.getChildren().toArray();\n\tfor( var i = 0; i < children.length; i++ ){\n\t\tvar child = children[i];\n\t\tif( child.getName() === 'topLeft' )\n\t\t\tne = true;\n\t\tif( child.getName() === 'topRight' )\n\t\t\tnw = true;\n\t\tif( child.getName() === 'bottomLeft' )\n\t\t\tsw = true;\n\t\tif( child.getName() === 'bottomRight' )\n\t\t\tse = true;\n\t}\n\t\n\tif( nw && ne && se && sw )\n\t\treturn;\n\t\t\n\t_group.getChildren().each(function( shape, n ){\n\t\tif( shape.getClassName() === 'Rect' ){\n\t\t\tshape.moveToBottom();\n\t\t}\n\t});\n\t\n\tmaxWidth = _group.getWidth();\n\tmaxHeight = _group.getHeight();\n\t\n\tmakeSizableHelper( _group, 0, 0, 'topLeft', 'nwse-resize' );\n\tmakeSizableHelper( _group, maxWidth, 0, 'topRight', 'nesw-resize' );\n\tmakeSizableHelper( _group, 0, maxHeight, 'bottomLeft', 'nesw-resize' );\n\tmakeSizableHelper( _group, maxWidth, maxHeight, 'bottomRight', 'nwse-resize' );\n\t\n\tvar topLeft = _group.find('.topLeft')[0];\n\tvar topRight = _group.find('.topRight')[0];\n\tvar bottomRight = _group.find('.bottomRight')[0];\n\tvar bottomLeft = _group.find('.bottomLeft')[0];\n\t\n\t_group.setAttr( 'selected', false );\n\t_group.setAttr( 'disabled', false );\n\t\n\t_group.on('click touchstart', function(e){\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( !_group.getAttr( 'selected' ) || Kinetic.multiSelect != null || !e.evt.shiftKey || !e.evt.ctrlKey ){\n\t\t\t//If shif and cntrl were not held during the click\n\t\t\tif( !e.evt.shiftKey && !e.evt.ctrlKey ){\n\t\t\t\tdeselect();\n\t\t\t\tselect( _group );\n\t\t\t} else if ( _group.getAttr( 'selected' ) ) {\n\t\t\t//If shif or cntrl were held during the click and object was already selected\n\t\t\t\tdeselect( _group );\n\t\t\t} else {\n\t\t\t//If shif and cntrl were held during the click and object was not already selected\n\t\t\t\tselect( _group );\n\t\t\t}\n\t\t\t\n\t\t\tselectStyle();\n\t\t}\n\t});\n\t\n\t_group.on('dragstart', function(e){\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( !_group.getAttr( 'selected' ) ){\n\t\t\t//If shif and cntrl were not held during the click\n\t\t\tif( !e.evt.shiftKey && !e.evt.ctrlKey ){\n\t\t\t\tdeselect();\n\t\t\t\tselect( _group );\n\t\t\t} else if ( _group.getAttr( 'selected' ) ) {\n\t\t\t//If shif or cntrl were held during the click and object was already selected\n\t\t\t\tdeselect( _group );\n\t\t\t} else {\n\t\t\t//If shif and cntrl were held during the click and object was not already selected\n\t\t\t\tselect( _group );\n\t\t\t}\n\t\t\t\n\t\t\tselectStyle();\n\t\t}\n\t});\n\t\n\t_group.on('mouseover', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( document.body.style.cursor !== 'nwse-resize' && document.body.style.cursor !== 'nesw-resize' && _group.getAttr( 'selected' ) ){\n\t\t\tdocument.body.style.cursor = 'all-scroll';\n\t\t}\n\t});\n\t\n\t_group.on('mouseout', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tdocument.body.style.cursor = 'default';\n \t});\n \t\n \t_group.on('dragend', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n \t\t\n\t\tmaster.canvas.ormObj.visualOnlySync();\n\t});\n\t\n\tif( typeof _type !== 'undefined' && _type === 'objects' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\t\n\t\t\tmaster.ormObj.openProperties( _group.id() );\n\t\t\tdeselect( _group );\n\t\t});\n\t} else if ( typeof _type !== 'undefined' && _type === 'predicate' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr('disabled') ) return;\n\t\t\t\n\t\t\tmaster.canvas.line.editPredicate( _group.id() );\n\t\t});\n\t} else if ( typeof _type !== 'undefined' && _type === 'rule' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr('disabled') ) return;\n\t\t\t\n\t\t\tmaster.rule.openChangeSymbol( _group.id() );\n\t\t});\n\t}\n}", "function makeDraggable() {\n const indicator = angular__default['default'].element('<' + element[0].nodeName.toLowerCase() + '>').addClass('fl-drag-indicator fl-item');\n const clone = angular__default['default'].element('<div>').addClass('fl-drag-clone');\n clone.append(indicator);\n\n const size = {};\n\n element.draggable({\n cursor: 'move',\n cancel: '[fl-drag-cancel]',\n helper: () => clone,\n start: (event) => {\n size.width = element.outerWidth();\n size.height = element.outerHeight();\n\n clone.css(flContainer.mapper.layout2px(flItem.item));\n indicator.css(flContainer.mapper.layout2px(flItem.item));\n\n element.children().clone().appendTo(indicator);\n flContainer.onItemEditStart();\n scope.$broadcast('flDragStart', event);\n },\n drag: (event, ui) => {\n const indicatorPos = flContainer.mapper.layout2px(flContainer.mapper.getClosestPosition(Object.assign(size, ui.position)));\n\n indicator.css({\n left: indicatorPos.left - ui.position.left,\n top: indicatorPos.top - ui.position.top\n });\n },\n stop: (event, ui) => {\n indicator.empty();\n flContainer.onItemEditEnd(flItem.item, flContainer.mapper.getClosestPosition(Object.assign(size, ui.position)));\n scope.$broadcast('flDragStop', event);\n }\n });\n }", "function anadirEventoDulce(){\r\n $('img').draggable({\r\n containment: '.panel-tablero',\r\n\t\tdroppable: 'img',\r\n\t\trevert: true,\r\n\t\trevertDuration: 500,\r\n\t\tgrid: [100, 100],\r\n\t\tzIndex: 10,\r\n\t\tdrag: constrainCandyMovement\r\n });\r\n $('img').droppable({\r\n\t\tdrop: dejaDulce\r\n\t});\r\n activarEventoDulce();\r\n}", "startDraggingAnchors(element) {\n const mousedown = (mouse, anchor) => {\n this.scalable = true;\n this.mouse = mouse;\n\n if (element.type === \"line\") {\n const P1 = element.bounding.P1;\n const P2 = element.bounding.P2;\n\n this.bound = {\n x1: P1.x + this.props.x,\n y1: P1.y + this.props.y,\n x2: P2.x + this.props.x,\n y2: P2.y + this.props.y,\n\n diffX: Math.abs(P1.x - P2.x),\n diffY: Math.abs(P1.y - P2.y),\n };\n\n this.initialBounds = {\n diffX: this.bound.diffX / this.previousScaleX,\n diffY: this.bound.diffY / this.previousScaleY,\n };\n\n const diffX = Math.abs(P1.x - P2.x) / 2;\n const diffY = Math.abs(P1.y - P2.y) / 2;\n\n const clickedPoint = [P1, P2][anchor - 1];\n const otherPoint = [P2, P1][anchor - 1];\n\n const isClickedPointBiggerX = clickedPoint.x > otherPoint.x;\n const isClickedPointBiggerY = clickedPoint.y > otherPoint.y;\n\n this.isClickedPointBiggerX = isClickedPointBiggerX;\n this.isClickedPointBiggerY = isClickedPointBiggerY;\n\n this.anchorTransition = {\n x: isClickedPointBiggerX ? -diffX : diffX,\n y: isClickedPointBiggerY ? -diffY : diffY,\n };\n\n const initialHalfDiffX = this.initialBounds.diffX / 2;\n const initialHalfDiffY = this.initialBounds.diffY / 2;\n\n const { x1, y1, x2, y2 } = element.props;\n\n this.anchorTransitionPos = {\n x1:\n x1 + (isClickedPointBiggerX ? initialHalfDiffX : -initialHalfDiffX),\n y1:\n y1 + (isClickedPointBiggerY ? initialHalfDiffY : -initialHalfDiffY),\n\n x2:\n x2 + (isClickedPointBiggerX ? initialHalfDiffX : -initialHalfDiffX),\n y2:\n y2 + (isClickedPointBiggerY ? initialHalfDiffY : -initialHalfDiffY),\n\n x: isClickedPointBiggerX ? initialHalfDiffX : -initialHalfDiffX,\n y: isClickedPointBiggerY ? initialHalfDiffY : -initialHalfDiffY,\n };\n } else {\n // NOT line elements\n this.bound = {\n x: element.bounding.minX + this.props.x,\n y: element.bounding.minY + this.props.y,\n width:\n Math.abs(element.bounding.maxX) + Math.abs(element.bounding.minX),\n height:\n Math.abs(element.bounding.maxY) + Math.abs(element.bounding.minY),\n };\n\n this.initialBounds = {\n width: this.bound.width / this.previousScaleX,\n height: this.bound.height / this.previousScaleY,\n };\n\n const halfWidth = this.bound.width / 2;\n const halfHeight = this.bound.height / 2;\n\n const initialHalfWidth = this.initialBounds.width / 2;\n const initialHalfHeight = this.initialBounds.height / 2;\n\n this.anchorTransition = {\n x: anchor % 2 ? -halfWidth : halfWidth,\n y: Math.floor(anchor / 3) ? halfHeight : -halfHeight,\n };\n\n if (element.type === \"polygon\") {\n const newPoints =\n element.props.points &&\n element.props.points\n .split(\" \")\n .map((point) => {\n const [xx, yy] = point.split(\",\");\n\n return {\n x:\n parseFloat(xx) +\n (anchor % 2 ? initialHalfWidth : -initialHalfWidth),\n y:\n parseFloat(yy) +\n (Math.floor(anchor / 3)\n ? -initialHalfHeight\n : initialHalfHeight),\n };\n })\n .reduce((sum, { x, y }) => `${sum} ${x},${y}`, \"\")\n .trim();\n\n this.anchorTransitionPos = {\n points: newPoints,\n x: anchor % 2 ? initialHalfWidth : -initialHalfWidth,\n y: Math.floor(anchor / 3) ? -initialHalfHeight : initialHalfHeight,\n };\n } else {\n this.anchorTransitionPos = {\n x: anchor % 2 ? initialHalfWidth : -initialHalfWidth,\n y: Math.floor(anchor / 3) ? -initialHalfHeight : initialHalfHeight,\n };\n }\n }\n };\n\n const mouseup = () => {\n this.scalable = false;\n\n this.previousScaleX = this.props.scaleX;\n this.previousScaleY = this.props.scaleY;\n\n this.props.x =\n this.props.x +\n this.anchorTransition.x +\n this.anchorTransitionPos.x * this.props.scaleX;\n\n this.props.y =\n this.props.y +\n this.anchorTransition.y +\n this.anchorTransitionPos.y * this.props.scaleY;\n\n if (element.type === \"polygon\") {\n const newPoints =\n element.props.points &&\n element.props.points\n .split(\" \")\n .map((point) => {\n const [xx, yy] = point.split(\",\");\n\n return { x: parseFloat(xx), y: parseFloat(yy) };\n })\n .reduce((sum, { x, y }) => `${sum} ${x},${y}`, \"\")\n .trim();\n\n this.anchorTransitionPos.points = newPoints;\n this.anchorTransitionPos.x = 0;\n this.anchorTransitionPos.y = 0;\n } else if (element.type === \"line\") {\n const { x1, y1, x2, y2 } = element.props;\n\n this.anchorTransitionPos.x1 = x1;\n this.anchorTransitionPos.y1 = y1;\n this.anchorTransitionPos.x2 = x2;\n this.anchorTransitionPos.y2 = y2;\n\n this.anchorTransitionPos.x = 0;\n this.anchorTransitionPos.y = 0;\n } else {\n this.anchorTransitionPos.x = 0;\n this.anchorTransitionPos.y = 0;\n }\n\n this.anchorTransition.x = 0;\n this.anchorTransition.y = 0;\n\n element.updateMouseTransformation(this);\n };\n\n const mousemove = (mouse, anchor) => {\n if (this.scalable) {\n if (element.type === \"line\") {\n const diffX = mouse.x - [this.bound.x1, this.bound.x2][anchor - 1];\n const diffY = mouse.y - [this.bound.y1, this.bound.y2][anchor - 1];\n\n const scaleX =\n this.previousScaleX -\n (this.isClickedPointBiggerX ? -diffX : diffX) /\n this.initialBounds.diffX;\n\n const scaleY =\n this.previousScaleY -\n (this.isClickedPointBiggerY ? -diffY : diffY) /\n this.initialBounds.diffY;\n\n this.mouse = mouse;\n\n this.props = {\n scaleX,\n scaleY,\n x: this.props.x || this.bound.x + this.bound.width / 2,\n y: this.props.y || this.bound.y + this.bound.height / 2,\n rotate: 0,\n };\n } else {\n const width = anchor % 2 ? this.bound.width : 0;\n const height = Math.floor(anchor / 3) ? 0 : this.bound.height;\n\n const diffX = mouse.x - (this.bound.x + width);\n const diffY = mouse.y - (this.bound.y + height);\n\n const scaleX =\n this.previousScaleX -\n (anchor % 2 ? diffX * -1 : diffX) / this.initialBounds.width;\n\n const scaleY =\n this.previousScaleY -\n (Math.floor(anchor / 3) ? diffY : diffY * -1) /\n this.initialBounds.height;\n\n const { x1, y1, x2, y2 } = this.bound;\n\n this.mouse = mouse;\n this.props = {\n scaleX,\n scaleY,\n x: this.props.x || Math.min(x1, x2) + Math.abs(x1 - x2) / 2,\n y: this.props.y || Math.min(y1, y2) + Math.abs(y1 - y2) / 2,\n rotate: 0,\n };\n }\n\n element.updateMouseTransformation(this);\n }\n };\n\n // these handlers start as soon as we click on of the anchors.\n this.scalingHandlers = { mousedown, mousemove, mouseup };\n }", "function addSortable() {\n //alert(\"pressed\");\n\n //This declares a new div element with a class of tile, and gives it a HTML label of a number.\n //Then the new element is appended to the list div.\n var sortableElement = $(\"<li></li>\").addClass(\"sortableTile\").html(sortableLabel++);\n $list2.append(sortableElement);\n\n Draggable.create(sortableElement, {\n type : \"y\",\n bounds : $list2,\n edgeResistance : 1,\n onPress : onSortablePress,\n onDragStart : onSortableDragStart,\n onDrag : sortableDrag,\n liveSnap : sortableSnap,\n onDragEnd : sortableDragEnd,\n });\n\n function onSortablePress() {\n var t = this.target,\n i = 0,\n child = t;\n while(child = child.previousSibling)\n if (child.nodeType === 1) i++;\n t.currentIndex = i;\n //The offsetHeight property returns viewable height of an element,\n // including padding, border and scrollbar, but not the margin.\n t.currentHeight = t.offsetHeight;\n t.kids = [].slice.call(t.parentNode.children); // convert to array\n }//end of onSortablePress Function\n\n function onSortableDragStart(){\n //This TweenMax gives the dragTile its shadow and change in size\n //The z-index makes sure that the tile that is pressed is on top of the other tiles\n TweenMax.to(sortableElement, 0.2, {\n autoAlpha : 0.75,\n boxShadow : shadow2,\n scale : 0.95,\n zIndex : \"+=1000\"\n });\n }// end of function sortableDragStart\n\n function sortableDragEnd() {\n var t = this.target,\n max = t.kids.length - 1,\n newIndex = Math.round(this.y / t.currentHeight);\n newIndex += (newIndex < 0 ? -1 : 0) + t.currentIndex;\n if (newIndex === max) {\n t.parentNode.appendChild(t);\n } else {\n t.parentNode.insertBefore(t, t.kids[newIndex+1]);\n }//end of if/else\n TweenMax.to(sortableElement, 0.2, {\n autoAlpha : 1,\n boxShadow : shadow1,\n scale : 1,\n zIndex : ++zIndex\n });\n }\n\n function sortableDrag() {\n var t = this.target,\n elements = t.kids.slice(), // clone\n indexChange = Math.round(this.y / t.currentHeight),\n bound1 = t.currentIndex,\n bound2 = bound1 + indexChange;\n if (bound1 < bound2) { // moved down\n TweenMax.to(elements.splice(bound1+1, bound2-bound1), 0.15, { yPercent: -100 });\n TweenMax.to(elements, 0.15, { yPercent: 0 });\n } else if (bound1 === bound2) {\n elements.splice(bound1, 1);\n TweenMax.to(elements, 0.15, { yPercent: 0 });\n } else { // moved up\n TweenMax.to(elements.splice(bound2, bound1-bound2), 0.15, { yPercent: 100 });\n TweenMax.to(elements, 0.15, { yPercent: 0 });\n }\n }//end sortableDrag function\n\n function sortableSnap(y) {\n var h = this.target.currentHeight;\n return Math.round(y / h) * h;\n }//end sortableSnap function\n\n}//end of add sortable function", "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 }", "onMouseDown(event) {\n event.preventDefault();\n var context = this;\n this.raycaster.setFromCamera(this.mouse, this.camera);\n\n //Finds all intersected objects (closet faces)\n //this.group.children[0] => Closet Group\n var intersects = this.raycaster.intersectObjects(this.group.children, true);\n //Intersects must be \n //Checks if any closet face was intersected\n if (intersects.length > 0) {\n\n //Gets the closest (clicked) object\n var face = intersects[0].object;\n console.log(\"Face ID => \" + face.id);\n console.log(\"Closet ID => \" + this.closet.id());\n let closetSlotsFaces = this.closet.getClosetSlotFaces();\n //Checks if the selected closet face is a slot \n for (var i = 0; i < closetSlotsFaces.length; i++) {\n var closet_face = closetSlotsFaces[i].mesh();\n if (closet_face == face) {\n //Disables rotation while moving the slot\n this.controls.enabled = false;\n //Sets the selection to the current slot\n this.selected_slot = face;\n if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) {\n this.offset = this.intersection.x - this.selected_slot.position.x;\n }\n }\n }\n\n //Checks if the selected object is a shelf\n for (let j = 0; j < this.closet_shelves_ids.length; j++) {\n let shelf = this.group.getObjectById(this.closet_shelves_ids[j]);\n if (shelf == face) {\n this.controls.enabled = false;\n this.selected_component = face;\n if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) {\n this.offset = this.intersection.y - this.selected_component.position.y;\n }\n }\n }\n\n //Checks if the selected object is a pole\n for (let j = 0; j < this.closet_poles_ids.length; j++) {\n let pole = this.group.getObjectById(this.closet_poles_ids[j]);\n if (pole == face) {\n this.controls.enabled = false;\n this.selected_component = face;\n if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) {\n this.offset = this.intersection.y - this.selected_component.position.y;\n }\n }\n }\n //Checks if the selected closet face is a face\n let leftFace = this.closet.getClosetFaces().get(FaceOrientationEnum.LEFT).mesh();\n let rightFace = this.closet.getClosetFaces().get(FaceOrientationEnum.RIGHT).mesh();\n if (rightFace == face ||\n leftFace == face) {\n //Disables rotation while moving the face\n this.controls.enabled = false;\n //Sets the selection to the current face\n this.selected_face = face;\n if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) {\n this.offset = this.intersection.x - this.selected_face.position.x;\n }\n }\n\n if (this.canMoveComponents) {\n var flagOpen = false;\n var flagClose = false;\n var j = 0;\n\n //Checks if the selected object is a sliding door\n\n let closetSlidingDoors=this.closet.getProducts(ProductTypeEnum.SLIDING_DOOR);\n\n while (!flagOpen && !flagClose && j < closetSlidingDoors.length) {\n let closetSlidingDoor=closetSlidingDoors[j].getFace().mesh(); //TODO: ??? Are you sure about that\n if (closetSlidingDoor == face) {\n this.controls.enabled = false;\n if (this.slidingDoor.position.x < 0) {\n flagClose = true; //\"Closing\" ==> slide door to the right\n } else {\n flagOpen = true; //\"Opening\" ==> slide door to the left\n }\n }\n j++;\n }\n\n if (flagOpen) {\n requestAnimationFrame(function () {\n context.slideDoorToLeft();\n });\n } else if (flagClose) {\n requestAnimationFrame(function () {\n context.slideDoorToRight();\n });\n }\n\n flagOpen = false;\n flagClose = false;\n j = 0;\n\n let closetDrawers = this.closet.getProducts(ProductTypeEnum.DRAWER);\n while (!flagOpen && !flagClose && j < closetDrawers.length) {\n let closetDrawerFaces = closetDrawers[j].getDrawerFaces();\n var closetDrawer = closetDrawers[j];\n //Always get the front face of any drawer at index 5*j+1\n var drawer_front_face = closetDrawerFaces.get(FaceOrientationEnum.FRONT).mesh();\n console.log(face);\n console.log(drawer_front_face);\n //Check if the selected object is a drawer's front face\n if (drawer_front_face == face) {\n this.controls.enabled = false;\n var drawer_base_face = closetDrawerFaces.get(FaceOrientationEnum.BASE).mesh();\n var drawer_left_face = closetDrawerFaces.get(FaceOrientationEnum.LEFT).mesh();\n var drawer_right_face = closetDrawerFaces.get(FaceOrientationEnum.RIGHT).mesh();\n var drawer_back_face = closetDrawerFaces.get(FaceOrientationEnum.BACK).mesh();\n if (drawer_front_face.position.z >= -50) {\n flagClose = true;\n } else {\n flagOpen = true;\n }\n }\n j++;\n }\n\n if (flagOpen) {\n /* requestAnimationFrame(function () {\n \n context.openDrawer(drawer_front_face, drawer_back_face, drawer_base_face, drawer_left_face, drawer_right_face);\n }); */\n /* requestAnimationFrame(function(){\n ThreeDrawerAnimations.open(closetDrawer)\n }); */\n ThreeDrawerAnimations.open(closetDrawer);\n } else if (flagClose) {\n /* requestAnimationFrame(function () {\n context.closeDrawer(drawer_front_face, drawer_back_face, drawer_base_face, drawer_left_face, drawer_right_face);\n }); */\n ThreeDrawerAnimations.close(closetDrawer);\n }\n\n j = 0;\n flagOpen = false;\n flagClose = false;\n\n let closetHingedDoors=this.closet.getProducts(ProductTypeEnum.HINGED_DOOR);\n\n while (!flagOpen && !flagClose && j < closetHingedDoors.length) {\n let hingedDoor=closetHingedDoors[j]; //TODO: Maybe wrong ?\n //TODO: REMOVE closet_face ???? Not currently used!!!!\n if (hingedDoor.getFace().mesh() == face) {\n this.controls.enabled = false;\n if (this.hingedDoor.rotation.y < 0) {\n flagClose = true;\n } else {\n flagOpen = true;\n }\n }\n j++;\n }\n\n if (flagOpen) {\n requestAnimationFrame(function () {\n context.openHingedDoor();\n });\n } else if (flagClose) {\n requestAnimationFrame(function () {\n context.closeHingedDoor();\n });\n }\n }\n }\n }", "zoomSvg (d3Event) {\n if (d3Event.deltaY > 0) {\n this.currentZoom -= this.currentZoom > 0.3 ? 0.2 : 0\n } else {\n this.currentZoom += this.currentZoom < 1.6 ? 0.2 : 0\n }\n this.svg.attr('transform', 'translate(' + this.movement.x + ' ' + this.movement.y + ') scale(' + this.currentZoom + ' ' + this.currentZoom + ')')\n }", "function dragElement( event ) {\r\n xPosition = document.all ? window.event.clientX : event.pageX;\r\n yPosition = document.all ? window.event.clientY : event.pageY;\r\n if ( selected !== null ) {\r\n selected.style.left = ((xPosition - xElement) + selected.offsetWidth / 2) + 'px';\r\n selected.style.top = ((yPosition - yElement) + selected.offsetHeight / 2) + 'px';\r\n }\r\n }", "onElementTouchStart(event) {\n const me = this,\n target = event.target,\n header = DomHelper.up(target, '.b-grid-header'),\n column = header && me.grid.getColumnFromElement(header);\n\n // If it's a multi touch, group.\n if (event.touches.length > 1 && column && column.groupable !== false) {\n me.store.group(column.field);\n }\n }", "findDroppable(e) {\r\n //check isDragndrop\r\n if (!this.dragObj.avatar) return;\r\n let oldDisplay = this.dragObj.avatar.style.display;\r\n this.dragObj.avatar.style.display = 'none';\r\n let elem = document.elementFromPoint(e.clientX, e.clientY);\r\n this.dragObj.avatar.style.display = oldDisplay;\r\n if (elem == null) {\r\n return null;\r\n }\r\n return elem.closest(this.options.dropableSelector);\r\n }", "function objectDropper(inum) {\n\n var oD = document.createElement(\"img\");\n oD.ID = \"oD\";\n oD.name = \"plus\";\n oD.class = \"centered\";\n oD.src = \"../DragImages/Inkplus.svg\";\n oD.draggable = \"false\";\n var gridlist = document.getElementById(\"div1\").children;\n\n for(j=0;j<gridlist.length;j++){\n if(gridlist[j].ID == \"div_\" + inum){\n // alert(gridlist[j].ID);\n gridlist[j].appendChild(oD);\n // alert(oD.class);\n oD.style = \"top: 50%; left: 50%; margin-top: -30px; margin-left: -19px; float:left;\";\n }\n }\n\n\n}", "function modeResize()\n{\n d3.selectAll(\"circle\").call(d3.behavior.drag().on(\"drag\", resize));\n}", "function zoom_actions() {\n inner.attr('transform', d3.zoomTransform(svg.node()));\n }", "function zoom_actions(){\n g.attr(\"transform\", d3.event.transform)\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function draggable() {\n\t$(\".bird\").draggable();\n}", "handleDrop (form, data, event) {\n event.stopImmediatePropagation()\n console.log(`FixedPositionForm.handleDrop(). form=`, form)\n console.log(`FixedPositionForm.handleDrop(), data=`, data)\n console.log(`FixedPositionForm.handleDrop(), el=`, this.$el)\n console.log(`FixedPositionForm.handleDrop(), event=`, event)\n var _fixed_x = data._fixed_x ? data._fixed_x : 0\n var _fixed_y = data._fixed_y ? data._fixed_y : 0\n\n // Work out the drop position\n let x = parseInt(_fixed_x) + (event.clientX - this.mouseDownX)\n let y = parseInt(_fixed_y) + (event.clientY - this.mouseDownY)\n console.log(`layer: x=${event.layerX}, y=${event.layerY}`)\n console.log(`mouseDown: x=${this.mouseDownX}, y=${this.mouseDownY}`)\n\n if (this.alignToGrid && this.gridSize > 1) {\n console.log('truncating position');\n x = Math.round(x / this.gridSize) * this.gridSize\n y = Math.round(y / this.gridSize) * this.gridSize\n }\n console.log(`new position: x=${x}, y=${y}`)\n\n var element = null\n\n if (data.dragtype == 'component') {\n\n // Get the element to be inserted, from the drop data.\n // let wrapper = {\n // type: 'contentservice.io',\n // version: \"1.0\",\n // layout: {\n // type: 'element-position',\n // _fixed_x: event.layerX,\n // _fixed_y: event.layerY,\n // children: [ ]\n // }\n // }\n\n // Get the layerX and layerY for components dragged from the contentservice\n x = event.layerX\n y = event.layerY\n \n console.log(`rooss 1`, data);\n let newElement = data.data\n // wrapper.layout.children.push(newElement)\n let position = this.element.children.length\n // console.error(`new wrapper is`, wrapper);\n console.error(`newElement is`, newElement);\n console.log(`rooss 2`);\n let rv = this.$content.insertLayout({ vm: this, parent: this.element, position, layout: newElement })\n console.log(`rooss 3`);\n console.log(`return from insertLayout is ${rv}`);\n this.counter++ //ZZZZZ?\n console.log(`rooss 4`);\n \n } else {\n // console.log(`Dropped non-component: '${data.type}'`)\n console.log(`Dropped element (not from toolbox)`)\n console.log(`data=`, data);\n // x: event.layerX,\n // y: event.layerY,\n // this.$content.setPropertyInElement({ vm: this, element: data, name: 'x', value: x })\n // this.$content.setPropertyInElement({ vm: this, element: data, name: 'y', value: y })\n // return\n element = data\n }\n\n this.$content.setProperty({ vm: this, element: element, name: '_fixed', value: true })\n this.$content.setProperty({ vm: this, element: element, name: '_fixed_x', value: x })\n this.$content.setProperty({ vm: this, element: element, name: '_fixed_y', value: y })\n this.$content.setProperty({ vm: this, element: element, name: 'parentIndex', value: data.parentIndex })\n\n console.log(element, data.parentIndex)\n\n\n\n // // Get the element to be inserted, from the drop data.\n // let insertContent = data.data\n\n // // Note that 'child' is the existing child, not the child being inserted.\n // if (child) {\n // // Insert before the specified child.\n // for (var i = 0; i < element.children.length; i++) {\n // if (element.children[i] === child) {\n // console.log(`Insert at position ${i}`)\n // this.$content.insertLayout({ vm: this, parent: element, position: i, layout: insertContent })\n // break\n // }\n // }\n // } else {\n // // No child specified - add at the end\n // this.$content.insertLayout({ vm: this, parent: element, position: -1, layout: insertContent })\n // }\n }", "_groupContainerHandler(currentElement, eventType) {\n const that = this,\n dropDown = currentElement.dropDown;\n\n if (eventType === 'down') {\n that._downTarget = currentElement;\n\n if (that.reorder && that._reorderItems.length > 1) {\n that._getTabCoordinates();\n that._reordering = true;\n that.setAttribute('dragged', '');\n that._draggedIndex = Array.from(that.$.tabStrip.children).indexOf(currentElement);\n }\n\n return;\n }\n\n if (!that._reordering && !that._swiping) {\n if (dropDown !== that._openDropDown && eventType === 'mouseover' && !currentElement.classList.contains('jqx-tab-group-selected')) {\n currentElement.setAttribute('hover', '');\n }\n else if (eventType === 'mouseout') {\n currentElement.removeAttribute('hover');\n }\n }\n\n if (eventType !== 'up' || that._downTarget !== currentElement || that._reorderedIndex !== undefined || that._swiping) {\n return;\n }\n\n if (dropDown === that._openDropDown) {\n that._closeGroupDropDown();\n\n if (!currentElement.classList.contains('jqx-tab-group-selected')) {\n currentElement.setAttribute('hover', '');\n }\n }\n else {\n that._openGroupDropDown(currentElement);\n }\n }", "isElementDraggable(el, event) {\n const {\n scheduler\n } = this,\n eventElement = DomHelper.up(el, scheduler.eventSelector),\n {\n eventResize\n } = scheduler.features;\n\n if (!eventElement || this.disabled) {\n return false;\n } // displaying something resizable within the event?\n\n if (el.matches('[class$=\"-handle\"]')) {\n return false;\n }\n\n const eventRecord = scheduler.resolveEventRecord(eventElement); // using EventResize and over a virtual handle?\n // Milestones cannot be resized\n\n return !(eventResize && !eventRecord.isMilestone && eventResize.resize.overAnyHandle(event, eventElement));\n }", "get dragX() {\n return Utils.RTD(this.rotation.x);\n }", "function make_draggable(identifier, on_end) {\n var restrict_translation_to_parent = {\n restriction: \"parent\",\n endOnly: true,\n elementRect: { top: 0, left: 0, bottom: 1, right: 1 }\n }\n interact(identifier).draggable({\n inertia: false,\n restrict: restrict_translation_to_parent,\n onmove: translateElement,\n onend: on_end\n });\n}", "drag_feedback(){\r\n this.dragging = true;\r\n }", "setupSource(el, sort = false, group = {}) {\n let that = this;\n new sortable(el, {\n sort: sort,\n ghostClass: \"ghost\",\n group: group,\n onStart: evt => {\n that.eventAggregator.publish('dragSource.onStart', evt);\n },\n onClone: evt => {\n that.eventAggregator.publish('dragSource.onClone', evt);\n },\n onEnd: evt => {\n that.eventAggregator.publish('dragSource.onEnd', evt);\n }\n });\n }", "function SortableGroup(){this.namespace='sortable'+(++SortableGroup.instanceCount);this.draggables={};this.droppables={};this.sortables={};this.linkedGroups=[];this.linkedGroups.onlinkjump=bagofholding;this.rootNode=null;}", "function startDrag() {\n $(\"#animalContainer\").append($(this).clone());\n $(this).removeClass(\"draggable\");\n $(this).draggable(\"option\", \"start\", undefined);\n}", "setDraggable(anchorDOM) {\n d3.select((anchorDOM.node().parentNode)).classed('cg-draggable', true)\n }", "function startDragGauge(evt)\r\n{\r\n\r\n\tif(!DraggingObjGauge &&addElemGaugeViz==true) //---prevents dragging conflicts on other draggable elements---\r\n\t{\r\n\r\n if(evt.target.parentNode.getAttribute(\"class\")==\"dragTargetObj\") //---text elem w/ tspan--\r\n \tobjDragTargetGauge = evt.target.parentNode\r\n\r\n if(objDragTargetGauge)\r\n\t {\r\n addNoSelectAtText()\r\n\r\n\r\n \t\tvar pnt = mySVG.createSVGPoint();\r\n\t\tpnt.x = evt.clientX;\r\n\t\tpnt.y = evt.clientY;\r\n\t\t//---elements in different(svg) viewports, and/or transformed ---\r\n\t\tvar sCTM = objDragTargetGauge.getScreenCTM();\r\n\t\tvar Pnt = pnt.matrixTransform(sCTM.inverse());\r\n\r\n\r\n\r\n\r\n\t\t\tobjTransformRequestObjGauge = objDragTargetGauge.ownerSVGElement.createSVGTransform()\r\n\r\n\t\t\t//---attach new or existing transform to element, init its transform list---\r\n\t\t\tvar myTransListAnim=objDragTargetGauge.transform\r\n\t\t\tobjTransListGauge=myTransListAnim.baseVal\r\n\r\n\t\t\tObjStartXGauge = Pnt.x\r\n\t\t\tObjStartYGauge = Pnt.y\r\n\r\n\r\n\r\n\t\t\tDraggingObjGauge=true\r\n\r\n\r\n\r\n\t\t}\r\n }\r\n\telse\r\n \tDraggingObjGauge=false\r\n\r\n}", "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "function drag(e) {\n draggedItem = e.target\n dragging = true\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 }", "switchContainers(target, e) {\n \n const cloneState = this.deepClone(this.state.tree),\n cloneState_ = this.deepClone(this.state.tree),\n draggedId = this.dragElementId,\n targetId = parseInt(target);\n \n cloneState_[targetId] = Object.assign({}, cloneState[targetId], {header: cloneState[draggedId].header, content: cloneState[draggedId].content, style: {border: '1px solid blue'}});\n cloneState_[draggedId] = Object.assign({}, cloneState[draggedId], {header: cloneState[targetId].header, content: cloneState[targetId].content});\n this.dropped = true;\n this.dragElement = null;\n this.setState({tree: Object.assign({}, cloneState, cloneState_)});\n }" ]
[ "0.61123204", "0.6081963", "0.5974425", "0.58198386", "0.5803953", "0.57410455", "0.5732408", "0.5727432", "0.5722066", "0.5688679", "0.5679193", "0.5624485", "0.560131", "0.55745864", "0.5566543", "0.5559153", "0.554501", "0.5529941", "0.55170584", "0.5488922", "0.5485738", "0.5482836", "0.5482503", "0.5463682", "0.54552674", "0.5452438", "0.54410166", "0.54410166", "0.54355514", "0.543548", "0.542423", "0.54196346", "0.5410218", "0.5404916", "0.54044765", "0.5400513", "0.5397424", "0.53965443", "0.5392388", "0.5388769", "0.53757286", "0.5352208", "0.5349201", "0.53464216", "0.53244", "0.5322188", "0.53162766", "0.5309161", "0.5295378", "0.5294891", "0.528883", "0.52858096", "0.5282882", "0.52813524", "0.5279544", "0.5278118", "0.52759725", "0.5273179", "0.5265596", "0.5265308", "0.525046", "0.5236594", "0.5235589", "0.52343637", "0.52319527", "0.52307045", "0.5230579", "0.5217671", "0.5215865", "0.52005345", "0.5196369", "0.519586", "0.5194658", "0.51943016", "0.51925", "0.51875615", "0.5185066", "0.5184936", "0.5184241", "0.51772", "0.51750207", "0.5171172", "0.51702017", "0.5168527", "0.5165605", "0.51626563", "0.51606643", "0.515614", "0.5152226", "0.5149393", "0.514835", "0.51460785", "0.5144457", "0.5142791", "0.5138482", "0.51366675", "0.51366675", "0.51366675", "0.51366675", "0.51366675", "0.5131354" ]
0.0
-1
| Procedures in renderNode |
function renderBackground(group, bg, useUpperLabel) { // For tooltip. bg.dataIndex = thisNode.dataIndex; bg.seriesIndex = seriesModel.seriesIndex; bg.setShape({ x: 0, y: 0, width: thisWidth, height: thisHeight }); if (thisInvisible) { // If invisible, do not set visual, otherwise the element will // change immediately before animation. We think it is OK to // remain its origin color when moving out of the view window. processInvisible(bg); } else { bg.invisible = false; var visualBorderColor = thisNode.getVisual('borderColor', true); var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor'); var normalStyle = getItemStyleNormal(itemStyleNormalModel); normalStyle.fill = visualBorderColor; var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); emphasisStyle.fill = emphasisBorderColor; if (useUpperLabel) { var upperLabelWidth = thisWidth - 2 * borderWidth; prepareText(normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, { x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight }); } // For old bg. else { normalStyle.text = emphasisStyle.text = null; } bg.setStyle(normalStyle); graphic.setElementHoverStyle(bg, emphasisStyle); } group.add(bg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_render() {}", "render() {}", "render() {}", "render() {}", "function render() {\n\t\t\n\t}", "render() {\n\n\t}", "render() {\n\n\t}", "render() { }", "function render() {\n\t}", "static rendered () {}", "static rendered () {}", "function render() {\n\n\t\t\t}", "function render() {\n\t\t\t}", "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "render() {\n }", "render() {\n\n }", "render() {\n // Subclasses should override\n }", "render(){\r\n\r\n\t}", "render() {\n\n }", "render() {\n\n }", "render() {\n\n }", "render() {\n }", "render() {\n }", "render(){}", "render(){}", "render() {\n\t\treturn null;\n\t}", "render() {\n\t\treturn (\n\t\t\tnull\n\t\t)\n\t}", "render( ) {\n return null;\n }", "onBeforeRendering() {}", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "onRender () {\n\n }", "render() { return super.render(); }", "render() {\n return null;\n }", "render() {\n return null;\n }", "function general_render(obj) {\n obj.render();\n }", "render(){return renderNotImplemented;}", "afterRender() { }", "afterRender() { }", "renderPrep() {\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\r\n return;\r\n }", "render() {\n return this.renderContent()\n }", "render() {\n return (\n\n\n\n\n\n )\n }", "function render() {\n\t\treturn graphTpl;\n\t}", "onRender()/*: void*/ {\n this.render();\n }", "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank\">${this.linkText}</a>`;\n if (this.action && this.actionText)\n action = html`${anchor ? \" | \" : \"\"}<a href=\"javascript:void(0)\" @click=${this.action}>${this.actionText}</a>`;\n let heading = \"\";\n if (this.heading)\n heading = html`<h4>${this.heading}</h4>`;\n\n render(html`${heading}${paragraph}<div id=\"links\">${anchor}${action}</div>`, this.tooltipElem);\n }", "onAfterRendering() {}", "function RenderEvent() {}", "prepareNodes() {\n const render = (node) => {\n node.html = nodeToHTML(node);\n node.nodesHTML = subnodesToHTML(node.nodes);\n\n const dimensions = getDimensions(node.html, {}, 'mindmap-node');\n node.width = dimensions.width;\n node.height = dimensions.height;\n\n const nodesDimensions = getDimensions(node.nodesHTML, {}, 'mindmap-subnode-text');\n node.nodesWidth = nodesDimensions.width;\n node.nodesHeight = nodesDimensions.height;\n };\n\n this.props.nodes.forEach(node => render(node));\n }", "_firstRendered() { }", "render() {\n return this.renderContent();\n }", "render () {\n throw new Error('render function must be override!')\n }", "function init() { render(this); }", "function render() {\n renderRegistry();\n renderDirectory();\n renderOverride();\n}", "render() {\n return super.render();\n }", "render() { // it is a function ==> render: function() {}\n return (<h1>Hello World!!!!!!!</h1>);\n }", "renderCodeNodes(p_node) {\n this.initialize();\n\n let codeNodes = this.vnotex.getWorker('markdownit').getCodeNodes(null);\n this.doRender(p_node, codeNodes);\n }", "render() {\n return this.renderChildren() || null;\n }", "function EqnNodeRenderer() { }", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "renderPage() {}", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "function TextRenderer(){}// no need for block level renderers", "render(ctx)\n\t{\n\t\tlet camera = this.tree.camera;\n\t\tlet zoom = camera.zoomSmooth;\n\n\t\tlet pos = this.posSmooth.toScreen(camera);\n\t\tlet width = this.width * zoom;\n\t\tlet height = this.height * zoom;\n\t\tlet radius = this.tree.theme.nodeBorderRadius * zoom;\n\t\tlet header = this.tree.theme.nodeHeaderSize * zoom;\n\n\t\tthis.buildNodeShape(ctx, pos, width, height, radius);\n\t\tctx.fillStyle = this.nodeColor;\n\t\tctx.fill();\n\n\t\tthis.buildNodeHeaderShape(ctx, pos, width, height, radius, header);\n\t\tctx.fillStyle = this.nodeHeaderColor;\n\t\tctx.fill();\n\n\t\tthis.buildNodeShape(ctx, pos, width, height, radius);\n\t\tctx.lineWidth = this.tree.theme.nodeBorderThickness * zoom;\n\n\t\tif (this.select)\n\t\t\tctx.strokeStyle = this.tree.theme.nodeBorderSelect;\n\t\telse if (this.hover)\n\t\t\tctx.strokeStyle = this.borderColorHighlight;\n\t\telse\n\t\t\tctx.strokeStyle = this.borderColor;\n\n\t\tctx.stroke();\n\n\t\tfor (let i = 0; i < this.inputPlugs.length; i++)\n\t\t\tthis.inputPlugs[i].render(ctx);\n\n\t\tfor (let i = 0; i < this.outputPlugs.length; i++)\n\t\t\tthis.outputPlugs[i].render(ctx);\n\n\t\tctx.fillStyle = this.tree.theme.headerFontColor;\n\t\tctx.font = this.tree.theme.headerFontSize * zoom + 'px '\n\t\t\t+ this.tree.theme.headerFontFamily;\n\t\tctx.textAlign = 'center';\n\t\tctx.textBaseline = 'middle';\n\t\tctx.fillText(this.name, pos.x + width / 2, pos.y + header / 2 * 1.05);\n\n\t\tthis.input.render(ctx);\n\t}", "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "render() {\n\t\tthis.a1.render(this.context);\n\t\tthis.b1.render(this.context);\n\t\tthis.c1.render(this.context);\n\t\tthis.c2.render(this.context);\n\t\tthis.d1.render(this.context);\n\t\tthis.e1.render(this.context);\n\t\tthis.f1.render(this.context);\n\t\tthis.g1.render(this.context);\n\t\tthis.a1s.render(this.context);\n\t\tthis.c1s.render(this.context);\n\t\tthis.d1s.render(this.context);\n\t\tthis.f1s.render(this.context);\n\t\tthis.g1s.render(this.context);\n\n\t}", "render()\n {\n return super.render();\n }", "renderContent() {\n return null;\n }", "render() {\n const { rootNode, sizeSet } = this;\n let visualIndex = this.visualIndex;\n\n if (this.isSharedViewSet() && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM)) {\n visualIndex += sizeSet.sharedSize.nextSize;\n }\n\n let node = rootNode.childNodes[visualIndex];\n\n if (node.tagName !== this.childNodeType) {\n const newNode = this.nodesPool();\n\n rootNode.replaceChild(newNode, node);\n node = newNode;\n }\n\n this.collectedNodes.push(node);\n this.visualIndex += 1;\n }", "renderHTML() {\n \n }", "sysRender() {\n \n let rendered = this.render();\n \n // If render() returns a String, then insert that as innerHTML in the\n // Part View node. Otherwise, do something else (TODO)\n \n if (typeof rendered === 'string') {\n this.domNode.innerHTML = rendered;\n } else if (false) { // TODO: test for jQuery return, DOM Node object, etc.\n // WHAT? \n }\n }", "render() {\n return \"\";\n }", "render() {\n this.update();\n }", "_displayBlocks() { /////////////////////\n return (\n <ViroNode>\n {this._makeBlocks()}\n </ViroNode>\n )\n }", "render() {\n return renderNotImplemented;\n }", "render() {\n return renderNotImplemented;\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "render() {\n return(\n null\n );\n }", "Render(){\n throw new Error(\"Render() method must be implemented in child!\");\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() { this.screen.render() }", "render() {\n this.renderComponents() // dial + outputs, algedonode, brass pads, strips, lights\n this.renderLabels()\n }", "function render()\n {\n if (me.triggerEvent('renderBefore', data) === false)\n return;\n\n // remove all child nodes\n container.html('');\n\n // render child nodes\n for (var i=0; i < data.length; i++) {\n data[i].level = 0;\n render_node(data[i], container);\n }\n\n me.triggerEvent('renderAfter', container);\n }", "beforeRender() { }", "function render(node) {\n switch (nodeType(node)) {\n case \"text\":\n return document.createTextNode(node);\n case \"element\":\n return renderElement(node);\n case \"component\":\n return renderComponent(node);\n }\n}", "render() {\n return <div>{this.toRender()}</div>;\n }", "function render$2(node, options) {\n if (options === void 0) {options = {};}\n var nodes = \"length\" in node ? node : [node];\n var output = \"\";\n for (var i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}", "static render(context, structure){\n Geonym.drawCircle(context,[0,0],0.8,'#F7F7F7','black');\n }" ]
[ "0.7804213", "0.7781378", "0.7781378", "0.7781378", "0.7779666", "0.7751212", "0.7751212", "0.77304775", "0.76755935", "0.7616766", "0.7616766", "0.76145667", "0.7603221", "0.758931", "0.758931", "0.745217", "0.7431533", "0.7423107", "0.7374434", "0.7340493", "0.7340493", "0.7340493", "0.72634536", "0.72634536", "0.6992544", "0.6992544", "0.68592715", "0.68359864", "0.6789869", "0.6750653", "0.67265904", "0.67258793", "0.66121125", "0.6602825", "0.6602825", "0.65801525", "0.6511582", "0.6501055", "0.6501055", "0.6495352", "0.64787245", "0.64787245", "0.64787245", "0.64787245", "0.64787245", "0.64787245", "0.6468586", "0.64564097", "0.6436266", "0.6413203", "0.6412377", "0.6398316", "0.6395279", "0.6393413", "0.6387152", "0.6381992", "0.6378925", "0.63527465", "0.63489735", "0.63251966", "0.62961876", "0.6289933", "0.6279074", "0.6277934", "0.62765634", "0.6274515", "0.6267178", "0.62560886", "0.62560886", "0.6256011", "0.6253522", "0.62448025", "0.62375265", "0.62171286", "0.6195543", "0.61860883", "0.6180479", "0.61792755", "0.6163515", "0.61631316", "0.6158166", "0.6158105", "0.6158105", "0.61437947", "0.61437947", "0.61437947", "0.61437947", "0.61233044", "0.61209935", "0.6115692", "0.61116487", "0.61116487", "0.61116487", "0.61007917", "0.6099842", "0.609954", "0.6058785", "0.6050183", "0.6049489", "0.6039374", "0.6038059" ]
0.0
-1
otherwise it will looks strange when 'zoomToNode'.
function prepareAnimationWhenNoOld(lasts, element, storageName) { var lastCfg = lasts[thisRawIndex] = {}; var parentNode = thisNode.parentNode; if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { var parentOldX = 0; var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation. // For convenience, get old bounding rect from background. var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; if (!reRoot && parentOldBg && parentOldBg.old) { parentOldX = parentOldBg.old.width; parentOldY = parentOldBg.old.height; } // When no parent old shape found, its parent is new too, // so we can just use {x:0, y:0}. lastCfg.old = storageName === 'nodeGroup' ? [0, parentOldY] : { x: parentOldX, y: parentOldY, width: 0, height: 0 }; } // Fade in, user can be aware that these nodes are new. lastCfg.fadein = storageName !== 'nodeGroup'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoom(node){\n\tif (node.zoomed) {\n\t\tupdate(node.prev);\t\t// zoom out to the previous node;\n\t\tprev = node.prev;\t\t// set prev to the node that you zoomed out to\n\t\tnode.zoomed = false;\n\t} else {\n\t\tupdate(node);\t\t\t// zoom to the clicked node\n\t\tnode.zoomed = true;\n\n\t\tif (prev) {\n\t\t\tnode.prev = prev;\n\t\t}\n\t\telse {\n\t\t\tvar index = visibleGraphs.indexOf(node.graph);\n\t\t\tnode.prev = visibleRoots[index];\n\t\t}\n\t\tprev = node;\t\t\t// set prev to the node that you zoomed to\n\t}\n}", "function zoom_actions() {\n inner.attr('transform', d3.zoomTransform(svg.node()));\n }", "zoomIn () {}", "function zoom_actions() {\r\n\r\n var transform = d3.event.transform;\r\n g.attr(\"transform\", transform.toString())\r\n d3.selectAll('.zoomed-node-text')\r\n .style('font-size', d => font_size(d.freq) / transform.k)\r\n .style(\"stroke-width\", function (d) { return font_size(d.freq) * .015 / transform.k; })\r\n .style('opacity', d => {\r\n return font_size(d.freq) * transform.k < 18 ? 0 : 1;\r\n })\r\n\r\n \r\n\r\n if (transform.k < 1.5) {\r\n }\r\n else {\r\n var hull = d3.selectAll('.edgelabel_d')\r\n hull.attr(\"visibility\", \"visible\")\r\n\r\n }\r\n\r\n\r\n }", "function zoomed() {\n\td3.selectAll(\".nodes\").attr(\"transform\", d3.event.transform)\n\td3.selectAll(\".links\").attr(\"transform\", d3.event.transform)\n}", "function naturalZoom() {\n let scale = d3.event.scale,\n translation = d3.event.translate;\n\n translation = [translation[0] + (marginLeft * scale), translation[1] + ((windowHeight / 2 - rootH / 2 - startNodeOffsetY) * scale)];\n\n svgGroup.attr(\"transform\", \"translate(\" + translation + \")scale(\" + scale + \")\");\n\n scope.workflowZoomed({\n zoom: scale\n });\n }", "function zoom_actions() {\r\n\r\n var transform = d3.event.transform;\r\n g.attr(\"transform\", transform.toString())\r\n d3.selectAll('.node-text')\r\n .style('font-size', d => font_size(d.freq) / transform.k)\r\n .style(\"stroke-width\", function (d) { return font_size(d.freq)*.015/transform.k;})\r\n\r\n .style('opacity', d => {\r\n return font_size(d.freq) * transform.k < 18 ? 0 : 1;\r\n })\r\n /* svg.selectAll(\".legend\")\r\n .attr(\"transform\",transform.toString())*/\r\n\r\n\r\n\r\n if (transform.k < 1.5) {\r\n }\r\n else {\r\n var hull = d3.selectAll('.edgelabel')\r\n hull.attr(\"visibility\", \"visible\")\r\n\r\n }\r\n\r\n\r\n }", "refreshZoom() {}", "zoomToFit() {\n const heightZoom = this.dims.height / this.graphDims.height;\n const widthZoom = this.dims.width / this.graphDims.width;\n let zoomLevel = Math.min(heightZoom, widthZoom, 1);\n if (zoomLevel < this.minZoomLevel) {\n zoomLevel = this.minZoomLevel;\n }\n if (zoomLevel > this.maxZoomLevel) {\n zoomLevel = this.maxZoomLevel;\n }\n if (zoomLevel !== this.zoomLevel) {\n this.zoomLevel = zoomLevel;\n this.updateTransform();\n this.zoomChange.emit(this.zoomLevel);\n }\n }", "zoomOut () {}", "function zoomChart() {\n transform = d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].transform;\n zoom_first = true; //Deactivate any mousover events during a zoom&pan event\n\n mouse_zoom_rect.on('mousemove', null).on('mouseout', null).on('click', null);\n hideTooltip();\n node_hover.style('display', 'none'); //Hide the rotating dots around hovered circle (if active)\n //Recalculate the node locations & attributes\n\n nodes.forEach(function (d) {\n var _transform$apply = transform.apply([d.x_fixed, d.y_fixed]),\n _transform$apply2 = Object(_babel_runtime_corejs2_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_transform$apply, 2),\n x = _transform$apply2[0],\n y = _transform$apply2[1];\n\n d.x = x;\n d.y = y;\n d.r = d.r_fixed * transform.k;\n if (d.type === 'element') d.r *= zoom_node_increase(transform.k); //Update the stroke weight to appear to get bigger on zoom in, except for the elements\n\n if (d.type !== 'element') d.stroke_width = d.stroke_width_fixed * transform.k; //https://stackoverflow.com/questions/23759457\n //Find a first guess for the font-size\n\n var font_size = roundTo((d.r - d.stroke_width) / 2.5 * (10 / (d.label.length + 1)), 2);\n\n if (d.type === 'concept' && d.r > 10 && font_size > 6) {\n // let old = font_size\n var font_width = (d.r - d.stroke_width) * 2 * (d.label.length >= 10 ? 0.7 : 0.75);\n var step = font_size < 8 ? 0.2 : 0.5; //Find a font-size that fits the circle\n\n font_size = roundTo(fitTextInCircle(ctx_nodes, d.label, Math.round(font_size) + 4, font_width, step), 2);\n } //if\n\n\n if (d.group !== 'biome') d.font_size = font_size;else d.font_size = 20 * transform.k;\n }); //forEach\n //Redraw the \"+\" icon\n\n if (click_active) renderClickIcon(current_click);else node_modal_group.style('display', 'none'); //Calculate new edge drawing variables\n\n if (edges_selected.length > 0) {\n calculateEdgeCenters(edges_selected);\n calculateEdgeGradient(edges_selected);\n } //if\n //Draw the nodes & edges\n\n\n drawSelected(); //Draw the possible hovered node as well\n\n if (current_hover) {\n drawHoveredNode(current_hover);\n showTooltip(current_hover);\n\n if (click_active) {\n //Draw rotating circle around the hovered node\n drawDottedHoverCircle(current_hover);\n } //if\n\n } //if\n\n } //function zoomChart", "static set niceMouseDeltaZoom(value) {}", "function resetZoom() {\n zoom.scale(1);\n zoom.translate([0, 0]);\n svg.transition().duration(300).attr('transform', 'translate(' + zoom.translate() + ') scale(' + zoom.scale() + ')')\n}", "function zoom_actions(){\r\n circles.attr(\"transform\", d3.event.transform);\r\n zoomed();\r\n}", "function zoomChart() {\n transform = d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].transform;\n zoom_first = true; //Deactivate any mousover events during a zoom&pan event\n\n mouse_zoom_rect.on('mousemove', null).on('mouseout', null).on('click', null);\n hideTooltip();\n node_hover.style('display', 'none'); //Hide the rotating dots around hovered circle (if active)\n //Recalculate the node locations & attributes\n\n nodes.forEach(function (d) {\n var _transform$apply = transform.apply([d.x_fixed, d.y_fixed]),\n _transform$apply2 = Object(_babel_runtime_corejs2_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_transform$apply, 2),\n x = _transform$apply2[0],\n y = _transform$apply2[1];\n\n d.x = x;\n d.y = y;\n d.r = d.r_fixed * transform.k;\n if (d.type === 'element') d.r *= zoom_node_increase(transform.k); //Update the stroke weight to appear to get bigger on zoom in, except for the elements\n\n if (d.type !== 'element') d.stroke_width = d.stroke_width_fixed * transform.k; //https://stackoverflow.com/questions/23759457\n //Find a first guess for the font-size\n\n var font_size = roundTo((d.r - d.stroke_width) / 2.5 * (10 / (d.label.length + 1)), 2); //When it actually seems to be drawn, find a better guess\n\n if (d.type === 'concept' && d.r > 10 && font_size > 6) {\n // let old = font_size\n var font_width = (d.r - d.stroke_width) * 2 * (d.label.length >= 10 ? 0.7 : 0.75);\n var step = font_size < 8 ? 0.2 : 0.5; //Find a font-size that fits the circle\n\n font_size = roundTo(fitTextInCircle(ctx_nodes, d.label, Math.round(font_size) + 4, font_width, step), 2);\n } //if\n\n\n d.font_size = font_size;\n }); //forEach\n // //Resize the community test circles\n // community_count.forEach(d => {\n // let [x, y] = transform.apply([d.x_fixed,d.y_fixed])\n // d.x = x\n // d.y = y\n // d.r = d.r_fixed * transform.k\n // })//forEach\n //Redraw the \"+\" icon\n\n if (click_active) renderClickIcon(current_click);else node_modal_group.style('display', 'none'); //Calculate new edge drawing variables\n\n if (edges_selected.length > 0) {\n calculateEdgeCenters(edges_selected);\n calculateEdgeGradient(edges_selected);\n } //if\n //Draw the nodes & egdes\n\n\n drawSelected(); //Draw the possible hovered node as well\n\n if (current_hover) {\n drawHoveredNode(current_hover);\n showTooltip(current_hover);\n\n if (click_active) {\n //Draw rotating circle around the hovered node\n drawDottedHoverCircle(current_hover);\n } //if\n\n } //if\n\n } //function zoomChart", "zoomOutViewLevel () {\n if (this.currentGraph) {\n const currentViewLength = this.currentView ? this.currentView.length : 0;\n\n if (this.currentGraph && this.currentGraph.highlightedNode) {\n this.setHighlightedNode(undefined);\n } else if (currentViewLength > 0) {\n this.currentView = this.currentView.slice(0, -1);\n this.setView(this.currentView);\n }\n }\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", "zoomTo(element) {\n //calculate the zooming and panning parameters needed\n let bounds = element.node().getBBox();\n let parent = element.node().parentElement;\n let width = bounds.width,\n height = bounds.height;\n let midX = bounds.x + width / 2,\n midY = bounds.y + height / 2;\n if (width == 0 || height == 0) return; // nothing to fit\n let scale = Math.max(.01, Math.min(5, 0.85 / Math.max(width / this.width, height / this.height)));\n let translate = [this.width / 2 - scale * midX, this.height / 2 - scale * midY];\n\n //if the element is empty, don't zoom or pan\n if(bounds.width == 0 || bounds.height == 0) {\n return;\n }\n\n //perform the zooming and panning\n this.svg.transition().duration(750).call(this.zoom.transform, d3.zoomIdentity.translate(translate[0], translate[1]).scale(scale));\n }", "function increaseZoom() {\n var increaseZoomOriginalSize = 1.1;\n mainDiagram.commandHandler.increaseZoom(increaseZoomOriginalSize);\n}", "function zoomActual()\n\t{\n\t\t_3dApp.script(_scriptGen.zoom(_options.defaultZoom));\n\t}", "function zoomed() {\n\t\tgraphContainer.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n\t}", "function zoom_actions(){\n g.attr(\"transform\", d3.event.transform)\n }", "function zoom() {\n\t\t\t var trans = d3.event.translate,\n\t\t scale = Math.min(6, Math.max(d3.event.scale, 2));\n\n\t\t var svgWidth = parseInt(d3.select(importedNode).attr(\"width\"));\n\t \t\tvar svgHeight = parseInt(d3.select(importedNode).attr('height'));\n\t \t\tvar xBound = (svgWidth - (width / scale)) * scale;\n\t \t\tvar yBound = (svgHeight - (height / scale)) * scale;\n\n\t\t var tx = Math.min(0, Math.max(xBound * -1, trans[0]));\n\t\t var ty = Math.min(0, Math.max(yBound * -1, trans[1]));\n\t\t\t g.attr(\"transform\", \"translate(\" + tx + \", \" + ty + \")scale(\" + d3.event.scale + \")\");\n\t\t\t zoomBehavior.translate([tx, ty]);\n\t\t}", "function zoom() {\n //console.log(\"zoom\");\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function handleZoom(e) {\n // Limit panning so the visualization remains on the screen.\n // TODO: Redo this as part of the d3.zoom() call above: http://bl.ocks.org/garrilla/11280861.\n if (e.transform.x > width * 0.5) {\n e.transform.x = width * 0.5;\n }\n if (e.transform.y > height * 0.05) {\n e.transform.y = height * 0.05;\n }\n currentZoom = e.transform;\n d3.select(\"svg g\")\n .attr(\"transform\", e.transform);\n}", "function performManualZoom(node, zoom_level) {\n //Set the \"selected\" node\n found = node; //Set the new final location\n //Based on https://bl.ocks.org/mbostock/b783fbb2e673561d214e09c7fb5cedee\n\n var new_zoom = d3__WEBPACK_IMPORTED_MODULE_6__[\"zoomIdentity\"].scale(zoom_level).translate(-node.x_fixed, -node.y_fixed); //Zoom into the node with transition\n //The variable zoom_duration comes from the zoom function\n\n mouse_zoom_rect.transition().duration(zoom_duration).call(zoom.transform, new_zoom).on('end', function () {\n setMouseClick(node);\n });\n } //function performManualZoom", "function performManualZoom(node, zoom_level) {\n //Set the \"selected\" node\n found = node; //Set the new final location\n //Based on https://bl.ocks.org/mbostock/b783fbb2e673561d214e09c7fb5cedee\n\n var new_zoom = d3__WEBPACK_IMPORTED_MODULE_6__[\"zoomIdentity\"].scale(zoom_level).translate(-node.x_fixed, -node.y_fixed); //Zoom into the node with transition\n //The variable zoom_duration comes from the zoom function\n\n mouse_zoom_rect.transition().duration(zoom_duration).call(zoom.transform, new_zoom).on('end', function () {\n setMouseClick(node);\n });\n } //function performManualZoom", "function manualZoom(zoom) {\n let scale = zoom / 100,\n translation = zoomObj.translate(),\n origZoom = zoomObj.scale(),\n unscaledOffsetX = (translation[0] + ((windowWidth * origZoom) - windowWidth) / 2) / origZoom,\n unscaledOffsetY = (translation[1] + ((windowHeight * origZoom) - windowHeight) / 2) / origZoom,\n translateX = unscaledOffsetX * scale - ((scale * windowWidth) - windowWidth) / 2,\n translateY = unscaledOffsetY * scale - ((scale * windowHeight) - windowHeight) / 2;\n\n svgGroup.attr(\"transform\", \"translate(\" + [translateX + (marginLeft * scale), translateY + ((windowHeight / 2 - rootH / 2 - startNodeOffsetY) * scale)] + \")scale(\" + scale + \")\");\n zoomObj.scale(scale);\n zoomObj.translate([translateX, translateY]);\n }", "function zoomed(event) {\n // Get the transform\n var transform = event.transform;\n var scale = event.transform.k;\n\n // THis is geometric re-scale:\n // (but note: CSS prevents lines from scaling)\n g.attr(\"transform\", event.transform);\n g.attr(\"scale\", scale.toString());\n\n // EK While looking at issue #510, #511, I saw that the code below\n // causes the 'hover' effect to disappear, which is a pity\n //\n // EK Possibly remove completely in time??\n //\n //link.style(\"stroke-width\", function (d) {\n // var width;\n // // Issue #510: used to be:\n // //width = widthrange(d.value);\n // width = fixed_width;\n // return width;\n //});\n //\n //link.style(\"stroke\", function (d) {\n // var m = ru.passim.seeker.overlap_stroke(d);\n // return m;\n //});*/\n\n // Make sure that the circle retain their size by dividing by the scale factor\n node.selectAll(\"circle\")\n .attr(\"r\", function (d) {\n var iSize = get_radius(d);\n return iSize / scale;\n })\n .attr(\"stroke-width\", function (d) {\n return 3 / scale;\n });\n node.selectAll(\"text\")\n .attr(\"x\", function (d) {\n var x = (-1 * (get_width(d) / Math.sqrt( scale)) / 2); // * scale;\n return x.toString();\n })\n .attr(\"y\", function (d) {\n var y = 2 + (4 * get_radius(d) / Math.sqrt(scale)); // * scale;\n return y.toString();\n })\n .style(\"font-size\", function (d) {\n var iSize = 2 + Math.round( 14 / scale);\n return (scale < 1) ? \"14px\" : iSize.toString() + \"px\";\n });\n\n // Semantic rescale: just the size of the circles\n //g.selectAll(\"circle\")\n // .attr('transform', event.transform);\n }", "resetZoom() {\n this.simcirWorkspace.zoom(false, 1);\n }", "zoomOut(e){\n // |--- check\n if(!(this.zoomLevel>1)) return;\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\n\n // |--- Align if out of border\n let\n viewChunkHr, viewChunkVr;\n\n if( this.x>0 ){\n this.x = 0;\n } else if( this.x<0 ){\n viewChunkHr = (this.refSvgContainer.offsetWidth*this.zoomCef) - Math.abs(this.x);\n\n if(viewChunkHr<this.refMap.offsetWidth){\n this.x = -((this.refSvgContainer.offsetWidth*this.zoomCef) - this.refMap.offsetWidth);\n }\n }\n\n if( this.y>0 ){\n this.y = 0;\n } else if( this.y<0 ){\n viewChunkVr = (this.refSvgContainer.offsetHeight*this.zoomCef) - Math.abs(this.y);\n\n if(viewChunkVr< this.refMap.offsetHeight){\n this.y = -((this.refSvgContainer.offsetHeight*this.zoomCef) - this.refMap.offsetHeight);\n }\n }\n }", "function mouseZoomAllTheWayIn() {\n expectLT(TimelineGraphView.MIN_SCALE, graphView().scale_);\n while (graphView().scale_ !== TimelineGraphView.MIN_SCALE) {\n mouseZoomIn(8);\n }\n // Verify that zooming in when already at max zoom works.\n mouseZoomIn(1);\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function resetBig() {\n svg.transition().duration(750).call(\n zoomBig.transform,\n d3.zoomIdentity.scale(0.55),\n d3.zoomTransform(svg.node()).invert([width / 2, height / 2])\n );\n }", "function zoomed(event) {\n // Get the transform\n var transform = event.transform;\n var scale = event.transform.k;\n\n // THis is geometric re-scale:\n // (but note: CSS prevents lines from scaling)\n g.attr(\"transform\", event.transform);\n\n link.style(\"stroke-width\", function (d) {\n return Math.sqrt(2 * d.value);\n });\n\n node.style(\"stroke-width\", function (d) {\n return 1 / scale;\n });\n node.attr(\"r\", function (d) {\n var scount = d.scount;\n var iSize = Math.max(10, scount / 2);\n return iSize /scale;\n });\n\n // Semantic rescale: just the size of the circles\n //g.selectAll(\"circle\")\n // .attr('transform', event.transform);\n }", "function zoomed() {\n\n var zoom_x = d3.event.scale,\n zoom_y = d3.event.scale,\n trans_x = d3.event.translate[0] - params.viz.clust.margin.left,\n trans_y = d3.event.translate[1] - params.viz.clust.margin.top;\n\n // apply transformation\n apply_transformation(trans_x, trans_y, zoom_x, zoom_y);\n }", "function ZoomableView() { }", "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 }", "static get niceMouseDeltaZoom() {}", "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "function zoom() {\n svgGroup.attr(\"transform\", `translate(${d3.event.translate})scale(${d3.event.scale})`);\n }", "function zoom() {\n var translate = d3.event.translate,\n scale = d3.event.scale;\n svg.attr(\"transform\", \"translate(\" + translate + \")scale(\" + d3.event.scale + \")\");\n }", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function zoomed(event) {\n // Get the transform\n var transform = event.transform;\n var scale = event.transform.k;\n\n // THis is geometric re-scale:\n // (but note: CSS prevents lines from scaling)\n g.attr(\"transform\", event.transform);\n\n link.style(\"stroke-width\", function (d) {\n return Math.sqrt(2 * d.value) / scale;\n });\n\n // Make sure that the circle retain their size by dividing by the scale factor\n node.selectAll(\"circle\")\n .attr(\"r\", function (d) {\n var scount = d.scount;\n var iSize = Math.max(10, scount / 2);\n return iSize / scale;\n })\n .attr(\"stroke-width\", function (d) {\n return 3 / scale;\n });\n node.selectAll(\"text\")\n .attr(\"x\", function (d) {\n var scount = d.scount;\n var iSize = Math.max(10, scount / 2);\n return iSize / scale;\n })\n .style(\"font-size\", function (d) {\n var iSize = Math.round(14 / scale);\n return (scale < 1) ? \"14px\" : iSize.toString() + \"px\";\n });\n\n }", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoomTo(event) {\n\n\t\tsetTimeout(function() {\n\t\t\tif ($('.magazine-viewport').data().regionClicked) {\n\t\t\t\t$('.magazine-viewport').data().regionClicked = false;\n\t\t\t} else {\n\t\t\t\tif ($('.magazine-viewport').zoom('value')==1) {\n\t\t\t\t\t$('.magazine-viewport').zoom('zoomIn', event);\n\t\t\t\t} else {\n\t\t\t\t\t$('.magazine-viewport').zoom('zoomOut');\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1);\n\n}", "zoomOut() {\n this.zoom *= 0.8;\n }", "function zoomTo(event) {\n\tsetTimeout(function() {\n\t\tif ($('.magazine-viewport').data().regionClicked) {\n\t\t\t$('.magazine-viewport').data().regionClicked = false;\n\t\t} else {\n\t\t\tif ($('.magazine-viewport').zoom('value') == 1) {\n\t\t\t\t$('.magazine-viewport').zoom('zoomIn', event);\n\t\t\t} else {\n\t\t\t\t$('.magazine-viewport').zoom('zoomOut');\n\t\t\t}\n\t\t}\n\t}, 1);\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 zoom() {\n $scope.svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function renderZoom(){\n // zoom_wrapper = new createjs.Container();\n // zoom_wrapper.alpha=0;\n // var selection = new createjs.Shape();\n // selection.graphics.clear().s(\"#4A90E2\").ss(1,\"round\").beginFill(\"#ECF3FC\").drawRect(0,0,width,options.zoom.targetHeight);\n // pointer = new createjs.Shape();\n // pointer.graphics.clear().s(\"#4A90E2\").ss(1,\"round\").moveTo(0,options.zoom.targetHeight/2);\n // pointer.graphics.lineTo(5,options.zoom.targetHeight/2);\n // pointerLabel = new createjs.Text(\"ggg\", \"11px Ubuntu Condensed\", \"#4A90E2\");\n // pointerLabel.x = 7;\n // pointerLabel.y = (options.zoom.targetHeight/2)-6;\n // zoom_wrapper.addChild(selection,pointer,pointerLabel);\n // stage.addChild(zoom_wrapper);\n // stage.addEventListener(\"mouseleave\", handleMouseLeave);\n // stage.addEventListener(\"mouseenter\", handleMouseEnter);\n\n zoomControl = new zoom();\n\n}", "zoomIn(x, y){ return this.zoom(x, y, this.Scale.current + this.Scale.factor) }", "zoomIn() {\n this.zoom *= 1.25;\n }", "function setZoom() {\n if(zoom == 2.0) {\n\t\tzoom = 1.0;\n\t} else {\n\t\tzoom = 2.0;\n\t}\n}", "zoomMap() {\n PaintGraph.Pixels.zoomExtent(this.props.map, this.props.bbox)\n window.refreshTiles()\n window.updateTiles()\n }", "function AdjustZoomLevel() {\n\tcurrentZoomLevel = map.getZoom();\n}", "zoomSvg (d3Event) {\n if (d3Event.deltaY > 0) {\n this.currentZoom -= this.currentZoom > 0.3 ? 0.2 : 0\n } else {\n this.currentZoom += this.currentZoom < 1.6 ? 0.2 : 0\n }\n this.svg.attr('transform', 'translate(' + this.movement.x + ' ' + this.movement.y + ') scale(' + this.currentZoom + ' ' + this.currentZoom + ')')\n }", "function zoomed() {\n tmSvgGroup.attr(\"transform\", d3.event.transform);\n}", "zoomTo(level) {\n this.transformationMatrix.a = isNaN(level) ? this.transformationMatrix.a : Number(level);\n this.transformationMatrix.d = isNaN(level) ? this.transformationMatrix.d : Number(level);\n this.zoomChange.emit(this.zoomLevel);\n this.updateTransform();\n this.update();\n }", "function zoom() {\n div.transition().duration(0).style(\"opacity\", 0);\n div2.transition().duration(0).style(\"opacity\", 0);\n div3.transition().duration(0).style(\"opacity\", 0);\n div.attr(\"style\", \"zoom:\" + (+ d3.event.scale * 100) + \"%\" );\n div2.attr(\"style\", \"zoom:\" + (+ d3.event.scale * 100) + \"%\");\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\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 zoom(root, p) {\n if (document.documentElement.__transition__) return;\n\n //console.log(root, p);\n\n // Rescale outside angles to match the new layout.\n var enterArc,\n exitArc,\n outsideAngle = d3.scale.linear().domain([0, 2 * Math.PI]);\n\n function insideArc(d) {\n //debugger\n return p.key > d.key\n ? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key\n ? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}\n : {depth: 0, x: 0, dx: 2 * Math.PI};\n }\n\n function outsideArc(d) {\n return {depth: d.depth + 1, x: outsideAngle(d.x), dx: outsideAngle(d.x + d.dx) - outsideAngle(d.x)};\n }\n\n center.datum(root);\n\n // When zooming in, arcs enter from the outside and exit to the inside.\n // Entering outside arcs start from the old layout.\n if (root === p) enterArc = outsideArc, exitArc = insideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\n path = path.data(_private.partition.nodes(root).slice(1), function(d) { return d.key; });\n\n // When zooming out, arcs enter from the inside and exit to the outside.\n // Exiting outside arcs transition to the new layout.\n if (root !== p) enterArc = insideArc, exitArc = outsideArc, outsideAngle.range([p.x, p.x + p.dx]);\n\n d3.transition().duration(d3.event.altKey ? 7500 : 750).each(function() {\n path.exit().transition()\n .style(\"fill-opacity\", function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })\n .attrTween(\"d\", function(d) { return _private.arcTween.call(this, exitArc(d)); })\n .each(function(d, i) {\n //console.log('start', this, i, d)\n d3.select('text.pathLabel').remove();\n d3.select('path.helperPath').remove();\n d3.select(this).select(\"title\").remove();\n })\n .remove();\n\n path.enter().append(\"path\")\n .style(\"fill-opacity\", function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })\n .style(\"fill\", function(d) { return d.fill; })\n .on(\"click\", zoomIn)\n .each(function(d) { this._current = enterArc(d); });\n\n path.transition()\n .style(\"fill-opacity\", 1)\n .attrTween(\"d\", function(d) { return _private.arcTween.call(this, _private.updateArc(d)); })\n .each('start', function(d, i) {\n //console.log('start', this, i, d)\n d3.select('text.pathLabel').remove();\n d3.select('path.helperPath').remove();\n d3.select(this).select(\"title\").remove();\n })\n .each('end', render);\n });\n }", "function zoomIn() {\n svgElementRef.current.transition().call(svgZoomRef.current.scaleBy, 2);\n setSelectedFocusView(null);\n resetSelectedUnits();\n }", "function zoomChartEnd() {\n //Only do this if there was an actual zoom/pan first and not a click\n if (!zoom_first) return;\n zoom_first = false; //Calculate new edge drawing variables\n\n calculateEdgeCenters(edges);\n calculateEdgeGradient(edges); //Redraw modal icon\n\n if (click_active) renderClickIcon(current_click); //Reset some of the mouse events\n\n mouse_zoom_rect.on('mousemove', mouseMoveChart).on('click', mouseClickChart); //If a node is not clicked or hovered, reset\n\n if (!click_active && !current_hover) {\n //Draw the nodes and edges as normal\n mouseOutNode(); //Reset the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n });\n } else {\n //Draw the previously selected nodes\n drawSelected(); //If no query multi-node-fix is active, draw hidden edges as well\n\n if (!(click_active && current_click === 'multi')) drawHiddenEdges(found); //Draw the possible hovered node as well\n\n if (current_hover) {\n drawHoveredNode(current_hover);\n showTooltip(current_hover);\n\n if (click_active) {\n //Draw rotating circle around the hovered node\n drawDottedHoverCircle(current_hover);\n } //if\n\n } //if\n\n } //else\n\n } //function zoomChartEnd", "function zoomChartEnd() {\n //Only do this if there was an actual zoom/pan first and not a click\n if (!zoom_first) return;\n zoom_first = false; //Calculate new edge drawing variables\n\n calculateEdgeCenters(edges);\n calculateEdgeGradient(edges); //Redraw modal icon\n\n if (click_active) renderClickIcon(current_click); //Reset some of the mouse events\n\n mouse_zoom_rect.on('mousemove', mouseMoveChart).on('click', mouseClickChart); //If a node is not clicked or hovered, reset\n\n if (!click_active && !current_hover) {\n //Draw the nodes and edges as normal\n mouseOutNode(); //Reset the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n });\n } else {\n //Draw the previously selected nodes\n drawSelected(); //If no query multi-node-fix is active, draw hidden edges as well\n\n if (!(click_active && current_click === 'multi')) drawHiddenEdges(found); //Draw the possible hovered node as well\n\n if (current_hover) {\n drawHoveredNode(current_hover);\n showTooltip(current_hover);\n\n if (click_active) {\n //Draw rotating circle around the hovered node\n drawDottedHoverCircle(current_hover);\n } //if\n\n } //if\n\n } //else\n\n } //function zoomChartEnd", "function zoomer() {\n if ($('#update_workspace_button').data('locked') == false) {\n //document.getElementsByClassName('hasSVG')[1].style.transformOrigin = 'center top';\n //d3svg.style(\"background-color\", \"green\");\n if (global_zoomstart_yes == false) {\n global_zoomstart_yes = true;\n console.log(\"Penguins are good.\");\n // d3.event.transform.k = global_graph_scale;\n };\n // Find the center of the on-screen SVG, which should be the focus of our zoom\n var crect = d3svg.node().parentNode.getBoundingClientRect();\n var pt = d3svg.node().createSVGPoint();\n pt.x = crect.x + (crect.width / 2);\n pt.y = crect.y + (crect.height / 2);\n var svgpt = pt.matrixTransform(d3svg.node().getScreenCTM().inverse())\n // debug\n // d3svg.append('circle').attr('cx', svgpt.x).attr('cy', svgpt.y).attr('r', 3).attr('fill', 'red');\n\n // // Hint taken from https://stackoverflow.com/questions/6711610/\n var sf = slider.property(\"value\");\n // // var matrix = [sf, 0, 0, sf, svgpt.x - (sf * svgpt.x), svgpt.y - (sf * svgpt.y)];\n // // var transform = 'matrix(' + matrix.join(\" \") + ')';\n // var transform = 'translate(-' + svgpt.x + ', -' + svgpt.y + ')';\n // transform += ' scale(' + slider.property(\"value\") + ') ';\n // transform += 'translate(' + svgpt.x + ', ' + svgpt.y + ')';\n // d3svg.attr('transform', transform);\n // // d3svg.attr('transform-origin', svgpt.x + \" \" + svgpt.y);\n d3svg.attr('transform', 'scale(' + sf + ')');\n\n var coords = [svgpt.x, svgpt.y];\n // This next bit grabs the coordinates relative to the container, which are used to \"neaten up\" the final pan.\n var coords2 = [pt.x, pt.y];\n percLR = coords2[0]\n percUD = coords2[1]\n //global_zoomstart_yes\n if (text_direction == 'BI') {\n // Locked pan to centre of X Axis\n var gwit = svg_root_element.getBoundingClientRect().width;\n crect.scrollTo({\n left: (gwit - crect.width) / 2\n });\n // Panning zoom in Y Axis\n console.log(\"Mouse coords at \" + coords[1]);\n var ghighA = svg_root_element.getBoundingClientRect().height; // Real height\n var ghighB = svg_root_element.getBBox().height; // Internal height\n var yval = coords[1] //This gives us INTERNAL Y coord\n var percy = yval / ghighB //This gives us the % of the way along the Y axis\n var realy = percy * ghighA\n console.log(\"True graph height is \" + ghighA + \", internal height is \" + ghighB);\n console.log(\"Internal Y is \" + yval + \", percent is \" + percy + \", real point to scroll to is \" + realy);\n $(\"div #svgenlargement\").scrollTop(realy - percUD);\n } else {\n // Panning zoom in X Axis, no need to change Y axis\n // Get the scale factor of the internal width vs. DOM with of the SVG\n var scrollScale = svg_root.getBoundingClientRect().width / svg_root.getBBox().width;\n // Apply this factor to the SVG center point, offsetting half the width of the box\n svg_root.parentNode.scrollTo({\n left: (svgpt.x * scrollScale) - (crect.width / 2)\n })\n }\n\n }\n}", "function resetZoom() {\n window.gsc = 0.9;\n window.desired_gsc = 0.9;\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 }", "_zoomEventListener() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n // ZOOM LISTENER\r\n d3.select('.zoom-display').on('keyup', function () {\r\n if (that.zoomState == false) return false;\r\n let zoom = d3.select(this).property('value') / 100;\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).y;\r\n let newK = zoom\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n })\r\n\r\n\r\n d3.selectAll('[data-zoom]').on('click', function () {\r\n if (that.zoomState == false) return false;\r\n\r\n let zoom = d3.select(this).attr('data-zoom');\r\n\r\n switch (zoom) {\r\n case \"35\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.35), (that.canvasSize.height * 0.35)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.35), (that.canvasSize.height * 0.35)).y;\r\n let newK = 0.35\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(35);\r\n }\r\n break;\r\n case \"50\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.5), (that.canvasSize.height * 0.5)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.5), (that.canvasSize.height * 0.5)).y;\r\n let newK = 0.5\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(50);\r\n }\r\n break;\r\n case \"100\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).y;\r\n let newK = 1\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(100);\r\n }\r\n break;\r\n case \"200\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 2), (that.canvasSize.height * 2)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 2), (that.canvasSize.height * 2)).y;\r\n let newK = 2\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(200);\r\n }\r\n break;\r\n case \"fit\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).y;\r\n let newK = 1\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(200);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n })\r\n\r\n // ZOOM STATE\r\n d3.select('#zoom-state').on('click', function () {\r\n let element = d3.select(this);\r\n let state = element.attr('data-zoom-state');\r\n if (state === 'enable') {\r\n that.zoomState = false;\r\n that.svg.on('.zoom', null);\r\n element.attr('data-zoom-state', 'disable');\r\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-disable.svg`);\r\n } else {\r\n that.zoomState = true;\r\n that.svg.call(that.zoom)\r\n that.zoom.transform(that.canvas, d3.zoomIdentity.translate(that.zoomData.x, that.zoomData.y).scale(that.zoomData.k));\r\n element.attr('data-zoom-state', 'enable');\r\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-enable.svg`);\r\n }\r\n })\r\n\r\n }", "function zoomonuser(){\r\n var name = document.getElementById(\"searchuser\").value;\r\n const getNode = id => {\r\n return data.nodes.find(node => node.name === name);\r\n }\r\n var nodeathand = getNode(name)\r\n Graph.centerAt(nodeathand.x, nodeathand.y, 1000);Graph.zoom(8, 2000);\r\n }", "zoomOut() {\n this.zoomWithScaleFactor(2.0)\n }", "function centerNode(source) {\n var t = d3.zoomTransform(svg.node());\n var x = -source.y0;\n var y = -source.x0;\n x = x * t.k + width / 2;\n y = y * t.k + height / 2;\n d3.select('svg')\n .transition()\n .duration(duration)\n .call( zoom.transform, d3.zoomIdentity.translate(x,y).scale(t.k) );\n }", "function centerNode(source) {\n scale = zoomListener.scale();\n x = - source.y0;\n y = - source.x0;\n x = x * scale + viewerWidth / 2;\n y = y * scale + viewerHeight / 2;\n d3.select('g').transition()\n .duration(duration)\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + scale + \")\");\n zoomListener.scale(scale);\n zoomListener.translate([x, y]);\n }", "function zoomTransition(selection, traSTY){\n selection.transition()\n .duration(400)\n .ease(d3.easeSinOut)\n .attr('transform', traSTY);\n return selection;\n}", "_setZoom() {\n\t\tif(this.getActiveMarkers().length == 1) {\n\t\t\treturn this.map.setZoom(16);\n\t\t}\n\n\t\tif(this.getActiveMarkers().length == 0) {\n\t\t\treturn this._reset();\n\t\t}\n\n\t\treturn this.map.setZoom(10);\n\t}", "evZooms(env) {\n for (var i = 0; i < this.selectors.length; i++) {\n var zval = CartoCSS.Tree.Zoom.all;\n for (var z = 0; z < this.selectors[i].zoom.length; z++) {\n zval = this.selectors[i].zoom[z].ev(env).zoom;\n }\n this.selectors[i].zoom = zval;\n }\n }", "function zoomInHere(x,y) {\r\n\r\n var transform = d3.zoomIdentity\r\n .translate(width / 2, height / 2)\r\n .scale(8)\r\n .translate(-x,-y);\r\n\r\n focus.transition().ease(d3.easeLinear).duration(1000).call(\r\n zoom.transform,\r\n transform\r\n //d3.zoomIdentity.translate(width / 2, height / 2).scale(8).translate(-x, -y),\r\n )\r\n\r\n }", "function doZoom( increment ) {\n newZoom = increment === undefined ? d3.event.scale \n\t\t\t\t\t: zoomScale(currentZoom+increment);\n if( currentZoom == newZoom )\n\treturn;\t// no zoom change\n\n // See if we cross the 'show' threshold in either direction\n if( currentZoom<SHOW_THRESHOLD && newZoom>=SHOW_THRESHOLD )\n\tsvg.selectAll(\"g.label\").classed('on',true);\n else if( currentZoom>=SHOW_THRESHOLD && newZoom<SHOW_THRESHOLD )\n\tsvg.selectAll(\"g.label\").classed('on',false);\n\n // See what is the current graph window size\n s = getViewportSize();\n width = s.w<WIDTH ? s.w : WIDTH;\n height = s.h<HEIGHT ? s.h : HEIGHT;\n\n // Compute the new offset, so that the graph center does not move\n zoomRatio = newZoom/currentZoom;\n newOffset = { x : currentOffset.x*zoomRatio + width/2*(1-zoomRatio),\n\t\t y : currentOffset.y*zoomRatio + height/2*(1-zoomRatio) };\n\n // Reposition the graph\n repositionGraph( newOffset, newZoom, \"zoom\" );\n }", "function transformHandler(e) {\n if (transitioning)\n return;\n\n currentFrame.zoom(e.detail.relative.scale,\n e.detail.midpoint.clientX,\n e.detail.midpoint.clientY);\n}", "function zoomHere(){\n\tconsole.log('zoom here');\n\tif(map){\n\t\tvar currentZoom = map.getZoom();\n\t\tmap.setZoom(currentZoom+1);\n\t\tmap.panTo(contextualMenuEvtPosition);\n\n\t}\n\tremoveContextualMenu()\n}", "function zoomFunction() {\n\t\tvar transform = d3.event.transform;\n\t\td3.select(\"#map_g\")\n\t\t.attr(\"transform\", \"translate(\" + transform.x + \",\" + transform.y + \") scale(\" + transform.k + \")\")\n\t}", "function TextualZoomControl() {\n }", "function fixIELayoutBug(view, node, viewStyle, nodeStyle) { // IE6, IE7\r\n if (!viewStyle.hasLayout) {\r\n view.style.zoom = 1;\r\n }\r\n node.style.zoom = 1; // apply z-index(sink canvas)\r\n if (nodeStyle.position === \"static\") {\r\n node.style.position = \"relative\"; // set \"position: relative\"\r\n }\r\n // bugfix position:relative + margin:auto\r\n // see demo/viewbox_position/position_relative.htm\r\n if (node.style.position === \"relative\") {\r\n (nodeStyle.marginTop === \"auto\") && (node.style.marginTop = 0);\r\n (nodeStyle.marginLeft === \"auto\") && (node.style.marginLeft = 0);\r\n (nodeStyle.marginRight === \"auto\") && (node.style.marginRight = 0);\r\n (nodeStyle.marginBottom === \"auto\") && (node.style.marginBottom = 0);\r\n }\r\n}", "function zoomed() {\n\t\t\tcarto.style(\"stroke-width\", 1.5 / d3.event.transform.k + \"px\").\n\t\t\t\tattr(\"transform\", d3.event.transform);\n\t\t}", "_zoomReset() {\n this.attachmentViewer.update({ scale: 1 });\n this._updateZoomerStyle();\n }", "function ZoomButton() {\n\tif(gridZoom == 10) {\n\t\tgridZoom = 3;\n\t}\n\telse {\n\t\tgridZoom = 10;\n\t\tUpdateGraphicsZoomMap();\n\t}\n\tUpdateTileMap();\n\tUpdateNoteGrid();\n}", "function doZoom(increment) {\n var newZoom = increment === undefined ? d3.event.scale : zoomScale(currentZoom + increment);\n if (currentZoom == newZoom)\n return; // no zoom change\n\n // See what is the current graph window size\n var s = getViewportSize();\n var width = s.w < WIDTH ? s.w : WIDTH;\n var height = s.h < HEIGHT ? s.h : HEIGHT;\n\n // Compute the new offset, so that the graph center does not move\n var zoomRatio = newZoom / currentZoom;\n\n var anchorx = width / 2,\n anchory = height / 2;\n\n var rawx = (anchorx - currentOffset.x) / currentZoom,\n rawy = (anchory - currentOffset.y) / currentZoom,\n\n newOffset = {\n x: currentOffset.x + rawx * (currentZoom - newZoom),\n y: currentOffset.y + rawy * (currentZoom - newZoom)\n };\n\n // Reposition the graph\n repositionGraph(newOffset, newZoom, \"zoom\");\n}", "function zoomed() {\n svg.attr('transform', 'translate(' + d3.event.translate + ')scale(' + d3.event.scale + ')');\n }", "function zoom() {\n // console.log(d3.event.scale);\n if ($scope.xAxisIsLocked && $scope.yAxisIsLocked) return;\n if ($scope.xAxisIsLocked) {\n svg.selectAll(\"circle\")\n .classed(\"animate\", false)\n .attr(\"cy\", function(d) { return x(d[\"y_category\"]); });\n d3.select('.y.axis').call(yAxis);\n } else if ($scope.yAxisIsLocked) {\n svg.selectAll(\"circle\")\n .classed(\"animate\", false)\n .attr(\"cx\", function(d) { return x(d[\"x_category\"]); });\n d3.select('.x.axis').call(xAxis);\n } else {\n svg.selectAll(\"circle\")\n .classed(\"animate\", false)\n .attr(\"cx\", function(d) { return x(d[\"x_category\"]); })\n .attr(\"cy\", function(d) { return y(d[\"y_category\"]); });\n d3.select('.x.axis').call(xAxis);\n d3.select('.y.axis').call(yAxis);\n }\n }", "function expand_node_view(node) {\n if(node.children.length>0)\n {\n node.view_series = false;\n for(var i=0; i<node.children.length; i++)\n node.children[i].view_series = true;\n }\n}", "function zoomed() {\n draw();\n circlesTranslate();\n }", "function zoomReset() {\n zoom.translate([0,0]).scale(1);\n svgMap.transition()\n .duration(750)\n .attr(\"transform\", \"\");\n svgMap.selectAll(\"circle\")\n .attr(\"d\", path.projection(projection))\n .attr(\"r\", circleRadius/zoom.scale());\n}", "function zoom(scaleFactor, translatePos) {\n\tclearCanvas();\n\tctx.save();\n\tctx.translate(translatePos.x, translatePos.y);\n\tctx.scale(scaleFactor,scaleFactor);\n\tctx.translate(-translatePos.x, -translatePos.y); // giati eprepe na bazoume to anti8eto ? den douleue opws h8ela to zoom\n\t// redraw();\n\tnonogram.drawGrid();\n\tnonogram.drawRowNumbers();\n\tnonogram.drawColumnNumbers();\n\t//Ζωγραφίζει τις επιλογές του χρήστη στα κελιά\n\tfor(let i=0; i<nonogram.emptyGrid.length; i++) {\n\t\tif(nonogram.emptyGrid[i].value === 1){\n\t\t\t//fil the cell black\n\t\t\tnonogram.drawBlackCell(nonogram.emptyGrid[i]);\n\t\t\tnonogram.drawPreview(nonogram.emptyGrid[i]);\n\t\t}else if(nonogram.emptyGrid[i].value === 2) {\n\t\t\t// nonogram.drawWhiteCell(nonogram.emptyGrid[i]);\n\t\t\tnonogram.drawXCell(nonogram.emptyGrid[i]);\n\t\t\tnonogram.drawPreview(nonogram.emptyGrid[i]);\n\t\t}\n\t}\n\t//Ζωγραφίζει τις επιλογές του χρήστη στα κελιά των αριθμών\n\tctx.beginPath();\n\tctx.strokeStyle = \"red\";\n\tctx.lineWidth = 3;\n\tfor(let i=0; i<nonogram.rowNumbersGrid.length; i++) {\n\t\tif(nonogram.rowNumbersGrid[i].value === 1) {\n\t\t\tctx.moveTo(nonogram.rowNumbersGrid[i].x+3, (nonogram.rowNumbersGrid[i].y + nonogram.blockSize)-3);\n\t\t\tctx.lineTo((nonogram.rowNumbersGrid[i].x + nonogram.blockSize)-3, nonogram.rowNumbersGrid[i].y+3);\n\t\t}\n\t}\n\n\tfor(let i=0; i<nonogram.columnNumbersGrid.length; i++) {\n\t\tif(nonogram.columnNumbersGrid[i].value === 1) {\t\n\t\t\tctx.moveTo(nonogram.columnNumbersGrid[i].x+3, (nonogram.columnNumbersGrid[i].y + nonogram.blockSize)-3);\n\t\t\tctx.lineTo((nonogram.columnNumbersGrid[i].x + nonogram.blockSize)-3, nonogram.columnNumbersGrid[i].y+3);\n\t\t}\n\t}\n\tctx.closePath();\n\tctx.stroke();\n\tctx.restore();\n\t//otan to zoom den einai sto level 1 na fainontai ta controls\n\tif(scaleFactor !== 1) {\n\t\t$(topControl).show();\n\t\t$(leftControl).show();\n\t\t$(rightControl).show();\n\t\t$(bottomControl).show();\n\t}else{\n\t\t$(topControl).hide();\n\t\t$(leftControl).hide();\n\t\t$(rightControl).hide();\n\t\t$(bottomControl).hide();\n\t}\n}", "function toggleImgZoom(){\n\t\t\t\t\tif( $element.data(\"zoomed\") ){\n\t\t\t\t\t\t// NOTE we allow the image to zoom out if functionality gets disabled\n\t\t\t\t\t\t// when it's in a zoomed state\n\t\t\t\t\t\tif(o.disabled) { return false; }\n\n\t\t\t\t\t\tif( o.placement === \"inline\" ){\n\t\t\t\t\t\t\t$contain.add( $parentPane ).css( { \"width\": $parentPane[0].offsetWidth + \"px\", \"height\": parseFloat( getComputedStyle( $parentPane[0] ).height ) + \"px\" } );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$zoomParent.addClass( zoomClass );\n\t\t\t\t\t\t$( targetImg ).css( \"width\", imgZoomWidth() + \"px\" );\n\n\t\t\t\t\t\t$(self).trigger( pluginName + \".after-zoom-in\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$zoomParent.removeClass( zoomClass );\n\t\t\t\t\t\tif( o.placement === \"inline\" ){\n\t\t\t\t\t\t\t$contain.add( $parentPane ).css( { \"width\": \"\", \"height\": \"\" } );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$( targetImg ).css( \"width\", \"\" );\n\n\t\t\t\t\t\t$(self).trigger( pluginName + \".after-zoom-out\");\n\t\t\t\t\t}\n\t\t\t\t}", "function zoomIn(){\n $(this).off('click', zoomIn);\n $(this).off('mouseover', showPointer);\n $(this).off('mouseleave', unZoom);\n\n $figureElt = $(this).parent();\n $img = $(this);\n $dezoom = $(this).parent().find('.dezoom');\n\n $bodyElt.css(\"overflow\" , \"hidden\");\n $figureElt.addClass('figure-zoom');\n $img.addClass('image-zoomed-in');\n\n $img.css({\n 'cursor' : 'initial',\n 'transform' : 'scale(1)',\n '-moz-transform' : 'scale(1)',\n '-webkit-transform' : 'scale(1)',\n 'transition' : '0s',\n '-moz-transition' : '0s',\n '-webkit-transition' : '0s'\n });\n\n $dezoom.click(function(){\n $bodyElt.css(\"overflow\" , \"visible\");\n $figureElt.removeClass('figure-zoom');\n $img.removeClass('image-zoomed-in');\n $img.css('cursor' , 'pointer');\n $img.on(\"click\", zoomIn);\n $img.on(\"mouseover\", showPointer);\n $img.on(\"mouseleave\", unZoom);\n });\n }" ]
[ "0.69734824", "0.6860572", "0.6723954", "0.6696952", "0.6536562", "0.643769", "0.63896275", "0.63575", "0.6356016", "0.6353609", "0.6297368", "0.6293824", "0.62618995", "0.6260596", "0.62486815", "0.62362343", "0.6226763", "0.6226763", "0.6196347", "0.6186906", "0.61808586", "0.6157341", "0.6154747", "0.6154361", "0.6133762", "0.6123739", "0.6103282", "0.6103282", "0.6099235", "0.60962087", "0.60931706", "0.60843587", "0.60749567", "0.6062454", "0.60620046", "0.6060542", "0.6045184", "0.60444856", "0.6041204", "0.6041204", "0.6041204", "0.6041204", "0.6041204", "0.6036069", "0.60166204", "0.60031164", "0.5969362", "0.5967598", "0.5967598", "0.59558225", "0.5953061", "0.5933604", "0.59237707", "0.59160227", "0.59144664", "0.59034306", "0.5887535", "0.58874655", "0.5884393", "0.58826905", "0.58762234", "0.5876059", "0.5873408", "0.5869888", "0.5861426", "0.5860045", "0.5841375", "0.5819639", "0.58086467", "0.57996076", "0.57996076", "0.57947564", "0.57920223", "0.5791964", "0.577831", "0.5772655", "0.57587594", "0.5758581", "0.5756446", "0.5746892", "0.5743436", "0.57417065", "0.57408863", "0.5740231", "0.57368016", "0.5734616", "0.57253265", "0.57229125", "0.57190305", "0.57148194", "0.57004493", "0.56974924", "0.5693132", "0.5692569", "0.568596", "0.5672029", "0.56700045", "0.56697184", "0.56691736", "0.56529367", "0.5651136" ]
0.0
-1
drill down and roll up differ background creation sequence from tree hierarchy sequence, which cause that lowser background element overlap upper ones. So we calculate z based on depth. Moreover, we try to shrink down z interval to [0, 1] to avoid that treemap with large z overlaps other components.
function calculateZ(depth, zInLevel) { var zb = depth * Z_BASE + zInLevel; return (zb - 1) / zb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateZ(depth,zInLevel){var zb=depth * Z_BASE + zInLevel;return (zb - 1) / zb;}", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t }", "function calculateZ(depth, zInLevel) {\n\t var zb = depth * Z_BASE + zInLevel;\n\t return (zb - 1) / zb;\n\t}", "function calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n }", "function _depth() { \n\t\t\t\t\treturn Math.max( Math.min( _pointA.z, _pointB.z ), 0.0001 ); \n\t\t\t\t}", "get depth() {}", "function calcular_Z_Index(){\r\n zIndex = (zIndex + 1);\r\n return zIndex\r\n}", "_flushUpdateZIndexOfChilden() {\n const _this = this;\n // Iterate over a clone:\n const _buffer = this.cloneObject(this._updateZIndexOfChildrenBuffer);\n this._updateZIndexOfChildrenBuffer = [];\n _buffer\n .map(_viewId => {\n const _view = _this.__views[_viewId];\n const _isRootView = _viewId === null;\n const _viewOrder = _isRootView ? _this.__viewsZOrder : _view.viewsZOrder;\n if (_viewOrder instanceof Array) {\n return _viewOrder;\n }\n else {\n return null;\n }\n })\n .filter(_viewOrder => {\n return _viewOrder !== null;\n })\n .map(_viewOrder => {\n let _zIndex = -1;\n return _viewOrder\n .map(_viewId => {\n const _view = _this.__views[_viewId];\n const _elemId = _view.elemId;\n if (_elemId) {\n _zIndex += 1;\n return [_elemId, _zIndex];\n }\n else {\n return null;\n }\n })\n .filter(_item => {\n return _item !== null;\n });\n })\n .forEach(_elemZIndexes => {\n _elemZIndexes.forEach(([_elemId, _zIndex]) => {\n ELEM.setStyle(_elemId, 'z-index', _zIndex, true);\n });\n });\n }", "calculateDepth() {\n for (let object of this.objects) {\n if (object.isNatural() || object.transitionsToward.length === 0) {\n this.setObjectDepth(object, new Depth({value: 0, craftable: object.isNatural()}));\n }\n }\n }", "depth() {\n return 0;\n }", "function drawTree(dataStructure, level) {\n var daDisegnare = true;\n var numChild = dataStructure.children.length;\n\n for (let i = 0; i < numChild; i++) {\n drawTree(dataStructure.children[i], level + 1);\n }\n\n if (numChild == 0) { //base case\n var spazioNodo = dataStructure.name.length * (4.3 + (parseFloat(dataStructure.value) * 10))\n if (level > 0 && arraySpazioLivelli[level - 2] > arraySpazioLivelli[level - 1]) {\n arraySpazioLivelli[level - 1] = arraySpazioLivelli[level - 2];\n }\n drawNode(dataStructure, arraySpazioLivelli[level - 1], level * levelLength);\n arraySpazioLivelli[level - 1] += spazioNodo + brotherDistance;\n for (let i = level - 1; i < arraySpazioLivelli.length; i++) {\n if (arraySpazioLivelli[i] < (arraySpazioLivelli[level - 1])) {\n arraySpazioLivelli[i] = (arraySpazioLivelli[level - 1]);\n }\n }\n daDisegnare = false;\n }\n\n for (let i = 0; i < dataStructure.children.length; i++) {\n if (dataStructure.children[i].disegnato == false) {\n daDisegnare = false;\n }\n }\n\n if (daDisegnare == true) {\n if (dataStructure.children.length == 1) {\n if (dataStructure.children[0].children.length == 0) {\n var spazioNodo = dataStructure.name.length * (4.3 + (parseFloat(dataStructure.value) * 10))\n drawNode(dataStructure, dataStructure.children[0].x, level * levelLength);\n arraySpazioLivelli[level - 1] = dataStructure.children[0].x + spazioNodo + brotherDistance;\n } else {\n var spazioNodo = dataStructure.name.length * (4.3 + (parseFloat(dataStructure.value) * 10))\n var spazioNodoFiglio = dataStructure.children[0].name.length * (4.3 + (parseFloat(dataStructure.value) * 10))\n drawNode(dataStructure, arraySpazioLivelli[level - 1], level * levelLength);\n arraySpazioLivelli[level - 1] += spazioNodo + brotherDistance;\n }\n } else {\n var XprimoFiglio = dataStructure.children[0].x;\n var XultimoFiglio = dataStructure.children[dataStructure.children.length - 1].x;\n var spazioNodo = dataStructure.name.length * (4.3 + (parseFloat(dataStructure.value) * 10))\n drawNode(dataStructure, arraySpazioLivelli[level - 1], level * levelLength);\n arraySpazioLivelli[level - 1] += spazioNodo + brotherDistance;\n }\n }\n}", "set depth(value) {}", "function DrawTheTree(geom, x_init, y_init, z_init){\n var geometry = geom;\n var Wrule = GetAxiomTree();\n var n = Wrule.length;\n var stackX = []; var stackY = []; var stackZ = []; var stackA = [];\n var stackV = []; var stackAxis = [];\n\n var theta = params.theta * Math.PI / 180;\n var scale = params.scale;\n var angle = params.angle * Math.PI / 180;\n\n var x0 = x_init; var y0 = y_init; var z0 = z_init ;\n var x; var y; var z;\n var rota = 0, rota2 = 0,\n deltarota = 18 * Math.PI/180;\n var newbranch = false;\n var axis_x = new THREE.Vector3( 1, 0, 0 );\n var axis_y = new THREE.Vector3( 0, 1, 0 );\n var axis_z = new THREE.Vector3( 0, 0, 1 );\n var zero = new THREE.Vector3( 0, 0, 0 );\n var axis_delta = new THREE.Vector3(),\n prev_startpoint = new THREE.Vector3();\n\n var startpoint = new THREE.Vector3(x0,y0,z0),\n endpoint = new THREE.Vector3();\n var bush_mark;\n var vector_delta = new THREE.Vector3(scale, scale, 0);\n\n for (var j=0; j<n; j++){\n var a = Wrule[j];\n if (a == \"+\"){angle -= theta;\n }\n if (a == \"-\"){angle += theta;\n }\n if (a == \"F\"){\n\n var a = vector_delta.clone().applyAxisAngle( axis_y, angle );\n endpoint.addVectors(startpoint, a);\n\n geometry.vertices.push(startpoint.clone());\n geometry.vertices.push(endpoint.clone());\n\n prev_startpoint.copy(startpoint);\n startpoint.copy(endpoint);\n\n axis_delta = new THREE.Vector3().copy(a).normalize();\n rota += deltarota;// + (5.0 - Math.random()*10.0);\n\n }\n if (a == \"L\"){\n endpoint.copy(startpoint);\n endpoint.add(new THREE.Vector3(0, scale*1.5, 0));\n var vector_delta2 = new THREE.Vector3().subVectors(endpoint, startpoint);\n vector_delta2.applyAxisAngle( axis_delta, rota2 );\n endpoint.addVectors(startpoint, vector_delta2);\n\n geometry.vertices.push(startpoint.clone());\n geometry.vertices.push(endpoint.clone());\n\n rota2 += 45 * Math.PI/180;\n }\n if (a == \"%\"){\n\n }\n if (a == \"[\"){\n stackV.push(new THREE.Vector3(startpoint.x, startpoint.y, startpoint.z));\n stackA[stackA.length] = angle;\n }\n if (a == \"]\"){\n var point = stackV.pop();\n startpoint.copy(new THREE.Vector3(point.x, point.y, point.z));\n angle = stackA.pop();\n }\n bush_mark = a;\n }\n return geometry;\n}", "get Depth() {}", "function setDepth(obj) {\n if (obj.children) {\n obj.children.forEach(function (d) {\n depthTemp++;\n setDepth(d);\n if (depthTemp > depth) {\n depth = depthTemp;\n }\n depthTemp = 0;\n });\n }\n depthTemp++;\n }", "function DrawTheTree2(geom, x_init, y_init, z_init){\n var geometry = geom;\n var Wrule = GetAxiomTree();\n var n = Wrule.length;\n var stackX = []; var stackY = []; var stackZ = []; var stackA = [];\n var stackV = []; var stackAxis = [];\n\n var theta = params.theta * Math.PI / 180;\n var scale = params.scale;\n var angle = params.angle * Math.PI / 180;\n\n var x0 = x_init; var y0 = y_init; var z0 = z_init ;\n var x; var y; var z;\n var rota = 0, rota2 = 0,\n deltarota = 18 * Math.PI/180;\n var newbranch = false;\n var axis_x = new THREE.Vector3( 1, 0, 0 );\n var axis_y = new THREE.Vector3( 0, 1, 0 );\n var axis_z = new THREE.Vector3( 0, 0, 1 );\n var zero = new THREE.Vector3( 0, 0, 0 );\n var axis_delta = new THREE.Vector3(),\n prev_startpoint = new THREE.Vector3();\n\n\n // NEW\n var decrease = params.treeDecrease;\n var treeWidth = params.treeWidth;\n // END\n\n\n var startpoint = new THREE.Vector3(x0,y0,z0),\n endpoint = new THREE.Vector3();\n var bush_mark;\n var vector_delta = new THREE.Vector3(scale, scale, 0);\n var cylindermesh = new THREE.Object3D();\n\n for (var j=0; j<n; j++){\n\n treeWidth = treeWidth-decrease;\n var a = Wrule[j];\n if (a == \"+\"){angle -= theta;}\n if (a == \"-\"){angle += theta;}\n if (a == \"F\"){\n\n var a = vector_delta.clone().applyAxisAngle( axis_y, angle );\n endpoint.addVectors(startpoint, a);\n\n cylindermesh.add(cylinderMesh(startpoint,endpoint,treeWidth));\n\n prev_startpoint.copy(startpoint);\n startpoint.copy(endpoint);\n\n axis_delta = new THREE.Vector3().copy(a).normalize();\n rota += deltarota;\n }\n if (a == \"L\"){\n endpoint.copy(startpoint);\n endpoint.add(new THREE.Vector3(0, scale*1.5, 0));\n var vector_delta2 = new THREE.Vector3().subVectors(endpoint, startpoint);\n vector_delta2.applyAxisAngle( axis_delta, rota2 );\n endpoint.addVectors(startpoint, vector_delta2);\n\n cylindermesh.add(cylinderMesh(startpoint,endpoint,treeWidth));\n\n rota2 += 45 * Math.PI/180;\n }\n if (a == \"%\"){\n\n }\n if (a == \"[\"){\n stackV.push(new THREE.Vector3(startpoint.x, startpoint.y, startpoint.z));\n stackA[stackA.length] = angle;\n }\n if (a == \"]\"){\n var point = stackV.pop();\n startpoint.copy(new THREE.Vector3(point.x, point.y, point.z));\n angle = stackA.pop();\n }\n bush_mark = a;\n }\n return cylindermesh;\n}", "_calcCoordinates(dataNodes) {\n let distScale = linear().range([20, this._innerRadius]).domain([0, this._dataLinks.heightTree]);\n this._vOrder.forEach((d, i) => {\n dataNodes[d].x = this._vAngle[i];\n dataNodes[d].y = this._innerRadius;\n });\n posOrdem(this._dataLinks.tree);\n function posOrdem(raiz) {\n let xPrim, xUlt;\n if (raiz.children !== undefined) {\n raiz.children.forEach(function (d) {\n posOrdem(d);\n });\n console.log(\"parent\", raiz);\n console.log(\"children\", raiz.children[0]);\n xPrim = raiz.children[0].data.x;\n xUlt = raiz.children[raiz.children.length - 1].data.x;\n if (xPrim < xUlt) {\n raiz.x = (xPrim + xUlt) / 2;\n raiz.data.x = (xPrim + xUlt) / 2;\n }\n else {\n raiz.x = ((xUlt + 360 - xPrim) / 2 + xPrim) % 360;\n raiz.data.x = (xPrim + xUlt) / 2;\n }\n raiz.y = distScale(raiz.depth);\n raiz.data.y = distScale(raiz.depth);\n }\n }\n }", "restack (){\n this._layers.forEach( (layer, key, index) => {\n layer.setDepth(index);\n //layer.objects.forEach(obj => {\n //if (obj.active)\n //obj.depth = index;\n //});\n });\n }", "function comeBackZIndex(){\n\t var children = layer.getChildren();\n\t var newArr = [];\n\t \n\t children.forEach(function(obj, i, a) {\n\t \tnewArr.push(obj);\n\t });\n\n\t newArr.forEach(function(obj, i, a) {\n\t\tif(obj.attrs.myZIndex){\n\t \t\tobj.setZIndex(obj.attrs.myZIndex);\n\t \t\tlayer.draw();\n\t\t}\n\t });\n}", "_updateZIndex() {\n HSystem.updateZIndexOfChildren(this.viewId);\n }", "setDepths() {\n this.room2_floor.setDepth(0);\n this.room2_character_north.setDepth(50);\n this.room2_character_east.setDepth(50);\n this.room2_character_south.setDepth(50);\n this.room2_character_west.setDepth(50);\n this.room2_E_KeyImg.setDepth(49);\n this.room2_activity1A.setDepth(100);\n\t// this.room2_activity1B.setDepth(100);\n\t// this.room2_activity1C.setDepth(100);\n\t// this.room2_activity1D.setDepth(100);\n this.room2_activity2A.setDepth(100);\n this.room2_activity2B.setDepth(100);\n\t// this.room2_activity2C.setDepth(100);\n\t// this.room2_activity2D.setDepth(100);\n this.room2_activity3A.setDepth(100);\n this.room2_activity3B.setDepth(100);\n this.room2_activity4A.setDepth(100);\n this.room2_activity4B.setDepth(100);\n\t// this.room2_activity4C.setDepth(100);\n\t// this.room2_activity4D.setDepth(100);\n\t// this.room2_activity4E.setDepth(100);\n this.room2_activity5A.setDepth(100);\n this.room2_activity5B.setDepth(100);\n\t// this.room2_activity5C.setDepth(100);\n\t// this.room2_activity5D.setDepth(100);\n\t// this.room2_activity5E.setDepth(100);\n\t// this.room2_activity5F.setDepth(100);\n this.room2_activity6A.setDepth(100);\n this.room2_activity6B.setDepth(100);\n this.room2_activity6C.setDepth(100);\n this.room2_activity6D.setDepth(100);\n this.room2_activity6E.setDepth(100);\n this.room2_map.setDepth(100);\n this.room2_notebook.setDepth(100);\n this.room2_help_menu.setDepth(100);\n this.countCoin.setDepth(0);\n\t this.returnDoor.setDepth(1);\n\t this.profile.setDepth(0);\n\n }", "computeMaxDepth() {\n let d = 0;\n for (const child of this.components) {\n d = Math.max(d + 1, child.children.computeMaxDepth());\n }\n return d;\n }", "buildHierarchy () {\n for (var i = this.layers.length - 1; i >= 0; i--) {\n for (var j = 0; j < this.layers[i].length; j++) {\n for (var k = 0; k < this.layers[i][j].length; k++) {\n if (this.layers[i][j][k] === null) {\n continue\n }\n if (this.layers[i][j][k].parents.length < 1) {\n this.roots.push(this.layers[i][j][k].findChildren(this, this.numChildren))\n }\n }\n }\n }\n }", "apportion(node, level) {\n let firstChild = node.firstChild();\n let firstChildLeftNeighbor = firstChild.leftNeighbor();\n let compareDepth = 1;\n const depthToStop = this.cfg.maxDepth - level;\n\n while (firstChild && firstChildLeftNeighbor && compareDepth <= depthToStop) {\n // calculate the position of the firstChild, according to the position of firstChildLeftNeighbor\n\n let modifierSumRight = 0;\n let modifierSumLeft = 0;\n let leftAncestor = firstChildLeftNeighbor;\n let rightAncestor = firstChild;\n\n for (let i = 0; i < compareDepth; i += 1) {\n leftAncestor = leftAncestor.parent();\n rightAncestor = rightAncestor.parent();\n modifierSumLeft += leftAncestor.modifier;\n modifierSumRight += rightAncestor.modifier;\n\n // all the stacked children are oriented towards right so use right variables\n if (rightAncestor.stackParent !== undefined) {\n modifierSumRight += rightAncestor.size() / 2;\n }\n }\n\n // find the gap between two trees and apply it to subTrees\n // and matching smaller gaps to smaller subtrees\n\n let totalGap =\n firstChildLeftNeighbor.prelim +\n modifierSumLeft +\n firstChildLeftNeighbor.size() +\n this.cfg.subTeeSeparation -\n (firstChild.prelim + modifierSumRight);\n\n if (totalGap > 0) {\n let subtreeAux = node;\n let numSubtrees = 0;\n\n // count all the subtrees in the LeftSibling\n while (subtreeAux && subtreeAux.id !== leftAncestor.id) {\n subtreeAux = subtreeAux.leftSibling();\n numSubtrees += 1;\n }\n\n if (subtreeAux) {\n let subtreeMoveAux = node;\n const singleGap = totalGap / numSubtrees;\n\n while (subtreeMoveAux.id !== leftAncestor.id) {\n subtreeMoveAux.prelim += totalGap;\n subtreeMoveAux.modifier += totalGap;\n\n totalGap -= singleGap;\n subtreeMoveAux = subtreeMoveAux.leftSibling();\n }\n }\n }\n\n compareDepth += 1;\n\n firstChild =\n firstChild.childrenCount() === 0\n ? node.leftMost(0, compareDepth)\n : (firstChild = firstChild.firstChild());\n\n if (firstChild) {\n firstChildLeftNeighbor = firstChild.leftNeighbor();\n }\n }\n }", "function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n\t var minKy = Infinity;\n\t each(nodesByBreadth, function (nodes) {\n\t var n = nodes.length;\n\t var sum = 0;\n\t each(nodes, function (node) {\n\t sum += node.getLayout().value;\n\t });\n\t var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\t\n\t if (ky < minKy) {\n\t minKy = ky;\n\t }\n\t });\n\t each(nodesByBreadth, function (nodes) {\n\t each(nodes, function (node, i) {\n\t var nodeDy = node.getLayout().value * minKy;\n\t\n\t if (orient === 'vertical') {\n\t node.setLayout({\n\t x: i\n\t }, true);\n\t node.setLayout({\n\t dx: nodeDy\n\t }, true);\n\t } else {\n\t node.setLayout({\n\t y: i\n\t }, true);\n\t node.setLayout({\n\t dy: nodeDy\n\t }, true);\n\t }\n\t });\n\t });\n\t each(edges, function (edge) {\n\t var edgeDy = +edge.getValue() * minKy;\n\t edge.setLayout({\n\t dy: edgeDy\n\t }, true);\n\t });\n\t }", "function buildQuadrants(maxLevel, data) {\n // [block, level]\n var stack = [0, 0];\n\n while (stack.length) {\n var level = stack.pop(),\n block = stack.pop();\n var topLeftBlock = 4 * block + BLOCKS,\n topRightBlock = 4 * block + 2 * BLOCKS,\n bottomLeftBlock = 4 * block + 3 * BLOCKS,\n bottomRightBlock = 4 * block + 4 * BLOCKS;\n var x = data[block + X_OFFSET],\n y = data[block + Y_OFFSET],\n width = data[block + WIDTH_OFFSET],\n height = data[block + HEIGHT_OFFSET],\n hw = width / 2,\n hh = height / 2;\n data[topLeftBlock + X_OFFSET] = x;\n data[topLeftBlock + Y_OFFSET] = y;\n data[topLeftBlock + WIDTH_OFFSET] = hw;\n data[topLeftBlock + HEIGHT_OFFSET] = hh;\n data[topRightBlock + X_OFFSET] = x + hw;\n data[topRightBlock + Y_OFFSET] = y;\n data[topRightBlock + WIDTH_OFFSET] = hw;\n data[topRightBlock + HEIGHT_OFFSET] = hh;\n data[bottomLeftBlock + X_OFFSET] = x;\n data[bottomLeftBlock + Y_OFFSET] = y + hh;\n data[bottomLeftBlock + WIDTH_OFFSET] = hw;\n data[bottomLeftBlock + HEIGHT_OFFSET] = hh;\n data[bottomRightBlock + X_OFFSET] = x + hw;\n data[bottomRightBlock + Y_OFFSET] = y + hh;\n data[bottomRightBlock + WIDTH_OFFSET] = hw;\n data[bottomRightBlock + HEIGHT_OFFSET] = hh;\n\n if (level < maxLevel - 1) {\n stack.push(bottomRightBlock, level + 1);\n stack.push(bottomLeftBlock, level + 1);\n stack.push(topRightBlock, level + 1);\n stack.push(topLeftBlock, level + 1);\n }\n }\n}", "_drawHexDepth(context, col, row) {\n let half = this.size.tile / 2;\n let offset = row % 2 ? this.size.tile / 2 : 0;\n context.beginPath();\n context.moveTo(col*this.size.tile+offset, row*this.size.tile+2);\n context.lineTo(col*this.size.tile+offset+half, row*this.size.tile-2);\n context.lineTo((col+1)*this.size.tile+offset, row*this.size.tile+2);\n context.lineTo((col+1)*this.size.tile - (offset ? 0 : half), (row+1)*this.size.tile-2);\n context.lineTo(col*this.size.tile+offset+half, (row+1)*this.size.tile+2);\n context.lineTo(col*this.size.tile+offset, (row+1)*this.size.tile-2);\n context.lineTo(col*this.size.tile+offset, row*this.size.tile+2);\n context.fill();\n }", "_updateZIndexAllSiblings() {\n HSystem.updateZIndexOfChildren(this.parent.viewId);\n }", "setMaxStackDepth(depth){\n maxDepth = depth;\n }", "function quadtree(img, sRow, sCol, path, lvl, numOfCols, parent) {\n\n var isSame = true;\n var startColor = img[sRow][sCol];\n var binStr = \"\";\n var rows = sRow + numOfCols;\n var cols = sCol + numOfCols;\n for (var i = sRow; i < rows; i++) {\n for (var j = sCol; j < cols; j++) {\n\n var cellColor = img[i][j];\n binStr += cellColor;\n if (startColor != cellColor) {\n isSame = false;\n }\n }\n }\n\n if (isSame) {\n addSiblings(parent);\n return {\n binStr: binStr,\n path: path,\n lvl: lvl,\n children: [],\n parent: parent,\n siblings: 0\n };\n\n } else {\n var child = {\n binStr: binStr,\n path: path,\n lvl: lvl,\n children: [],\n parent: parent,\n siblings: 0\n };\n addSiblings(parent);\n var halfCols = Math.floor(numOfCols / 2);\n lvl++;\n child.children.push(quadtree(img, sRow, sCol, path + \"0\", lvl, halfCols, child));\n child.children.push(quadtree(img, sRow, halfCols, path + \"1\", lvl, halfCols, child));\n child.children.push(quadtree(img, sRow + halfCols, sCol, path + \"2\", lvl, halfCols, child));\n child.children.push(quadtree(img, sRow + halfCols, sRow + halfCols, path + \"3\", lvl, halfCols, child));\n return child;\n }\n}", "buildHierarchy(obj) {\n var that = this;\n var csv = obj;\n // obj = _.clone(obj);\n csv = _.filter(obj, (obje) => {\n return obje[0].split(\">\").length < 13;\n });\n var root = {\"name\": \"root\", \"children\": []};\n for (var i = 1; i < csv.length - 1; i++) {\n var sequence = csv[i][0];\n var size = +csv[i][1];\n var conType = csv[i][2];\n //console.log(csv[i])\n if (isNaN(size)) {\n break;\n }\n var parts = sequence.split(\">\");\n parts = _.map(parts, _.trim);\n parts = _.map(parts, function (a) {\n return that.resolveStepName(a);\n });\n var currentNode = root;\n for (var j = 0; j < parts.length; j++) {\n var children = currentNode[\"children\"];\n var nodeName = parts[j];\n var childNode;\n if (j + 1 < parts.length) {\n // Not yet at the end of the sequence; move down the tree.\n var foundChild = false;\n for (var k = 0; k < children.length; k++) {\n if (children[k][\"name\"] == nodeName) {\n childNode = children[k];\n foundChild = true;\n break;\n }\n }\n // If we don't already have a child node for this branch, create it.\n if (!foundChild) {\n childNode = {\"name\": nodeName, \"children\": []};\n children.push(childNode);\n }\n currentNode = childNode;\n }\n else {\n // Reached the end of the sequence; create a leaf node.\n childNode = {\"name\": nodeName, \"children\": [], \"size\": size, conversion_type: conType};\n children.push(childNode);\n }\n }\n }\n\n\n return root;\n }", "function ziggurat(n, zheight, sf) {\r\n if (n == 0)\r\n return new THREE.Object3D();\r\n // construct new ziggurat\r\n var s1 = ziggurat(n-1, zheight, sf);\r\n // transform it\r\n s1.position.z = zheight;\r\n s1.scale = new THREE.Vector3(sf, sf, 1);\r\n // construct new base mesh under s1 of size 2x2xzheight\r\n // ... more here\r\n // place s1 and base in common group\r\n var s1Group = new THREE.Object3D();\r\n s1Group.add(s1);\r\n s1Group.add(base);\r\n return s1Group;\r\n}", "getDepth() {\n return this.depth;\n }", "function setZindex() {\n scope_HandleNumbers.forEach(function (handleNumber) {\n var dir = scope_Locations[handleNumber] > 50 ? -1 : 1;\n var zIndex = 3 + (scope_Handles.length + dir * handleNumber);\n scope_Handles[handleNumber].style.zIndex = zIndex;\n });\n } // Test suggested values and apply margin, step.", "function randTree() {\n var tree = {};\n var pxrange;\n\n // ## Generate\n // height\n var heightMin = 8;\n var heightMax = 300;\n tree.height = Math.floor(Math.random()*heightMax+heightMin);\n\n // width\n var widthMin = 4;\n var widthMax = 120;\n tree.width = Math.floor(Math.random()*widthMax+widthMin);\n\n // number of branches\n var branchesMin = 0;\n var branchesMax = 5;\n tree.branches = Math.floor(Math.random()*branchesMax+branchesMin);\n\n // number of leaves\n var leavesMin = 0;\n var leavesMax = (tree.branches * 3) + 3;\n tree.leaves = Math.floor(Math.random()*leavesMax+leavesMin);\n\n // leaf color\n var colorLeaf = ['green', 'yellow', 'red'];\n tree.colorLeaf = colorLeaf[Math.floor(Math.random()*colorLeaf.length)];\n\n // branch color\n var colorBranch = ['brown','grey'];\n tree.colorBranch = colorBranch[Math.floor(Math.random()*colorBranch.length)];\n\n // smaller trees\n tree.img = 'tree' + Math.floor(Math.random()*9+1);\n\n return tree;\n\n}", "function get_lower_index(zi)\n {\n var max_zindex = 0;\n arr = $('#dashboard .canvas');\n\n for(i=0 ; i < arr.length; i++)\n {\n if(arr[i].style.zIndex < zi)\n {\n max_zindex = Math.max(arr[i].style.zIndex, max_zindex);\n }\n }\n return max_zindex;\n }", "initTrees(number) {\n //Front rows:\n let distance = this.lastTreePosition / this.numberOfTreeRows * 2; //Distance to next tree row.\n let positionCurrent = this.lastTreePosition;\n for(let i = this.trees.length; i < number; i++) {\n let imageNumber = this.treeCounter % this.imageInitializer.numberTreeImages; //Select tree image based on available number of variations, then repeat.\n this.trees.push(new TreeRow(-5, positionCurrent, this.treeSpeed, imageNumber, false, this.imageInitializer.numberTreeImages)); //Push initial.\n this.treeCounter++;\n positionCurrent += distance;\n }\n //Transparent back row:\n //this.newTree();\n }", "function depthCompare(a, b) {\n if (a.z < b.z) {\n return -1;\n }\n if (a.z > b.z) {\n return 1;\n }\n return 0;\n}", "function depthCompare(a, b) {\n if (a.z < b.z) {\n return -1;\n }\n if (a.z > b.z) {\n return 1;\n }\n return 0;\n}", "function a$6(a){a.include(a$9),a.code.add(t$i`float linearDepthFromFloat(float depth, vec2 nearFar) {\nreturn -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n}\nfloat linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {\nreturn linearDepthFromFloat(rgba2float(texture2D(depthTex, uv)), nearFar);\n}`);}", "setObjectDepth(object, depth) {\n if (depth.compare(object.depth) < 0) {\n // console.log(\"Depth set for\", object.id, object.name, \"to\", depth.value);\n object.depth = depth;\n\n // Favor transitions where the actor or target remains\n // Otherwise we get broken tools as the easiest transition\n // I don't think this is necessary because of the difficulty sorting\n // const transitions = object.transitionsAway.sort((a, b) => (a.tool || a.targetRemains) ? -1 : 1);\n for (let transition of object.transitionsAway) {\n this.calculateTransition(transition);\n }\n }\n }", "function calculateZ2(depth, z2InLevel) {\n return depth * Z2_BASE + z2InLevel;\n}", "_getCalculatedZIndex(element) {\n const zIndexIncrements = {\n top: 100,\n bottom: 10,\n left: 1,\n right: 1,\n };\n let zIndex = 0;\n // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,\n // loses the array generic type in the `for of`. But we *also* have to use `Array` because\n // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`\n for (const dir of STICKY_DIRECTIONS) {\n if (element.style[dir]) {\n zIndex += zIndexIncrements[dir];\n }\n }\n return zIndex ? `${zIndex}` : '';\n }", "function getSegmentZIndex(properties) {\n\t// 400 is the default zIndex for overlayPanes, stay slightly below this level\n\tvar index = 350;\n\tindex += 10 * (rkGlobal.priorityStrings.length - properties.priority);\n\tindex += 1 * (rkGlobal.stressStrings.length - properties.stress);\n\treturn index;\n}", "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "function Z(){var e=l.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||l[t]:e.height||l[t]}", "sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }", "function __WEBPACK_DEFAULT_EXPORT__() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "function __WEBPACK_DEFAULT_EXPORT__() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "function __WEBPACK_DEFAULT_EXPORT__() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}", "process(n) {\n let turtle = new Turtle();\n let stack = new Array();\n let insn = this.getIteration(n);\n let depth = new Array();\n let curDepth = 0;\n console.log(this.Iterations);\n turtle.applyLeftRot(-90);\n for (let i = 0; i < insn.length; i++) {\n let sym = insn.substr(i, 1);\n if (sym == \"F\") {\n let start = vec3.fromValues(turtle.pos[0], turtle.pos[1], turtle.pos[2]);\n turtle.moveForward(this.DefaultStep);\n let end = vec3.fromValues(turtle.pos[0], turtle.pos[1], turtle.pos[2]);\n this.Branches.push(new Branch(start, end));\n }\n else if (sym == \"f\") {\n turtle.moveForward(this.DefaultStep);\n }\n else if (sym == \"+\") {\n turtle.applyUpRot(this.DefaultAngle);\n }\n else if (sym == \"-\") {\n turtle.applyUpRot(-this.DefaultAngle);\n }\n else if (sym == \"&\") {\n turtle.applyLeftRot(this.DefaultAngle);\n }\n else if (sym == \"^\") {\n turtle.applyLeftRot(-this.DefaultAngle);\n }\n else if (sym == \"\\\\\") {\n turtle.applyForwardRot(this.DefaultAngle);\n }\n else if (sym == \"/\") {\n turtle.applyForwardRot(-this.DefaultAngle);\n }\n else if (sym == \"|\") {\n turtle.applyUpRot(180);\n }\n else if (sym == \"[\") {\n stack.push(turtle);\n }\n else if (sym == \"]\") {\n turtle = stack.pop();\n }\n else if (sym == \"*\") {\n let geoPos = vec3.fromValues(turtle.pos[0], turtle.pos[1], turtle.pos[2]);\n this.Geometries.push(new Geometry(geoPos, sym));\n }\n else {\n let geoPos = vec3.fromValues(turtle.pos[0], turtle.pos[1], turtle.pos[2]);\n this.Geometries.push(new Geometry(geoPos, sym));\n }\n }\n }", "initDepths(columns = this.columns, parent = null) {\n let me = this,\n maxDepth = 0;\n\n if (parent && parent.meta) parent.meta.depth++;\n\n for (let column of columns) {\n // TODO: this should maybe move\n column.meta.depth = 0;\n\n if (column.children) {\n me.initDepths(column.children, column);\n if (column.meta.depth && parent) parent.meta.depth += column.meta.depth;\n }\n\n if (column.meta.depth > maxDepth) maxDepth = column.meta.depth;\n }\n\n if (!parent) {\n this.maxDepth = maxDepth;\n }\n\n return maxDepth;\n }", "function generateTree(s, dt) {\n result[s] = 0;\n temp.push(s);\n\tconsole.log(temp);\n var j = 0;\n while (j < temp.length) {\n var i = temp[j];\n//battleground is made using 61X23 matrix and each cell is treated as node in the graph these can be identified \n//with unique number\n if (!bool[i]) { //this checks whether the node is accessed or not and all the if condition present in this \n //describes whether adjacent node should include or not . \n if (\n Math.trunc((i + 60) / 61) == 1 + Math.trunc(i / 61) &&\n find(i + 60) &&\n !bool[i + 60]\n ) \n //left bottom side to ith node\n {\n temp.push(i + 60);\n result[i + 60] = result[i] + 1;\n if (i + 60 == dt) break;\n }\n if (find(i + 61) && !bool[i + 61]) {\n result[i + 61] = result[i] + 1;\n temp.push(i + 61);\n if (i + 61 == dt) break;\n }\n //bottom side to ith node\n if (\n Math.trunc((i + 62) / 61) == Math.trunc(i / 61) + 1 &&\n find(i + 62) &&\n !bool[i + 62]\n )\n //rightbottom side to ith node\n {\n temp.push(i + 62);\n result[i + 62] = result[i] + 1;\n if (i + 62 == dt) break;\n }\n if ((i + 1) % 61 > i % 61 && find(i + 1) && !bool[i + 1]) \n //right side to ith node\n {\n result[i + 1] = result[i] + 1;\n temp.push(i + 1);\n if (i + 1 == dt) break;\n }\n\n if (\n Math.trunc((i - 60) / 61) + 1 == Math.trunc(i / 61) &&\n find(i - 60) &&\n !bool[i - 60]\n )//top right side to ith node \n {\n temp.push(i - 60);\n result[i - 60] = result[i] + 1;\n if (i - 60 == dt) break;\n }\n if (\n Math.trunc(Math.abs(i - 62) / 61) + 1 == Math.trunc(i / 61) &&\n find(i - 62) &&\n !bool[i - 62]\n ) //top left side to ith node\n {\n temp.push(i - 62);\n result[i - 62] = result[i] + 1;\n if (i - 62 == dt) break;\n }\n\n if (find(i - 61) && !bool[i - 61])\n //above node to ith node\n {\n temp.push(i - 61);\n result[i - 61] = result[i] + 1;\n if (i - 61 == dt) break;\n }\n if ((i - 1) % 61 < i % 61 && find(i - 1) && !bool[i - 1])\n //leftnode to ith node\n {\n temp.push(i - 1);\n result[i - 1] = result[i] + 1;\n if (i - 1 == dt) break;\n }\n\n bool[i] = true;\n }\n j++;\n }\n //the below conditions are game terminating conditions , executing shops in retrack() function\n if (source == destination) {\n window.alert(\"You Lost\" + \"\\n\\n\\n\" + \"Score :\" + score);\n exit = \"lost\";\n } else if (j == temp.length) {\n d[source].style.backgroundColor = sourceColor;\n d[source].innerHTML = \"s\";\n exit = \"lost\";\n alert(\"No Path\");\n }\n}", "addMazeInnerWalls(level, gridSize, gridScale) {\n const toExclude = this.wallsToExclude(gridSize + 1, gridSize + 1, gridScale);\n let ex = 0;\n for(let i = 0; i < gridSize - 1; i++) {\n let x = i * gridScale;\n while (ex < toExclude.length && toExclude[ex].x < x) {\n ex++;\n }\n for (let j = 0; j < gridSize; j++) {\n let z = (j - 0.5) * gridScale;\n if (ex < toExclude.length && toExclude[ex].x == x) {\n while (ex < toExclude.length && toExclude[ex].z < z) {\n ex++;\n }\n if (ex < toExclude.length && toExclude[ex].z == z) {\n ex++;\n continue;\n }\n }\n const pos = new Vector3(x, level*gridScale, z);\n const normal = new Vector3(1, 0, 0);\n this.addWall(pos, normal, gridScale);\n }\n }\n ex = 0;\n for(let i = 0; i < gridSize; i++) {\n let x = (i - 0.5)*gridScale;\n while (ex < toExclude.length && toExclude[ex].x < x) {\n ex++;\n }\n for (let j = 0; j < gridSize - 1; j++) {\n let z = j*gridScale;\n if (ex < toExclude.length && toExclude[ex].x == x) {\n while (ex < toExclude.length && toExclude[ex].z < z) {\n ex++;\n }\n if (ex < toExclude.length && toExclude[ex].z == z) {\n ex++;\n continue;\n }\n }\n const pos = new Vector3(x, level*gridScale, z);\n const normal = new Vector3(0, 0, 1);\n this.addWall(pos, normal, gridScale);\n }\n }\n }", "function gameZ(x,y,z) {\n\t\t\tswitch (viewDir) {\n\t\t\t\tcase 0:\n\t\t\t\t\tvar zIndex = (200 - (z-y-x)*2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tvar zIndex = (200 - (z-y+x)*2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tvar zIndex = (200 - (z+y+x)*2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tvar zIndex = (200 - (z+y-x)*2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn zIndex;\n\t\t}", "placenodes() {\n this._extents = [\n [0, 0],\n [0, 0]\n ];\n\n this.x = 0.0;\n this.last_span = 0.0;\n //let x = 0.0,\n // last_span = 0;\n \n this.last_node = null;\n this.last_span = 0.0;\n\n (this.save_x = this.x), (this.save_span = this.last_span * 0.5);\n\n this.do_scaling = this.options[\"scaling\"];\n let undef_BL = false;\n\n this.is_under_collapsed_parent = false;\n this.max_depth = 1;\n \n // Set initial x\n this.phylotree.nodes.x = this.tree_layout(\n this.phylotree.nodes,\n this.do_scaling\n );\n\n this.max_depth = d3.max(this.phylotree.nodes.descendants(), n => {\n return n.depth;\n });\n\n if (this.do_scaling && undef_BL) {\n // requested scaling, but some branches had no branch lengths\n // redo layout without branch lengths\n this.do_scaling = false;\n this.phylotree.nodes.x = this.tree_layout(this.phylotree.nodes);\n }\n\n let at_least_one_dimension_fixed = false;\n\n this.draw_scale_bar = this.options[\"show-scale\"] && this.do_scaling;\n\n // this is a hack so that phylotree.pad_height would return ruler spacing\n this.offsets[1] = Math.max(\n this.font_size,\n -this._extents[1][0] * this.fixed_width[0]\n );\n\n if (this.options[\"top-bottom-spacing\"] == \"fixed-step\") {\n this.size[0] = this._extents[0][1] * this.fixed_width[0];\n this.scales[0] = this.fixed_width[0];\n } else {\n this.scales[0] = (this.size[0] - this.pad_height()) / this._extents[0][1];\n at_least_one_dimension_fixed = true;\n }\n\n this.shown_font_size = Math.min(this.font_size, this.scales[0]);\n\n if (this.radial()) {\n // map the nodes to polar coordinates\n this.draw_branch = _.partial(drawArc, this.radial_center);\n this.edge_placer = arcSegmentPlacer;\n\n let last_child_angle = null,\n last_circ_position = null,\n last_child_radius = null,\n min_radius = 0,\n effective_span = this._extents[0][1] * this.scales[0];\n\n let compute_distance = function(r1, r2, a1, a2, annular_shift) {\n annular_shift = annular_shift || 0;\n return Math.sqrt(\n (r2 - r1) * (r2 - r1) +\n 2 *\n (r1 + annular_shift) *\n (r2 + annular_shift) *\n (1 - Math.cos(a1 - a2))\n );\n };\n\n let max_r = 0;\n\n this.phylotree.nodes.each(d => {\n let my_circ_position = d.x * this.scales[0];\n d.angle = (2 * Math.PI * my_circ_position) / effective_span;\n d.text_angle = d.angle - Math.PI / 2;\n d.text_angle = d.text_angle > 0 && d.text_angle < Math.PI;\n d.text_align = d.text_angle ? \"end\" : \"start\";\n d.text_angle = (d.text_angle ? 180 : 0) + (d.angle * 180) / Math.PI;\n });\n\n this.do_lr(at_least_one_dimension_fixed);\n\n this.phylotree.nodes.each(d => {\n d.radius = (d.y * this.scales[1]) / this.size[1];\n max_r = Math.max(d.radius, max_r);\n });\n\n let annular_shift = 0;\n\n this.phylotree.nodes.each(d => {\n if (!d.children) {\n let my_circ_position = d.x * this.scales[0];\n if (last_child_angle !== null) {\n let required_spacing = my_circ_position - last_circ_position,\n radial_dist = compute_distance(\n d.radius,\n last_child_radius,\n d.angle,\n last_child_angle,\n annular_shift\n );\n\n let local_mr =\n radial_dist > 0\n ? required_spacing / radial_dist\n : 10 * this.options[\"max-radius\"];\n\n if (local_mr > this.options[\"max-radius\"]) {\n // adjust the annular shift\n let dd = required_spacing / this.options[\"max-radius\"],\n b = d.radius + last_child_radius,\n c =\n d.radius * last_child_radius -\n (dd * dd -\n (last_child_radius - d.radius) *\n (last_child_radius - d.radius)) /\n 2 /\n (1 - Math.cos(last_child_angle - d.angle)),\n st = Math.sqrt(b * b - 4 * c);\n\n annular_shift = Math.min(\n this.options[\"annular-limit\"] * max_r,\n (-b + st) / 2\n );\n min_radius = this.options[\"max-radius\"];\n } else {\n min_radius = Math.max(min_radius, local_mr);\n }\n }\n\n last_child_angle = d.angle;\n last_circ_position = my_circ_position;\n last_child_radius = d.radius;\n }\n });\n\n this.radius = Math.min(\n this.options[\"max-radius\"],\n Math.max(effective_span / 2 / Math.PI, min_radius)\n );\n\n if (at_least_one_dimension_fixed) {\n this.radius = Math.min(\n this.radius,\n (Math.min(effective_span, this._extents[1][1] * this.scales[1]) -\n this.label_width) *\n 0.5 -\n this.radius * annular_shift\n );\n }\n\n this.radial_center = this.radius_pad_for_bubbles = this.radius;\n this.draw_branch = _.partial(drawArc, this.radial_center);\n\n let scaler = 1;\n\n if (annular_shift) {\n scaler = max_r / (max_r + annular_shift);\n this.radius *= scaler;\n }\n\n this.phylotree.nodes.each(d => {\n cartesianToPolar(\n d,\n this.radius,\n annular_shift,\n this.radial_center,\n this.scales,\n this.size\n );\n\n max_r = Math.max(max_r, d.radius);\n\n if (this.options[\"draw-size-bubbles\"]) {\n this.radius_pad_for_bubbles = Math.max(\n this.radius_pad_for_bubbles,\n d.radius + this.nodeBubbleSize(d)\n );\n } else {\n this.radius_pad_for_bubbles = Math.max(\n this.radius_pad_for_bubbles,\n d.radius\n );\n }\n\n if (d.collapsed) {\n d.collapsed = d.collapsed.map(p => {\n let z = {};\n z.x = p[0];\n z.y = p[1];\n z = cartesianToPolar(\n z,\n this.radius,\n annular_shift,\n this.radial_center,\n this.scales,\n this.size\n );\n return [z.x, z.y];\n });\n\n let last_point = d.collapsed[1];\n\n d.collapsed = d.collapsed.filter(function(p, i) {\n if (i < 3 || i > d.collapsed.length - 4) return true;\n if (\n Math.sqrt(\n Math.pow(p[0] - last_point[0], 2) +\n Math.pow(p[1] - last_point[1], 2)\n ) > 3\n ) {\n last_point = p;\n return true;\n }\n return false;\n });\n }\n });\n\n this.size[0] = this.radial_center + this.radius / scaler;\n this.size[1] = this.radial_center + this.radius / scaler;\n } else {\nthis.do_lr();\n\n this.draw_branch = draw_line;\n this.edge_placer = lineSegmentPlacer;\n this.right_most_leaf = 0;\n\n this.phylotree.nodes.each(d => {\n\n d.x *= this.scales[0];\n d.y *= this.scales[1]*.8;\n\n if (this.options[\"layout\"] == \"right-to-left\") { \n d.y = this._extents[1][1] * this.scales[1] - d.y;\n }\n\n\n if (isLeafNode(d)) {\n this.right_most_leaf = Math.max(\n this.right_most_leaf,\n d.y + this.nodeBubbleSize(d)\n );\n }\n\n if (d.collapsed) {\n d.collapsed.forEach(p => {\n p[0] *= this.scales[0];\n p[1] *= this.scales[1]*.8;\n });\n\n let last_x = d.collapsed[1][0];\n\n d.collapsed = d.collapsed.filter(function(p, i) {\n if (i < 3 || i > d.collapsed.length - 4) return true;\n if (p[0] - last_x > 3) {\n last_x = p[0];\n return true;\n }\n return false;\n });\n }\n });\n }\n\n if (this.draw_scale_bar) {\n let domain_limit, range_limit;\n\n if (this.radial()) {\n range_limit = Math.min(this.radius / 5, 50);\n domain_limit = Math.pow(\n 10,\n Math.ceil(\n Math.log((this._extents[1][1] * range_limit) / this.radius) /\n Math.log(10)\n )\n );\n \n\n range_limit = domain_limit * (this.radius / this._extents[1][1]);\n\n if (range_limit < 30) {\n let stretch = Math.ceil(30 / range_limit);\n range_limit *= stretch;\n domain_limit *= stretch;\n }\n } else {\n domain_limit = this._extents[1][1];\n\n range_limit =\n this.size[1] - this.offsets[1] - this.options[\"left-offset\"] - this.shown_font_size;\n }\n\n let scale = d3\n .scaleLinear()\n .domain([0, domain_limit])\n .range([0, range_limit]),\n \n scaleTickFormatter = d3.format(\".2f\");\n\n this.draw_scale_bar = d3\n .axisTop()\n .scale(scale)\n .tickFormat(function(d) {\n if (d === 0) {\n return \"\";\n }\n return scaleTickFormatter(d);\n });\n\n if (this.radial()) {\n this.draw_scale_bar.tickValues([domain_limit]);\n } else {\n let round = function(x, n) {\n return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);\n };\n\n let my_ticks = scale.ticks();\n my_ticks = my_ticks.length > 1 ? my_ticks[1] : my_ticks[0];\n\n this.draw_scale_bar.ticks(\n Math.min(\n 10,\n round(\n range_limit /\n (this.shown_font_size *\n scaleTickFormatter(my_ticks).length *\n 2),\n 0\n )\n )\n );\n }\n } else {\n this.draw_scale_bar = null;\n }\n\n return this;\n }", "getOuterDepth() {\n mustInherit();\n }", "function getDepth(mag) {\n return (mag/10) \n }", "tidy(root) {\n let orderedNodes = [];\n this.postTraverse(root, orderedNodes);\n let modMap = {};\n let centerMap = {};\n let min_dist = 100;\n for (let node of orderedNodes) {\n centerMap[node.id] = 0;\n node.cx = 0;\n if (node.children.length != 0) {\n node.children[0].cx == 0;\n for (let i = 1; i < node.children.length; i++) {\n node.children[i].cx = node.children[i - 1].cx + min_dist;\n }\n centerMap[node.id] = (node.children[0].cx + node.children[node.children.length - 1].cx) / 2;\n }\n }\n // console.log(centerMap);\n for (let node of orderedNodes) {\n // console.log(node.label);\n //Set the top y value\n node.cy = node.depth * 75 + 50;\n let leftSiblings = (node.parents[0] != undefined && node.parents[0].children[0] !== node);\n // console.log(leftSiblings);\n // console.log(centeredValue);\n if (!leftSiblings) {\n node.cx = centerMap[node.id];\n modMap[node.id] = 0;\n }\n else {\n node.cx = node.parents[0].children[node.parents[0].children.indexOf(node) - 1].cx + min_dist;\n modMap[node.id] = node.cx - centerMap[node.id];\n }\n }\n this.shiftChildrenByMod(root, 0, modMap);\n modMap = this.clearModMap(modMap);\n //dealing with conflicts, twice.\n // modMap = this.fixConflicts(root, orderedNodes, modMap);\n modMap = this.fixConflicts(root, orderedNodes, modMap);\n this.fixOffScreen(root, modMap);\n root.cx = (root.children[0].cx + root.children[root.children.length - 1].cx) / 2;\n }", "function makeTree(n, x, y, z, rz, ry, tree) {\n\n // Get a cylinder mesh\n let segment = shapes.getCylinder(n * 0.75 / 2, n / 2, 8, \"#e0a872\")\n\n //Create a group that will serve as te center of rotation\n const group = new THREE.Group();\n const dir = new THREE.Vector3(0, 1, 0) \n group.position.x = x;\n group.position.y = y;\n group.position.z = z;\n\n group.add(segment)\n tree.add(group)\n segment.position.y += 4;\n // The rotation is done in two steps, a rotation around the Z axis followed by a rotation around the Y axis\n group.rotation.z = rz;\n let axis = new THREE.Vector3(0, 0, 1);\n let angle = rz;\n dir.applyAxisAngle(axis, angle)\n group.rotation.y = ry;\n axis = new THREE.Vector3(0, 1, 0)\n angle = ry;\n dir.applyAxisAngle(axis, angle)\n \n // Scale the direction vector to easily find the endpoint of the branch (which is also the start point of the next branches)\n dir.multiply(new THREE.Vector3(8, 8, 8));\n\n // num dictates how many branches branch off this branch\n let num = Math.floor(Math.random() * 2 * n)\n if(tree.children.length < 10) { // If the tree is too small, add an extra child branch\n num ++\n }\n for (let i = 0; i < num; i++) {\n makeTree(n * 0.75, x + dir.x, y + dir.y, z + dir.z, Math.random() * Math.PI / 2, ry + Math.PI * 2 / num * i + Math.random() * Math.PI / 6 - Math.PI / 3, tree)\n }\n\n // If this is a terminal branch then attach a bushel of leaves\n if (num == 0) {\n let leaves = shapes.getSphere(Math.log(n * 10.75), `rgb(${Math.floor(Math.random() * 100)}, 255, ${Math.floor(Math.random() * 100)})`)\n leaves.position.x = x + dir.x\n leaves.position.y = y + dir.y\n leaves.position.z = z + dir.z\n tree.add(leaves)\n }\n\n}", "levelTraversal () {\n let elements = [];\n let agenda = [this];\n while(agenda.length > 0) {\n let curElem = agenda.shift();\n if(curElem.height == 0) continue;\n elements.push(curElem);\n agenda.push(curElem.left);\n agenda.push(curElem.right);\n }\n return elements;\n }", "function Tree(density, startPosX, startPosY, charWidth, char, wordSize) {\n this.leaves = [];\n this.branches = [];\n\n // BOUNDARY CHECK using a background layer\n let tempCanvas = createGraphics(width, height);\n tempCanvas.fill(100);\n tempCanvas.textFont(myFont);\n tempCanvas.textSize(wordSize);\n tempCanvas.text(char, startPosX, startPosY);\n\n // MAKE LEAVES\n\n for (var i = 0; i < density; i++) {\n let tempPos = createVector(random(startPosX, startPosX + charWidth), random(startPosY, startPosY - charWidth * 1.25));\n // check if tempPos is within B/W bounds\n let sampleColor = tempCanvas.get(tempPos.x, tempPos.y);\n\n if (sampleColor[0] == 100) {\n this.leaves.push(new Leaf(tempPos.x, tempPos.y));\n } else {\n density += 1;\n }\n }\n // console.log('density Count is ' + density)\n\n // MAKE ROOT\n let rootNum = startRootNum; // could change later\n let rootPos = [];\n for (let i = 0; i < rootNum; i++) {\n\n // making sure sketch doesn't crash!\n if (i > 100) {\n console.log(\"Something is wrong, can't find a place to place roots!\")\n break;\n }\n\n // making a 'root' start from inside the letter\n let tempPos = createVector(random(startPosX, startPosX + charWidth), random(startPosY, startPosY - charWidth));\n\n // check if tempPos is within B/W bounds\n let sampleColor = tempCanvas.get(tempPos.x, tempPos.y);\n\n // Resample root pos if tempPos is not within bounds\n if (sampleColor[0] == 100) {\n rootPos.push(tempPos);\n } else {\n rootNum += 1;\n }\n\n }\n\n\n let roots = [];\n var dir = createVector(0, -1);\n for (let i = 0; i < rootPos.length; i++) {\n let root = new Branch(null, rootPos[i], dir)\n this.branches.push(root);\n var current = root;\n var found = false;\n let failCount = 0;\n while (!found) {\n\n for (let i = 0; i < this.leaves.length; i++) {\n var d = p5.Vector.dist(current.pos, this.leaves[i].pos);\n\n if (d < max_dist) {\n found = true;\n }\n }\n if (!found) {\n // failCount += 1;\n console.log(\"failcount is \" + failCount);\n\n // if I delete it it still works, what's this doing??\n\n var branch = current.next();\n current = branch;\n this.branches.push(current);\n // if (failCount > 10) {\n // console.log(\"failcount is \" + failCount);\n // break;\n // }\n }\n\n }\n }\n\n this.grow = function() {\n for (var i = 0; i < this.leaves.length; i++) {\n var leaf = this.leaves[i];\n var closestBranch = null;\n var record = max_dist;\n\n for (var j = 0; j < this.branches.length; j++) {\n var branch = this.branches[j];\n var d = p5.Vector.dist(leaf.pos, branch.pos);\n if (d < min_dist) {\n leaf.reached = true;\n closestBranch = null;\n break;\n } else if (d < record) {\n closestBranch = branch;\n record = d;\n }\n }\n\n if (closestBranch != null) {\n var newDir = p5.Vector.sub(leaf.pos, closestBranch.pos);\n newDir.normalize();\n closestBranch.dir.add(newDir);\n closestBranch.count++;\n }\n }\n\n for (var i = this.leaves.length - 1; i >= 0; i--) {\n if (this.leaves[i].reached) {\n this.leaves.splice(i, 1);\n }\n }\n\n for (var i = this.branches.length - 1; i >= 0; i--) {\n var branch = this.branches[i];\n if (branch.count > 0) {\n branch.dir.div(branch.count + 1);\n this.branches.push(branch.next());\n branch.reset();\n }\n }\n }\n\n\n\n\n\n this.show = function(debugView) {\n\n if (debugView) {\n // DEBUGGING VIEW FOR LETTERS!\n image(tempCanvas, 0, 0);\n\n // root start points are RED\n tempCanvas.noStroke();\n tempCanvas.fill(255, 0, 0);\n for (let i = 0; i < rootPos.length; i++) {\n tempCanvas.ellipse(rootPos[i].x, rootPos[i].y, 10);\n }\n\n // shows unreached leaves in GREEN\n for (var i = 0; i < this.leaves.length; i++) {\n this.leaves[i].showDebug();\n }\n }\n\n for (var i = 0; i < this.branches.length; i++) {\n this.branches[i].show();\n }\n\n }\n\n}", "function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n var minKy = Infinity;\n util[\"k\" /* each */](nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n util[\"k\" /* each */](nodes, function (node) {\n sum += node.getLayout().value;\n });\n var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\n if (ky < minKy) {\n minKy = ky;\n }\n });\n util[\"k\" /* each */](nodesByBreadth, function (nodes) {\n util[\"k\" /* each */](nodes, function (node, i) {\n var nodeDy = node.getLayout().value * minKy;\n\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n util[\"k\" /* each */](edges, function (edge) {\n var edgeDy = +edge.getValue() * minKy;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}", "function sube_z(id_obj) {\n\t\tvar z_in = document.getElementById(id_obj).style.zIndex;\n\t\tif(z_in<4){\n\t\t\tvar z_new = parseInt(z_in)+parseInt('1');\n\t\t document.getElementById(id_obj).style.zIndex = z_new;\n\t } else {\n\t \talert (\"No puedes subir más este objeto\");\n\t \t\n\t } \n\t}", "function rbushTreeItem(ring, edge) {\n\n var start = coord[ring][edge];\n var end = coord[ring][edge+1];\n\n if (start[0] < end[0]) {\n var minX = start[0], maxX = end[0];\n } else {\n var minX = end[0], maxX = start[0];\n };\n if (start[1] < end[1]) {\n var minY = start[1], maxY = end[1];\n } else {\n var minY = end[1], maxY = start[1];\n }\n return {minX: minX, minY: minY, maxX: maxX, maxY: maxY, ring: ring, edge: edge};\n }", "split() {\n // bottom four octants\n // -x-y-z\n this.nodes[0] = new Octree(this.bounds.x, this.bounds.y, this.bounds.z, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n // +x-y-z\n this.nodes[1] = new Octree(this.bounds.frontX, this.bounds.y, this.bounds.z, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n // -x+y-z\n this.nodes[2] = new Octree(this.bounds.x, this.bounds.frontY, this.bounds.z, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n // +x+y-z\n this.nodes[3] = new Octree(this.bounds.frontX, this.bounds.frontY, this.bounds.z, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n\n // top four octants\n // -x-y+z\n this.nodes[4] = new Octree(this.bounds.x, this.bounds.y, this.bounds.top, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n // +x-y+z\n this.nodes[5] = new Octree(this.bounds.frontX, this.bounds.y, this.bounds.top, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n // -x+y+z\n this.nodes[6] = new Octree(this.bounds.x, this.bounds.frontY, this.bounds.top, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n // +x+y+z\n this.nodes[7] = new Octree(this.bounds.frontX, this.bounds.frontY, this.bounds.top, this.bounds.subWidthX, this.bounds.subWidthY, this.bounds.subHeight, this.maxLevels, (this.level + 1));\n }", "function increase_z() {\n\n\tvar sodu_2 = [];\n\tsodu_2[0] = [1, 0];\n\tsodu_2[1] = [0, 1];\n\tsodu_2[2] = [1, 1];\n\tsodu_2[3] = [0, 0];\n\n\tfor (var row = 0; row < num_row; row++) {\n\t\tif (row%2 == sodu_2[num_increase][0]) {\n\t\t\tfor (var col = 0; col < num_col; col++) {\n\t\t\t\tif (col%2 == sodu_2[num_increase][1]) {\n\t\t\t\t\tz_index[pics_index - 1][row][col] = num_pic - 1;\n\t\t\t\t\tpic[pics_index - 1][row][col].style.zIndex = z_index[pics_index - 1][row][col];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (num_increase == 3) {\n\t\tnum_increase = 0;\n\n\t\tclearInterval(id);\n\t\ttimer_Flag = 0;\n\n\t\tpics_index--;\n\n\t\tchange_highlight(pics_index);\n\t} else {\n\t\tnum_increase++;\n\t}\n}", "getInnerDepth() {\n mustInherit();\n }", "function Tree(sketch) {\n this.closeEnough = function (b) {\n for (var i = 0; i < this.leaves.length; i++) {\n var d = p5.Vector.dist(b.pos, this.leaves[i].pos);\n if (d < max_dist) {\n return true;\n }\n }\n return false;\n }\n\n this.leaves = [];\n this.branches = [];\n\n var n = 200;\n if(sketch.isLiveJs) n = 2000;\n for (var i = 0; i < n; i++) {\n this.leaves.push(new Leaf(sketch));\n }\n var pos = sketch.createVector(0, sketch.height);\n var dir = sketch.createVector(0, -1);\n var root = new Branch(sketch, pos, dir);\n this.branches.push(root);\n var current = new Branch(sketch, root);\n\n while (!this.closeEnough(current)) {\n var trunk = new Branch(sketch, current);\n this.branches.push(trunk);\n current = trunk;\n }\n\n this.grow = function() {\n for (var i = 0; i < this.leaves.length; i++) {\n var l = this.leaves[i];\n var closest = null;\n var closestDir = null;\n var record = -1;\n\n for (var j = 0; j < this.branches.length; j++) {\n var b = this.branches[j];\n var dir = p5.Vector.sub(l.pos, b.pos)\n var d = dir.mag();\n if (d < min_dist) {\n l.reached = true;\n closest = null;\n break;\n } else if (d > max_dist) {\n } else if (closest == null || d < record) {\n closest = b;\n closestDir = dir;\n record = d;\n }\n }\n\n if (closest != null) {\n closestDir.normalize();\n closest.dir.add(closestDir);\n closest.count++;\n }\n }\n\n for (var i = this.leaves.length - 1; i >= 0; i--) {\n if (this.leaves[i].reached) {\n this.leaves.splice(i, 1);\n }\n }\n\n for (var i = this.branches.length - 1; i >= 0; i--) {\n var b = this.branches[i];\n if (b.count > 0) {\n b.dir.div(b.count);\n var rand = p5.Vector.random2D();\n rand.setMag(0.3);\n b.dir.add(rand);\n b.dir.normalize();\n var newB = new Branch(sketch, b);\n this.branches.push(newB);\n b.reset();\n }\n }\n }\n\n this.show = function() {\n for (var i = 0; i < this.leaves.length; i++) {\n this.leaves[i].show();\n }\n\n for (var i = 0; i < this.branches.length; i++) {\n var b = this.branches[i];\n if (b.parent != null) {\n var sw = sketch.map(i, 0, this.branches.length, 6, 0);\n sketch.strokeWeight(sw);\n sketch.stroke(255);\n sketch.line(b.pos.x, b.pos.y, b.pos.z, b.parent.pos.x, b.parent.pos.y, b.parent.pos.z);\n }\n }\n }\n}", "zigZag() {\n\n var array = [];\n\n return Private.zigZag(array, this.head);\n }", "initDepths(columns = this.columns.topColumns, parent = null) {\n let me = this,\n maxDepth = 0;\n if (parent && parent.meta) parent.meta.depth++;\n\n for (const column of columns) {\n // TODO: this should maybe move\n column.meta.depth = 0;\n\n if (column.children) {\n me.initDepths(column.children.filter(me.columns.chainedFilterFn), column);\n if (column.meta.depth && parent) parent.meta.depth += column.meta.depth;\n }\n\n if (column.meta.depth > maxDepth) maxDepth = column.meta.depth;\n }\n\n if (!parent) {\n me.maxDepth = maxDepth;\n }\n\n return maxDepth;\n }", "renderScene(scene) {\n let flatScene = this.projectScene(scene)\n\n let polygonList = []\n flatScene.addToList(polygonList)\n //polygonList.sort((a, b) => (a === b)? 0 : a? -1 : 1)\n polygonList.sort(function(a, b) {\n if(a.getAverageDepth() < b.getAverageDepth()) {\n return 1\n } else if(a.getAverageDepth() > b.getAverageDepth()) {\n return -1\n } else if(a.justOutline && !b.justOutline) {//Both are same depth, sort by outline or not\n return -1\n } else return 1\n })\n // polygonList.sort((a,b) => (a.getAverageDepth() < b.getAverageDepth()) ? 1 : -1 || (a.justOutline === b.justOutline)? 0 : a.justOutline? 1 : -1)\n \n let context = this.canvas.getContext(\"2d\")\n \n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n //Clear context first? \n for(let i = 0; i < polygonList.length; i++) {\n let polygon = polygonList[i] \n polygon.render(context)\n }\n }", "function getZIndex(el) {return _zIndex && !isNaN(_zIndex) ? (_zIndex - 0) : $XH.getZIndex(el);}", "function getZIndex(el) {return _zIndex && !isNaN(_zIndex) ? (_zIndex - 0) : $XH.getZIndex(el);}", "function DepthShell(){\n\tvar p= {\n\t\tminFilter: THREE.NearestFilter,\n\t\tmagFilter: THREE.NearestFilter,\n\t\tstencilBuffer: false,//3js depth attachments are wack such that adding a stencil causes depth24_stencil8, while without is only depth16. i dont think we need much precision\n\t\tformat: THREE.RedFormat,\n\t\ttype: THREE.FloatType,\n\t\tdepthBuffer: true,\n\t};\n\t//3js does not support multiple depth buffers\n\n\tconst back= this.back= new THREE.WebGLRenderTarget(100,100,p);\n\tconst front= this.front= new THREE.WebGLRenderTarget(100,100,p);\n\t back.depthTexture= new THREE.DepthTexture();\n\tfront.depthTexture= new THREE.DepthTexture();\n\n\n\tconst scene_front= new THREE.Scene();\n\tconst scene_back= new THREE.Scene();\t\n\t//having 2 scenes is cleaner than mutating the override material\n\tscene_front.overrideMaterial= new THREE.MeshDepthMaterial({ colorWrite: true, side: THREE.FrontSide });\n\tscene_back.overrideMaterial= new THREE.MeshDepthMaterial({ colorWrite: true, side: THREE.BackSide }); \n\tscene_front.sortObjects= false;\n\tscene_back.sortObjects= false;\n\tthis.add= o=>{\n\t\tscene_front.add(o);\n\t\t scene_back.add(o);\n\t};\n\tthis.dispose= ()=>{\n\t\tback.dispose();\n\t\tfront.dispose();\n\t};\n\tthis.setSize= (width, height)=>{\n\t\tconst w= width;\n\t\tconst h= height;\n\t\t back.setSize(w,h);\n\t\tfront.setSize(w,h);\n\t};\n\t//uses the added objects\n\tthis.render= (renderer,camera)=>{\n\t\tconst pop= {\n\t\t\ttarg: renderer.getRenderTarget(),\n\t\t};\n\n\t\trenderer.setRenderTarget(back);\n\t\t//renderer.clearDepth();\n\t\trenderer.render(scene_back, camera);\n\n\t\trenderer.setRenderTarget(front);\n\t\t//renderer.clearDepth();\n\t\trenderer.render(scene_front, camera);\n\n\t\t//restore state (this is terrible yet standard design)\n\t\trenderer.setRenderTarget(pop.targ);\n\t};\n}", "function spawnGreenLeaf()\n{\n //creating an if block to spawn the leaves at specific points or distance\n if(frameCount%60==0)\n {\n greenLeaf=createSprite(random(0,400),0,20,20)\n greenLeaf.addImage(\"greenLeaf\",greenLeafImage)\n greenLeaf.velocityY=5\n greenLeaf.scale= 0.2\n // leaf behind the rabbit\n greenLeaf.depth=rabbit.depth \n rabbit.depth=rabbit.depth+1\n\n }\n \n}", "function getNextZ() {\n nextZ = nextZ + 1;\n return nextZ-1;\n}", "function createTree(x , y, z){ //holds all of the below as a function\r\n\t//treeTrunk the brown trunk of the tree\r\n\tvar g1 = new THREE.CylinderGeometry( 0.6, 0.6, 4.5, 20); ///(top, bottom, size, shapeish)\r\n\tvar m1 = new THREE.MeshToonMaterial({color:0x603B14,transparent:false,flatShading:false});\r\n\tm1.shininess = 7;\r\n//\tvar m1 = new THREE.MeshBasicMaterial( {color: 0x603B14} );\r\n\tvar treeTrunk = new THREE.Mesh( g1, m1 );\r\n\t//treeTrunk.rotation.y = globeBox.getCenter[2];\r\n\t//treeLower- the green part of the tree creation\r\n\tvar g2 = new THREE.CylinderGeometry(0.1, 2.9, 7, 20); // You had the sizes the wrong way around, didn't need to -7 the scale.\r\n\tvar m2 = new THREE.MeshToonMaterial({color:0x358C47,transparent:false,flatShading:false});\r\n\tm2.shininess = 5;\r\n\tvar treeLower = new THREE.Mesh( g2, m2 );\r\n\t\r\n\t// Set position of tree parts.\r\n\ttreeLower.position.x=0;\r\n\ttreeLower.position.y=6.0; //-920 for big view //6.0 works with ghetto set up\r\n\ttreeLower.position.z=0; //250 //0 works with my ghetto set up\r\n\t//add tree meshes\r\n\tscene.add( treeTrunk );\r\n\tscene.add(treeLower);\r\n\t//scales the trees up to be seen better.\r\n\ttreeTrunk.scale.x = 6;\r\n\ttreeTrunk.scale.y = 6;\r\n\ttreeTrunk.scale.z = 6;\r\n\t// define parent-child relationships\r\n\ttreeLower.parent = treeTrunk;\r\n\ttreeTrunk.position.x = x;\r\n\ttreeTrunk.position.y = y;\r\n\ttreeTrunk.position.z = z;\r\n\ttreeTrunk.parent = globe;\r\n\tvar rotation = new THREE.Quaternion();\r\n\trotation.setFromUnitVectors(globe.up, treeTrunk.position.clone().normalize());\r\n\ttreeTrunk.quaternion.copy(rotation);\r\n\t\r\n\t// Enable shadows.\r\n\ttreeTrunk.castShadow = true;\r\n\ttreeLower.castShadow = true;\r\n\r\n\t// Sets the name so the raycast can query against it.\r\n\ttreeLower.name = \"tree\";\r\n\ttreeTrunk.name = \"tree\";\r\n}", "setDepthBasedOnChildren() {\n if (this.left != null) {\n this.depth = this.left.depth + 1;\n }\n if (this.right != null && this.depth <= this.right.depth) {\n this.depth = this.right.depth + 1;\n }\n }", "get depth() {\n\t\treturn this._depth;\n\t}", "breadthFirst() {\n let queue = new LinkedQueue();\n let visited = new LinkedList();\n queue.enqueue(new Point(WORLD_WIDTH - 2, WORLD_HEIGHT - 2, 0));\n let current = null;\n while (queue.length > 0) {\n current = queue.dequeue();\n let j = current.y;\n let i = current.x;\n if (this.tiles[j - 1][i] === 'F' &&\n !visited.contains(new Point(i, j - 1))) {\n queue.enqueue(new Point(i, j - 1, current.depth + 1));\n visited.add(new Point(i, j - 1));\n }\n if (this.tiles[j + 1][i] === 'F' &&\n !visited.contains(new Point(i, j + 1))) {\n queue.enqueue(new Point(i, j + 1, current.depth + 1));\n visited.add(new Point(i, j + 1));\n }\n if (this.tiles[j][i - 1] === 'F' &&\n !visited.contains(new Point(i - 1, j))) {\n queue.enqueue(new Point(i - 1, j, current.depth + 1));\n visited.add(new Point(i - 1, j));\n }\n if (this.tiles[j][i + 1] === 'F' &&\n !visited.contains(new Point(i + 1, j))) {\n queue.enqueue(new Point(i + 1, j, current.depth + 1));\n visited.add(new Point(i + 1, j));\n }\n }\n return current;\n }", "secondWalk(node, level, X, Y) {\n if (level > this.cfg.maxDepth) {\n return;\n }\n\n const xTmp = node.prelim + X;\n const yTmp = Y;\n const align = this.cfg.nodeAlign;\n const orient = this.cfg.rootOrientation;\n let levelHeight;\n let nodesizeTmp;\n\n if (orient === 'NORTH' || orient === 'SOUTH') {\n levelHeight = this.levelMaxDim[level].height;\n nodesizeTmp = node.height;\n if (node.pseudo) {\n // eslint-disable-next-line no-param-reassign\n node.height = levelHeight;\n } // assign a new size to pseudo nodes\n } else if (orient === 'WEST' || orient === 'EAST') {\n levelHeight = this.levelMaxDim[level].width;\n nodesizeTmp = node.width;\n if (node.pseudo) {\n // eslint-disable-next-line no-param-reassign\n node.width = levelHeight;\n } // assign a new size to pseudo nodes\n }\n\n // eslint-disable-next-line no-param-reassign\n node.X = xTmp;\n\n if (node.pseudo) {\n // pseudo nodes need to be properly aligned, otherwise position is not correct in some examples\n if (orient === 'NORTH' || orient === 'WEST') {\n // eslint-disable-next-line no-param-reassign\n node.Y = yTmp; // align \"BOTTOM\"\n } else if (orient === 'SOUTH' || orient === 'EAST') {\n // eslint-disable-next-line no-param-reassign\n node.Y = yTmp + (levelHeight - nodesizeTmp); // align \"TOP\"\n }\n } else {\n // eslint-disable-next-line no-param-reassign\n node.Y =\n // eslint-disable-next-line no-nested-ternary\n align === 'CENTER'\n ? yTmp + (levelHeight - nodesizeTmp) / 2\n : align === 'TOP'\n ? yTmp + (levelHeight - nodesizeTmp)\n : yTmp;\n }\n\n if (orient === 'WEST' || orient === 'EAST') {\n const swapTmp = node.X;\n // eslint-disable-next-line no-param-reassign\n node.X = node.Y;\n // eslint-disable-next-line no-param-reassign\n node.Y = swapTmp;\n }\n\n if (orient === 'SOUTH') {\n // eslint-disable-next-line no-param-reassign\n node.Y = -node.Y - nodesizeTmp;\n } else if (orient === 'EAST') {\n // eslint-disable-next-line no-param-reassign\n node.X = -node.X - nodesizeTmp;\n }\n\n if (node.childrenCount() !== 0) {\n if (node.id === 0 && this.cfg.hideRootNode) {\n // ako je root node Hiden onda nemoj njegovu dijecu pomaknut po Y osi za Level separation, neka ona budu na vrhu\n this.secondWalk(node.firstChild(), level + 1, X + node.modifier, Y);\n } else {\n this.secondWalk(\n node.firstChild(),\n level + 1,\n X + node.modifier,\n Y + levelHeight + this.cfg.levelSeparation,\n );\n }\n }\n\n if (node.rightSibling()) {\n this.secondWalk(node.rightSibling(), level, X, Y);\n }\n }", "async function buildHierarchy(rem, depth, store) {\r\n if (!rem) return;\r\n if (!rem.children) return {rem};\r\n\r\n const childrenRemIds = await store.getRem(rem.children);\r\n const children = await Promise.all(\r\n childrenRemIds.map((c) => buildHierarchy(c, depth + 1, store))\r\n );\r\n await Promise.all(\r\n children.map(\r\n async (c) =>\r\n (c.descriptorData = await matchPowerUpDescriptor(c, descriptorFormatters, store))\r\n )\r\n );\r\n rem.descriptors = children.filter((c) => c.descriptorData);\r\n rem.children = children.filter((c) => !c.descriptorData);\r\n rem.depth = depth;\r\n return rem;\r\n}", "initTrails( array ){\r\n let index = 0;\r\n let h = colorMax / ( this.var.m + 0.5 );\r\n //parent branches\r\n for( let i = this.var.n; i < this.var.l; i++ ){\r\n let first = this.var.l - 1;\r\n let second = i;\r\n let hue = h * ( i - this.var.n );\r\n this.createTrail( first, second, hue );\r\n\r\n //child branches\r\n for( let j = 0; j < array[i - this.var.n]; j++ ){\r\n first = index + j;\r\n hue = h * ( i - this.var.n ) + h / ( array[i - this.var.n] + 1 ) * ( j + 1 );\r\n this.createTrail( first, second, hue );\r\n }\r\n index += array[i - this.var.n];\r\n }\r\n }", "getZOrder() {\n return this.views\n .filter(_view => {\n return _view && _view.parent.elemId === 0;\n })\n .map((_view, index) => {\n let zIndex = ELEM.getStyle(_view.elemId, 'z-index', true);\n if (zIndex !== 'auto') {\n zIndex = parseInt(zIndex, 10);\n if (!isFinite(zIndex)) {\n zIndex = 'auto';\n }\n }\n return {\n index,\n viewId: _view.viewId,\n zIndex\n };\n })\n .sort((a, b) => {\n if (a.zIndex === b.zIndex) {\n return a.index - b.index;\n }\n else if (a.zIndex === 'auto') {\n return -1;\n }\n else if (b.zIndex === 'auto') {\n return 1;\n }\n else {\n return a.zIndex - b.zIndex;\n }\n })\n .map(({viewId}) => {\n return viewId;\n });\n }", "placeNodes({ sliceDepth, frontierDepth, parent, inject, wrap: wrap2 }) {\n while (this.depth > frontierDepth)\n this.closeFrontierNode();\n if (wrap2)\n for (let i = 0; i < wrap2.length; i++)\n this.openFrontierNode(wrap2[i]);\n let slice2 = this.unplaced, fragment = parent ? parent.content : slice2.content;\n let openStart = slice2.openStart - sliceDepth;\n let taken = 0, add = [];\n let { match, type } = this.frontier[frontierDepth];\n if (inject) {\n for (let i = 0; i < inject.childCount; i++)\n add.push(inject.child(i));\n match = match.matchFragment(inject);\n }\n let openEndCount = fragment.size + sliceDepth - (slice2.content.size - slice2.openEnd);\n while (taken < fragment.childCount) {\n let next = fragment.child(taken), matches2 = match.matchType(next.type);\n if (!matches2)\n break;\n taken++;\n if (taken > 1 || openStart == 0 || next.content.size) {\n match = matches2;\n add.push(closeNodeStart(next.mark(type.allowedMarks(next.marks)), taken == 1 ? openStart : 0, taken == fragment.childCount ? openEndCount : -1));\n }\n }\n let toEnd = taken == fragment.childCount;\n if (!toEnd)\n openEndCount = -1;\n this.placed = addToFragment(this.placed, frontierDepth, Fragment.from(add));\n this.frontier[frontierDepth].match = match;\n if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)\n this.closeFrontierNode();\n for (let i = 0, cur = fragment; i < openEndCount; i++) {\n let node = cur.lastChild;\n this.frontier.push({ type: node.type, match: node.contentMatchAt(node.childCount) });\n cur = node.content;\n }\n this.unplaced = !toEnd ? new Slice(dropFromFragment(slice2.content, sliceDepth, taken), slice2.openStart, slice2.openEnd) : sliceDepth == 0 ? Slice.empty : new Slice(dropFromFragment(slice2.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice2.openEnd : sliceDepth - 1);\n }", "function width_at_depth (points, percent_depth){\n var lowest = 1000000;\n var highest = -1000000;\n for (var i = 0; i < points.length; i++){\n if (points[i][1] < lowest){\n lowest = points[i][1];\n }\n if (points[i][1] > highest){\n highest = points[i][1];\n }\n }\n var pair1 = [];\n var pair2 = []; // defines the line segments that intersect with y = -max_depth/2\n var target_y = highest - (Math.abs(highest-lowest)*percent_depth);\n console.log(target_y);\n for (var i = 0; i < points.length; i++){\n if (i === 0){\n // if on the first point, compare with the last point\n if (((points[points.length-1][1]-target_y) * (points[0][1]-target_y)) <= 0){\n // if the differences between the y-coordinates and half of max_depth have opposite signs\n if (pair1.length === 0) {\n pair1 = [points[0], points[points.length - 1]];\n } else{\n pair2 = [points[0], points[points.length - 1]];\n }\n }\n } else {\n if (((points[i-1][1]-target_y) * (points[i][1]-target_y)) <= 0){\n if (pair1.length === 0) {\n pair1 = [points[i-1], points[i]];\n } else{\n pair2 = [points[i-1], points[i]];\n }\n }\n }\n }\n // find x-coordinates of intersections\n var slope1 = (pair1[1][1]-pair1[0][1]) / (pair1[1][0]-pair1[0][0]);\n var slope2 = (pair2[1][1]-pair2[0][1]) / (pair2[1][0]-pair2[0][0]);\n var intersection1 = (target_y-pair1[0][1]) / slope1 + pair1[0][0];\n var intersection2 = (target_y-pair2[0][1]) / slope2 + pair2[0][0];\n return Math.abs(intersection1-intersection2);\n}", "get depth() {\n return this._depth;\n }", "get depth() {\n return this._depth;\n }", "function getLayerStack(TYPE) {\r\n if (ie4) {\r\n var tempLayerZIndex = null;\r\n for (var tempLayerLoop in document.all) {\r\n if (typeof(document.all[tempLayerLoop]) == 'object' && (document.all[tempLayerLoop].tagName == 'DIV' || document.all[tempLayerLoop].tagName == 'SPAN')) {\r\n if (tempLayerZIndex == null || eval('document.all[tempLayerLoop].style.zIndex ' + TYPE + ' tempLayerZIndex')) {\r\n tempLayerZIndex = document.all[tempLayerLoop].style.zIndex;\r\n }\r\n }\r\n }\r\n }\r\n else if (ns4) {\r\n var tempParentObj = (arguments.length == 1) ? document : arguments[1];\r\n var tempLayerZIndex = (arguments.length == 1) ? null : arguments[2];\r\n for (var tempLayerLoop in tempParentObj.layers) {\r\n var tempConstructor = tempParentObj.layers[tempLayerLoop].constructor + '';\r\n if (tempConstructor.indexOf('function Layer()') != -1) {\r\n if (tempLayerZIndex == null || eval('tempParentObj.layers[tempLayerLoop].zIndex ' + TYPE + ' tempLayerZIndex')) {\r\n tempLayerZIndex = tempParentObj.layers[tempLayerLoop].zIndex;\r\n }\r\n if (tempParentObj.layers[tempLayerLoop].layers.length > 0) {\r\n tempLayerZIndex = getLayerStack(TYPE,tempParentObj.layers[tempLayerLoop].document,tempLayerZIndex);\r\n }\r\n }\r\n }\r\n }\r\n else if (dyn) {\r\n var tempLayerZIndex = null;\r\n var tempLayersObj = document.getElementsByTagName('div');\r\n for (var tempLayerLoop = 0; tempLayerLoop < tempLayersObj.length; tempLayerLoop++) {\r\n if (tempLayerZIndex == null || eval('tempLayersObj[tempLayerLoop].style.zIndex ' + TYPE + ' tempLayerZIndex')) {\r\n tempLayerZIndex = tempLayersObj[tempLayerLoop].style.zIndex;\r\n }\r\n }\r\n }\r\n return tempLayerZIndex;\r\n }", "mazeUsingKruskal(grid){\n let verticalWalls=[];\n let horizontalWalls=[];\n let z=0;\n let y=0;\n let parent=[];\n for (let row = 0; row < 23; row++) {\n let temp=[];\n for (let col = 0; col < 57; col++) {\n if((((row+col)%2===0)||(row%2===0))&&((row!==START_NODE_ROW || col!==START_NODE_COL)&&(row!==FINISH_NODE_ROW || col!==FINISH_NODE_COL))){\n const newGrid = getNewGridWithWallToggled(this.state.grid, row, col);\n this.setState({grid: newGrid, mouseIsPressed: false});\n }\n if((((row+col)%2===0)&&(row%2===0))&&(row!==0 && row!==22)){\n verticalWalls.push([row,col]);\n z++;\n }\n if(((row+col)%2===0)&&(row%2===1)){\n horizontalWalls.push([row,col]);\n y++;\n }\n temp.push([row,col]);\n }\n parent.push(temp);\n }\n let temp1=Math.floor(4*Math.random());\n if(temp1===0){\n parent[START_NODE_ROW-1][START_NODE_COL][0]=parent[START_NODE_ROW-1][START_NODE_COL-1][0];\n parent[START_NODE_ROW-1][START_NODE_COL][1]=parent[START_NODE_ROW-1][START_NODE_COL-1][1];\n parent[START_NODE_ROW-1][START_NODE_COL+1][0]=parent[START_NODE_ROW-1][START_NODE_COL-1][0];\n parent[START_NODE_ROW-1][START_NODE_COL+1][1]=parent[START_NODE_ROW-1][START_NODE_COL-1][1];\n grid[START_NODE_ROW-1][START_NODE_COL].isWall=false;\n y--;\n }\n else if(temp1===1){\n parent[START_NODE_ROW-1][START_NODE_COL+1][0]=parent[START_NODE_ROW+1][START_NODE_COL+1][0];\n parent[START_NODE_ROW-1][START_NODE_COL+1][1]=parent[START_NODE_ROW+1][START_NODE_COL+1][1];\n parent[START_NODE_ROW][START_NODE_COL+1][0]=parent[START_NODE_ROW+1][START_NODE_COL+1][0];\n parent[START_NODE_ROW][START_NODE_COL+1][1]=parent[START_NODE_ROW+1][START_NODE_COL+1][1];\n grid[START_NODE_ROW][START_NODE_COL+1].isWall=false;\n z--;\n }\n else if(temp1===2){\n parent[START_NODE_ROW+1][START_NODE_COL-1][0]=parent[START_NODE_ROW+1][START_NODE_COL+1][0];\n parent[START_NODE_ROW+1][START_NODE_COL-1][1]=parent[START_NODE_ROW+1][START_NODE_COL+1][1];\n parent[START_NODE_ROW+1][START_NODE_COL][0]=parent[START_NODE_ROW+1][START_NODE_COL+1][0];\n parent[START_NODE_ROW+1][START_NODE_COL][1]=parent[START_NODE_ROW+1][START_NODE_COL+1][1];\n grid[START_NODE_ROW+1][START_NODE_COL].isWall=false;\n y--;\n }\n else{\n parent[START_NODE_ROW][START_NODE_COL-1][0]=parent[START_NODE_ROW-1][START_NODE_COL-1][0];\n parent[START_NODE_ROW][START_NODE_COL-1][1]=parent[START_NODE_ROW-1][START_NODE_COL-1][1];\n parent[START_NODE_ROW+1][START_NODE_COL-1][0]=parent[START_NODE_ROW-1][START_NODE_COL-1][0];\n parent[START_NODE_ROW+1][START_NODE_COL-1][1]=parent[START_NODE_ROW-1][START_NODE_COL-1][1];\n grid[START_NODE_ROW][START_NODE_COL-1].isWall=false;\n z--;\n }\n let temp2=Math.floor(4*Math.random());\n if(temp2===0){\n parent[FINISH_NODE_ROW-1][FINISH_NODE_COL][0]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][0];\n parent[FINISH_NODE_ROW-1][FINISH_NODE_COL][1]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][1];\n parent[FINISH_NODE_ROW-1][FINISH_NODE_COL+1][0]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][0];\n parent[FINISH_NODE_ROW-1][FINISH_NODE_COL+1][1]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][1];\n grid[FINISH_NODE_ROW-1][FINISH_NODE_COL].isWall=false;\n y--;\n }\n else if(temp2===1){\n parent[FINISH_NODE_ROW-1][FINISH_NODE_COL+1][0]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][0];\n parent[FINISH_NODE_ROW-1][FINISH_NODE_COL+1][1]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][1];\n parent[FINISH_NODE_ROW][FINISH_NODE_COL+1][0]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][0];\n parent[FINISH_NODE_ROW][FINISH_NODE_COL+1][1]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][1];\n grid[FINISH_NODE_ROW][FINISH_NODE_COL+1].isWall=false;\n z--;\n }\n else if(temp2===2){\n parent[FINISH_NODE_ROW+1][FINISH_NODE_COL-1][0]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][0];\n parent[FINISH_NODE_ROW+1][FINISH_NODE_COL-1][1]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][1];\n parent[FINISH_NODE_ROW+1][FINISH_NODE_COL][0]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][0];\n parent[FINISH_NODE_ROW+1][FINISH_NODE_COL][1]=parent[FINISH_NODE_ROW+1][FINISH_NODE_COL+1][1];\n grid[FINISH_NODE_ROW+1][FINISH_NODE_COL].isWall=false;\n y--;\n }\n else{\n parent[FINISH_NODE_ROW][FINISH_NODE_COL-1][0]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][0];\n parent[FINISH_NODE_ROW][FINISH_NODE_COL-1][1]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][1];\n parent[FINISH_NODE_ROW+1][FINISH_NODE_COL-1][0]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][0];\n parent[FINISH_NODE_ROW+1][FINISH_NODE_COL-1][1]=parent[FINISH_NODE_ROW-1][FINISH_NODE_COL-1][1];\n grid[FINISH_NODE_ROW][FINISH_NODE_COL-1].isWall=false;\n z--;\n }\n while(y>0 && z>0){\n let x=Math.floor(2*Math.random());\n if(x===0){\n let ind1=Math.floor(y*Math.random());\n if(ind1===y){\n ind1--;\n }\n let curRow=horizontalWalls[ind1][0];\n let curCol=horizontalWalls[ind1][1];\n let a=parent[curRow][curCol-1][0];\n let b=parent[curRow][curCol-1][1];\n if ((parent[curRow][curCol+1][0]!==a)||(parent[curRow][curCol+1][1]!==b)){\n for (let row = 0; row < 23; row++) {\n for (let col = 0; col < 57; col++) {\n if((row!==curRow || col!==curCol+1)&&(parent[row][col][0]===parent[curRow][curCol+1][0] && parent[row][col][1]===parent[curRow][curCol+1][1])){\n parent[row][col][0]=a;\n parent[row][col][1]=b;\n }\n }\n }\n parent[curRow][curCol+1][0]=a;\n parent[curRow][curCol+1][1]=b;\n parent[curRow][curCol][0]=a;\n parent[curRow][curCol][1]=b;\n grid[curRow][curCol].isWall=false;\n }\n horizontalWalls.splice(ind1,1);\n y--;\n }\n else{\n let ind2=Math.floor(z*Math.random());\n if(ind2===z){\n ind2--;\n }\n let curRow=verticalWalls[ind2][0];\n let curCol=verticalWalls[ind2][1];\n let a=parent[curRow-1][curCol][0];\n let b=parent[curRow-1][curCol][1];\n if ((parent[curRow+1][curCol][0]!==a)||(parent[curRow+1][curCol][1]!==b)){\n for (let row = 0; row < 23; row++) {\n for (let col = 0; col < 57; col++) {\n if((row!==curRow+1 || col!==curCol)&&(parent[row][col][0]===parent[curRow+1][curCol][0] && parent[row][col][1]===parent[curRow+1][curCol][1])){\n parent[row][col][0]=a;\n parent[row][col][1]=b;\n }\n }\n }\n parent[curRow+1][curCol][0]=a;\n parent[curRow+1][curCol][1]=b;\n parent[curRow][curCol][0]=a;\n parent[curRow][curCol][1]=b;\n grid[curRow][curCol].isWall=false;\n }\n verticalWalls.splice(ind2,1);\n z--;\n }\n }\n \n while(y>0){\n let ind1=Math.floor(y*Math.random());\n let curRow=horizontalWalls[ind1][0];\n let curCol=horizontalWalls[ind1][1];\n let a=parent[curRow][curCol-1][0];\n let b=parent[curRow][curCol-1][1];\n if ((parent[curRow][curCol+1][0]!==a)||(parent[curRow][curCol+1][1]!==b)){\n for (let row = 0; row < 23; row++) {\n for (let col = 0; col < 57; col++) {\n if((row!==curRow || col!==curCol+1)&&(parent[row][col][0]===parent[curRow][curCol+1][0] && parent[row][col][1]===parent[curRow][curCol+1][1])){\n parent[row][col][0]=a;\n parent[row][col][1]=b;\n }\n }\n }\n parent[curRow][curCol+1][0]=a;\n parent[curRow][curCol+1][1]=b;\n parent[curRow][curCol][0]=a;\n parent[curRow][curCol][1]=b;\n grid[curRow][curCol].isWall=false;\n }\n horizontalWalls.splice(ind1,1);\n y--;\n }\n while(z>0){\n let ind2=Math.floor(z*Math.random());\n let curRow=verticalWalls[ind2][0];\n let curCol=verticalWalls[ind2][1];\n let a=parent[curRow-1][curCol][0];\n let b=parent[curRow-1][curCol][1];\n if ((parent[curRow+1][curCol][0]!==a)||(parent[curRow+1][curCol][1]!==b)){\n for (let row = 0; row < 23; row++) {\n for (let col = 0; col < 57; col++) {\n if((row!==curRow+1 || col!==curCol)&&(parent[row][col][0]===parent[curRow+1][curCol][0] && parent[row][col][1]===parent[curRow+1][curCol][1])){\n parent[row][col][0]=a;\n parent[row][col][1]=b;\n }\n }\n }\n parent[curRow+1][curCol][0]=a;\n parent[curRow+1][curCol][1]=b;\n parent[curRow][curCol][0]=a;\n parent[curRow][curCol][1]=b;\n grid[curRow][curCol].isWall=false;\n }\n verticalWalls.splice(ind2,1);\n z--;\n }\n }", "function Z(){var e=c.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||c[t]:e.height||c[t]}", "function set_all_position(data, parent_coor) {\n data.data.hexagons = [];\n for (var i = 0; i < 6; i++) {\n var a = (i) / 6 * Math.PI * 2; //angle of this hex relative to parent center\n var x = _this.config.hexagon_scale * Math.cos(a) * (Math.sqrt(3) / 3);\n var y = _this.config.hexagon_scale * Math.sin(a) * (Math.sqrt(3) / 3);\n data.data.hexagons[i] = {\n x: x,\n y: y,\n absolute_x: parent_coor.absolute_x + x * Math.pow(1 / 3, data.depth - 1),\n absolute_y: parent_coor.absolute_y + y * Math.pow(1 / 3, data.depth - 1),\n pos: i\n };\n\n //update boundary box\n var d = data.data.hexagons[i];\n if (d.absolute_x > boundary_box.max_x) boundary_box.max_x = d.absolute_x;\n if (d.absolute_y > boundary_box.max_y) boundary_box.max_y = d.absolute_y;\n if (d.absolute_x < boundary_box.min_x) boundary_box.min_x = d.absolute_x;\n if (d.absolute_y < boundary_box.min_y) boundary_box.min_y = d.absolute_y;\n\n\n }\n data.data.hexagons[6] = {\n x: 0,\n y: 0,\n absolute_x: parent_coor.absolute_x,\n absolute_y: parent_coor.absolute_y,\n pos: 6\n\n };\n //data.children[6].words = data.data.topics[6];\n //delete data.data.topics;\n\n delete data.data.submodels;\n\n if (data.children && data.children.length > 0) {\n for (var i = 0; i < data.children.length; i++) {\n set_all_position(data.children[i], data.data.hexagons[i]);\n }\n\n }\n if (data.parent == null)\n data.is_root = true;\n else\n data.is_root = false;\n //delete data.parent;\n }", "static zSort(up, type, elements_data) {\t\n\t\t\tlet layer = canvas.getLayerByEmbeddedName(type);\n\t\t\tconst siblings = layer.placeables;\t\n\t\t\t// Determine target sort index\n\t\t\tlet z = 0;\n\t\t\tif ( up ) {\n\t\t\t\telements_data.sort((a, b) => a.z - b.z);\n\t\t\t \tz = siblings.length ? Math.max(...siblings.map(o => o.data.z)) + 1 : 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\telements_data.sort((a, b) => b.z - a.z);\n\t\t\t \tz = siblings.length ? Math.min(...siblings.map(o => o.data.z)) - 1 : -1;\n\t\t\t}\n\t\t\n\t\t\t// Update all controlled objects\n\t\t\tfor (let i = 0; i < elements_data.length; i++) {\n\t\t\t\tlet d = up ? i : i * -1;\n\t\t\t\telements_data[i].z = z + d;\t\t\t\t\n\t\t\t}\n\t\t\treturn elements_data;\n\t\t}", "function generateTerrain() {\n background(255);\n fill(0);\n let xOff = start;\n //resetting the flag variables and average height variable\n highestPoint = height;\n flagX = 0;\n averageHeight = 0;\n rectNum = 0;\n for (let x = 0; x < width; x++) {\n let y = noise(xOff) * height;\n if (y <= highestPoint) {\n //setting my flag variables\n highestPoint = y;\n flagX = x;\n }\n //adding up every rect y and counting how many their are\n averageHeight += y;\n rectNum++;\n fill(0);\n rect(x, y, rectWidth, height - y);\n xOff += inc;\n }\n start += inc;\n}" ]
[ "0.692601", "0.64672476", "0.64490134", "0.62117696", "0.59978294", "0.5924424", "0.5889413", "0.58626413", "0.58525366", "0.58176625", "0.58069456", "0.57727456", "0.5749385", "0.56843436", "0.5664976", "0.5660208", "0.56331307", "0.560288", "0.5593327", "0.55618757", "0.5554169", "0.5516821", "0.5490214", "0.54710925", "0.5450906", "0.5417038", "0.541018", "0.53626776", "0.53331995", "0.5322162", "0.531731", "0.5296403", "0.52906007", "0.5288877", "0.5276553", "0.52700025", "0.52602905", "0.525492", "0.525492", "0.52547544", "0.5233446", "0.52220196", "0.52195036", "0.52186763", "0.5214024", "0.5214024", "0.52115744", "0.5211528", "0.5211528", "0.5211528", "0.52112496", "0.52008325", "0.51982963", "0.5192394", "0.5181901", "0.51757556", "0.51756316", "0.5166938", "0.51658714", "0.51615506", "0.51579034", "0.51575327", "0.51570565", "0.5153414", "0.515115", "0.5144302", "0.51440716", "0.5143747", "0.5142425", "0.51412964", "0.5138", "0.51378876", "0.51373494", "0.51373494", "0.51345104", "0.51286274", "0.5127492", "0.5118657", "0.51150626", "0.5113031", "0.51106673", "0.5109022", "0.51075584", "0.5103022", "0.51005673", "0.5100441", "0.5099984", "0.5096503", "0.5096503", "0.5089811", "0.50864303", "0.5082023", "0.5076585", "0.5074391", "0.50686646" ]
0.6321998
8
MUST be called after `prepareSource` called Here we need to make auto series, especially for auto legend. But we do not modify series.name in option to avoid side effects.
function autoSeriesName(seriesModel) { // User specified name has higher priority, otherwise it may cause // series can not be queried unexpectedly. var name = seriesModel.name; if (!modelUtil.isNameSpecified(seriesModel)) { seriesModel.name = getSeriesAutoName(seriesModel) || name; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoSeriesName(seriesModel) {\n\t // User specified name has higher priority, otherwise it may cause\n\t // series can not be queried unexpectedly.\n\t var name = seriesModel.name;\n\t\n\t if (!isNameSpecified(seriesModel)) {\n\t seriesModel.name = getSeriesAutoName(seriesModel) || name;\n\t }\n\t }", "function autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!_util_model__WEBPACK_IMPORTED_MODULE_3__[/* isNameSpecified */ \"n\"](seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}", "function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isTypedArray */ \"E\"])(data) ? _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_TYPED_ARRAY */ \"g\"] : _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_ORIGINAL */ \"f\"]\n });\n}", "function graph_line_generate(category,text,data,dom,title,subtitle,color)\n{\n $('#' + dom).highcharts({\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n xAxis: {\n categories: category,\n crosshair: true\n },\n yAxis: {\n min: 0,\n title: {\n text: text\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n colors: color,\n series: [data]\n });\n}", "function optionChanged (newsample){\n createchart(newsample) \n metadata(newsample)\n}", "function createSourceFromSeriesDataOption(data) {\n\t return new SourceImpl({\n\t data: data,\n\t sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n\t });\n\t }", "chartDataSource(data, name, random) {\n data.map(d=>{\n if (d.canvas) {\n let number = d.canvas.className.split('_')[1];\n\n if (number === random) {\n let properties = d.components.properties;\n\n for (let i = 0; i < properties.length; i++) {\n properties[i].name === 'dataSource' ? properties[i].value = name : null;\n }\n }\n }\n });\n this.props.saveData(data);\n }", "function preInit(target, data, options) {\n options = options || {};\n options.axesDefaults = options.axesDefaults || {};\n options.legend = options.legend || {};\n options.seriesDefaults = options.seriesDefaults || {};\n var setopts = false;\n if (options.seriesDefaults.renderer == $.jqplot.MekkoRenderer) {\n setopts = true;\n }\n else if (options.series) {\n for (var i=0; i < options.series.length; i++) {\n if (options.series[i].renderer == $.jqplot.MekkoRenderer) {\n setopts = true;\n }\n }\n }\n \n if (setopts) {\n options.axesDefaults.renderer = $.jqplot.MekkoAxisRenderer;\n options.legend.renderer = $.jqplot.MekkoLegendRenderer;\n options.legend.preDraw = true;\n }\n }", "function createFeatureSeries(name) {\r\n var series = featureChart.series.push(new am4charts.LineSeries());\r\n series.dataFields.valueY = name;\r\n series.dataFields.dateX = \"Date\";\r\n series.name = name;\r\n series.strokeWidth = 1.5;\r\n series.tooltipText = \"[bold]{name}[/]: {valueY.formatNumber('#.##')}\";\r\n\r\n var segment = series.segments.template;\r\n segment.interactionsEnabled = true;\r\n\r\n var hoverState = segment.states.create(\"hover\");\r\n hoverState.properties.strokeWidth = 3;\r\n\r\n var dimmed = segment.states.create(\"dimmed\");\r\n dimmed.properties.stroke = am4core.color(\"#dadada\");\r\n\r\n //Define hover-over events\r\n segment.events.on(\"over\", function(event) {\r\n processOver(event.target.parent.parent.parent);\r\n });\r\n segment.events.on(\"out\", function(event) {\r\n processOut(event.target.parent.parent.parent);\r\n });\r\n return series;\r\n }", "function optionChanged(a) {\n CreateBarChart(a);\n CreateBubbleChart(a);\n DisplaySampleMetaData(a);\n CreateGaugeChart(a);\n}", "function optionChanged(sample) {\n createChart(sample);\n createMetaData(sample);\n // createGauge(sample)\n}", "function setOption(chartDisplayType, option, yySetting, data, skinConfig, panelType) {\n // let dimensionCodeFileld = yySetting.dataField.dimensionX[0].codeField;///store_code\n // let dimensionNameFileld = yySetting.dataField.dimensionX[0].nameField;//store_name\n\n var dimensionCodeFileld = eChartCommon.eChartLabel.unionedXCode; ///store_code\n var dimensionNameFileld = eChartCommon.eChartLabel.unionedXName; //store_name\n\n\n var legendData = [];\n var series = [];\n var xAxisData = [];\n var dimensionX = _lodash2.default.get(yySetting, 'dataField.dimensionX');\n var dimensionSub = _lodash2.default.get(yySetting, 'dataField.dimensionSub');\n var measure = _lodash2.default.get(yySetting, 'dataField.measure');\n var barWidth = _lodash2.default.get(yySetting, 'series.barWidth') ? _lodash2.default.get(yySetting, 'series.barWidth') : 10;\n var barMaxWidth = _lodash2.default.get(yySetting, 'series.barMaxWidth') ? _lodash2.default.get(yySetting, 'series.barMaxWidth') : 10;\n var barGap = _lodash2.default.get(yySetting, 'series.barGap') ? _lodash2.default.get(yySetting, 'series.barGap') : '100%';\n var barCategoryGap = _lodash2.default.get(yySetting, 'series.barCategoryGap') ? _lodash2.default.get(yySetting, 'series.barCategoryGap') : '20%';\n var eChartSubType = yySetting.subType;\n\n var maxNameLength = 0;\n // barWidth = 10;\n // let allLength = 1050;//像素\n // let barAll = data.length * measureLength;\n // if (dimensionSubLength > 0) {\n // barAll = data.length * dimensionSubLength;\n // }\n\n // let barAllLength = barAll * barWidth * 2;//默认barWidth=10 ,barGap=100%,barCategoryGap=默认barGap\n\n // let zoomRate = 100 * allLength / (barAllLength == 0 ? 1 : barAllLength);\n\n // if (zoomRate < 100) {\n // option.dataZoom = [{ type: 'slider', end: zoomRate }];\n // }\n // barWidth: 10;\n // barGap: '100%';\n // barCategoryGap: '20%';//类目间柱形距离,默认为类目间距的20%,可设固定值\n var colorList = eChartCommon.getChartColorArr(100);\n if (dimensionSub.length > 0) {\n //如果存在次维度\n // let dimensionSubCodeFileld = yySetting.dataField.dimensionSub[0].codeField;///store_code\n // let dimensionSubNameFileld = yySetting.dataField.dimensionSub[0].nameField;//store_name\n var dimensionSubCodeFileld = eChartCommon.eChartLabel.unionedSubCode;\n var dimensionSubNameFileld = eChartCommon.eChartLabel.unionedSubName;\n // let dimensionSubStack = yySetting.dataField.dimensionSub[0].hasOwnProperty(\"stack\") ? yySetting.dataField.dimensionSub[0].stack : yySetting.stack;\n var dimensionSubStack = yySetting.stack;\n var measureValueField = measure[0].valueField;\n var xAxisItems = [];\n var seriesItems = [];\n data.forEach(function (itemData) {\n if (xAxisItems.indexOf(itemData[dimensionNameFileld]) < 0) {\n xAxisItems.push(itemData[dimensionNameFileld]);\n if (maxNameLength < itemData[dimensionNameFileld].length) maxNameLength = itemData[dimensionNameFileld].length;\n }\n itemData[dimensionSubNameFileld] = eChartCommon.trimCaptionForLegend(itemData[dimensionSubNameFileld], \"barChart\");\n if (seriesItems.indexOf(itemData[dimensionSubNameFileld]) < 0) {\n seriesItems.push(itemData[dimensionSubNameFileld]);\n }\n });\n\n seriesItems.forEach(function (eleS) {\n legendData.push({ name: eleS, textStyle: { width: '10px', height: '10px' } });\n var seriesData = [];\n xAxisItems.forEach(function (eleX) {\n if (xAxisData.indexOf(eleX) < 0) xAxisData.push(eleX);\n var itemDataValue = \"0\";\n data.forEach(function (itemData) {\n if (itemData[dimensionNameFileld] == eleX && itemData[dimensionSubNameFileld] == eleS) itemDataValue = itemData[measureValueField];\n });\n seriesData.push(itemDataValue);\n });\n series.push({\n name: eleS,\n type: 'bar',\n stack: dimensionSubStack,\n silent: true, //图形是否不响应和触发鼠标事件,默认为 false,即响应和触发鼠标事件\n barMaxWidth: barMaxWidth,\n // barWidth: barWidth,\n // barGap: barGap,// 百分比或者数字,表示bar宽度的百分之多少或者几倍\n // barCategoryGap: barCategoryGap,\n data: seriesData,\n itemStyle: {\n normal: {\n color: function color(params) {\n return colorList[params.seriesIndex];\n },\n barBorderRadius: yySetting.bVertical == true ? [5, 5, 0, 0] : [0, 5, 5, 0], //圆角半径,单位px,支持传入数组分别指定 4 个圆角半径\n opacity: 1 //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。\n }\n }\n });\n });\n } else {\n if (measure.length == 1 && eChartSubType == \"3\") {\n var orderInfo = yySetting.orderInfo;\n var orderField = orderInfo.orderField;\n if (orderInfo.orderBy == \"asc\") {\n data.sort(function (a, b) {\n return b[orderField] - a[orderField];\n });\n } else if (orderInfo.orderBy == \"desc\") {\n data.sort(function (a, b) {\n return a[orderField] - b[orderField];\n });\n }\n }\n measure.forEach(function (itemMeasure) {\n legendData.push({ name: itemMeasure.caption, textStyle: { width: '10px', height: '10px' } });\n var seriesData = [];\n data.forEach(function (itemData) {\n if (!!itemData[dimensionNameFileld] == true) {\n // seriesData.push(itemData[itemMeasure.valueField]);\n seriesData.push(_lodash2.default.get(itemData, itemMeasure.valueField, 0));\n if (xAxisData.indexOf(itemData[dimensionNameFileld]) < 0) {\n if (maxNameLength < itemData[dimensionNameFileld].length) maxNameLength = itemData[dimensionNameFileld].length;\n xAxisData.push(itemData[dimensionNameFileld]);\n }\n }\n });\n series.push({\n name: itemMeasure.caption,\n type: 'bar',\n // stack: itemMeasure.hasOwnProperty(\"stack\") ? itemMeasure.stack : yySetting.stack,\n stack: yySetting.stack,\n silent: true, //图形是否不响应和触发鼠标事件,默认为 false,即响应和触发鼠标事件\n barMaxWidth: barMaxWidth,\n // barWidth: barWidth,\n // barGap: barGap,// 百分比或者数字,表示bar宽度的百分之多少或者几倍\n // barCategoryGap: barCategoryGap,\n data: seriesData,\n itemStyle: {\n normal: {\n color: function color(params) {\n return colorList[params.seriesIndex];\n },\n barBorderRadius: yySetting.bVertical == true ? [5, 5, 0, 0] : [0, 5, 5, 0], //圆角半径,单位px,支持传入数组分别指定 4 个圆角半径\n opacity: 1 //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。\n }\n }\n // lineStyle: {\n // normal: {\n // color: function (params) { return colorList[params.seriesIndex] }\n // }\n // },\n });\n });\n }\n option.legend.data = legendData;\n option.series = series;\n var needWrap = _lodash2.default.get(yySetting, 'xAxis.axisLabel.needWrap');\n var wrapRowLen = _lodash2.default.get(yySetting, 'xAxis.axisLabel.wrapRowLen');\n if (needWrap && wrapRowLen) {\n option.xAxis.axisLabel.formatter = function (value) {\n return eChartCommon.wrapString(value, wrapRowLen);\n };\n }\n option.xAxis.data = xAxisData;\n if (yySetting.bVertical == false) {\n option.xAxis.axisLabel.formatter = null;\n var tmp = option.xAxis;\n option.xAxis = option.yAxis;\n option.yAxis = tmp;\n }\n\n option.tooltip.formatter = function (params) {\n var result = '';\n params.forEach(function (item) {\n if (result == '') result = item.name;\n result = result + \"</br>\" + '<span style=\"display:inline-block;margin-right:5px;border-radius:9px;width:8px;height:8px;background-color:' + item.color + '\"></span>' + \" \" + item.seriesName + \" : \" + item.value;\n });\n return result;\n };\n\n if (dimensionX.length == 1) {\n if (yySetting.bVertical) option.xAxis.name = option.xAxis.name || dimensionX[0].caption;else option.yAxis.name = option.yAxis.name || dimensionX[0].caption;\n }\n if (measure.length == 1) {\n if (yySetting.bVertical) option.yAxis.name = option.yAxis.name || measure[0].caption;else option.xAxis.name = option.xAxis.name || measure[0].caption;\n }\n // option.legend.itemWidth = 10;\n // option.legend.itemWidth = 10;\n // option.grid.top = option.legend.top + option.legend.height + 30;\n // option.tooltip.padding = [5, 15, 5, 15,];// 上右 下左\n // option.tooltip.textStyle = { fontSize: 12 };\n // option.grid = {\n // top: 0,\n // left: 0,// grid 组件离容器左侧的距离。\n // right: 0,// default: '10%' grid 组件离容器右侧的距离\n // bottom: 30,//grid 组件离容器下侧的距离\n // containLabel: true\n // }\n // option.xAxis.axisLabel.inside = false;\n //\n // option.toolbox.feature.saveAsImage.icon = 'path://M432.45,595.444c0,2.177-4.661,6.82-11.305,6.82c-6.475,0-11.306-4.567-11.306-6.82s4.852-6.812,11.306-6.812C427.841,588.632,432.452,593.191,432.45,595.444L432.45,595.444z M421.155,589.876c-3.009,0-5.448,2.495-5.448,5.572s2.439,5.572,5.448,5.572c3.01,0,5.449-2.495,5.449-5.572C426.604,592.371,424.165,589.876,421.155,589.876L421.155,589.876z M421.146,591.891c-1.916,0-3.47,1.589-3.47,3.549c0,1.959,1.554,3.548,3.47,3.548s3.469-1.589,3.469-3.548C424.614,593.479,423.062,591.891,421.146,591.891L421.146,591.891zM421.146,591.891';\n // option.toolbox.feature.saveAsImage.icon = <SvgIcon type={\"baocunweitupian\"} />;\n // symbol: 'image://./echarts/themes/default/images/icon-shop.png',\n // option.toolbox.feature.saveAsImage.icon = 'image://http://echarts.baidu.com/images/favicon.png';\n // option.toolbox.feature.saveAsImage.iconStyle = { textPosition: 'top', textAlign: 'left' };\n // option.toolbox.orient = \"vertical\";\n // option.toolbox.height = 14;\n // option.toolbox.width = 81;\n // option.legend.padding = [55, 10, 5, 10]\n // option.toolbox.iconStyle = {\n // normal: {\n // color: 'red',//设置颜色\n // }\n // }\n // option.toolbox.emphasis.iconStyle.borderColor = \"red\";\n // option.toolbox.emphasis = { iconStyle: { color: \"red\" } };\n // option.dataZoom = [{ type: 'inside' }];\n // option.grid.height = 500;\n\n if (legendData.length * xAxisData.length > 100) {\n //超过100可缩放\n option.dataZoom = [{ type: 'inside', zoomOnMouseWheel: 'shift' }];\n }\n\n if (chartDisplayType == \"panel\") //如果在大屏展现,则需要特殊调整参数\n {\n option.grid.left = '5%';\n option.grid.right = '5%';\n option.grid.bottom = '5%';\n option.grid.containLabel = true;\n option.xAxis.nameLocation = \"start\";\n option.yAxis.nameLocation = \"start\";\n if (panelType == 3) {\n option.title.left = 10;\n option.legend.left = 10;\n } else if (panelType == 2) {\n option.tooltip.position = function (point, params, dom, rect, size) {\n //其中point为当前鼠标的位置,size中有两个属性:viewSize和contentSize,分别为外层div和tooltip提示框的大小\n var x = point[0]; //\n var y = point[1];\n var viewWidth = size.viewSize[0];\n var viewHeight = size.viewSize[1];\n var boxWidth = size.contentSize[0];\n var boxHeight = size.contentSize[1];\n var posX = 0; //x坐标位置\n var posY = 0; //y坐标位置\n if (x < boxWidth) {\n //左边放不开\n posX = 5;\n } else {\n //左边放的下\n posX = x - boxWidth;\n }\n if (y < boxHeight) {\n //上边放不开\n posY = 5;\n } else {\n //上边放得下\n posY = y - boxHeight;\n }\n return [posX, posY];\n };\n }\n } else if (chartDisplayType == \"mobile\") //如果在移动端展现,则需要特殊调整参数\n {\n option.grid.left = '2%';\n option.grid.right = '2%';\n option.grid.bottom = '5%';\n option.grid.containLabel = true;\n\n option.xAxis.nameLocation = \"start\";\n option.yAxis.nameLocation = \"start\";\n\n option.legend.top = 35;\n\n option.tooltip.position = function (point, params, dom, rect, size) {\n //其中point为当前鼠标的位置,size中有两个属性:viewSize和contentSize,分别为外层div和tooltip提示框的大小\n var x = point[0]; //\n var y = point[1];\n var viewWidth = size.viewSize[0];\n var viewHeight = size.viewSize[1];\n var boxWidth = size.contentSize[0];\n var boxHeight = size.contentSize[1];\n var posX = 0; //x坐标位置\n var posY = 0; //y坐标位置\n if (x < boxWidth) {\n //左边放不开\n posX = 5;\n } else {\n //左边放的下\n posX = x - boxWidth;\n }\n if (y < boxHeight) {\n //上边放不开\n posY = 5;\n } else {\n //上边放得下\n posY = y - boxHeight;\n }\n return [posX, posY];\n };\n } else if (chartDisplayType == \"rpt\") {\n option.grid.containLabel = true;\n option.grid.left = '2%';\n option.grid.right = '2%';\n }\n if (!!skinConfig && skinConfig.displaySkin) {\n _lodash2.default.set(option, \"title.textStyle.color\", skinConfig.displaySkin.textColor);\n _lodash2.default.set(option, \"legend.textStyle.color\", skinConfig.displaySkin.textColor);\n\n _lodash2.default.set(option, \"xAxis.nameTextStyle.color\", skinConfig.displaySkin.textColor);\n _lodash2.default.set(option, \"yAxis.nameTextStyle.color\", skinConfig.displaySkin.textColor);\n\n _lodash2.default.set(option, \"xAxis.axisLine.lineStyle.color\", skinConfig.displaySkin.axisLineColor);\n _lodash2.default.set(option, \"yAxis.axisLine.lineStyle.color\", skinConfig.displaySkin.axisLineColor);\n\n _lodash2.default.set(option, \"xAxis.splitLine.lineStyle.color\", skinConfig.displaySkin.splitLineColor);\n _lodash2.default.set(option, \"yAxis.splitLine.lineStyle.color\", skinConfig.displaySkin.splitLineColor);\n\n _lodash2.default.set(option, \"xAxis.axisLabel.textStyle.color\", skinConfig.displaySkin.textColor);\n _lodash2.default.set(option, \"yAxis.axisLabel.textStyle.color\", skinConfig.displaySkin.textColor);\n\n // let xAxisData2 = [];\n // _.forEach(option.xAxis.data, (ele, key) => {\n // let newData = {\n // value: ele,\n // textStyle: { color: skinConfig.displaySkin.textColor }\n // };\n // xAxisData2.push(newData);\n // });\n // option.xAxis.data = xAxisData2;\n }\n\n option.legend.pageIconColor = \"#949CA6\";\n option.legend.pageIconInactiveColor = \"#C9CDD3\";\n option.legend.pageIconSize = 10;\n\n setAddLengthInfoByRotate(option, yySetting, chartDisplayType, panelType, maxNameLength, _lodash2.default.get(option, 'xAxis.axisLabel.rotate'));\n\n // option.title.left = \"0\";\n // option.legend.left = \"0\";\n // option.grid.left = '0';\n return option;\n}", "function seriesOnAfterSetOptions(e) {\n this.resetA11yMarkerOptions = merge(e.options.marker || {}, this.userOptions.marker || {});\n }", "function postParseOptions(options) {\n\t\t for (var i=0; i<this.series.length; i++) {\n\t\t this.series[i].seriesColors = this.seriesColors;\n\t\t this.series[i].colorGenerator = this.colorGenerator;\n\t\t }\n\t\t }", "function setOptions(o){\n\t\t\t\n\t\t\toptions = merge(o, {\n\t\t\t\tcolors: ['#00A8F0', '#C0D800', '#cb4b4b', '#4da74d', '#9440ed'], //=> The default colorscheme. When there are > 5 series, additional colors are generated.\n\t\t\t\tlegend: {\n\t\t\t\t\tshow: true,\t\t\t\t// => setting to true will show the legend, hide otherwise\n\t\t\t\t\tnoColumns: 1,\t\t\t// => number of colums in legend table\n\t\t\t\t\tlabelFormatter: null,\t// => fn: string -> string\n\t\t\t\t\tlabelBoxBorderColor: '#ccc', // => border color for the little label boxes\n\t\t\t\t\tcontainer: null,\t\t\t// => container (as jQuery object) to put legend in, null means default on top of graph\n\t\t\t\t\tposition: 'ne',\t\t\t// => position of default legend container within plot\n\t\t\t\t\tmargin: 5,\t\t\t\t// => distance from grid edge to default legend container within plot\n\t\t\t\t\tbackgroundColor: null,\t// => null means auto-detect\n\t\t\t\t\tbackgroundOpacity: 0.85\t// => set to 0 to avoid background, set to 1 for a solid background\n\t\t\t\t},\n\t\t\t\txaxis: {\n\t\t\t\t\tticks: null,\t\t\t// => format: either [1, 3] or [[1, 'a'], 3]\n\t\t\t\t\tnoTicks: 5,\t\t\t\t// => number of ticks for automagically generated ticks\n\t\t\t\t\ttickFormatter: defaultTickFormatter, // => fn: number -> string\n\t\t\t\t\ttickDecimals: null,\t\t// => no. of decimals, null means auto\n\t\t\t\t\tmin: null,\t\t\t\t// => min. value to show, null means set automatically\n\t\t\t\t\tmax: null,\t\t\t\t// => max. value to show, null means set automatically\n\t\t\t\t\tautoscaleMargin: 0\t\t// => margin in % to add if auto-setting min/max\n\t\t\t\t},\n\t\t\t\tyaxis: {\n\t\t\t\t\tticks: null,\t\t\t// => format: either [1, 3] or [[1, 'a'], 3]\n\t\t\t\t\tnoTicks: 5,\t\t\t\t// => number of ticks for automagically generated ticks\n\t\t\t\t\ttickFormatter: defaultTickFormatter, // => fn: number -> string\n\t\t\t\t\ttickDecimals: null,\t\t// => no. of decimals, null means auto\n\t\t\t\t\tmin: null,\t\t\t\t// => min. value to show, null means set automatically\n\t\t\t\t\tmax: null,\t\t\t\t// => max. value to show, null means set automatically\n\t\t\t\t\tautoscaleMargin: 0\t\t// => margin in % to add if auto-setting min/max\n\t\t\t\t},\n\t\t\t\tpoints: {\n\t\t\t\t\tshow: false,\t\t\t// => setting to true will show points, false will hide\n\t\t\t\t\tradius: 3,\t\t\t\t// => point radius (pixels)\n\t\t\t\t\tlineWidth: 2,\t\t\t// => line width in pixels\n\t\t\t\t\tfill: true,\t\t\t\t// => true to fill the points with a color, false for (transparent) no fill\n\t\t\t\t\tfillColor: '#ffffff'\t// => fill color\n\t\t\t\t},\n\t\t\t\tlines: {\n\t\t\t\t\tshow: false,\t\t\t// => setting to true will show lines, false will hide\n\t\t\t\t\tlineWidth: 2, \t\t\t// => line width in pixels\n\t\t\t\t\tfill: false,\t\t\t// => true to fill the area from the line to the x axis, false for (transparent) no fill\n\t\t\t\t\tfillColor: null\t\t\t// => fill color\n\t\t\t\t},\n\t\t\t\tbars: {\n\t\t\t\t\tshow: false,\t\t\t// => setting to true will show bars, false will hide\n\t\t\t\t\tlineWidth: 2,\t\t\t// => in pixels\n\t\t\t\t\tbarWidth: 1,\t\t\t// => in units of the x axis\n\t\t\t\t\tfill: true,\t\t\t\t// => true to fill the area from the line to the x axis, false for (transparent) no fill\n\t\t\t\t\tfillColor: null\t\t\t// => fill color\n\t\t\t\t},\n\t\t\t\tgrid: {\n\t\t\t\t\tcolor: '#545454',\t\t// => primary color used for outline and labels\n\t\t\t\t\tbackgroundColor: null,\t// => null for transparent, else color\n\t\t\t\t\ttickColor: '#dddddd',\t// => color used for the ticks\n\t\t\t\t\tlabelMargin: 3\t\t\t// => margin in pixels\n\t\t\t\t},\n\t\t\t\tselection: {\n\t\t\t\t\tmode: null,\t\t\t\t// => one of null, 'x', 'y' or 'xy'\n\t\t\t\t\tcolor: '#B6D9FF',\t\t// => selection box color\n\t\t\t\t\tfps: 10\t\t\t\t\t// => frames-per-second\n\t\t\t\t},\n\t\t\t\tmouse: {\n\t\t\t\t\ttrack: null,\t\t\t// => true to track the mouse, no tracking otherwise\n\t\t\t\t\tposition: 'se',\t\t\t// => position of the value box (default south-east)\n\t\t\t\t\ttrackFormatter: defaultTrackFormatter, // => formats the values in the value box\n\t\t\t\t\tmargin: 3,\t\t\t\t// => margin in pixels of the valuebox\n\t\t\t\t\tcolor: '#ff3f19',\t\t// => line color of points that are drawn when mouse comes near a value of a series\n\t\t\t\t\ttrackDecimals: 1,\t\t// => decimals for the track values\n\t\t\t\t\tsensibility: 2,\t\t\t// => the lower this number, the more precise you have to aim to show a value\n\t\t\t\t\tradius: 3\t\t\t\t// => radius of the tracck point\n\t\t\t\t},\n\t\t\t\tshadowSize: 4\t\t\t\t// => size of the 'fake' shadow\n\t\t\t});\n\t\t\t\n\t\t\t/**\n\t\t\t * Collect colors assigned by the user to a serie.\n\t\t\t */\n\t\t\tvar neededColors = series.length;\n\t\t\tvar usedColors = [];\n\t\t\tvar assignedColors = [];\n\t\t\tfor(var i = 0; i < series.length; ++i){\n\t\t\t\tvar sc = series[i].color;\n\t\t\t\tif(sc != null){\n\t\t\t\t\t--neededColors;\n\t\t\t\t\tif(Object.isNumber(sc)) assignedColors.push(sc);\n\t\t\t\t\telse usedColors.push(parseColor(series[i].color));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Calculate the number of colors that need to be generated.\n\t\t\t */\n\t\t\tfor(var j = 0; j < assignedColors.length; ++j){\n\t\t\t\tneededColors = Math.max(neededColors, assignedColors[j] + 1);\n\t\t\t}\n\t\n\t\t\t/**\n\t\t\t * Generate colors.\n\t\t\t */\n\t\t\tvar colors = [];\n\t\t\tvar variation = 0;\n\t\t\tvar k = 0;\n\t\t\twhile(colors.length < neededColors){\n\t\t\t\tvar c = (options.colors.length == k) ? new Color(100, 100, 100) : parseColor(options.colors[k]);\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Make sure each serie gets a different color.\n\t\t\t\t */\n\t\t\t\tvar sign = variation % 2 == 1 ? -1 : 1;\n\t\t\t\tvar factor = 1 + sign * Math.ceil(variation / 2) * 0.2;\n\t\t\t\tc.scale(factor, factor, factor);\n\t\n\t\t\t\t/**\n\t\t\t\t * @todo if we're getting to close to something else, we should probably skip this one\n\t\t\t\t */\n\t\t\t\tcolors.push(c);\n\t\t\t\t\n\t\t\t\tif(++k >= options.colors.length){\n\t\t\t\t\tk = 0;\n\t\t\t\t\t++variation;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t/**\n\t\t\t * Fill the options with the generated colors.\n\t\t\t */\n\t\t\tvar colori = 0;\n\t\t\tfor(var m = 0, s; m < series.length; ++m){\n\t\t\t\ts = series[m];\n\t\n\t\t\t\t/**\n\t\t\t\t * Assign the color.\n\t\t\t\t */\n\t\t\t\tif(s.color == null){\n\t\t\t\t\ts.color = colors[colori].toString();\n\t\t\t\t\t++colori;\n\t\t\t\t}else if(Object.isNumber(s.color)){\n\t\t\t\t\ts.color = colors[s.color].toString();\n\t\t\t\t}\n\t\n\t\t\t\ts.lines = Object.extend(Object.clone(options.lines), s.lines);\n\t\t\t\ts.points = Object.extend(Object.clone(options.points), s.points);\n\t\t\t\ts.bars = Object.extend(Object.clone(options.bars), s.bars);\n\t\t\t\ts.mouse = Object.extend(Object.clone(options.mouse), s.mouse);\n\t\t\t\t\n\t\t\t\tif(s.shadowSize == null) s.shadowSize = options.shadowSize;\n\t\t\t}\n\t\t}", "function legendClickHandler(d, i) {\n\tsn.runtime.excludeSources.toggle(d.source);\n\tregenerateChart(sn.runtime.powerIOAreaChart);\n}", "function optionChanged(id) {\n CreatePlot(id);\n MetaData(id);\n }", "function legendClickHandler(d, i) {\n\tsn.runtime.excludeSources.toggle(d.source);\n\tregenerateChart();\n}", "function optionChanged(newSample){\n //alert(newSample);\n chartBuilder(newSample);\n metadataBuilder(newSample);\n }", "function optionChanged (sample) {\ndemographic_panel(sample);\ncreate_charts(sample);\n}", "_setChartOptions() {\n /**\n * the animated loader\n */\n const _loader = this.loader\n /**\n * chart default options\n */\n let _options = {\n hoverOffset: 8,\n layout: {},\n chartArea: {\n backgroundColor: \"transparent\"\n },\n elements: {},\n spanGaps: true,\n plugins: {\n title: {},\n tooltip: {},\n legend: {\n display: CT_SHOWLEGEND.includes(this.chart_type) || false\n }\n },\n animation: {\n onComplete: function () {\n if (_loader) _loader.style.display = \"none\"\n }\n }\n }\n /**\n * check enable gradient colors for state charts or\n */\n if (this.graphData.config.gradient === true && this.graphData.config.mode === \"simple\") {\n _options.gradientcolor = {\n color: true,\n type: this.chart_type\n }\n }\n /**\n * check enable gradient colors for data series chart\n */\n if (plugin_gradient && this.graphData.config.gradient) {\n _options.plugins = {\n plugin_gradient\n }\n }\n /**\n * check secondary axis\n * this.graphData.config holds the configruation data\n * this.graphData.data.datasets data per series\n */\n if (this.graphData.config.secondaryAxis && this.graphData && this.graphData.data && this.graphData.data.datasets) {\n let _scaleOptions = {}\n this.graphData.data.datasets.forEach((dataset) => {\n if (dataset.yAxisID) {\n _scaleOptions[dataset.yAxisID] = {}\n _scaleOptions[dataset.yAxisID].id = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].type = \"linear\"\n _scaleOptions[dataset.yAxisID].position = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].display = true\n if (dataset.yAxisID.toLowerCase() == \"right\") {\n _scaleOptions[dataset.yAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n if (dataset.xAxisID) {\n _scaleOptions[dataset.xAxisID] = {}\n _scaleOptions[dataset.xAxisID].id = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].type = \"linear\"\n _scaleOptions[dataset.xAxisID].position = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].display = true\n if (dataset.xAxisID.toLowerCase() == \"top\") {\n _scaleOptions[dataset.xAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n })\n if (_scaleOptions) {\n _options.scales = _scaleOptions\n }\n }\n /**\n * bubble axis label based on the data settings\n *\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n const _itemlist = this.entity_items.getEntitieslist()\n let labelX = _itemlist[0].name\n labelX += _itemlist[0].unit ? \" (\" + _itemlist[0].unit + \")\" : \"\"\n let labelY = _itemlist[1].name\n labelY += _itemlist[1].unit ? \" (\" + _itemlist[1].unit + \")\" : \"\"\n _options.scales = {\n x: {\n id: \"x\",\n title: {\n display: true,\n text: labelX\n }\n },\n y: {\n id: \"y\",\n title: {\n display: true,\n text: labelY\n }\n }\n }\n /**\n * scale bubble (optional)\n */\n if (this.graphData.config.bubbleScale) {\n _options.elements = {\n point: {\n radius: (context) => {\n const value = context.dataset.data[context.dataIndex]\n return value._r * this.graphData.config.bubbleScale\n }\n }\n }\n }\n }\n /**\n * special case for timescales to translate the date format\n */\n if (this.graphData.config.timescale && this.graphData.config.datascales) {\n _options.scales = _options.scales || {}\n _options.scales.x = _options.scales.x || {}\n _options.scales.x.maxRotation = 0\n _options.scales.x.autoSkip = true\n _options.scales.x.major = true\n _options.scales.x.type = \"time\"\n _options.scales.x.time = {\n unit: this.graphData.config.datascales.unit,\n format: this.graphData.config.datascales.format,\n isoWeekday: this.graphData.config.datascales.isoWeekday\n }\n _options.scales.x.ticks = {\n callback: xAxisFormat\n }\n }\n /**\n * case barchart segment\n * TODO: better use a plugin for this feature.\n * set bar as stacked, hide the legend for the segmentbar,\n * hide the tooltip item for the segmentbar.\n */\n if (this.graphData.config.segmentbar === true) {\n _options.scales = {\n x: {\n id: \"x\",\n stacked: true\n },\n y: {\n id: \"y\",\n stacked: true\n }\n }\n _options.plugins.legend = {\n labels: {\n filter: (legendItem, data) => {\n return data.datasets[legendItem.datasetIndex].tooltip !== false\n }\n },\n display: false\n }\n _options.plugins.tooltip.callbacks = {\n label: (chart) => {\n if (chart.dataset.tooltip === false || !chart.dataset.label) {\n return null\n }\n return `${chart.formattedValue} ${chart.dataset.unit || \"\"}`\n }\n }\n _options.interaction = {\n intersect: false,\n mode: \"index\"\n }\n } else {\n /**\n * callbacks for tooltip\n */\n _options.plugins.tooltip = {\n callbacks: {\n label: formatToolTipLabel,\n title: formatToolTipTitle\n }\n }\n _options.interaction = {\n intersect: true,\n mode: \"point\"\n }\n }\n /**\n * disable bubble legend\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n _options.plugins.legend = {\n display: false\n }\n }\n /**\n * multiseries for pie and doughnut charts\n */\n if (this.graphData.config.multiseries === true) {\n _options.plugins.legend = {\n labels: {\n generateLabels: function (chart) {\n const original = Chart.overrides.pie.plugins.legend.labels.generateLabels,\n labelsOriginal = original.call(this, chart)\n let datasetColors = chart.data.datasets.map(function (e) {\n return e.backgroundColor\n })\n datasetColors = datasetColors.flat()\n labelsOriginal.forEach((label) => {\n label.datasetIndex = label.index\n label.hidden = !chart.isDatasetVisible(label.datasetIndex)\n label.fillStyle = datasetColors[label.index]\n })\n return labelsOriginal\n }\n },\n onClick: function (mouseEvent, legendItem, legend) {\n legend.chart.getDatasetMeta(legendItem.datasetIndex).hidden = legend.chart.isDatasetVisible(\n legendItem.datasetIndex\n )\n legend.chart.update()\n }\n }\n _options.plugins.tooltip = {\n callbacks: {\n label: function (context) {\n const labelIndex = context.datasetIndex\n return `${context.chart.data.labels[labelIndex]}: ${context.formattedValue} ${context.dataset.unit || \"\"}`\n }\n }\n }\n }\n /**\n * preset cart current config\n */\n let chartCurrentConfig = {\n type: this.chart_type,\n data: {\n datasets: []\n },\n options: _options\n }\n /**\n * merge default with chart config options\n * this.chartconfig.options see yaml config\n * - chart\n * - options:\n */\n if (this.chartconfig.options) {\n chartCurrentConfig.options = deepMerge(_options, this.chartconfig.options)\n } else {\n chartCurrentConfig.options = _options\n }\n return chartCurrentConfig\n }", "function createParallelIfNeeded(option){if(option.parallel){return;}var hasParallelSeries=false;zrUtil.each(option.series,function(seriesOpt){if(seriesOpt && seriesOpt.type === 'parallel'){hasParallelSeries = true;}});if(hasParallelSeries){option.parallel = [{}];}}", "function createChart(chartName, titleText, seriesOptions, yAxisOptions) {\n return new Highcharts.StockChart({\n exporting: {\n enabled: true\n },\n chart: {\n events: {\n selection: selectPointsByDrag,\n selectedpoints: selectedPoints,\n click: unselectByClick\n },\n zoomType: 'xy',\n renderTo: chartName,\n marginLeft: 100, // Keep all charts left aligned\n spacingTop: 20,\n spacingBottom: 20\n },\n title: {\n text: titleText\n },\n xAxis: {\n type: 'datetime',\n title: {\n text: 'Local Time'\n },\n ordinal: false,\n minRange: 3600\n },\n navigator: {\n xAxis: {\n dateTimeLabelFormats: {\n hour: '%e. %b'\n }\n }\n },\n yAxis: yAxisOptions,\n series: seriesOptions,\n tooltip: {\n enabled: true,\n crosshairs: [true],\n positioner(labelWidth, labelHeight, point) {\n let tooltipX;\n let tooltipY;\n if (point.plotX + this.chart.plotLeft < labelWidth && point.plotY + labelHeight > this.chart.plotHeight) {\n tooltipX = this.chart.plotLeft;\n tooltipY = this.chart.plotTop + this.chart.plotHeight - 2 * labelHeight - 10;\n } else {\n tooltipX = this.chart.plotLeft;\n tooltipY = this.chart.plotTop + this.chart.plotHeight - labelHeight;\n }\n return {x: tooltipX, y: tooltipY};\n },\n formatter() {\n let s = moment(this.x).format('YYYY/MM/DD HH:mm:ss');\n s += '<br/>' + this.series.name + ' <b>' + this.y.toFixed(2) + '</b>' + '<br/>' + this.x;\n return s;\n },\n shared: false\n },\n credits: {\n enabled: false\n },\n legend: {\n enabled: true,\n align: 'right',\n layout: 'vertical',\n verticalAlign: 'top',\n y: 200\n },\n rangeSelector: {\n inputEnabled: false,\n allButtonsEnabled: true,\n buttons: [\n {\n type: 'day',\n count: 1,\n text: '1 Day'\n }, {\n type: 'day',\n count: 3,\n text: '3 Days'\n }, {\n type: 'minute',\n count: 60,\n text: 'Hour'\n }\n ],\n buttonTheme: {\n width: 60\n },\n selected: 1\n }\n });\n}", "function updateOption(data, type) {\n\n // set base color \n let primaryColor = this.__setColor(data.data.length);\n let symbol = ['circle', 'rect', 'triangle', 'diamond', 'pin', 'arrow', 'roundRect'];\n\n let seriesData = [];\n if (type === 'Normal') {\n data.data.forEach(function (val, index) {\n seriesData.push({\n name: data.index[index],\n type: \"line\",\n data: val,\n itemStyle: {\n color: primaryColor[index]\n },\n symbol: symbol[index],\n })\n })\n } else {\n let accumulatedData = [];\n\n data.data.forEach(function (val, index) {\n let normal_array = val;\n let accumulated_array = [];\n normal_array.reduce(function (a, b, i) {\n return accumulated_array[i] = a + b;\n }, 0);\n accumulatedData.push(accumulated_array);\n })\n\n data.data.forEach(function (val, index) {\n seriesData.push({\n name: data.index[index],\n type: \"line\",\n data: accumulatedData[index],\n itemStyle: {\n color: primaryColor[index]\n },\n symbol: symbol[index],\n })\n })\n }\n\n let xAxis = {\n type: 'category',\n boundaryGap: false,\n data: data.columns\n }\n\n let legend = {\n bottom: '0%',\n data: data.index\n }\n\n return {\n xAxis: xAxis,\n legend: legend,\n series: seriesData\n }\n}", "function createChart(seriesOptions) {\n\n $('#chart').highcharts('StockChart', {\n\n rangeSelector: {\n selected: false\n },\n\n yAxis: {\n labels: {\n formatter: function () {\n return (this.value > 0 ? ' + ' : '') + this.value + '%';\n }\n },\n plotLines: [{\n value: 0,\n width: 2,\n color: 'silver'\n }]\n },\n\n plotOptions: {\n series: {\n compare: 'percent'\n }\n },\n\n tooltip: {\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',\n valueDecimals: 2\n },\n\n series: seriesOptions\n });\n}", "function createHighChartsTune() {\r\n $('#highchartTune').highcharts({\r\n chart: {zoomType: 'xy', alignTicks: false, type: 'line'},\r\n credits: {enabled: false},\r\n exporting: {enabled: false},\r\n legend: {enabled: false},\r\n title: {text: null, style: {fontSize: \"12px\", color: \"black\"}},\r\n tooltip: {shared: true},\r\n plotOptions: {line: {animation: false}}, \r\n xAxis: [{type: \"datetime\", crosshair: true, labels:{style: {fontSize: \"8px\"}}}],\r\n yAxis: [{endOnTick: false, startOnTick: false, lineWidth: 0.75, title: {text: null, style: {color: plotColors.pv}},\r\n labels:{format: \"{value}°C\", style: {fontSize: \"8px\", color: plotColors.pv}}},\r\n {endOnTick: false, startOnTick: false, lineWidth: 0.75, opposite: true, title: {text: null}, \r\n labels:{format: \"{value}%\", style: {fontSize: \"8px\", color: plotColors.out}}}],\r\n series: [\r\n {id: 'seriesPV', name: 'Temperature', lineWidth: 0.75, color: plotColors.pv, marker: {enabled: false}, yAxis: 0},\r\n {id: 'seriesSP', name: 'Setpoint', lineWidth: 0.75, color: plotColors.sp, marker: {enabled: false}, yAxis: 0},\r\n {id: 'seriesOut', name: 'Output', lineWidth: 0.75, color: plotColors.out, marker: {enabled: false}, yAxis: 1}\r\n ]\r\n });\r\n return $('#highchartTune').highcharts();\r\n}", "function optionChanged(newSelection) {\n buildChart(newSelection);\n}", "function createSeries(field, name, stacked) {\n var series = chart.series.push(new am4charts.ColumnSeries());\n series.dataFields.valueY = field;\n series.dataFields.categoryX = \"year\";\n series.name = name;\n series.columns.template.tooltipText = \"{name}: [bold]{valueY}[/]\";\n series.stacked = stacked;\n series.columns.template.width = am4core.percent(95);\n }", "function optionChanged(newSample){\n buildCharts(newSample);\n MetaData(newSample);\n}", "function optionChanged(name){\r\n // Testing option change\r\n // console.log(name)\r\n buildCharts(name) \r\n demographicData(name)\r\n}", "function populateGraphs(provider, seriesOptions) {\n Highcharts.setOptions({\n lang: {\n thousandsSep: ','\n },\n });\n Highcharts.stockChart(provider, {\n title: {\n \ttext: provider\n \t\t},\n legend: {\n enabled: true,\n align: 'right',\n backgroundColor: '#FCFFC5',\n borderColor: 'black',\n borderWidth: 2,\n layout: 'vertical',\n verticalAlign: 'top',\n y: 100,\n shadow: true\n },\n\n rangeSelector: {\n selected: 4\n },\n\n yAxis: {\n\n opposite: false,\n\n labels: {\n formatter: function () {\n return (this.value > 0 ? '' : '') + this.value;\n },\n style: {\n fontSize:'15px'\n }\n },\n\n plotLines: [{\n value: 0,\n width: 2,\n color: 'silver'\n }]\n },\n\n plotOptions: {\n series: {\n compare: 'events',\n showInNavigator: true\n }\n },\n\n series: seriesOptions,\n\n\n tooltip: {\n enabled: true,\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b><br/>',\n // valueDecimals: 2,\n // split: true,\n },\n\n exporting: {\n sourceWidth: 1600,\n sourceHeight: 400,\n // scale: 2 (default)\n chartOptions: {\n subtitle: null\n }\n }\n\n });\n }", "function optionChanged(newSample) {\n getData(newSample, createCharts);\n}", "function initRightChart() {\n\n var option1 = {\n title: {\n text: '',\n subtext: '',\n x: 'center'\n },\n tooltip: {\n trigger: 'item',\n formatter: \"{b} : {c} ({d}%)\"\n },\n label: { normal: {show:true}},\n legend: {\n orient: 'vertical',\n right: 50,\n bottom: 20,\n data: [\n {name:'箱式',icon:'circle' },\n { name: '柜式', icon: 'circle' },\n { name: '卧式', icon: 'circle' }\n ]\n },\n series: [\n {\n name: '访问来源',\n type: 'pie',\n radius: '55%',\n center: ['40%', '45%'],\n selectedOffset: 4,\n label: {\n normal: {\n show: true,\n position:'inside',\n formatter: \"{c}\"\n }\n },\n data: [\n { itemStyle: { normal: { color: '#ffab5a' } } },\n { selected: true, itemStyle: { normal: { color: '#a0e792' } } },\n { itemStyle: { normal: { color: '#5ebfe7' } } },\n \n ],\n \n }\n ]\n };\n\n var option2 = {\n color: ['#3398DB'],\n tooltip: {\n trigger: 'axis',\n axisPointer: { // 坐标轴指示器,坐标轴触发有效\n type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'\n }\n },\n grid: {\n left: '3%',\n right: '30px',\n bottom: '20px',\n top: '20px',\n containLabel: true\n },\n xAxis: [\n {\n type: 'category',\n data: [],\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n lineStyle: {\n color: \"#dddddd\"\n }\n },\n axisTick: {\n show: false\n },\n axisLabel: {\n textStyle: {\n color: '#c6c6c6'\n }\n }\n }\n ],\n yAxis: [\n {\n type: 'value',\n axisLine: {\n lineStyle: {\n color: \"#dddddd\"\n }\n },\n axisTick: {\n show: false\n },\n axisLabel: {\n textStyle: {\n color: '#c6c6c6'\n }\n }\n }\n ],\n series: [\n {\n name: '用水量',\n type: 'bar',\n barWidth: '50%',\n itemStyle: {\n normal: {\n color: new echarts.graphic.LinearGradient(\n 0, 0, 0, 1,\n [\n { offset: 0, color: '#59cdfd' },\n { offset: 0.5, color: '#27befd' },\n { offset: 1, color: '#07b4fd' }\n ]\n )\n }\n },\n data: []\n }\n ]\n };\n var option3 = {\n color: ['#3398DB'],\n tooltip: {\n trigger: 'axis',\n axisPointer: { // 坐标轴指示器,坐标轴触发有效\n type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'\n }\n },\n grid: {\n left: '3%',\n right: '30px',\n bottom: '20px',\n top:'20px',\n containLabel: true\n },\n xAxis: [\n {\n type: 'category',\n data: [1,2,3,4,5,6,7],\n axisTick: {\n alignWithLabel: true\n },\n axisLine: {\n lineStyle: {\n color: \"#dddddd\"\n }\n },\n axisTick: {\n show: false\n },\n axisLabel: {\n textStyle: {\n color: '#c6c6c6'\n }\n }\n }\n ],\n yAxis: [\n {\n type: 'value',\n axisLine: {\n lineStyle: {\n color: \"#dddddd\"\n }\n },\n axisTick: {\n show: false\n },\n axisLabel: {\n textStyle: {\n color: '#c6c6c6'\n }\n }\n }\n ],\n series: [\n {\n name: '用电量',\n type: 'bar',\n barWidth: '50%',\n itemStyle: {\n normal: {\n color: new echarts.graphic.LinearGradient(\n 0, 0, 0, 1,\n [\n { offset: 0, color: '#fdc959' },\n { offset: 0.5, color: '#fd8723' },\n { offset: 1, color: '#fd6407' }\n ]\n )\n }\n },\n data: []\n }\n ]\n };\n mapChart1.setOption(option1);\n //mapChart2.setOption(option2);\n //mapChart3.setOption(option3);\n}", "function optionChanged(newID) {\n fillTable(newID);\n makeCharts(newID);\n}", "function getOptions() {\n var options = {\n\n chart: {\n zoomType: 'x',\n spacingRight: 20,\n renderTo: 'container'\n },\n \n title: {\n text: ''\n },\n subtitle: {\n text: 'Source: nodemy-analytics.herokuapp.com'\n },\n xAxis: {\n type: 'datetime',\n labels: {\n rotation: -60,\n align: 'right',\n style: {\n fontSize: '10px',\n fontFamily: 'Verdana, sans-serif'\n }\n },\n dateTimeLabelFormats: { \n month: '%b %Y'\n },\n //tickInterval: 24 * 3600 * 1000 * 7 // default to one week\n tickInterval: 30 * 24 * 3600 * 1000\n },\n \n yAxis: {\n title: {\n text: \"Application Events\"\n },\n min: 0,\n allowDecimals: false,\n maxPadding: 0.2\n },\n \n plotOptions: {\n column: {\n pointPadding: 5.0,\n borderWidth: 0\n }\n },\n\n series: [{\n name: 'Generic Series Message',\n data: new Array({}),\n dataLabels: {\n enabled: false,\n rotation: -90, \n color: '#000000',\n align: 'middle',\n x: 0,\n y: -25,\n style: {\n fontSize: '13px',\n fontFamily: 'Verdana, sans-serif',\n textShadow: '0 0 0px black'\n }\n }\n }]\n }\n\n return options;\n }", "function optionChanged(NextSample){\n ChartInfo(NextSample);\n AllData(NextSample);\n\n }", "function postParseOptions(options) {\n for (var i=0; i<this.series.length; i++) {\n this.series[i].seriesColors = this.seriesColors;\n this.series[i].colorGenerator = $.jqplot.colorGenerator;\n }\n }", "function optionChanged(id) {\r\n buildplot(id);\r\n}", "function updateLineGraphTitle(data_option, year) {\n var title = lineGraphTitles[data_option] + \" in \" + year;\n d3.select(\"#lineGraphTitle\").text(title);\n}", "function onSeriesPointClick(point, event) {\n if (isDefined(point)) {\n setTimeout(function () {\n\n var _series = point.series.options;\n var highchart = point.series.chart;\n var chart = _series.ChartProvider;\n var specter = chart.Parent;\n chart = specter.getChart(chart.Name);\n\n // when is the chart object updated? after this function finshes?\n var selectedPoints = highchart.getSelectedPoints();\n chart.Selected = [];\n\n if (selectedPoints.length == 0)\n _series.Clear();\n\n $.each(selectedPoints, function (i, p) {\n var item = {};\n //get Series fields values\n $.each(p.series.options.Fields, function (i, field) {\n item[field] = _series[field] + '';\n });\n //get the point fields values\n $.each(p.Fields, function (i, field) {\n item[field] = p[field] + '';\n });\n\n item[\"$seriesname\"] = p.series.name;\n item[\"$series\"] = p.series.options;\n item[\"$data\"] = $.extend(true, {}, p);\n item[\"Value\"] = p.name;\n chart.Selected.push(item);\n\n //chart.Selected.push({\n // data: $.extend(true,{},p),\n // series: p.series.name//.options//.name\n //});\n });\n //Log(chart.Selected);\n //onClick event is from chart json\n if (isDefined(_series.onClick)) {\n _series.onClick(event);\n }\n event.Source = chart;\n event.Selected = chart.Selected;\n //Log(chart.Selected);\n //charts filter selection for specter\n var filterItem = {\n Name: chart.Name,\n Type: CHART,\n Contents: chart.Selected,\n Source: _series\n };\n\n if (isDefined(_series.DrillItem)) {\n filterItem.DrillItem = _series.DrillItem;\n processDrillItem(_series.DrillItem, event);\n }\n\n var linkedItems = _series.LinkedItems;\n if (isDefined(linkedItems)) {\n $.each(linkedItems, function (i, item) {\n processLinkedItem(item, event);\n });\n }\n\n specter.UpdateFilter(filterItem);\n\n }, 50);\n\n //if (point.state == \"select\")\n //{\n // findAndRemove(chart.Selected, \"Name\", point.name);\n //}\n //else\n //{\n // else { \n // chart.Selected.push({\n // Name: point.name,\n // Point: point//.name\n // });\n // }\n //}\n ////event.Specter = _series.Parent;\n }\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function changePattern(val) {\n var type = val;\n var summaryArray3 =[];\n var drillDown3=[];\n if(yearGapFlag | monthGapFlag){\n summaryArray3 = summaryArray2;\n drillDown3 = drillDown2;\n }else{\n summaryArray3 = summaryArray;\n drillDown3 = drillDown;\n }\n\n // console.log(summaryArray3);\n if(type !== 'line'){\n var chart = new Highcharts.chart({\n chart: {\n defaultSeriesType: type,\n renderTo: 'graphDiv',\n events: {\n drilldown: function (e) {\n chart.setTitle({text: drilldownTitle + e.point.name});\n chart.setSubtitle(\"\");\n },\n drillup: function(e) {\n chart.setTitle({ text: defaultTitle });\n }\n }\n },\n title: {\n text: defaultTitle\n },\n subtitle: {\n text: 'Click the columns to view more details..'\n },\n xAxis: {\n type: 'category'\n },\n yAxis: {\n title: {\n text: 'Total patch count'\n }\n\n },\n legend: {\n enabled: false\n },\n plotOptions: {\n series: {\n borderWidth: 0,\n dataLabels: {\n enabled: true,\n format: '{point.y}'\n }\n }\n },\n\n tooltip: {\n headerFormat: '<span style=\"font-size:11px\">{series.name} Summary</span><br>',\n pointFormat: '<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y}</b> of Total<br/>'\n },\n\n series: [{\n name: 'Patch',\n colorByPoint: true,\n data: summaryArray3\n }],\n drilldown: {\n series: drillDown3\n }\n });\n }else{\n var chart = new Highcharts.chart({\n chart: {\n defaultSeriesType: type,\n renderTo: 'graphDiv',\n events: {\n drilldown: function (e) {\n chart.setTitle({text: drilldownTitle + e.point.name});\n chart.setSubtitle(\"\");\n },\n drillup: function(e) {\n chart.setTitle({ text: defaultTitle });\n }\n }\n },\n title: {\n text: defaultTitle\n },\n subtitle: {\n text: 'Click the columns to view more details..'\n },\n xAxis: {\n type: 'category'\n },\n yAxis: {\n title: {\n text: 'Total patch count'\n }\n\n },\n legend: {\n enabled: false\n },\n plotOptions: {\n series: {\n borderWidth: 0,\n dataLabels: {\n enabled: true,\n format: '{point.y}'\n }\n }\n },\n\n tooltip: {\n headerFormat: '<span style=\"font-size:11px\">{series.name} Summary</span><br>',\n pointFormat: '<span style=\"color:{point.color}\">{point.name}</span>: <b>{point.y}</b> of Total<br/>'\n },\n\n series: [{\n name: 'Patch',\n color:'Black',\n data: summaryArray3\n }],\n drilldown: {\n series: drillDown3\n }\n });\n }\n\n}", "function createParallelIfNeeded(option) {\n\t if (option.parallel) {\n\t return;\n\t }\n\t\n\t var hasParallelSeries = false;\n\t each(option.series, function (seriesOpt) {\n\t if (seriesOpt && seriesOpt.type === 'parallel') {\n\t hasParallelSeries = true;\n\t }\n\t });\n\t\n\t if (hasParallelSeries) {\n\t option.parallel = [{}];\n\t }\n\t }", "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "function optionChanged(newSample) {\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "function createChart(data, options='')\n{\n if(options == '')\n {\n options = {\n showPoint: true,\n lineSmooth: false,\n height: \"260px\",\n fullWidth: false,\n plugins: [\n Chartist.plugins.tooltip({\n tooltipOffset: {\n x: 30,\n y: 40\n },\n })\n ],\n axisX: {\n showGrid: true,\n showLabel: true,\n },\n axisY: {\n offset: 40,\n },\n };\n }\n Chartist.Line('#chartSale', data, options);\n $('#save-stage').removeClass('hide');\n saveBoardStage();\n $('body').removeClass('loading');\n}", "function init_options(field, data_type) {\n var colors = ['#ADCD9E','#8E7098','#F3D469','#E1755F','#7EBEE4'];\n var options = {\n title: capitalizeFirstLetter(data_type) + ' by ' + field.toLowerCase(), \n width: 700,\n height: 400,\n legend: { position: 'right' },\n colors: colors,\n hAxis: {title: '', minValue: 0},\n vAxis: {title: '', minValue: 0},\n curveType: 'function',\n animation: {startup: true, easing: 'linear'}\n };\n return options;\n }", "setData(name, data) {\n if(!App.pathFinder.data.visualisation_enabled) {\n return;\n }\n\n App.pathFinder.chart.series.find(\n el => el.name === name\n ).setData(data);\n }", "piePlotoptions(settings, existingOptions) {\n existingOptions.series = {\n stacking: null,\n colorByPoint: true\n };\n existingOptions.pie = {\n cursor: 'pointer',\n dataLabels: {\n enabled: true,\n format: '{y:.' + this.decimals + 'f}%',\n distance: -30,\n style: {\n fontSize: this.fontSize,\n textShadow: 'none',\n textOutline: 'none'\n }\n },\n showInLegend: true\n };\n return existingOptions;\n }", "function changeSelect(stk) \n\n{\n // This variable stores the option selected by the user from the dropdown\n const typeOfChart = document.getElementById('typeOfChart').value;\n\n const results = stk;\n\n // delaring an empty list which does a look up on the json and stores the data\n dataToShow = []\n\n // conditional statement to update the chart with values bbased upon user selection\n if(typeOfChart === 'Open') \n {\n dataToShow = results.map(row=> row.Open)\n } \n else if(typeOfChart === 'Low') \n {\n dataToShow = results.map(row=> row.Low)\n } \n else if(typeOfChart === 'High') \n {\n dataToShow = results.map(row=> row.High)\n } \n else if(typeOfChart === 'Close') \n {\n dataToShow = results.map(row=> row.Close)\n } \n else if(typeOfChart === 'Adj_Close') {\n dataToShow = results.map(row=> row.Adj_Close)\n }\n\n// This variable is used to display the frame after an option is selected\nvar newOptions = {\n \n series: [{\n name: \"Stock Prices\",\n data: dataToShow\n }],\n\n chart: {\n height: 500,\n width: 1000,\n type: 'line',\n zoom: {enabled: false}\n },\n dataLabels: {enabled: false},\n stroke: {curve: 'straight'},\n title: {\n text: 'Lumber Futures Stock Price',\n align: pos,\n style: {fontSize: '24px'}\n },\n grid: {\n row: {\n colors: ['#f3f3f3', 'transparent'], // takes an array which will be repeated on columns\n opacity: 0.5\n },\n },\n xaxis: {categories: results.map(row=> row.Date),}\n };\n\n chart.updateOptions (newOptions, true, true, true)\n }", "function onChartLoad(event) {\n\n //get the chart instance first\n\n var highcharts = event.target;\n $.each(highcharts.series, function (i, s) {\n try {\n var specSeries = s.options;\n if (isDefined(specSeries.onLoad)) {\n specSeries.onLoad(s, event);\n }\n var chart = specSeries.ChartProvider;\n\n var spec = specSeries.ChartProvider.Parent;\n chart = spec.getChart(chart.Name);\n selected = chart.Selected;\n if (isDefined(selected)) {\n //.forEach(function (selectedPoint, index) {\n $.each(selected, function (i, item) {\n if (item[\"$seriesname\"] == s.name) {\n var point = findAndGetObj(s.data, \"name\", item.Value);\n if (isDefined(point))\n point.select(true, true);\n }\n });\n //var hasThisSeriesSelected = findAndGetObj(selected, \"Series\", s.name);\n //if (isDefined(hasThisSeriesSelected)) {\n // point.select();\n //}\n // }); \n }\n }\n catch (err)\n { }\n });\n}", "function build_plot_options(title, annotations)\n{\n\treturn {\n\t\tresponse: true,\n\t\tplugins: {\n\t\t\tannotation: {\n\t\t\t\tannotations: annotations\n\t\t\t},\n\n\t\t\tlegend: {\n\t\t\t\tdisplay: false\n\t\t\t},\n\n\t\t\ttitle: {\n\t\t\t\tdisplay: true,\n\t\t\t\ttext: title,\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 20,\n\t\t\t\t\tweight: \"bold\"\n\t\t\t\t}\n\t\t\t},\n\n\t\t\ttooltip: {\n\t\t\t\tmode: \"index\",\n\t\t\t\tintersect: \"false\",\n\t\t\t\tcallbacks: {\n\t\t\t\t\ttitle: function(items) {\n\t\t\t\t\t\tvar chart = items[0].chart;\n\t\t\t\t\t\tvar timestamps = chart.config._config.data.labels;\n\t\t\t\t\t\tvar label = items[0].label;\n\t\t\t\t\t\tvar index = items[0].dataIndex;\n\n\t\t\t\t\t\t// Find the date, since the current label will often just be the time\n\t\t\t\t\t\tfor (let i=index; i >= 0; i--)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// An array indicates a date label, whereas a string is a time label\n\t\t\t\t\t\t\tif (timestamps[i].constructor == Array)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// The current label was actually a date all along\n\t\t\t\t\t\t\t\tif (i == index)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel = timestamps[i][1];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Display the date in front of the time\n\t\t\t\t\t\t\t\treturn timestamps[i][0] + \" @ \" + label;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Should never get here, but return the default label for safety\n\t\t\t\t\t\treturn label;\n\t\t\t\t\t},\n\n\t\t\t\t\tlabel: function(item) {\n\t\t\t\t\t\tvar value = item.formattedValue;\n\n\t\t\t\t\t\t// Add the units to the temp, as well as some space\n\t\t\t\t\t\treturn \" \" + value + \" °C\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tscales: {\n\t\t\tx: {\n\t\t\t\t//type: \"time\",\n\t\t\t\tticks: {\n\t\t\t\t\tdisplay: true,\n\t\t\t\t\tincludeBounds: true,\n\t\t\t\t\tmaxRotation: 0\n\t\t\t\t},\n\n\t\t\t\ttitle: {\n\t\t\t\t\tdisplay: true,\n\t\t\t\t\ttext: \"Time\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tsize: 16,\n\t\t\t\t\t\tweight: \"bold\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\ty: {\n\t\t\t\ttitle: {\n\t\t\t\t\tdisplay: true,\n\t\t\t\t\ttext: \"Temp (C)\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tsize: 16,\n\t\t\t\t\t\tweight: \"bold\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}", "function optionChanged(newSample) { \r\n buildMetadata(newSample);\r\n buildCharts(newSample);\r\n\r\n }", "function optionChanged(newSample) {\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "function processOptions(plot, options) {\r\n\t\t\t\tif (options.series.curvedLines.active) {\r\n\t\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\r\n\t\t\t\t}\r\n\t\t\t}", "selectDataSource(data, sourceName, random) {\n let html = '<option class=\"existDataSource\">' + sourceName + '</option>';\n\n $('select.data').append(html);\n $('select.data').on('change', (e)=>{\n let data = this.props.reportData,\n name = $(e.target)[0][$(e.target)[0].selectedIndex].value,\n widgetConfig = $(e.target)[0].offsetParent.className,\n random = widgetConfig.split('_')[1];\n\n $(e.target)[0].selectedIndex > 1 ? this.chartDataSource(data, name, random) : null;\n });\n }", "function setSeriesByChart(chart_id, serie, serie_name, serie_type){\n\tvar highcharts = getChartById(chart_id);\n\tif(highcharts != null){\n\t\tvar series = highcharts.series;\n\t\tvar exist_serie = false;\n\t\tfor(var i = 0; i < series.length; i++){\n\t\t\tif(series[i].name == serie_name){\n\t\t\t\tif(series[i].type != serie_type){\n\t\t\t\t\tseries[i].update({\n\t\t type: serie_type,\n \t\tdrilldown: true\n\t\t });\n\t\t\t\t}\n\t\t\t\tseries[i].setData(serie);\n\t\t\t\texist_serie = true;\n\t\t\t}\n\t\t}\n\t\tif(!exist_serie){\n\t\t\thighcharts.addSeries({\n\t\t\t\ttype: serie_type,\n\t\t\t\tname: serie_name,\n\t\t\t\tdata: serie\n\t\t\t});\n\t\t}\n\t}\n}", "function option1Changed(option1) {\n selection_one = option1;\n createBarChart(option1,selection_two);\n createETForMFinfo(option1,selection_two);\n createApexChart(option1,selection_two); \n}", "function createListFromArray(source, seriesModel, opt) {\n opt = opt || {};\n\n if (!Object(Source[\"e\" /* isSourceInstance */])(source)) {\n source = Object(Source[\"c\" /* createSourceFromSeriesDataOption */])(source);\n }\n\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem[\"a\" /* default */].get(coordSysName);\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs;\n\n if (coordSysInfo && coordSysInfo.coordSysDims) {\n coordSysDimDefs = util[\"H\" /* map */](coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType); // dimInfo.stackable = isStackable(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n var useEncodeDefaulter = opt.useEncodeDefaulter;\n var dimInfoList = createDimensions(source, {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefaulter: util[\"w\" /* isFunction */](useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? util[\"i\" /* curry */](sourceHelper[\"c\" /* makeSeriesEncodeForAxisCoordSys */], coordSysDimDefs, seriesModel) : null\n });\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && util[\"k\" /* each */](dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n\n if (opt.createInvertedIndices) {\n dimInfo.createInvertedIndices = true;\n }\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\n var list = new data_List(dimInfoList, seriesModel);\n list.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n list.hasItemOption = false;\n list.initData(source, null, dimValueGetter);\n return list;\n}", "function optionChanged(newId) {\n Plot(newId);\n}" ]
[ "0.60257244", "0.57195324", "0.55616117", "0.55496806", "0.5541335", "0.55334026", "0.55303097", "0.55199957", "0.5486875", "0.5467299", "0.5464967", "0.5463103", "0.5456786", "0.54505247", "0.5441329", "0.54402953", "0.5410441", "0.5368964", "0.535817", "0.532579", "0.5272584", "0.52687305", "0.52482617", "0.52470595", "0.5207866", "0.5206902", "0.52017534", "0.51965594", "0.51853454", "0.51815385", "0.5179415", "0.5176445", "0.5157667", "0.5154481", "0.51399916", "0.5136695", "0.5129383", "0.5127863", "0.51207906", "0.51149344", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.5114795", "0.511394", "0.5113774", "0.51009464", "0.51009464", "0.51009464", "0.50990343", "0.50939053", "0.5090371", "0.5085685", "0.50856596", "0.5081525", "0.5069001", "0.5057608", "0.5057575", "0.5052367", "0.504484", "0.5043076", "0.50384396", "0.50383586", "0.5034222" ]
0.58042413
3
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function parsePosition(seriesModel, api) { var center = seriesModel.get('center'); var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent(center[0], api.getWidth()); var cy = parsePercent(center[1], api.getHeight()); var r = parsePercent(seriesModel.get('radius'), size / 2); return { cx: cx, cy: cy, r: r }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "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 }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Parse and decode geo json
function decode(json) { if (!json.UTF8Encoding) { return json; } var encodeScale = json.UTF8Scale; if (encodeScale == null) { encodeScale = 1024; } var features = json.features; for (var f = 0; f < features.length; f++) { var feature = features[f]; var geometry = feature.geometry; var coordinates = geometry.coordinates; var encodeOffsets = geometry.encodeOffsets; for (var c = 0; c < coordinates.length; c++) { var coordinate = coordinates[c]; if (geometry.type === 'Polygon') { coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale); } else if (geometry.type === 'MultiPolygon') { for (var c2 = 0; c2 < coordinate.length; c2++) { var polygon = coordinate[c2]; coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale); } } } } // Has been decoded json.UTF8Encoding = false; return json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.24342929034426,\n 38.150691355539586\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.277074920227072,\n 38.18335224460118\n\n ],\n [\n 13.30660067706301,\n 38.18389197106355\n\n ],\n [\n 13.278104888488791,\n 38.165808957979515\n\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.309476005126974,\n 38.13233005362,\n ],\n [\n\n 13.337628470947287,\n 38.135030534863766\n ],\n [\n 13.31805907397463,\n 38.11153300139878\n ]\n ]\n ]\n }\n }\n ]\n }\n}", "function parseJson(entry){\n\t\t\t\t\t\t\t\t\t\t\tvar polygon=entry[\"cap:polygon\"],\n\t\t\t\t\t\t\t\t\t\t\t\tfeature=null;\n\n\t\t\t\t\t\t\t\t\t\t\t//polygon exists\n\t\t\t\t\t\t\t\t\t\t\tif(polygon&&polygon!=\"\"&&!(polygon instanceof Object)){\n\t\t\t\t\t\t\t\t\t\t\t\tpolygon=polygon.split(\" \");\n\t\t\t\t\t\t\t\t\t\t\t\tvar coordinates=[polygon.map(function(coords){coords=coords.split(\",\"); return [parseFloat(coords[1]), parseFloat(coords[0])]})];\n\n\t\t\t\t\t\t\t\t\t\t\t\tfeature={\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype:\"Feature\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tgeometry:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype:\"Polygon\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcoordinates: coordinates\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\tproperties:(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar out={}, feed=json.feed;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var k in feed){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(k!='entry'){out[k]=feed[k]}\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\tfor(var k in entry){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tout['entry-'+k]=entry[k]\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\treturn out\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\treturn feature\n\t\t\t\t\t\t\t\t\t\t}", "static get_geo( json, bin, m_names=null ){\n\t\t\treturn this.load_geo( json, bin, m_names );\n\t\t}", "function geoParse(config){\n var geoData = geoJSON.parse(combinedData, {Point: ['lat', 'long']});\n // console.log(\"geoParse\");\n // console.log(geoData);\n // geoData.sort(sortByNAME);\n geoWrite(config, geoData); //----------------------- next function\n}", "function parseJSONP(data) {\n\t\t//we call the function to turn it into geoJSON and write a callback to add it to the geojson object\n\t\ttoGeoJSON(data,\n\t\t\tfunction(georesponse) {\n\t\t\t\tif (georesponse.features.length > 0) {\n\t\t\t\t\tvar selected = new L.geoJson(georesponse);\n\t\t\t\t\tvar selectedbounds = selected.getBounds();\n\t\t\t\t\tmap.fitBounds(selectedbounds);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "function getGeolocation() {\n // console.log(this.responseText);\n var data = JSON.parse(this.responseText);\n var results = data.results;\n results.forEach(function (element) {\n console.log(element.geometry.location);\n var ubication = {\n lat: element.geometry.location.lat,\n lng: element.geometry.location.lng\n };\n });\n }", "function parseGeoserverJson(response) {\n function parseId(idStr) {\n return idStr.match(/\\d*$/)[0] // ex: \"layergroup.24\" -> \"24\"\n }\n\n var features = Ext.util.JSON.decode(response.responseText).features\n return _(features).map(function(feature) {\n return _(feature.properties).defaults({\n id : parseId(feature.id)\n })\n })\n }", "decodeResponse(encoded, precision, srsOrigin) {\n\n let len = encoded.length,\n index = 0,\n lat = 0,\n lng = 0,\n array = [];\n\n precision = Math.pow(10, -precision);\n\n while (index < len) {\n let b, shift = 0,\n result = 0;\n do {\n b = encoded.charCodeAt(index++) - 63;\n result |= (b & 0x1f) << shift;\n shift += 5;\n } while (b >= 0x20);\n var dlat = ((result & 1) ? ~(result >> 1) : (result >> 1));\n lat += dlat;\n shift = 0;\n result = 0;\n do {\n b = encoded.charCodeAt(index++) - 63;\n result |= (b & 0x1f) << shift;\n shift += 5;\n } while (b >= 0x20);\n let dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));\n lng += dlng;\n // array.push( {lat: lat * precision, lng: lng * precision}\n // );\n array.push([lat * precision, lng * precision]);\n }\n //return array;\n let arrayProjectionOrigin = [];\n\n for (let a = 0; a < array.length; a = a + 1) {\n\n //Tenemos que cambiar posición de x e y\n let point = new ol.geom.Point(ol.proj.transform([array[a][1], array[a][0]], 'EPSG:4326', srsOrigin));\n let arrayAux = [point.getCoordinates()[0], point.getCoordinates()[1]];\n arrayProjectionOrigin.push(arrayAux);\n }\n return arrayProjectionOrigin;\n }", "function readJSONFromFile(){\n console.log(\"--> OPEN file\");\n fs.readFile('output.geojson', 'utf8', function (err, data) {\n if (err) throw err;\n console.log(data);\n obj = JSON.parse(data);\n console.log(obj.features[0].properties[\"Latest measurement\"]);\n });\n}", "static locationInfoFromJSON (inFilename) {\n let data = fs.readFileSync(inFilename, 'utf8')\n let tmpLocationInfo = JSON.parse(data)\n return tmpLocationInfo\n }", "function convertJson() {\n\tvar jsonstring = document.getElementById(\"geojson\").textContent;\n\tif (jsonstring == '') {\n\t\tjsonstring = document.getElementById(\"geojson_uf\").textContent;\n\t}\n\ttry {\n\t\tvar geojson = JSON.parse(jsonstring);\n\t\t// check for full GeoJSON (if copied directly from http://geojson.io/)\n\t\tif (geojson[\"type\"] == \"FeatureCollection\" && geojson[\"features\"] != undefined) {\n\t\t\t// geojson is formatted correctly already\n\t\t\t// so we don't need to do anything\n\t\t} else if (geojson[\"type\"] == \"Feature\" && geojson[\"geometry\"] != undefined) {\n\t\t\tgeojson = {\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [\n\t\t\t\t\tgeojson\n\t\t\t\t]\n\t\t\t}\n\t\t} else if (geojson[\"type\"] == \"Polygon\" && geojson[\"coordinates\"] != undefined) {\n\t\t\tgeojson = {\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [{\n\t\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\t\"properties\": {},\n\t\t\t\t\t\"geometry\": geojson\n\t\t\t\t}]\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Warning: GeoJSON is not formatted correctly.\")\n\t\t}\n\t\t// check switch toggle for input coordinate system\n\t\t// and convert if necessary\n\t\tif (document.getElementById('EPSG4326').checked != true) {\n\t\t\tgeojson = convertEPSG3857to4326(geojson);\n\t\t}\n\t\tgeoJsonToOutput(geojson);\n\t} catch(error) {\n\t\talert(\"Warning: GeoJSON is not formatted correctly. \\n\" + error);\n\t}\n}", "async function geoJSON(config) {\n let geoJSON = await d3.json(\"countries.geo.json\")\n let path = d3.geoPath(\n d3.geoMercator()\n .scale(180)\n .translate([config.center.x/1.5, config.center.y/1.5])\n )\n let dictFeatures = geoJSON.features.reduce((result, d) => {\n if (d.properties.name == \"United States of America\") {\n let maxLength = Math.max(...d.geometry.coordinates.map(d => d.length))\n d.geometry.coordinates = d.geometry.coordinates.filter(d => d.length == maxLength)\n result[\"United States\"] = d\n } else if (d.properties.name == \"South Korea\") {\n result[\"Korea\"] = d\n } else if (d.properties.name == \"Slovakia\") {\n result[\"Slovak Republic\"] = d\n } else {\n result[d.properties.name] = d\n }\n\n return result\n }, {})\n\n return {\n \"features\": dictFeatures,\n \"path\": path,\n \"centroids\": (() => {\n let centroidsDict = {}\n for (let arr of Object.entries(dictFeatures)) {\n let key = arr[0]\n let val = arr[1]\n let centroid = path.centroid(val)\n centroidsDict[key] = {\n \"x\": centroid[0],\n \"y\": centroid[1]\n }\n }\n return centroidsDict\n })()\n }\n}", "function parseObjects_native(reader, offset, cb) {\n var obj = JSON.parse(reader.toString());\n var arr = obj.features || obj.geometries || [obj];\n arr.forEach(o => cb(o));\n }", "getJsonFromServer() {\n fetch(`${servername}/getjson`)\n .then(res => res.json())\n .then(data=>{\n if(data != null) {\n for(let element of data) {\n if(element.jsonstring.df != null) {\n if(element.jsonstring.df.lob != null) {\n // Parse the json points to receive json data.\n let stringConverter = element.jsonstring.df.lob\n let floatStringArray = stringConverter.split(',')\n let latitude = parseFloat(floatStringArray[0])\n let longitude = parseFloat(floatStringArray[1])\n \n // Create a new feature on OpenLayers\n if(!this.doesFeatureExist(latitude, longitude)) {\n let longLat = fromLonLat([longitude, latitude])\n let newFeature = new Feature({\n geometry: new Point(longLat),\n information: element.jsonstring\n })\n this.vectorAlerts.addFeature(newFeature)\n }\n }\n else console.log('lob was null. JSON must be broken:', element)\n }\n else console.log(\"data.df was empty. Consider fixing json string?\", element)\n }\n console.log('Features were updated', this.vectorAlertLayer.getSource().getFeatures())\n }\n else console.log(\"data had returned null\")\n })\n }", "function convertGeoJsonCoordinates(coords)\n{\n\treturn new L.LatLng(-coords[1], coords[0], coords[2]);\n}", "function parseCoordinates(mapId) {\n var coordsField = $('#map-coords-field-' + mapId).val(); // read values from mak\n var coordsFormat = $('#map-coords-format-' + mapId).val();\n\n // Regex inspiration by: http://www.nearby.org.uk/tests/geotools2.js\n\n // It seems to be necessary to escape the values. Otherwise, the degree\n // symbol (°) is not recognized.\n var str = escape(coordsField);\n // However, we do need to replace the spaces again do prevent regex error.\n str = str.replace(/%20/g, ' ');\n\n var pattern, matches;\n var latsign, longsign, d1, m1, s1, d2, m2, s2;\n var latitude, longitude, latlong;\n\n if (coordsFormat === '1') {\n // 46° 57.1578 N 7° 26.1102 E\n pattern = /(\\d+)[%B0\\s]+(\\d+\\.\\d+)\\s*([NS])[%2C\\s]+(\\d+)[%B0\\s]+(\\d+\\.\\d+)\\s*([WE])/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[3] === 'S') ? -1 : 1;\n longsign = (matches[6] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[1]);\n m1 = parseFloat(matches[2]);\n d2 = parseFloat(matches[4]);\n m2 = parseFloat(matches[5]);\n latitude = latsign * (d1 + (m1 / 60.0));\n longitude = longsign * (d2 + (m2 / 60.0));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '2') {\n // 46° 57' 9.468\" N 7° 26' 6.612\" E\n pattern = /(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)[%22\\s]+([NS])[%2C\\s]+(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)[%22\\s]+([WE])/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[4] === 'S') ? -1 : 1;\n longsign = (matches[8] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[1]);\n m1 = parseFloat(matches[2]);\n s1 = parseFloat(matches[3]);\n d2 = parseFloat(matches[5]);\n m2 = parseFloat(matches[6]);\n s2 = parseFloat(matches[7]);\n latitude = latsign * (d1 + (m1 / 60.0) + (s1 / (60.0 * 60.0)));\n longitude = longsign * (d2 + (m2 / 60.0) + (s2 / (60.0 * 60.0)));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '3') {\n // N 46° 57.1578 E 7° 26.1102\n pattern = /([NS])\\s*(\\d+)[%B0\\s]+(\\d+\\.\\d+)[%2C\\s]+([WE])\\s*(\\d+)[%B0\\s]+(\\d+\\.\\d+)/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[1] === 'S') ? -1 : 1;\n longsign = (matches[4] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[2]);\n m1 = parseFloat(matches[3]);\n d2 = parseFloat(matches[5]);\n m2 = parseFloat(matches[6]);\n latitude = latsign * (d1 + (m1 / 60.0));\n longitude = longsign * (d2 + (m2 / 60.0));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '4') {\n // N 46° 57' 9.468\" E 7° 26' 6.612\"\n pattern = /([NS])\\s*(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)[%22%2C\\s]+([WE])\\s*(\\d+)[%B0\\s]+(\\d+)[%27\\s]+(\\d+\\.\\d+)/i;\n matches = str.match(pattern);\n if (matches) {\n latsign = (matches[1] === 'S') ? -1 : 1;\n longsign = (matches[5] === 'W') ? -1 : 1;\n d1 = parseFloat(matches[2]);\n m1 = parseFloat(matches[3]);\n s1 = parseFloat(matches[4]);\n d2 = parseFloat(matches[6]);\n m2 = parseFloat(matches[7]);\n s2 = parseFloat(matches[8]);\n latitude = latsign * (d1 + (m1 / 60.0) + (s1 / (60.0 * 60.0)));\n longitude = longsign * (d2 + (m2 / 60.0) + (s2 / (60.0 * 60.0)));\n latlong = [latitude, longitude];\n }\n } else if (coordsFormat === '5') {\n // 46.95263, 7.43517\n pattern = /(\\d+\\.\\d+)[%2C\\s]+(\\d+\\.\\d+)/i;\n matches = str.match(pattern);\n if (matches) {\n latlong = [matches[1], matches[2]];\n }\n }\n\n if (latlong != null) {\n var mapOptions = getMapOptionsById(mapId);\n zoomAddSearchMarker(mapOptions, L.latLng(latlong), true);\n showParseFeedback(mapId, 'Coordinates successfully parsed.', 'success');\n } else {\n showParseFeedback(mapId, tForInvalidFormat, 'error');\n }\n return false;\n}", "loadFromLocalFile (file) {\n let deferred = this.$q.defer();\n let ext = GeoUtils.getFileExtension(file.name);\n let reader = new FileReader();\n //\n if ((ext === 'kmz') || (ext === 'jpeg') || (ext === 'jpg')){\n reader.readAsArrayBuffer(file);\n } else {\n reader.readAsText(file);\n }\n reader.onload = () => {\n let p = null;\n switch (ext) {\n case 'kml':\n p = this._fromKml(reader.result);\n break;\n case 'json':\n p = this._fromJson(JSON.parse(reader.result));\n break;\n case 'geojson':\n p = this._fromJson(JSON.parse(reader.result));\n break;\n case 'kmz':\n p = this._fromKmz(reader.result);\n break;\n case 'gpx':\n p = this._fromGpx(reader.result);\n break;\n case 'jpeg':\n p = this._fromImage(reader, file.name);\n break;\n case 'jpg':\n p = this._fromImage(reader, file.name);\n break;\n case 'dsmap':\n p = this._fromDsmap(JSON.parse(reader.result));\n break;\n default:\n p = this._fromJson(JSON.parse(reader.result));\n }\n p.then( (data)=> { return deferred.resolve(data);});\n // deffered.resolve(p)\n };\n return deferred.promise;\n }", "function GeoJSONReader(reader) {\n\n // Read objects synchronously, with callback\n this.readObjects = function(onObject) {\n // Search first x bytes of file for features|geometries key\n // 300 bytes not enough... GeoJSON files can have additional non-standard properties, e.g. 'metadata'\n // var bytesToSearch = 300;\n var bytesToSearch = 5000;\n var start = reader.findString('\"features\"', bytesToSearch) ||\n reader.findString('\"geometries\"', bytesToSearch);\n // Assume single Feature or geometry if collection not found\n // (this works for ndjson files too)\n var offset = start ? start.offset : 0;\n T$1.start();\n parseObjects(reader, offset, onObject);\n // parseObjects_native(reader, offset, onObject);\n debug('Parse GeoJSON', T$1.stop());\n };\n }", "function refreshDataFromGeoJson() {\n var newData = new google.maps.Data({\n map: map,\n style: map.data.getStyle(),\n controls: ['Point', 'LineString', 'Polygon']\n });\n try {\n var userObject = JSON.parse(geoJsonInput.value);\n var newFeatures = newData.addGeoJson(userObject);\n } catch (error) {\n newData.setMap(null);\n if (geoJsonInput.value !== \"\") {\n setGeoJsonValidity(false);\n } else {\n setGeoJsonValidity(true);\n }\n return;\n }\n // No error means GeoJSON was valid!\n map.data.setMap(null);\n map.data = newData;\n bindDataLayerListeners(newData);\n setGeoJsonValidity(true);\n}", "function ConvertirGeometriaAJson(CadenaGeometria) {\n var ArregloPuntosGeometrias = [];\n if (CadenaGeometria.indexOf('GEOMETRYCOLLECTION') != -1) {\n CadenaGeometria = CadenaGeometria.replace(\"GEOMETRYCOLLECTION (\", '');\n CadenaGeometria = CadenaGeometria.split(')))').join('))');\n var poligonos = CadenaGeometria.split('),');\n\n CadenaGeometria = '';\n for (var i = 0; i < poligonos.length; i++) {\n var CadenaResultado = poligonos[i] + \")\";\n if (poligonos[i].indexOf(\"MULTIPOLYGON\") != -1) {\n CadenaResultado = CadenaResultado.replace(\" MULTIPOLYGON ((\", 'MULTIPOLYGON ((');\n CadenaResultado = CadenaResultado.replace(\"MULTIPOLYGON ((\", '');\n CadenaResultado = CadenaResultado.split(\", \").join(',');\n CadenaResultado = CadenaResultado.split(\"), \").join(\"@\");\n CadenaResultado = CadenaResultado.split(\"(\").join('');\n CadenaResultado = CadenaResultado.split(\")\").join('');\n CadenaResultado = CadenaResultado.split(' ').join('');\n if (i < (poligonos.length - 1)) {\n CadenaGeometria += CadenaResultado + \"@\";\n }\n else {\n CadenaGeometria += CadenaResultado;\n }\n }\n else if (poligonos[i].indexOf(\"POLYGON\") != -1) {\n CadenaResultado = CadenaResultado.replace(' POLYGON', 'POLYGON');\n CadenaResultado = CadenaResultado.replace(\"POLYGON (\", '');\n CadenaResultado = CadenaResultado.split(\", \").join(',');\n CadenaResultado = CadenaResultado.split(\"(\").join('');\n CadenaResultado = CadenaResultado.split(\")\").join('');\n if (i < (poligonos.length - 1)) {\n CadenaGeometria += CadenaResultado + \"@\";\n }\n else {\n CadenaGeometria += CadenaResultado;\n }\n }\n }\n }\n else if (CadenaGeometria.indexOf('MULTIPOLYGON') != -1) {\n CadenaGeometria = CadenaGeometria.replace(\" MULTIPOLYGON ((\", 'MULTIPOLYGON ((');\n CadenaGeometria = CadenaGeometria.replace(\"MULTIPOLYGON ((\", '');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\"), \").join(\"@\");\n CadenaGeometria = CadenaGeometria.split(\"(\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n CadenaGeometria = CadenaGeometria.split(' ').join('');\n }\n else if (CadenaGeometria.indexOf('POLYGON') != -1) {\n CadenaGeometria = CadenaGeometria.replace(' POLYGON', 'POLYGON');\n CadenaGeometria = CadenaGeometria.replace(\"POLYGON (\", '');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\"(\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n else if (CadenaGeometria.indexOf('POINT') != -1) {\n\n CadenaGeometria = CadenaGeometria.split(\"POINT (\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n else if (CadenaGeometria.indexOf('LINESTRING') != -1) {\n CadenaGeometria = CadenaGeometria.split(\"LINESTRING (\").join('');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n var Geometrias = CadenaGeometria.split('@');\n for (var i = 0; i < Geometrias.length; i++) {\n var arregloPuntos = [];\n var puntos = Geometrias[i].split(',');\n for (var j = 0; j < puntos.length; j++) {\n var cadenaPunto = puntos[j].split(' ');\n arregloPuntos.push({ x: cadenaPunto[0], y: cadenaPunto[1] });\n }\n ArregloPuntosGeometrias.push(arregloPuntos);\n }\n\n return ArregloPuntosGeometrias;\n\n}", "function GeoJSON(config) {\n Resource.call(this, config);\n this._geojson = null;\n}", "function deserialize() {\n var features = formats['in'][informaType].read(element);\n if(features) {\n\t\t\t\tmap.addLayer(vectorLayer);\n vectorLayer.addFeatures(features);\n } else {\n\t\t alert('Bad Input my friend, revisa tu geometria');\n }\n }", "function CKtoGeoJSON(CKjson){\n //Create an empty GeoJSON object to be filled with data and returned\n var geoJson={\n type: \"Feature\",\n geometry: {},\n properties:{}\n };\n \n //If the CKobject is already a valid GeoJSON object, simply use it.\n if(isValidGeoJson(CKjson)==true){\n geoJson = CKjson;\n }\n //if the CK object has a shape or geometry field, use this as the geometry of the GeoJSON object\n else if(CKjson.shape || CKjson.geometry){\n geoJson.geometry = CKjson.shape||CKjson.geometry;\n //All fields not in shape/geometry go into the properties of the GeoJSON object\n for(property in CKjson){\n if(Object.prototype.hasOwnProperty.call(CKjson, property)){\n if(property != \"shape\" && property != \"geometry\"){\n geoJson.properties[property]=CKjson[property];\n }\n }\n }\n }\n //If there is no shape but there is data, look through data for Lat/Long fields.\n else if(CKjson.data){\n geoJson.geometry[\"type\"]=\"Point\";\n geoJson.geometry[\"coordinates\"] = findLonLat(CKjson.data);\n //Then add all fields to properties\n for(property in CKjson){\n if(Object.prototype.hasOwnProperty.call(CKjson, property)){\n if(property != \"shape\" && property != \"geometry\"){\n geoJson.properties[property]=CKjson[property];\n }\n }\n }\n }\n //If there is no shape and no data, look through the object for Lat/Long fields.\n else{\n geoJson.geometry[\"type\"]=\"Point\";\n geoJson.geometry[\"coordinates\"] = findLonLat(CKjson);\n //Then add all fields to properties\n for(property in CKjson){\n if(Object.prototype.hasOwnProperty.call(CKjson, property)){\n if(property != \"shape\" && property != \"geometry\"){\n geoJson.properties[property]=CKjson[property];\n }\n }\n }\n }\n \n //attach visibility flags which are used by the filter to show/hide specific layers\n geoJson.visible = true;\n geoJson.visible_changed = false;\n \n return geoJson;\n}", "function getGeoData() {\n\n //determine if the handset has client side geo location capabilities\n if(geo_position_js.init()){\n\tgeo_position_js.getCurrentPosition(\n\t\t\t\t\t function(data){\n\t\t\t\t\t \n\t\t\t\t\t LATITUDE = data.coords.latitude;\n\t\t\t\t\t LONGITUDE = data.coords.longitude;\n\n\t\t\t\t\t },\n\n\t\t\t\t\t function(data){\n\t\t\t\t\t alert('could not retrieve geo data');\n\t\t\t\t\t }\n\t\t\t\t\t );\n }\n else{\n\talert(\"Functionality not available\");\n }\n\n\n\n}", "function convertBigQuery() {\n\tvar bqstring = document.getElementById(\"bigquery\").textContent;\n\t// get rid of the unimportant BigQuery syntax parts\n\tbqstring = bqstring.replace('POLYGON','').replace('((','').replace('))','');\n\tvar points = bqstring.split(',');\n\tvar coords = [];\n\tfor (var i=0; i < points.length; i++) {\n\t\tvar pair = points[i];\n\t\t// trim any trailing whitespace\n\t\tpair = pair.trim();\n\t\t// separate lon and lat via regexp\n\t\t// split on one (or more) space characters\n\t\tpair = pair.split(/\\s+/);\n\t\tconsole.log()\n\t\tvar lon = parseFloat(pair[0]);\n\t\tvar lat = parseFloat(pair[1]);\n\t\tconsole.log(lon, lat)\n\t\tcoords.push([lon,lat]);\n\t}\n\tvar geojson = {\n\t\t\"type\": \"FeatureCollection\",\n\t\t\"features\": [\n\t\t {\n\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\"properties\": {},\n\t\t\t\t\"geometry\": {\n\t\t\t\t\t\"type\": \"Polygon\",\n\t\t\t\t\t\"coordinates\": [ coords ]\n\t\t\t\t}\n\t\t }\n\t\t]\n\t};\n\tgeoJsonToOutput(geojson);\n}", "function GeometryParser() {}", "function geojson_callback(geojson_text) {\n features = JSON.parse(geojson_text);\n if(layer) layer.remove();\n layer = L.geoJSON(null,options).addTo(map);\n layer.addData(features);\n}", "function ufoToGeoJson(ufo) {\n return {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [\n ufo.fields.location.lon,\n ufo.fields.location.lat\n ]\n },\n properties: {\n title: ufo.fields.locationName,\n ufo: ufo\n }\n };\n}", "function decodeGeoFirestoreObject(geoFirestoreObj) {\r\n if (validateGeoFirestoreObject(geoFirestoreObj, true)) {\r\n return geoFirestoreObj.d;\r\n }\r\n else {\r\n throw new Error('Unexpected location object encountered: ' + JSON.stringify(geoFirestoreObj));\r\n }\r\n}", "function parseGeoLoc(s) {\n var pts = new String(s).split(\",\");\n return new google.maps.LatLng(parseFloat(pts[0]), parseFloat(pts[1]));\n}", "parseGeoLocation(position){\n window.FranklyAdsGeoLocation = {};\n window.FranklyAdsGeoLocation.latitude = position.coords.latitude;\n window.FranklyAdsGeoLocation.longitude = position.coords.longitude;\n FranklyAdsGeoLocation.retrieved = true;\n console.log(\"FranklyAds.parseGeoLocation \", window.FranklyAdsGeoLocation.latitude, window.FranklyAdsGeoLocation.longitude);\n return position;\n }", "function getJSON(input) {\n if (typeof input === 'string') {\n var re = /^[\\+\\-]?[0-9\\.]+,[ ]*\\ ?[\\+\\-]?[0-9\\.]+$/; // lat,lng\n if (input.match(re)) {\n input = '[' + input + ']';\n }\n return JSON.parse(jsonize(input));\n }\n else {\n return input;\n }\n}", "function getData(userLocation) {\n userLocation = userLocation !== \"\" ? userLocation : \"Philadelphia, PA\";\n const endPointURL = `https://api.mapbox.com/geocoding/v5/mapbox.places/${userLocation}.json`;\n const params = {\n limit: 1,\n fuzzyMatch: true,\n bbox:\n \"-76.23327974765701, 39.290566999999996, -74.389708, 40.608579999999996\",\n access_token: MAPBOX_API_KEY,\n };\n let badRequest = false;\n\n const queryString = formatQueryParams(params);\n const url = endPointURL + \"?\" + queryString;\n\n fetch(url)\n .then((response) => {\n if (response.status >= 200 && response.status < 400) {\n return response.json();\n }\n return {features: [] }\n })\n .then((data) => {\n let lat, lng;\n // If the Mapbox geolocation does not find a location, then provide a default (Philadelphia)\n if (data.features.length === 0) {\n lat = 40.010854;\n lng = -75.126666;\n badRequest=true;\n } else {\n lat = data.features[0].center[1];\n lng = data.features[0].center[0]; \n }\n // Retrieve Census FIPS codes for the given coordinates\n\n return fetch(\n `https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_ACS2019/Mapserver/8/query?geometry=${lng},${lat}&geometryType=esriGeometryPoint&inSR=4269&spatialRel=esriSpatialRelIntersects&returnGeometry=false&f=pjson&outFields=STATE,COUNTY,TRACT`\n )\n .then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error(response.statusText);\n }\n })\n .then((responseJson) => {\n const fipsCodes = responseJson.features[0].attributes;\n let geoTags = {\n lat,\n lng,\n fipsCodes,\n stateGeoid: fipsCodes[\"STATE\"],\n countyGeoid: fipsCodes[\"COUNTY\"],\n tractGeoid: fipsCodes[\"TRACT\"],\n combinedGeoid:\n fipsCodes[\"STATE\"] + fipsCodes[\"COUNTY\"] + fipsCodes[\"TRACT\"],\n };\n return geoTags;\n });\n })\n .then((geoTags) => {\n const acsVars = [\n \"DP05_0001E\",\n \"DP03_0027PE\",\n \"DP03_0028PE\",\n \"DP03_0029PE\",\n \"DP03_0030PE\",\n \"DP03_0031PE\",\n \"DP03_0033PE\",\n \"DP03_0034PE\",\n \"DP03_0035PE\",\n \"DP03_0036PE\",\n \"DP03_0037PE\",\n \"DP03_0038PE\",\n \"DP03_0039PE\",\n \"DP03_0040PE\",\n \"DP03_0041PE\",\n \"DP03_0042PE\",\n \"DP03_0043PE\",\n \"DP03_0044PE\",\n \"DP03_0045PE\",\n \"DP03_0062E\",\n \"DP04_0134E\",\n \"DP04_0089E\",\n \"DP05_0018E\",\n \"DP05_0039PE\",\n \"DP05_0044PE\",\n \"DP05_0038PE\",\n \"DP05_0052PE\",\n \"DP05_0057PE\",\n \"DP05_0058PE\",\n \"DP05_0037PE\",\n \"DP03_0009PE\",\n \"DP04_0005E\",\n ];\n\n const countyAcsArgs = {\n sourcePath: [\"acs\", \"acs5\", \"profile\"],\n vintage: 2019,\n values: acsVars,\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n },\n geoResolution: \"20m\",\n statsKey: CENSUS_API_KEY,\n };\n\n const tractAcsArgs = {\n sourcePath: [\"acs\", \"acs5\", \"profile\"],\n vintage: 2019,\n values: acsVars,\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n tract: geoTags.tractGeoid,\n },\n geoResolution: \"500k\",\n statsKey: CENSUS_API_KEY,\n };\n\n const countyPepArgs = {\n sourcePath: [\"pep\", \"population\"],\n vintage: 2019,\n values: [\"DATE_CODE\", \"DATE_DESC\", \"POP\"],\n geoHierarchy: {\n state: geoTags.stateGeoid,\n county: geoTags.countyGeoid,\n },\n statsKey: CENSUS_API_KEY,\n };\n\n function censusGeoids() {\n return new Promise((resolve, reject) => {\n resolve(geoTags);\n });\n }\n\n function countyAcs(args = countyAcsArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n function countyPep(args = countyPepArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n function ctAcsPromise(args = tractAcsArgs) {\n return new Promise((resolve, reject) => {\n census(args, (err, json) => {\n if (!err) {\n resolve(json);\n } else {\n reject(err);\n }\n });\n });\n }\n\n Promise.all([countyAcs(), censusGeoids(), ctAcsPromise(), countyPep()])\n .then((values) => {\n const msaLocations = {\n states: [\"10\", \"24\", \"34\", \"42\"],\n counties: [\n \"003\",\n \"005\",\n \"007\",\n \"015\",\n \"017\",\n \"029\",\n \"033\",\n \"045\",\n \"091\",\n \"101\",\n ],\n };\n const { states, counties } = msaLocations;\n const isInMSA =\n states.includes(values[1].fipsCodes[\"STATE\"]) &&\n counties.includes(values[1].fipsCodes[\"COUNTY\"]);\n\n // If the request falls outside of MSA\n let searchLocation = `${values[1].lng},${values[1].lat}`;\n\n // Check if searched location is in MSA; if not replace with default\n // location / stats; set badRequest to true\n if (!isInMSA) {\n values[0] = defaultCounty;\n values[2] = defaultTract;\n searchLocation = `-75.126666,40.010854`;\n badRequest = true;\n }\n\n const statistics = {\n msa: phillyMSAGeoJson.features[0].properties,\n county: values[0].features[0].properties,\n countyPep: values[3],\n tract: values[2].features[0].properties,\n };\n\n SearchService.getProperties(knex(req), searchLocation).then(\n (properties) => {\n const allProperties = properties.rows;\n\n return res.json({\n badRequest,\n apiStatistics: transformStats(statistics),\n properties: allProperties,\n msa: phillyMSAGeoJson,\n county: values[0],\n tract: values[2],\n });\n }\n );\n })\n .catch((error) => {\n throw new Error(error);\n });\n })\n .catch((error) => {\n logger.error(error);\n console.error(error);\n });\n }", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function refreshDataFromGeoJson() {\n deselectLastFeature();\n\n var newData = new google.maps.Data({\n map: map,\n style: map.data.getStyle(),\n controls: ['Point', 'LineString', 'Polygon']\n });\n try {\n var userObject = JSON.parse(geoJsonInput.value);\n var newFeatures = newData.addGeoJson(userObject);\n } catch (error) {\n newData.setMap(null);\n if (geoJsonInput.value !== \"\") {\n setGeoJsonValidity(false);\n } else {\n setGeoJsonValidity(true);\n }\n return;\n }\n // No error means GeoJSON was valid!\n map.data.setMap(null);\n map.data = newData;\n\n bindDataLayerListeners(newData);\n setGeoJsonValidity(true);\n\n setTimeout(fitMapToAllFeatures, 17);\n\n}", "function parseGoogleGeocodes(response) {\n // the result has a results property that is an array\n // there may be more than one result when the address is ambiguous\n // for pragmatic reasons, only use the first result\n // if the result does not have a zip code, then assume the user\n // did not provide a valid address\n\n var result = response.results[0]\n , zipComponent = findAddressComponent(result.address_components, 'postal_code')\n , simple = {}\n ;\n\n simple.zip5 = zipComponent ? zipComponent.short_name : null;\n simple.address = result.formatted_address.replace(/,\\s*USA/, '');\n simple.localAddress = getLocalAddress(result) || simple.address;\n simple.location = result.geometry.location;\n return simple;\n}", "function jsonTransform() {\n\tconsole.log(\"in json function\");\n\t$.getJSON(\"ajax/WagPregeo.json\",function(data) {\n\t\t$.each(data,function(key, val) {\t\n\t\t\taddressArray.push({id: val.id, name: val.name,addresseng: val.addresseng, addresscn: val.addresscn});\n\t\t});\n\t\tinitializeGeo();\t\n\t});\n}", "static async getGeoData() {\n try {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIKey}`);\n const data = await response.json();\n return (data.coord);\n } catch(err) {\n alert(err);\n }\n }", "function GeoJSONWrapper (features) {\n\t this.features = features\n\t this.length = features.length\n\t}", "function GeoJSONWrapper (features) {\n\t this.features = features\n\t this.length = features.length\n\t}", "static parseJSON(jstr) {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`JSON.parse for \\\"${jstr}\\\"`);\n}\nif ((jstr != null) && jstr.length > 0) {\nreturn JSON.parse(jstr);\n} else {\nlggr.warn(`JSON.parse failed for \\\"${jstr}\\\"`);\nreturn null;\n}\n}", "function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }", "function isValidGeoJson(jsonObj){\n if(jsonObj.type){\n if(jsonObj.type==\"FeatureCollection\"){\n if(jsonObj.hasOwnProperty(\"features\")){\n for(var i=0;i<jsonObj.features.length;i++){\n if(!isValidGeoJson(jsonObj.features[i])){\n return false;\n }\n }\n return true;\n }\n }\n else if(jsonObj.type == \"Feature\"){\n if(jsonObj.hasOwnProperty(\"geometry\")&&jsonObj.hasOwnProperty(\"properties\")){\n if(!isValidGeoJsonGeometry(jsonObj.geometry)){\n return false;\n }\n return true;\n }\n }\n else{\n return isValidGeoJsonGeometry(jsonObj)\n }\n }\n return false;\n}", "function Geography(user) {\n return $http.get('http://prod1.groupz.in:7000/Authenticator?request=' + JSON.stringify(user)).then(handleSuccess, handleError('Error Login'));\n }", "function getGEO(input){\n // grab 2018 cencus data\n d3.json(`/sqlsearch/${input}`).then(function(data){\n\n var info2 = data\n // get lat and lon out of Json and then group for Weather api\n globalLat = info2.lat[0]\n globalLon = info2.lng[0]\n var both = globalLat+\",\"+ globalLon\n // send to weather api\n getWeather(both)\n })\n}", "function GeoCallback ( in_geocode_response\t///< The JSON object.\n\t\t\t\t\t\t\t)\n\t{\n\t\tif ( in_geocode_response && in_geocode_response[0] && in_geocode_response[0].geometry && in_geocode_response[0].geometry.location )\n\t\t\t{\n\t\t\tWhereAmI_CallBack ( {'coords':{'latitude':in_geocode_response[0].geometry.location.lat(),'longitude':in_geocode_response[0].geometry.location.lng()}} );\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\talert ( c_g_address_lookup_fail );\n\t\t\twindow.history.back();\n\t\t\t};\n\t}", "function simplifyGeojson(geo, n){\n\n}", "function GeoJSONWrapper (features) {\n this.features = features\n this.length = features.length\n}", "function GeoJSONWrapper (features) {\n this.features = features\n this.length = features.length\n}", "function Location(jsonObject){\n this.formatted_query = jsonObject[0].display_name;\n this.latitude = jsonObject[0].lat;\n this.longitude = jsonObject[0].lon;\n\n}", "processGeocodeData(results, status) {\n let first = 0;\n if (status === \"OK\") {\n const location = results[first].geometry.location;\n let position = {\n 'lat': location.lat(),\n 'lng': location.lng(),\n }\n this.setNewPanorama(position);\n } else {\n console.error(\"GeoCoding information not found for this location.\");\n }\n }", "function retrieve_map_data(lat_lon_json) {\n let xmlhttprequest = new XMLHttpRequest();\n xmlhttprequest.open(\"GET\", '../cgi-bin/get_map_info.py?n_per_comuna=True');\n xmlhttprequest.timeout = 1000;\n xmlhttprequest.onload = async function () {\n let json_data = JSON.parse(\n JSON.parse(\n JSON.stringify(\n JSON.parse(xmlhttprequest.responseText)\n )\n ).replace(/'/g, '\"')\n );\n\n add_markers(json_data, lat_lon_json);\n }\n xmlhttprequest.onerror = function (pe) {\n console.log(\"FAILED to retrieve the data\");\n }\n xmlhttprequest.send(null);\n}", "getGC() {\n return this.$http.get(PATH + \"gc_polygon.topo.json\", {cache: true})\n .then(function(data, status) {\n return topojson.feature(data.data, data.data.objects['dc_polygon.geo']);\n });\n }", "function parseMetadata(d){\n\treturn {\n\t\tiso_a3: d.ISO_A3,\n\t\tiso_num: d.ISO_num,\n\t\tdeveloped_or_developing: d.developed_or_developing,\n\t\tregion: d.region,\n\t\tsubregion: d.subregion,\n\t\tname_formal: d.name_formal,\n\t\tname_display: d.name_display,\n\t\tlngLat: [+d.lng, +d.lat]\n\t}\n}", "function parseMetadata(d){\n\treturn {\n\t\tiso_a3: d.ISO_A3,\n\t\tiso_num: d.ISO_num,\n\t\tdeveloped_or_developing: d.developed_or_developing,\n\t\tregion: d.region,\n\t\tsubregion: d.subregion,\n\t\tname_formal: d.name_formal,\n\t\tname_display: d.name_display,\n\t\tlngLat: [+d.lng, +d.lat]\n\t}\n}", "function parseMetadata(d){\n\treturn {\n\t\tiso_a3: d.ISO_A3,\n\t\tiso_num: d.ISO_num,\n\t\tdeveloped_or_developing: d.developed_or_developing,\n\t\tregion: d.region,\n\t\tsubregion: d.subregion,\n\t\tname_formal: d.name_formal,\n\t\tname_display: d.name_display,\n\t\tlngLat: [+d.lng, +d.lat]\n\t}\n}", "function getLocation(json, url){\n \n var validTweets = json.filter(function (obj) {return obj.geo != null;});\n return validTweets.map(\n\tfunction(obj){ \n\t var coord = obj.geo.coordinates;\n\t return {url: \"https://maps.google.ca/maps?q=\" + coord[0] + \",\" + coord[1],\n\t\t user_id: obj.user.id,\n\t\t profile_image_url: obj.user.profile_image_url,\n\t\t screen_name: obj.user.screen_name};\n\t});\n\n}", "function jsonParsing(jsonData, jsonLegData) {\r\n completePolyline = [];\r\n legInfo = [];\r\n time = {\r\n walkingTime : jsonData.itineraries[0].walkTime,\r\n transitTime : jsonData.itineraries[0].transitTime,\r\n waitingTime : jsonData.itineraries[0].waitingTime,\r\n start : jsonData.itineraries[0].startTime,\r\n end : jsonData.itineraries[0].endTime,\r\n transfers : jsonData.itineraries[0].transfers,\r\n transitModes : getTransitModes(jsonLegData)\r\n };\r\n for (j=0; j < jsonLegData.length; j++) {\r\n legInfo.push({ currentLeg:j + 1,\r\n transitMode:jsonLegData[j].mode, \r\n legDuration : (jsonLegData[j].endTime - jsonLegData[j].startTime) / 1000,\r\n route : jsonLegData[j].route,\r\n routeName: jsonLegData[j].routeLongName,\r\n routeID : jsonLegData[j].routeId,\r\n routeColor : jsonLegData[j].routeColor,\r\n departurePlace : jsonLegData[j].from.name,\r\n departureTime : jsonLegData[j].from.departure,\r\n arrivalPlace : jsonLegData[j].to.name,\r\n arrivalTime : jsonLegData[j].to.arrival,\r\n legPolyline : decodeGeometry(jsonLegData[j].legGeometry.points)});\r\n completePolyline.push(decodeGeometry(jsonLegData[j].legGeometry.points));\r\n }\r\n return {time, completePolyline, legInfo};\r\n}", "function parseData(d){\n\n\treturn {\n\t\tlngLat: [+d.Lng,+d.Lat],\n\t\tprice: d.price,\n\t\tdistrict: d.district\n\t}\n}", "function GeoJSONWrapper(features) {\n this.features = features;\n this.length = features.length;\n this.extent = EXTENT;\n}", "function unpackJSON(feed, sortAttr){\n // Converts the USGS's geojson feed into an array of quake objects and optionally sorts them \n // based on the specified attribute name (if present)\n //\n // Each object in the list contains the following attributes:\n // longitude, latitude, depth, mag, place, time, updated, tz, url, \n // detail, felt, cdi, mmi, alert, status, tsunami, sig, net, code, \n // ids, sources, types, nst, dmin, rms, gap, magType, type,\n // \n // See the ComCat documentation page for details on what each attribute encodes:\n // https://earthquake.usgs.gov/data/comcat/data-eventterms.php\n // \n quakes = _.map(feed.features, item => {\n let [longitude, latitude, depth] = item.geometry.coordinates\n return _.extend({longitude, latitude, depth}, item.properties)\n })\n\n return sortAttr ? sortQuakes(quakes, sortAttr) : quakes\n}", "function init(){\n synchronizeMap();\n\n // Zoom in once\n if(count == 0){\n map.setLevel(15);\n count = 1;\n }\n\n AdvancedGeolocation.start(function(data){\n\n try{\n\n // Don't draw anything if graphics layer suspended\n if(!map.graphics.suspended){\n\n var jsonObject = JSON.parse(data);\n\n switch(jsonObject.provider){\n case \"gps\":\n if(jsonObject.latitude != \"0.0\"){\n addLocationData(\"GPS\", jsonObject);\n console.log(\"GPS location detected - lat:\" +\n jsonObject.latitude + \", lon: \" + jsonObject.longitude +\n \", accuracy: \" + jsonObject.accuracy);\n var point = new Point(jsonObject.longitude, jsonObject.latitude);\n map.centerAt(point);\n addGraphic( greenGPSSymbol, point);\n }\n break;\n\n case \"network\":\n if(jsonObject.latitude != \"0.0\"){\n addLocationData(\"Network\", jsonObject);\n console.log(\"Network location detected - lat:\" +\n jsonObject.latitude + \", lon: \" + jsonObject.longitude +\n \", accuracy: \" + jsonObject.accuracy);\n var point = new Point(jsonObject.longitude, jsonObject.latitude);\n map.centerAt(point);\n addGraphic( blueNetworkSymbol, point);\n }\n break;\n\n case \"satellite\":\n console.log(\"Satellites detected \" + (Object.keys(jsonObject).length - 1));\n console.log(\"Satellite meta-data: \" + data);\n addSatelliteData(jsonObject);\n break;\n\n case \"cell_info\":\n console.log(\"cell_info JSON: \" + data);\n break;\n\n case \"cell_location\":\n console.log(\"cell_location JSON: \" + data);\n break;\n\n case \"signal_strength\":\n console.log(\"Signal strength JSON: \" + data);\n break;\n }\n }\n }\n catch(exc){\n console.log(\"Invalid JSON: \" + exc);\n }\n },\n function(error){\n console.log(\"Error JSON: \" + JSON.stringify(error));\n var e = JSON.parse(error);\n console.log(\"Error no.: \" + e.error + \", Message: \" + e.msg + \", Provider: \" + e.provider);\n },\n /////////////////////////////////////////\n //\n // These are the required plugin options!\n // README has API details\n //\n /////////////////////////////////////////\n {\n \"minTime\":0,\n \"minDistance\":0,\n \"noWarn\":false,\n \"providers\":\"all\",\n \"useCache\":true,\n \"satelliteData\":true,\n \"buffer\":true,\n \"bufferSize\":10,\n \"signalStrength\":false\n });\n }", "function deserialize() {\n var element = document.getElementById('text');\n var type = document.getElementById(\"formatType\").value;\n var features = formats['in'][type].read(element.value);\n var bounds;\n if(features) {\n if(features.constructor != Array) {\n features = [features];\n }\n for(var i=0; i<features.length; ++i) {\n if (!bounds) {\n bounds = features[i].geometry.getBounds();\n } else {\n bounds.extend(features[i].geometry.getBounds());\n }\n\n }\n vectors.addFeatures(features);\n map.zoomToExtent(bounds);\n var plural = (features.length > 1) ? 's' : '';\n element.value = features.length + ' feature' + plural + ' aggiunte'\n } else {\n element.value = 'Nessun input ' + type;\n }\n}", "function topo2geo(topology, objectName) {\n // Decode first object/feature as default\n if (!objectName) {\n objectName = Object.keys(topology.objects)[0];\n }\n var object = topology.objects[objectName];\n // Already decoded => return cache\n if (object['hc-decoded-geojson']) {\n return object['hc-decoded-geojson'];\n }\n // Do the initial transform\n var arcsArray = topology.arcs;\n if (topology.transform) {\n var _a = topology.transform,\n scale_1 = _a.scale,\n translate_1 = _a.translate;\n arcsArray = topology.arcs.map(function (arc) {\n var x = 0,\n y = 0;\n return arc.map(function (position) {\n position = position.slice();\n position[0] = (x += position[0]) * scale_1[0] + translate_1[0];\n position[1] = (y += position[1]) * scale_1[1] + translate_1[1];\n return position;\n });\n });\n }\n // Recurse down any depth of multi-dimentional arrays of arcs and insert\n // the coordinates\n var arcsToCoordinates = function (arcs) {\n if (typeof arcs[0] === 'number') {\n return arcs.reduce(function (coordinates,\n arcNo,\n i) {\n var arc = arcNo < 0 ? arcsArray[~arcNo] : arcsArray[arcNo];\n // The first point of an arc is always identical to the last\n // point of the previes arc, so slice it off to save further\n // processing.\n if (arcNo < 0) {\n arc = arc.slice(0, i === 0 ? arc.length : arc.length - 1);\n arc.reverse();\n }\n else if (i) {\n arc = arc.slice(1);\n }\n return coordinates.concat(arc);\n }, []);\n }\n return arcs.map(arcsToCoordinates);\n };\n var features = object.geometries\n .map(function (geometry) { return ({\n type: 'Feature',\n properties: geometry.properties,\n geometry: {\n type: geometry.type,\n coordinates: geometry.coordinates ||\n arcsToCoordinates(geometry.arcs)\n }\n }); });\n var geojson = {\n type: 'FeatureCollection',\n copyright: topology.copyright,\n copyrightShort: topology.copyrightShort,\n copyrightUrl: topology.copyrightUrl,\n features: features,\n 'hc-recommended-mapview': object['hc-recommended-mapview'],\n bbox: topology.bbox,\n title: topology.title\n };\n object['hc-decoded-geojson'] = geojson;\n return geojson;\n }", "function getLngFromStr(geo) {\n\treturn geo.split(\",\")[1].replace(/\\)/, \"\").replace(/ /, \"\");\n}", "function reverseGeocode(coords) {\n const templateStr = `https://nominatim.openstreetmap.org/reverse?lat=${coords.lat}&lon=${coords.lon}&format=geojson`;\n //console.log(templateStr);\n return axios.get(templateStr)\n .then(res => res.data)\n .catch(err => { throw err; })\n}", "parse() {\n /**\n * The first two bytes are a bitmask which states which features are present in the mapFile\n * The second two bytes are.. something?\n */\n const featureFlags = this.take(2, \"featureFlags\").readUInt16LE(0);\n this.take(2, \"unknown01\");\n if (featureFlags & 0b000000000000001) {\n this.robotStatus = this.take(0x2C, \"robot status\");\n }\n\n\n if (featureFlags & 0b000000000000010) {\n this.mapHead = this.take(0x28, \"map head\");\n this.parseImg();\n }\n if (featureFlags & 0b000000000000100) {\n let head = asInts(this.take(12, \"history\"));\n this.history = [];\n for (let i = 0; i < head[2]; i++) {\n // Convert from ±meters to mm. UI assumes center is at 20m\n let position = this.readFloatPosition(this.buf, this.offset + 1);\n // first byte may be angle or whether robot is in taxi mode/cleaning\n //position.push(this.buf.readUInt8(this.offset)); //TODO\n this.history.push(position[0], position[1]);\n this.offset += 9;\n }\n }\n if (featureFlags & 0b000000000001000) {\n // TODO: Figure out charge station location from this.\n let chargeStation = this.take(16, \"charge station\");\n this.chargeStation = {\n position: this.readFloatPosition(chargeStation, 4),\n orientation: chargeStation.readFloatLE(12)\n };\n }\n if (featureFlags & 0b000000000010000) {\n let head = asInts(this.take(12, \"virtual wall\"));\n\n this.virtual_wall = [];\n this.no_go_area = [];\n\n let wall_num = head[2];\n\n for (let i = 0; i < wall_num; i++) {\n this.take(12, \"virtual wall prefix\");\n let body = asFloat(this.take(32, \"Virtual walls coords\"));\n\n if (body[0] === body[2] && body[1] === body[3] && body[4] === body[6] && body[5] === body[7]) {\n //is wall\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n\n this.virtual_wall.push([x1, y1, x2, y2]);\n } else {\n //is zone\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.no_go_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n }\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000000100000) {\n let head = asInts(this.take(12, \"area head\"));\n let area_num = head[2];\n\n this.clean_area = [];\n\n for (let i = 0; i < area_num; i++) {\n this.take(12, \"area prefix\");\n let body = asFloat(this.take(32, \"area coords\"));\n\n let x1 = Math.round(ViomiMapParser.convertFloat(body[0]));\n let y1 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[1]));\n let x2 = Math.round(ViomiMapParser.convertFloat(body[2]));\n let y2 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[3]));\n let x3 = Math.round(ViomiMapParser.convertFloat(body[4]));\n let y3 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[5]));\n let x4 = Math.round(ViomiMapParser.convertFloat(body[6]));\n let y4 = Math.round(ViomiMapParser.MAX_MAP_HEIGHT - ViomiMapParser.convertFloat(body[7]));\n\n this.clean_area.push([x1, y1, x2, y2, x3, y3, x4, y4]);\n\n this.take(48, \"unknown48\");\n }\n }\n if (featureFlags & 0b000000001000000) {\n let navigateTarget = this.take(20, \"navigate\");\n this.navigateTarget = {position: this.readFloatPosition(navigateTarget, 8)};\n }\n if (featureFlags & 0b000000010000000) {\n let realtimePose = this.take(21, \"realtime\");\n this.realtimePose = {position: this.readFloatPosition(realtimePose, 9)};\n }\n\n if (featureFlags & 0b000100000000000) {\n //v6 example: 5b590f5f00000001\n //v7 example: e35a185e00000001\n this.take(8, \"unknown8\");\n this.parseRooms();\n // more stuff i don't understand\n this.take(50, \"unknown50\");\n this.take(5, \"unknown5\");\n this.points = [];\n try {\n this.parsePose();\n } catch (e) {\n Logger.warn(\"Unable to parse Pose\", e); //TODO\n }\n }\n this.take(this.buf.length - this.offset, \"trailing\");\n\n // TODO: one of them is just the room outline, not actual past navigation logic\n return this.convertToValetudoMap({\n image: this.img,\n zones: this.rooms,\n //TODO: at least according to all my sample files, this.points is never the path\n //Why is this here?\n //path: {points: this.points.length ? this.points : this.history},\n path: {points: this.history},\n goto_target: this.navigateTarget && this.navigateTarget.position,\n robot: this.realtimePose && this.realtimePose.position,\n charger: this.chargeStation && this.chargeStation.position,\n virtual_wall: this.virtual_wall,\n no_go_area: this.no_go_area,\n clean_area: this.clean_area\n });\n }", "function Location(jsonObject){\n console.log(jsonObject);\n\n this.formatted_query = jsonObject[0].display_name;\n this.latitude = jsonObject[0].lat;\n this.longitude = jsonObject[0].lon;\n\n}", "function getMapData(data) {\n\n\tfor (var i = 0; i < data.length; i++) {\n loc[i] = data[i].loc;\n locX[i] = data[i].locx;\n locY[i] = data[i].locy;\n }\n\n//console.log(data[1]);\n}", "function zipToGeoJson(binZip,options) {\n\tvar manifestZip = xdmp.zipManifest(binZip);\n\tvar items = [];\n\tfor (prop in manifestZip) {\n\t items.push(manifestZip[prop])\n\t}\n\tvar projection = items.filter(function(item) {\n\t return item.path.match(/\\.prj/gi);\n\t}).map(function(item,index) {\n\t return xdmp.zipGet(binZip,item.path,{\"format\":\"text\"});\n\t})[0];\n\tvar objOut = {};\n\titems\n\t .filter(function(item) {\n\t return item.path.match(/\\.shp$/) || item.path.match(/\\.dbf/);\n\t })\n\t .map(function(item) {\n\t var builder = new NodeBuilder();\n\t var tbuilder = new NodeBuilder();\n\n\t //Build a binaryNode \n\t var entry = xdmp.zipGet(binZip,item.path,{\"format\":\"binary\"});\n\t for(e of entry) {\n\t builder.addNode(e);\n\t }\n\t var bin = builder.toNode();\n\t var path = item.path;\n\t var buffer = BinToBuffer(bin);\n\t //Iterate matched items and process file types\n\t switch(true) {\n\t case /\\.dbf$/gi.test(path) :\n\t type = \"dbf\"; \n\t //We need to extract dbf text before we parse dbf\n\t var text = Utf8ArrayToStr(buffer); \n\t objOut.dbf = DBFParser.parse(buffer.buffer,path,text,\"utf-8\");\n\t break;\n\t case /\\.shp$/gi.test(path) : \n\t objOut.shp = SHPParser.parse(buffer.buffer);\n\t break;\n\t default: throw(\"WHY:\" + path)\n\t }\n\t });\n\treturn toGeoJson(objOut);\n}", "convertFromGoogle(llobjs) {\n llobjs.forEach( function(llo) {\n if (typeof(llo.lat) != \"undefined\" && typeof(llo.lng) != \"undefined\") {\n llo.latitude = llo.lat();\n llo.longitude = llo.lng();\n }\n });\n }", "function convertToGeoJson(data) {\n var lat = data.coord.lat;\n var lon = data.coord.lon;\n var pm10Value = getPM10Value(pm10Measures,lat,lon);\n\n var pm10Index = getPM10Index(pm10Value);\n var windIndex = getWindIndex(data.wind.speed * 3.6);\n var grasslandIndex = getGrasslandIndex(lat, lon);\n var weatherIndex = getWeatherIndex(data.weather[0].id);\n\n //new season index\n var seasonIndex = getSeasonIndex();\n\n var score = pm10Index + windIndex + grasslandIndex + weatherIndex + seasonIndex;\n var riskRating = getRiskRating(score).rating;\n var feature = {\n type: \"Feature\",\n properties: {\n city: data.name,\n temp: data.main.temp,\n weather: data.weather[0].main,\n windSpeed: data.wind.speed * 3.6,\n pm10: pm10Value,\n riskScore: score,\n riskRating: riskRating,\n icon: mapMarkers[riskRating],\n coordinates: [lon, lat]\n },\n geometry: {\n type: \"Point\",\n coordinates: [lon, lat]\n }\n };\n // Set the custom marker icon\n map.data.setStyle(function(feature) {\n return {\n icon: {\n url: feature.getProperty('icon'),\n anchor: new google.maps.Point(25, 25),\n scaledSize: new google.maps.Size(30,30)\n }\n };\n });\n // returns object\n return feature;\n}", "function eqfeed_callback(data) {\n map.data.addGeoJson(data);\n }", "function parseGeometry(FBXTree, relationships, geoNode, deformers) {\n switch (geoNode.attrType) {\n case 'Mesh':\n return parseMeshGeometry(FBXTree, relationships, geoNode, deformers);\n //break;\n case 'NurbsCurve':\n return parseNurbsGeometry(geoNode);\n }\n}", "function createFeatures(UFOPlots) {\nconsole.log(\"-----------\");\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.index);\ncurindx =UFOPlots.features[20][\"geometry\"].properties.index \nurlcall =\"/api_getUFOText_v1.1 <\" + curindx + \">\"\nconsole.log(getText(urlcall))\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.Date_Time);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Shape);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Duration); \nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[0]);\nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[1]);\n\nlet plot = [];\nlet plot2 =[];\nvar test=[]; \n// let features = UFOPlots.features;\n// features.forEach(f => {\n// coords = f.geometry.coordinates;\n// plot.push([coords[1]['latitude'], coords[0]['longitude']])\n// });\n\n let features = UFOPlots[\"features\"];\n console.log(\"Point 20:\",features[20]['geometry'].coordinates[0] ,features[20]['geometry'].coordinates[1] );\nfor (let i = 0; i < UFOPlots[\"features\"].length; i++){\n let test = [features[i]['geometry'].coordinates[0] , features[i]['geometry'].coordinates[1]] \n let lng =features[i]['geometry'].coordinates[0]//['longitude']\n let lat =features[i]['geometry'].coordinates[1]//['latitude']\n plot.push([lng,lat])\n plot2.push([lat,lng])\n //plot.push(test);\n} \nconsole.log(\"here\");\n// console.log(plot);\n\nvar MiB2 = L.geoJson(plot,{\n pointToLayer: function (features, plot) {\n return L.circleMarker(plot, geojsonMarkerOptions_MiB)\n .bindPopup(\"<h3>\" + \"Base: \" + features.properties[2] +\n \"</h3><hr><p>\" + \"Military Branch: \" + features.properties[2] + \"<br>\" +\n \"State: \" + features.properties[2] + \"</p>\");\n }\n});\n // createMap(MiB,true);\n //if you used the heat map with the for loop above, this will work \nvar MiB2 = L.heatLayer(plot, {\n radius: 10,\n blur: 1\n}); \nconsole.log(\"here after\");\n// Sending our UFO layer to the createMap function\ncreateMap(MiB2,true);\n}", "addFeature(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n \"layer\": \"default\",\n \"values\": {}\n }, json);\n let map = self.maps[options.map].object;\n let layer = self.maps[options.map].layers[options.layer];\n let view = map.getView();\n let source = layer.getSource();\n console.log(layer);\n let projection = \"EPSG:\" + options.geometry.match(/SRID=(.*?);/)[1];\n let wkt = options.geometry.replace(/SRID=(.*?);/, '');\n let format = new ol_format_WKT__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n let feature = format.readFeature(wkt);\n options.values.geometry = feature.getGeometry().transform(projection, view.getProjection().getCode());\n source.addFeature(new ol__WEBPACK_IMPORTED_MODULE_1__[\"Feature\"](options.values));\n self.finished(pid, self.queue.DEFINE.FIN_OK);\n }", "function d(r$1){return r$1.features.map((o=>{const t=k.fromJSON(r$1.spatialReference),s=n.fromJSON(o);return r(s.geometry)&&(s.geometry.spatialReference=t),s}))}", "function GeoJSONWrapper(features) {\n\t this.features = features;\n\t this.length = features.length;\n\t this.extent = EXTENT;\n\t}", "function GeoJSONWrapper(features) {\n\t this.features = features;\n\t this.length = features.length;\n\t this.extent = EXTENT;\n\t}", "function jsonResponse(feed) {\r\n\r\n if (feed && feed.value && feed.value.items && feed.value.items.length > 0) {\r\n\r\n // here we shall generate geo (or adr) uFormat\r\n\r\n var locationName = document.getElementById('insertGeoLocation').value;\r\n\r\n var geoUFormat = '';\r\n\r\n var lat = feed.value.items[0].lat;\r\n\r\n var lon = feed.value.items[0].lon;\r\n\r\n if (lat != null && lon != null) {\r\n\r\n insertAtCursor(\r\n\r\n document.getElementById('textarea'), \r\n\r\n createGeoMicroformat(locationName, lat, lon));\r\n\r\n }\r\n\r\n }\r\n\r\n $(WAIT_ELEM_ID).style.display = 'none';\r\n\r\n document.getElementsByTagName('body')[0].style.cursor = body_cursor_bak;\r\n\r\n insertGeoFormCancel();\r\n\r\n}", "function parseJson(json) {\n\t\t let obj = JSON.parse(json)\n\t\t return obj\n\t}", "function geojsonToVectorLayer(geojson, projection) {\n // textStyle is a function because each point has a different text associated\n function textStyle(text) {\n return new ol.style.Text({\n 'font': '12px Calibri,sans-serif',\n 'text': text,\n 'fill': new ol.style.Fill({\n 'color': '#000'\n }),\n 'stroke': new ol.style.Stroke({\n 'color': '#fff',\n 'width': 3\n })\n });\n }\n\n function textStylePoint(text, rotation) {\n return new ol.style.Text({\n 'font': '12px Calibri,sans-serif',\n 'text': ' ' + text, // we pad with spaces due to rotational offset\n 'textAlign': 'center',\n 'fill': new ol.style.Fill({\n 'color': '#000'\n }),\n 'stroke': new ol.style.Stroke({\n 'color': '#fff',\n 'width': 3\n })\n });\n }\n\n function getStrokeStyle(feature) {\n var color = '#663300';\n var width = 2;\n var lineDash = [1, 0];\n\n if (feature.get('trace')) {\n var trace = feature.get('trace');\n\n // Set line color and weight\n if (trace.trace_type && trace.trace_type === 'geologic_struc') {\n color = '#FF0000';\n if (trace.geologic_structure_type\n && (trace.geologic_structure_type === 'fault' || trace.geologic_structure_type === 'shear_zone')) {\n width = 4;\n }\n }\n else if (trace.trace_type && trace.trace_type === 'contact') {\n color = '#000000';\n if (trace.contact_type && trace.contact_type === 'intrusive'\n && trace.intrusive_contact_type && trace.intrusive_contact_type === 'dike') {\n width = 4;\n }\n }\n else if (trace.trace_type && trace.trace_type === 'geomorphic_fea') {\n width = 4;\n color = '#0000FF';\n }\n else if (trace.trace_type && trace.trace_type === 'anthropenic_fe') {\n width = 4;\n color = '#800080';\n }\n\n // Set line pattern\n lineDash = [.01, 10];\n if (trace.trace_quality && trace.trace_quality === 'known') lineDash = [1, 0];\n else if (trace.trace_quality && trace.trace_quality === 'approximate'\n || trace.trace_quality === 'questionable') lineDash = [20, 15];\n else if (trace.trace_quality && trace.trace_quality === 'other') lineDash = [20, 15, 0, 15];\n }\n\n return new ol.style.Stroke({\n 'color': color,\n 'width': width,\n 'lineDash': lineDash\n });\n }\n\n function getIconForFeature(feature) {\n var feature_type = 'none';\n var rotation = 0;\n var symbol_orientation = 0;\n var facing = undefined;\n var orientation_type = 'none';\n var orientation = feature.get('orientation');\n if (orientation) {\n rotation = orientation.strike || (orientation.dip_direction - 90) % 360 || orientation.trend || rotation;\n symbol_orientation = orientation.dip || orientation.plunge || symbol_orientation;\n feature_type = orientation.feature_type || feature_type;\n orientation_type = orientation.type || orientation_type;\n facing = orientation.facing;\n }\n\n return new ol.style.Icon({\n 'anchorXUnits': 'fraction',\n 'anchorYUnits': 'fraction',\n 'opacity': 1,\n 'rotation': HelpersFactory.toRadians(rotation),\n 'src': SymbologyFactory.getSymbolPath(feature_type, symbol_orientation, orientation_type, facing),\n 'scale': 0.05\n });\n }\n\n function getPolyFill(feature) {\n var color = 'rgba(0, 0, 255, 0.4)'; // blue\n var colorApplied = false;\n var tags = ProjectFactory.getTagsBySpotId(feature.get('id'));\n if (tags.length > 0) {\n _.each(tags, function (tag) {\n if (tag.type === 'geologic_unit' && tag.color && !_.isEmpty(tag.color) && !colorApplied) {\n var rgbColor = HelpersFactory.hexToRgb(tag.color);\n color = 'rgba(' + rgbColor.r + ', ' + rgbColor.g + ', ' + rgbColor.b + ', 0.4)';\n colorApplied = true;\n }\n });\n }\n if (feature.get('surface_feature') && !colorApplied) {\n var surfaceFeature = feature.get('surface_feature');\n switch (surfaceFeature.surface_feature_type) {\n case 'rock_unit':\n color = 'rgba(0, 255, 255, 0.4)'; // light blue\n break;\n case 'contiguous_outcrop':\n color = 'rgba(240, 128, 128, 0.4)'; // pink\n break;\n case 'geologic_structure':\n color = 'rgba(0, 255, 255, 0.4)'; // light blue\n break;\n case 'geomorphic_feature':\n color = 'rgba(0, 128, 0, 0.4)'; // green\n break;\n case 'anthropogenic_feature':\n color = 'rgba(128, 0, 128, 0.4)'; // purple\n break;\n case 'extent_of_mapping':\n color = 'rgba(128, 0, 128, 0)'; // no fill\n break;\n case 'extent_of_biological_marker': // green\n color = 'rgba(0, 128, 0, 0.4)';\n break;\n case 'subjected_to_similar_process':\n color = 'rgba(255, 165, 0,0.4)'; // orange\n break;\n case 'gradients':\n color = 'rgba(255, 165, 0,0.4)'; // orange\n break;\n }\n }\n return new ol.style.Fill({\n 'color': color\n });\n }\n\n // Set styles for points, lines and polygon and groups\n function styleFunction(feature, resolution) {\n var rotation = 0;\n var pointText = feature.get('name');\n var orientation = feature.get('orientation');\n if (orientation) {\n rotation = orientation.strike || orientation.trend || rotation;\n pointText = orientation.dip || orientation.plunge || pointText;\n }\n\n var pointStyle = [\n new ol.style.Style({\n 'image': getIconForFeature(feature),\n 'text': textStylePoint(pointText.toString(), rotation)\n })\n ];\n var lineStyle = [\n new ol.style.Style({\n 'stroke': getStrokeStyle(feature),\n 'text': textStyle(feature.get('name'))\n })\n ];\n var polyText = feature.get('name');\n var polyStyle = [\n new ol.style.Style({\n 'stroke': new ol.style.Stroke({\n 'color': '#000000',\n 'width': 0.5\n }),\n 'fill': getPolyFill(feature),\n 'text': textStyle(polyText)\n })\n ];\n var styles = [];\n styles.Point = pointStyle;\n styles.MultiPoint = pointStyle;\n styles.LineString = lineStyle;\n styles.MultiLineString = lineStyle;\n styles.Polygon = polyStyle;\n styles.MultiPolygon = polyStyle;\n\n return styles[feature.getGeometry().getType()];\n }\n\n var features;\n if (projection.getUnits() === 'pixels') {\n features = (new ol.format.GeoJSON()).readFeatures(geojson);\n }\n else {\n features = (new ol.format.GeoJSON()).readFeatures(geojson, {\n 'featureProjection': projection\n });\n }\n\n return new ol.layer.Vector({\n 'source': new ol.source.Vector({\n 'features': features\n }),\n 'title': geojson.properties.name,\n 'style': styleFunction,\n 'visible': typeVisibility[geojson.properties.name.split(' (')[0]]\n });\n }", "function callback(response) \n {\n \n // get boundaries\n console.log( response.results[0] );\n console.log( \"got \" + response.results[0].attributes.CTYUA13NM);\n //console.log( response.results[0].attributes.CTYUA13NM );\n /// console.log( response.results[0].attributes.CTYUA13NM+\": \" + parseInt( response.results[0].attributes[\"Shape.STArea()\"],10)/1000000 );\n //capture area\n areaMeasures[response.results[0].attributes.CTYUA13NM] = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n areaObj[response.results[0].attributes.CTYUA13NM].area = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n\n if (response.results.length > 0) \n {\n // document.getElementById(\"foundward\").value = response.results[0].attributes.WD11NM;\n\n var ens = new Array();\n //alert(response.results[0].geometry.rings.length);\n for (var k = 0; k < response.results[0].geometry.rings.length; k++) {\n ens[k] = response.results[0].geometry.rings[k];\n }\n\n // approximate datum correction, good enough for this demo\n \n var latmeters = 50;\n var lonmeters = -100;\n\n var minlat = 360.0;\n var maxlat = -360.0;\n var minlon = 360.0;\n var maxlon = -360.0;\n\n // create array of points converted to lat/lon (from easting/northing) and capture mins and maxes\n for (var j = 0; j < ens.length; j++) {\n //alert('j = ' + j);\n latlons[j] = new Array();\n for (var i = 0; i < ens[j].length; i++) {\n var testpoint = ens[j][i];\n var grid = new OsGridRef(testpoint[0] + lonmeters, testpoint[1] + latmeters);\n var latlon = OsGridRef.osGridToLatLong(grid);\n if (latlon.lon < minlon) {\n minlon = latlon.lon;\n }\n if (latlon.lon > maxlon) {\n maxlon = latlon.lon;\n }\n if (latlon.lat < minlat) {\n minlat = latlon.lat;\n }\n if (latlon.lat > maxlat) {\n maxlat = latlon.lat;\n }\n latlons[j][i] = latlon;\n }\n }\n\n // calculate zoom level\n var zoomLevel = getZoom(minlon, maxlon, minlat, maxlat, 512, 512);\n\n // calculate centroid\n var centroid = getCentroid(minlon, maxlon, minlat, maxlat);\n //initialize(centroid.lat, centroid.lon, zoomLevel, latlons);\n drawArea(latlons, response.results[0].value);\n } else {\n alert(\"No matching ward found\");\n }\n }", "function m(e, r) {\n var n = e.geometry,\n o = e.toJSON(),\n s = o;\n\n if (Object(_core_maybe_js__WEBPACK_IMPORTED_MODULE_0__[\"isSome\"])(n) && (s.geometry = JSON.stringify(n), s.geometryType = Object(_geometry_support_jsonUtils_js__WEBPACK_IMPORTED_MODULE_3__[\"getJsonType\"])(n), s.inSR = n.spatialReference.wkid || JSON.stringify(n.spatialReference)), o.groupByFieldsForStatistics && (s.groupByFieldsForStatistics = o.groupByFieldsForStatistics.join(\",\")), o.objectIds && (s.objectIds = o.objectIds.join(\",\")), o.orderByFields && (s.orderByFields = o.orderByFields.join(\",\")), !o.outFields || !o.returnDistinctValues && (null != r && r.returnCountOnly || null != r && r.returnExtentOnly || null != r && r.returnIdsOnly) ? delete s.outFields : -1 !== o.outFields.indexOf(\"*\") ? s.outFields = \"*\" : s.outFields = o.outFields.join(\",\"), o.outSR ? s.outSR = o.outSR.wkid || JSON.stringify(o.outSR) : n && (o.returnGeometry || o.returnCentroid) && (s.outSR = s.inSR), o.returnGeometry && delete o.returnGeometry, o.outStatistics && (s.outStatistics = JSON.stringify(o.outStatistics)), o.pixelSize && (s.pixelSize = JSON.stringify(o.pixelSize)), o.quantizationParameters && (s.quantizationParameters = JSON.stringify(o.quantizationParameters)), o.parameterValues && (s.parameterValues = JSON.stringify(o.parameterValues)), o.rangeValues && (s.rangeValues = JSON.stringify(o.rangeValues)), o.dynamicDataSource && (s.layer = JSON.stringify({\n source: o.dynamicDataSource\n }), delete o.dynamicDataSource), o.timeExtent) {\n var _t131 = o.timeExtent,\n _e134 = _t131.start,\n _r60 = _t131.end;\n null == _e134 && null == _r60 || (s.time = _e134 === _r60 ? _e134 : \"\".concat(null == _e134 ? \"null\" : _e134, \",\").concat(null == _r60 ? \"null\" : _r60)), delete o.timeExtent;\n }\n\n return s;\n }", "function getCoordData(coordinates) {\n let url = MAPS_API_URL + \"geocode/json?address=\" + coordinates;\n return new Promise(function(resolve, reject) {\n return request.get(url, function(err, response, body) {\n let json = (isJson(body) ? JSON.parse(body) : body);\n if(!json || json == undefined || !json.results || !json.results[0]) return resolve('unparsable data: ' + body);\n let row = json.results[0];\n if(!row) return resolve(false);\n let output = {\n city: row.formatted_address, \n latitude: row.geometry.location.lat,\n longitude: row.geometry.location.lng,\n };\n resolve(output);\n });\n });\n}", "function _zoneGotoAddr(addr, ct) \n{\n\n /* get the latitude/longitude for the zip */\n //var url = \"http://ws.geonames.org/postalCodeSearch?postalcode=\"+zip+\"&country=\"+ct+\"&style=long&maxRows=5\";\n var url = \"./Track?page=\" + PAGE_ZONEGEOCODE + \"&addr=\" + addr + \"&country=\" + ct + \"&_uniq=\" + Math.random();\n //alert(\"URL \" + url);\n try {\n var req = jsmGetXMLHttpRequest();\n if (req) {\n req.open(\"GET\", url, true);\n //req.setRequestHeader(\"CACHE-CONTROL\", \"NO-CACHE\");\n //req.setRequestHeader(\"PRAGMA\", \"NO-CACHE\");\n //req.setRequestHeader(\"If-Modified-Since\", \"Sat, 1 Jan 2000 00:00:00 GMT\");\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n var lat = 0.0;\n var lon = 0.0;\n for (;;) {\n\n /* get xml */\n var xmlStr = req.responseText;\n if (!xmlStr || (xmlStr == \"\")) {\n break;\n }\n \n /* get XML doc */\n var xmlDoc = createXMLDocument(xmlStr);\n if (xmlDoc == null) {\n break;\n }\n\n /* try parsing as \"geocode\" encaspulated XML */\n var geocode = xmlDoc.getElementsByTagName(TAG_geocode);\n if ((geocode != null) && (geocode.length > 0)) {\n //alert(\"geocode: \" + xmlStr);\n var geocodeElem = geocode[0];\n if (geocodeElem != null) {\n var latn = geocodeElem.getElementsByTagName(TAG_lat);\n var lonn = geocodeElem.getElementsByTagName(TAG_lng);\n if (!lonn || (lonn.length == 0)) { lonn = geocodeElem.getElementsByTagName(TAG_lon); }\n if ((latn.length > 0) && (lonn.length > 0)) {\n lat = numParseFloat(latn[0].childNodes[0].nodeValue,0.0);\n lon = numParseFloat(lonn[0].childNodes[0].nodeValue,0.0);\n break;\n }\n }\n break;\n }\n\n /* try parsing as forwarded XML from Geonames */\n var geonames = xmlDoc.getElementsByTagName(TAG_geonames);\n if ((geonames != null) && (geonames.length > 0)) {\n //alert(\"geonames: \" + xmlStr);\n // returned XML was forwarded as-is from Geonames\n var geonamesElem = geonames[0];\n var codeList = null;\n if (geonamesElem != null) {\n codeList = geonamesElem.getElementsByTagName(TAG_code);\n if (!codeList || (codeList.length == 0)) {\n codeList = geonamesElem.getElementsByTagName(TAG_geoname);\n }\n }\n if (codeList != null) {\n for (var i = 0; i < codeList.length; i++) {\n var code = codeList[i];\n var latn = code.getElementsByTagName(TAG_lat);\n var lonn = code.getElementsByTagName(TAG_lng);\n if ((latn.length > 0) && (lonn.length > 0)) {\n lat = numParseFloat(latn[0].childNodes[0].nodeValue,0.0);\n lon = numParseFloat(lonn[0].childNodes[0].nodeValue,0.0);\n break;\n }\n }\n }\n break;\n }\n\n /* break */\n //alert(\"unknown: \" + xmlStr);\n break;\n\n }\n\n /* set lat/lon */\n if ((lat == 0.0) && (lon == 0.0)) {\n // skip\n } else {\n var radiusM = MAX_ZONE_RADIUS_M / 10;\n jsvZoneIndex = 0;\n //_jsmSetPointZoneValue(0, lat, lon, radiusM);\n //for (var z = 1; z < jsvZoneCount; z++) {\n // _jsmSetPointZoneValue(z, 0.0, 0.0, radiusM);\n //}\n\n // first non-zero point\n var firstPT = null;\n for (var x = 0; x < jsvZoneList.length; x++) {\n var pt = jsvZoneList[x]; // JSMapPoint\n if ((pt.lat != 0.0) || (pt.lon != 0.0)) {\n firstPT = pt;\n break;\n }\n }\n\n if (firstPT == null) {\n // no valid points - create default geofence\n if (jsvZoneType == ZONE_POINT_RADIUS) {\n // single point at location\n var radiusM = zoneMapGetRadius(true);\n _jsmSetPointZoneValue(0, lat, lon, radiusM);\n } else\n if (jsvZoneType == ZONE_SWEPT_POINT_RADIUS) {\n // single point at location\n var radiusM = zoneMapGetRadius(true);\n _jsmSetPointZoneValue(0, lat, lon, radiusM);\n } else {\n var radiusM = 450;\n var crLat = geoRadians(lat); // radians\n var crLon = geoRadians(lon); // radians\n for (x = 0; x < jsvZoneList.length; x++) {\n var deg = x * (360.0 / jsvZoneList.length);\n var radM = radiusM / EARTH_RADIUS_METERS;\n if ((deg == 0.0) || ((deg > 170.0) && (deg < 190.0))) { radM *= 0.8; }\n var xrad = geoRadians(deg); // radians\n var rrLat = Math.asin(Math.sin(crLat) * Math.cos(radM) + Math.cos(crLat) * Math.sin(radM) * Math.cos(xrad));\n var rrLon = crLon + Math.atan2(Math.sin(xrad) * Math.sin(radM) * Math.cos(crLat), Math.cos(radM)-Math.sin(crLat) * Math.sin(rrLat));\n _jsmSetPointZoneValue(x, geoDegrees(rrLat), geoDegrees(rrLon), radiusM);\n }\n }\n } else {\n // move all points relative to first point\n var radiusM = zoneMapGetRadius(true);\n var deltaLat = lat - firstPT.lat;\n var deltaLon = lon - firstPT.lon;\n for (var x = 0; x < jsvZoneList.length; x++) {\n var pt = jsvZoneList[x];\n if ((pt.lat != 0.0) || (pt.lon != 0.0)) {\n _jsmSetPointZoneValue(x, (pt.lat + deltaLat), (pt.lon + deltaLon), radiusM);\n }\n }\n }\n\n // reset\n _zoneReset();\n\n }\n\n } else\n if (req.readyState == 1) {\n // alert('Loading GeoNames from URL: [' + req.readyState + ']\\n' + url);\n } else {\n // alert('Problem loading URL? [' + req.readyState + ']\\n' + url);\n }\n }\n req.send(null);\n } else {\n alert(\"Error [_zoneCenterOnZip]:\\n\" + url);\n }\n } catch (e) {\n alert(\"Error [_zoneCenterOnZip]:\\n\" + e);\n }\n\n}", "async importPointCloud(uri, options) {\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createDefaultGltfOptions();\n if (options && options.files) {\n for (let fileName in options.files) {\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getExtension(fileName);\n if (fileExtension === 'drc') {\n return await this.__decodeDraco(options.files[fileName], defaultOptions, basePath, options).catch((err) => {\n console.log('this.__decodeDraco error', err);\n });\n }\n }\n }\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fetchArrayBuffer(uri);\n return await this.__decodeDraco(arrayBuffer, defaultOptions, basePath, options).catch((err) => {\n console.log('this.__decodeDraco error', err);\n });\n }", "function csvToGeoJSON(){ //csv = reader.result\r\n\t\t\tvar lines=csv.split(/[\\r\\n]+/); // split for windows and mac csv (newline or carriage return)\r\n\t\t\tdelete window.csv; // reader.result from drag&drop not needed anymore\r\n\t\t\tvar headers=lines[0].split(\",\"); //not needed?\r\n\t\t\tvar matchID = document.getElementById(\"coordIDSelect\").value;\r\n\t\t\tvar xColumn = document.getElementById(\"xSelect\").value;\r\n\t\t\tvar yColumn = document.getElementById(\"ySelect\").value;\r\n\r\n\t\t\t// get the positions of the seleted columns in the header\r\n\t\t\tvar positionMatchID = headers.indexOf(matchID);\r\n\t\t\tvar positionX = headers.indexOf(xColumn);\r\n\t\t\tvar positionY = headers.indexOf(yColumn);\r\n\r\n\t\t\tvar obj_array = []\r\n\t\t\tfor(var i=1;i<lines.length-1;i++){\r\n\t\t\t\tvar json_obj = {\"type\": \"Feature\"};\r\n\t\t\t\tvar currentline=lines[i].split(\",\");\r\n\t\t\t\t//for(var j=0;j<headers.length;j++){\r\n\t\t\t\t\tjson_obj[\"geometry\"] = {\r\n\t\t\t\t\t\t\t\"type\" : \"Point\",\r\n\t\t\t\t\t\t\t\"coordinates\" : [parseFloat(currentline[positionX]), parseFloat(currentline[positionY])]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tjson_obj[\"properties\"] = {};\r\n\t\t\t\t\tjson_obj[\"properties\"][matchID] = currentline[positionMatchID]; // get the name of zaehlstellen variable\r\n\t\t\t\t\tobj_array.push(json_obj);\r\n\t\t\t};\r\n\r\n\t\tvar complete_geojson = {\"type\":\"FeatureCollection\",\r\n\t\t\t\t\t\t\t\t\"features\": obj_array // all objects of the csv\r\n\t\t\t\t\t\t\t\t}\r\n\t//\talert(complete_geojson);\r\n\t\treturn complete_geojson; //return geoJSON\r\n\t}", "function getGeometry(post) {\n var street = post.data.street.replace(/ /g, \"+\");\n var country = \"Australia\";\n var state = \"NSW\";\n var api_key = \"AIzaSyCzS2PFKgSqc_Uz6R4--UM72xaRjKAcPZU\";\n var url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\" + street + \"+\" + post.data.suburb + \"+\" + state + \"+\" + country + \"=\" + api_key;\n //post\n $.ajax({\n type: \"get\",\n url: url,\n dataType: \"json\",\n success: function (data) {\n var geometry = data.results[0].geometry.location;\n post.data.longitude = geometry.lng;\n post.data.latitude = geometry.lat;\n $.ajax(post);\n },\n error: function (data) {\n }\n });\n}", "function geoJSONCompare(testGeo, expectedGeo){\n strictEqual(testGeo.type, expectedGeo.type, \"Types match\");\n QUnit.push(coordsCompare(testGeo.coordinates, expectedGeo.coordinates), testGeo.coordinates, expectedGeo.coordinates, \"Comparing coordinates\");\n}", "async function fetchGeoCoordinatesData(destination) {\n const api_url = `http://api.geonames.org/searchJSON?q=${destination}&maxRows=1&username=${GEONAMES_API_KEY}`;\n const fetchResponse = await fetch(api_url);\n const json = await fetchResponse.json();\n let coordinatesData = {\n lat: json.geonames[0].lat,\n lng: json.geonames[0].lng,\n countryCode: json.geonames[0].countryCode,\n };\n\n return coordinatesData;\n}", "function projectGeoJsonPolygon(geometry){\n if (!geometry || geometry.type != 'Polygon' || !geometry.coordinates || !geometry.coordinates[0]) {\n return null;\n } else {\n return _.map(geometry.coordinates[0], function(p){\n return merc.forward(p)\n });\n }\n}", "function validateGeoJSON(myGeoJSON){\n if (myGeoJSON.length==0)\n {\n JL(\"mylogger\").fatal(\"Empty GeoJSON!\");\n return false;\n }\n try {\n var myObj=JSON.parse(myGeoJSON);\n if(propertiesCheck(myObj.features[0].properties)&&geometryCheck(myObj.features[0].geometry)){\n JL(\"mylogger\").info(\"Valid!\");\n return true;\n }\n else{\n return false;\n }\n } catch (e) {\n JL(\"mylogger\").fatal(\"Invalid GeoJSON!\");\n return false;\n }\n}" ]
[ "0.6401467", "0.6251229", "0.6087593", "0.5867118", "0.5793363", "0.5769249", "0.57245433", "0.5660727", "0.5587197", "0.5554582", "0.5480767", "0.5463705", "0.54294145", "0.53844434", "0.53714746", "0.5360499", "0.5350253", "0.5340355", "0.5337533", "0.5335312", "0.53113735", "0.5301105", "0.52703923", "0.5258741", "0.52336437", "0.5171153", "0.51682967", "0.5168261", "0.5158631", "0.5150322", "0.5144581", "0.5137567", "0.51308763", "0.51162595", "0.5115221", "0.51007473", "0.5087186", "0.50814915", "0.5077755", "0.5077755", "0.50653505", "0.5054925", "0.5051776", "0.50489885", "0.50465333", "0.50413746", "0.5040791", "0.50139683", "0.50139683", "0.5002297", "0.49928322", "0.498267", "0.49780366", "0.49774686", "0.49774686", "0.49774686", "0.49751887", "0.4954799", "0.4946008", "0.49393463", "0.4936088", "0.4929754", "0.49291238", "0.49282232", "0.4926342", "0.49026775", "0.48983714", "0.48933527", "0.4888798", "0.48849064", "0.4883862", "0.48818874", "0.48810062", "0.48789755", "0.4877809", "0.48766628", "0.48679838", "0.48621133", "0.48621133", "0.48478267", "0.48478073", "0.48473942", "0.48366302", "0.48121747", "0.48076433", "0.48073772", "0.48069316", "0.48039603", "0.4797115", "0.47958526", "0.47876963", "0.4785958", "0.4779476" ]
0.6084094
9
src\components\TabContent.svelte generated by Svelte v3.6.7
function get_each_context$c(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.tab = list[i]; child_ctx.idx = i; return child_ctx; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tabs_svelte_create_fragment(ctx) {\n\tlet div;\n\tlet current;\n\tconst default_slot_template = /*#slots*/ ctx[1].default;\n\tconst default_slot = (0,internal/* create_slot */.nu)(default_slot_template, ctx, /*$$scope*/ ctx[0], null);\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = (0,internal/* element */.bG)(\"div\");\n\t\t\tif (default_slot) default_slot.c();\n\t\t\t(0,internal/* attr */.Lj)(div, \"class\", \"tabs\");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\t(0,internal/* insert */.$T)(target, div, anchor);\n\n\t\t\tif (default_slot) {\n\t\t\t\tdefault_slot.m(div, null);\n\t\t\t}\n\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tif (default_slot) {\n\t\t\t\tif (default_slot.p && (!current || dirty & /*$$scope*/ 1)) {\n\t\t\t\t\t(0,internal/* update_slot */.Tj)(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[0], !current ? -1 : dirty, null, null);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\t(0,internal/* transition_in */.Ui)(default_slot, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\t(0,internal/* transition_out */.et)(default_slot, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) (0,internal/* detach */.og)(div);\n\t\t\tif (default_slot) default_slot.d(detaching);\n\t\t}\n\t};\n}", "constructor(tabContent, info, tab) {\n this.tabContent = document.querySelectorAll(tabContent);\n this.info = document.querySelector(info);\n this.tab = document.querySelectorAll(tab);\n this.hideTabContent(1);\n }", "function ContentTabs (props) {\n return (\n <Tabs defaultActiveKey={1} animation={false} id=\"noanim-tab-example\">\n <Tab eventKey={1} title=\"Register\">\n <div className=\"tabContent\">\n <Form\n page={props.page}\n name={props.name}\n email={props.email}\n regCode={props.regCode}\n status={props.status}\n comments={props.comments}\n guests={props.guests}\n onInputChange={props.onInputChange}\n addRegistrant={props.addRegistrant}\n updateState={props.updateState}\n addGuest={props.addGuest}\n handleGuests={props.handleGuests}\n removeGuest={props.removeGuest}\n />\n </div>\n </Tab>\n <Tab eventKey={2} title=\"Details\">\n <Detail \n temperatures={props.temperatures}\n accordion={props.accordion}\n changeBool={props.changeBool}\n google_api={props.google_api}\n months={props.months}\n days={props.days}\n hours={props.hours}\n mins={props.mins}\n secs={props.secs}\n counter={props.counter}\n />\n </Tab>\n <Tab eventKey={3} title=\"Travel\">\n <Travel \n google_api={props.google_api}\n changeBool={props.changeBool}\n updateState={props.updateState}\n accordionAir={props.accordionAir}\n accordionBus={props.accordionBus}\n accordionCar={props.accordionCar}\n accordionStay={props.accordionStay}\n counter={props.counter}\n />\n </Tab>\n <Tab eventKey={4} title=\"Plans\">\n <Plans \n accordionCity={props.accordionCity}\n accordionFall={props.accordionFall}\n accordionHalloween={props.accordionHalloween}\n changeBool={props.changeBool}\n />\n </Tab>\n </Tabs>\n );\n}", "function TabsPage() {\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_3__home_home__[\"a\" /* HomePage */];\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_1__courses_courses__[\"a\" /* CoursesPage */];\n this.tab3Root = __WEBPACK_IMPORTED_MODULE_2__enroll_now_enroll_now__[\"a\" /* EnrollNowPage */];\n this.tab4Root = __WEBPACK_IMPORTED_MODULE_4__personal_details_personal_details__[\"a\" /* PersonalDetailsPage */];\n this.tab5Root = __WEBPACK_IMPORTED_MODULE_5__program_calender_program_calender__[\"a\" /* ProgramCalenderPage */];\n this.tab6Root = __WEBPACK_IMPORTED_MODULE_6__my_program_my_program__[\"a\" /* MyProgramPage */];\n this.tab7Root = __WEBPACK_IMPORTED_MODULE_7__admin_admin__[\"a\" /* AdminPage */];\n }", "tabGrab(tab){\n switch(tab){\n case \"synopsis\":\n return <Synopsis\n synopsis={this.state.MALdata.synopsis}\n trailer={this.state.ALdata ? this.state.ALdata.trailer : null}\n />\n break;\n case \"cast\":\n return <Cast\n characters={this.state.MALcast.characters}\n staff={this.state.MALcast.staff}\n themes={this.state.MALcast.themes}\n />\n break;\n case \"episodes\":\n return <Episodes\n episodes={this.state.MALepisodes}\n />\n break;\n case \"related\":\n return <Related\n related={this.state.MALrelated}\n changeModal={(data) => this.props.newModal(data)}\n />\n break;\n default:\n return <div>?</div>\n break;\n }\n }", "renderTabs() {\n return (\n <Tabs defaultActiveKey={1} id=\"tab\" >\n <Tab eventKey={1} title=\"Projects\">\n {this.renderProjs()}\n </Tab>\n <Tab eventKey={2} title=\"Users\">\n {this.renderUsers()}\n </Tab>\n <Tab eventKey={3} title=\"Search\">\n {this.renderSearch()}\n <ListGroup><br /><br />\n {this.renderResult()}\n </ListGroup>\n </Tab>\n </Tabs>\n );\n }", "getTabViewContents(){\n const { context, schemas, windowWidth, windowHeight, href, session } = this.props;\n const { mounted } = this.state;\n\n //context = SET; // Use for testing along with _testing_data\n\n const processedFiles = this.allProcessedFilesFromExperimentSet(context);\n const processedFilesUniqeLen = (processedFiles && processedFiles.length && ProcessedFilesStackedTableSection.allFilesUniqueCount(processedFiles)) || 0;\n const rawFiles = this.allFilesFromExperimentSet(context, false);\n const rawFilesUniqueLen = (rawFiles && rawFiles.length && RawFilesStackedTableSection.allFilesUniqueCount(rawFiles)) || 0;\n const width = this.getTabViewWidth();\n\n const commonProps = { width, context, schemas, windowWidth, href, session, mounted };\n const propsForTableSections = _.extend(SelectedFilesController.pick(this.props), commonProps);\n\n var tabs = [];\n\n // Processed Files Table Tab\n if (processedFilesUniqeLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-microchip fas icon-fw\"/>{ ' ' + processedFilesUniqeLen + \" Processed File\" + (processedFilesUniqeLen > 1 ? 's' : '') }</span>,\n key : 'processed-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={processedFiles}>\n <ProcessedFilesStackedTableSection {...propsForTableSections} files={processedFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Raw files tab, if have experiments with raw files\n if (rawFilesUniqueLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-leaf fas icon-fw\"/>{ ' ' + rawFilesUniqueLen + \" Raw File\" + (rawFilesUniqueLen > 1 ? 's' : '') }</span>,\n key : 'raw-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={rawFiles}>\n <RawFilesStackedTableSection {...propsForTableSections} files={rawFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Supplementary Files Tab\n if (ExperimentSetView.shouldShowSupplementaryFilesTabView(context)){\n //const referenceFiles = SupplementaryFilesTabView.allReferenceFiles(context) || [];\n //const opfCollections = SupplementaryFilesTabView.combinedOtherProcessedFiles(context) || [];\n //const allOpfFiles = _.reduce(opfCollections, function (memo, coll) { return memo.concat(coll.files || []); }, []);\n //const allFiles = referenceFiles.concat(allOpfFiles);\n tabs.push({\n tab : <span><i className=\"icon icon-copy far icon-fw\"/> Supplementary Files</span>,\n key : 'supplementary-files',\n content: (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={[]/*allFiles*/}>\n <SupplementaryFilesTabView {...propsForTableSections} {...this.state} />\n </SelectedFilesController>\n )\n });\n }\n\n // Graph Section Tab\n if (this.shouldGraphExist()){\n tabs.push(FileViewGraphSection.getTabObject(\n _.extend({}, this.props, { 'isNodeCurrentContext' : this.isWorkflowNodeCurrentContext }),\n this.state,\n this.handleToggleAllRuns,\n width\n ));\n }\n\n return _.map(tabs.concat(this.getCommonTabs()), function(tabObj){\n return _.extend(tabObj, {\n 'style' : {\n 'minHeight' : Math.max(mounted && !isServerSide() && (windowHeight - 180), 100) || 800\n }\n });\n });\n }", "function createContent(tabName) {\n let content = document.createElement('div');\n content.id = tabName;\n content.className = 'tab-pane';\n let inputUrl = document.createElement('input')\n inputUrl.id = 'new-tab-url';\n inputUrl.setAttribute('type', 'text');\n inputUrl.setAttribute('placeholder', 'Digite a url');\n let buttonGo = document.createElement('button');\n buttonGo.id = 'open-page';\n buttonGo.setAttribute('type', 'button');\n buttonGo.innerHTML = 'GO';\n buttonGo.addEventListener('click', requestUrl, true);\n inputUrl.addEventListener(\"keyup\", function(event) {\n event.preventDefault();\n if (event.keyCode == 13) {\n buttonGo.click();\n }\n });\n let iframe = document.createElement('iframe');\n iframe.id = 'webview';\n content.appendChild(inputUrl);\n content.appendChild(buttonGo);\n content.appendChild(iframe);\n ui.conteudo.appendChild(content);\n}", "function App() {\n return (\n <div>\n <h1>Tabs Demo</h1>\n <Tabs>\n <div label=\"Home\">Please click on the To do list tab!</div>\n <div label=\"Calendar\"></div>\n <div label=\"Stickers\">\n After 'while, <em>Crocodile</em>!\n </div>\n <div label=\"To Do List\">\n <ul>\n </ul>\n </div>\n </Tabs>\n </div>\n );\n}", "function hideTabContent(a) {// to hide all the content elements\n for (let i = a; i < tabContent.length; i++){\n tabContent[i].classList.remove('show');\n tabContent[i].classList.add('hide');//manipulate classes in the css file to hide the content elements\n }\n }", "function TabsPage() {\r\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_1__home_home__[\"a\" /* HomePage */];\r\n }", "function TabsDoc(props) {\n return (\n <>\n <div className=\"flex flex-1 flex-grow-0 items-center justify-end\">\n <Button\n className=\"normal-case\"\n variant=\"contained\"\n color=\"secondary\"\n component=\"a\"\n href=\"https://mui.com/components/tabs\"\n target=\"_blank\"\n role=\"button\"\n >\n <Icon>link</Icon>\n <span className=\"mx-4\">Reference</span>\n </Button>\n </div>\n <Typography className=\"text-40 my-16 font-700\" component=\"h1\">\n Tabs\n </Typography>\n <Typography className=\"description\">\n Tabs make it easy to explore and switch between different views.\n </Typography>\n\n <Typography className=\"mb-40\" component=\"div\">\n Tabs organize and allow navigation between groups of content that are related and at the\n same level of hierarchy.\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Basic tabs\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n A basic example with tab panels.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/BasicTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/BasicTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Experimental API\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <code>@mui/lab</code> offers utility components that inject props to implement accessible\n tabs following{' '}\n <a href=\"https://www.w3.org/TR/wai-aria-practices/#tabpanel\">\n WAI-ARIA authoring practices\n </a>\n .\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/LabTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/LabTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Wrapped labels\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Long labels will automatically wrap on tabs. If the label is too long for the tab, it will\n overflow, and the text will not be visible.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/TabsWrappedLabel.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/TabsWrappedLabel.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Colored tab\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/ColorTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/ColorTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Disabled tab\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n A tab can be disabled by setting the <code>disabled</code> prop.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/DisabledTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/DisabledTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Fixed tabs\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Fixed tabs should be used with a limited number of tabs, and when a consistent placement\n will aid muscle memory.\n </Typography>\n <Typography className=\"text-20 mt-20 mb-10 font-700\" component=\"h3\">\n Full width\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n The <code>variant=\"fullWidth\"</code> prop should be used for smaller views. This demo also\n uses{' '}\n <a href=\"https://github.com/oliviertassinari/react-swipeable-views\">\n react-swipeable-views\n </a>{' '}\n to animate the Tab transition, and allowing tabs to be swiped on touch devices.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/FullWidthTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/FullWidthTabs.js')}\n />\n </Typography>\n <Typography className=\"text-20 mt-20 mb-10 font-700\" component=\"h3\">\n Centered\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n The <code>centered</code> prop should be used for larger views.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/CenteredTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/CenteredTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Scrollable tabs\n </Typography>\n <Typography className=\"text-20 mt-20 mb-10 font-700\" component=\"h3\">\n Automatic scroll buttons\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n By default, left and right scroll buttons are automatically presented on desktop and hidden\n on mobile. (based on viewport width)\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonAuto.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonAuto.js')}\n />\n </Typography>\n <Typography className=\"text-20 mt-20 mb-10 font-700\" component=\"h3\">\n Forced scroll buttons\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Left and right scroll buttons be presented (reserve space) regardless of the viewport width\n with <code>{`scrollButtons={true}`}</code> <code>allowScrollButtonsMobile</code>:\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonForce.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonForce.js')}\n />\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n If you want to make sure the buttons are always visible, you should customize the opacity.\n </Typography>\n\n <FuseHighlight component=\"pre\" className=\"language-css\">\n {` \n.MuiTabs-scrollButtons.Mui-disabled {\n opacity: 0.3;\n}\n`}\n </FuseHighlight>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonVisible.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonVisible.js')}\n />\n </Typography>\n <Typography className=\"text-20 mt-20 mb-10 font-700\" component=\"h3\">\n Prevent scroll buttons\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Left and right scroll buttons are never be presented with{' '}\n <code>{`scrollButtons={false}`}</code>. All scrolling must be initiated through user agent\n scrolling mechanisms (e.g. left/right swipe, shift mouse wheel, etc.)\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonPrevent.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/ScrollableTabsButtonPrevent.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Customization\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Here is an example of customizing the component. You can learn more about this in the{' '}\n <a href=\"/customization/how-to-customize/\">overrides documentation page</a>.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/CustomizedTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/CustomizedTabs.js')}\n />\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n 🎨 If you are looking for inspiration, you can check{' '}\n <a href=\"https://mui-treasury.com/styles/tabs/\">\n MUI Treasury&#39;s customization examples\n </a>\n .\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Vertical tabs\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n To make vertical tabs instead of default horizontal ones, there is{' '}\n <code>orientation=\"vertical\"</code>:\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/VerticalTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/VerticalTabs.js')}\n />\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Note that you can restore the scrollbar with <code>visibleScrollbar</code>.\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Nav tabs\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n By default, tabs use a <code>button</code> element, but you can provide your custom tag or\n component. Here&#39;s an example of implementing tabbed navigation:\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/NavTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/NavTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Icon tabs\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n Tab labels may be either all icons or all text.\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/IconTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/IconTabs.js')}\n />\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/IconLabelTabs.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/IconLabelTabs.js')}\n />\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Third-party routing library\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n One frequent use case is to perform navigation on the client only, without an HTTP\n round-trip to the server. The <code>Tab</code> component provides the <code>component</code>{' '}\n prop to handle this use case. Here is a{' '}\n <a href=\"/guides/routing/#tabs\">more detailed guide</a>.\n </Typography>\n <Typography className=\"text-32 mt-40 mb-10 font-700\" component=\"h2\">\n Accessibility\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n (WAI-ARIA:{' '}\n <a href=\"https://www.w3.org/TR/wai-aria-practices/#tabpanel\">\n https://www.w3.org/TR/wai-aria-practices/#tabpanel\n </a>\n )\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n The following steps are needed in order to provide necessary information for assistive\n technologies:\n </Typography>\n <ol>\n <li>\n Label <code>Tabs</code> via <code>aria-label</code> or <code>aria-labelledby</code>.\n </li>\n <li>\n <code>Tab</code>s need to be connected to their corresponding{' '}\n <code>[role=\"tabpanel\"]</code> by setting the correct <code>id</code>,{' '}\n <code>aria-controls</code> and <code>aria-labelledby</code>.\n </li>\n </ol>\n <Typography className=\"mb-40\" component=\"div\">\n An example for the current implementation can be found in the demos on this page. We&#39;ve\n also published <a href=\"#experimental-api\">an experimental API</a> in <code>@mui/lab</code>{' '}\n that does not require extra work.\n </Typography>\n <Typography className=\"text-20 mt-20 mb-10 font-700\" component=\"h3\">\n Keyboard navigation\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n The components implement keyboard navigation using the &quot;manual activation&quot;\n behavior. If you want to switch to the &quot;selection automatically follows focus&quot;\n behavior you have pass <code>selectionFollowsFocus</code> to the <code>Tabs</code>{' '}\n component. The WAI-ARIA authoring practices have a detailed guide on{' '}\n <a href=\"https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focus\">\n how to decide when to make selection automatically follow focus\n </a>\n .\n </Typography>\n <Typography className=\"text-16 mt-16 mb-10\" component=\"h4\">\n Demo\n </Typography>\n <Typography className=\"mb-40\" component=\"div\">\n The following two demos only differ in their keyboard navigation behavior. Focus a tab and\n navigate with arrow keys to notice the difference, e.g.{' '}\n <kbd className=\"key\">Arrow Left</kbd>.\n </Typography>\n\n <FuseHighlight component=\"pre\" className=\"language-jsx\">\n {` \n/* Tabs where selection follows focus */\n<Tabs selectionFollowsFocus />\n`}\n </FuseHighlight>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/AccessibleTabs1.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/AccessibleTabs1.js')}\n />\n </Typography>\n\n <FuseHighlight component=\"pre\" className=\"language-jsx\">\n {` \n/* Tabs where each tab needs to be selected manually */\n<Tabs />\n`}\n </FuseHighlight>\n <Typography className=\"mb-40\" component=\"div\">\n <FuseExample\n className=\"my-24\"\n iframe={false}\n component={\n require('app/main/documentation/material-ui-components/components/tabs/AccessibleTabs2.js')\n .default\n }\n raw={require('!raw-loader!app/main/documentation/material-ui-components/components/tabs/AccessibleTabs2.js')}\n />\n </Typography>\n </>\n );\n}", "static get properties() {\n return {\n ...super.properties,\n\n /**\n * the id of the active tab\n */\n activeTab: {\n type: String,\n attribute: \"active-tab\"\n },\n /**\n * whether the tabbed interface is disabled\n */\n disabled: {\n type: Boolean,\n reflect: true\n },\n /**\n * whether the tabbed interface is hidden\n */\n hidden: {\n type: Boolean,\n reflect: true\n },\n /**\n * the minimum breakpoint for showing tab text with icons, or\n * - use `0` to always show icons only\n * - use `-1` to always show text with icons\n */\n iconBreakpoint: {\n type: Number,\n attribute: \"icon-breakpoint\"\n },\n /**\n * unique identifier/anchor for the tabbed interface\n */\n id: {\n type: String,\n reflect: true\n },\n /**\n * the minimum breakpoint for horizontal layout of tabs, or\n * - use `0` for horizontal-only\n * - use `-1` for vertical-only\n */\n layoutBreakpoint: {\n type: Number,\n attribute: \"layout-breakpoint\"\n },\n /**\n * the size of the tabs,\n * where `xs` is the smaller breakpoint\n * and `xs` is the larger breakpoint\n */\n responsiveSize: {\n type: String,\n reflect: true,\n attribute: \"responsive-size\"\n },\n /**\n * whether the tabbed interface is in vertical layout mode\n */\n vertical: {\n type: Boolean,\n reflect: true\n },\n /**\n * whether the tabbed interface has icons for each tab\n */\n __hasIcons: {\n type: Boolean\n },\n /**\n * an array of tab data based on slotted `a11y-tab` elements\n */\n __items: {\n type: Array\n },\n /**\n * a mutation observer to monitor slotted `a11y-tab` elements\n */\n __observer: {\n type: Object\n },\n forceHorizontal: {\n type: Boolean,\n attribute: \"force-horizontal\"\n }\n };\n }", "phaseTabs() {\n var allPhasesTab = (\n <li key={'all'} className={'tab ' + this.isViewingPhase('all')}>\n <a id={'all'} onClick={this.setPhase}>All Games</a>\n </li>\n );\n var tabList = [allPhasesTab];\n for(var phase in this.props.divisions) {\n if(phase != 'noPhase') {\n var oneTab = (\n <li key={phase} className={'tab ' + this.isViewingPhase(phase)}>\n <a id={phase} onClick={this.setPhase}>{phase}</a>\n </li>\n );\n tabList.push(oneTab);\n }\n }\n var skinny = this.state.overflowTabs ? '' : ' skinny-tabs';\n return (\n <div className=\"nav-content\">\n <ul className={'tabs tabs-transparent' + skinny} id=\"phase-tabs\">\n {tabList}\n </ul>\n </div>\n );\n }", "render(){\n var trackers_list = get_top_trackers()\n\n return (\n <div className=\"flex-container\">\n <Tab.Container id=\"tracker-tabs\" defaultActiveKey=\"first\">\n <Row class=\"tracker-list-box\">\n <Col sm={3}>\n <Nav variant=\"pills\" className=\"flex-column\">\n <Nav.Item>\n <Nav.Link variant=\"primary\" className=\"header-tab\" eventKey=\"first\">Website</Nav.Link>\n </Nav.Item>\n {trackers_list.map(datas =>\n <Nav.Item>\n <Nav.Link variant=\"primary\" eventKey={datas[0]}>{datas[0]}</Nav.Link>\n </Nav.Item>\n )}\n </Nav>\n </Col>\n <Col sm={8}>\n <Tab.Content>\n <Tab.Pane eventKey=\"first\">\n <p className=\"text-for-tabs\"> Click on a tab to view a scrollable list of the trackers on that website!\n </p>\n </Tab.Pane>\n {trackers_list.map(datas =>\n <Tab.Pane eventKey={datas[0]}>\n <ul class=\"tracker-list\">\n {datas[1].map(tracker =>\n <li style={{listStyle: 'circle', marginLeft: '4px', marginTop: '2px', marginBottom: '2px'}}>{tracker}</li>\n )}\n </ul>\n </Tab.Pane>\n )}\n </Tab.Content>\n </Col>\n </Row>\n </Tab.Container>\n </div>\n )\n }", "_makeTabsFromPfTab() {\n const ul = this.querySelector('ul');\n if (this.children && this.children.length) {\n const pfTabs = [].slice\n .call(this.children)\n .filter(node => node.nodeName === 'PF-TAB');\n [].forEach.call(pfTabs, (pfTab, idx) => {\n const tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n }\n else {\n pfTab.style.display = 'none';\n }\n });\n }\n }", "get tabs() {\n if (!this.props.renderHiddenTabs) {\n return this.visibleTab;\n }\n\n const tabs = this.children.map((child, index) => {\n return (\n <Tab\n role='tabpanel'\n title={ child.props.title }\n tabId={ child.props.tabId }\n position={ this.props.position }\n key={ this.tabRefs[index] }\n ariaLabelledby={ this.tabRefs[index] }\n isTabSelected={ this.isTabSelected(child.props.tabId) }\n >\n {child.props.children}\n </Tab>\n );\n });\n\n return tabs;\n }", "function openTab(tabName) {\n let i;\n let tabContent;\n\n tabContent = document.getElementsByClassName(\"tab-content\");\n\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n\n document.getElementById(tabName).style.display = \"flex\";\n}", "render({ children } = this.props) {\n let {TabStyle} = Theme;\n return (\n <View style={this.props.hideTabContent ? TabStyle.containerWithOutContent : TabStyle.container}>\n\n {/* Tabs row */}\n {this._renderTabs(children, 'top')}\n\n {/* Content */}\n {this._renderContent(children)}\n\n {this._renderTabs(children, 'bottom')}\n </View>\n );\n }", "function TabsComponent() {\r\n return <Tabs data={tabItems} />;\r\n}", "function showTabContent(b){//to show the content element we need\n if (tabContent[b].classList.contains('hide')){\n tabContent[b].classList.remove('hide');\n tabContent[b].classList.add('show');\n }\n }", "function makeActive(tab)\n{\n for (i = 0; i < TabView.listTabs.length; i++)\n {\n let tabElement = document.getElementById(TabView.listTabs[i].getIdTab());\n tabElement.className = tabElement.className.replace(ACTIVE_TAB_CLASS, '');\n\n let content = document.getElementById(TabView.listTabs[i].getIdContent());\n content.className = content.className.replace(ACTIVE_CONTENT_CLASS, '');\n }\n\n document.getElementById(tab.getIdTab()).className += ACTIVE_TAB_CLASS;\n document.getElementById(tab.getIdContent()).className += ACTIVE_CONTENT_CLASS;\n}", "update() {\n if (!this.dirty)\n return;\n this.dirty = false;\n const shadowRoot = this.shadowRoot;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n const activateTab = function (ev) {\n const tab = ev.target;\n if (tab.tagName === 'LABEL') {\n self.activateTab(tab.parentNode.dataset.name);\n }\n };\n // 1. Remove the event handlers\n shadowRoot.querySelectorAll('.tab').forEach((x) => {\n x.removeEventListener('click', activateTab);\n });\n // 2. Collect the content of each tab\n const slots = shadowRoot.querySelectorAll('.original-content slot');\n let content = '';\n slots.forEach((slot) => {\n let text = slot\n .assignedNodes()\n .map((node) => node.innerHTML)\n .join('');\n if (text) {\n // Remove empty comments. This 'trick' is used to work around\n // an issue where Eleventy ignores empty lines in HTML blocks,\n // so an empty comment is insert, but it now needs to be removed\n // so that the empty line is properly picked up by CodeMirror. Sigh.\n text = text.replace(/<!-- -->/g, '');\n const tabId = randomId();\n const language = slot.name;\n content += `<div class='tab' id=\"${tabId}\" data-name=\"${language}\">\n <input type=\"radio\" id=\"${tabId}\" name=\"${this.id}\">\n <label for=\"${tabId}\">${language}</label>\n <div class=\"content ${language.toLowerCase()}\">\n <textarea data-language=\"${language.toLowerCase()}\">${text}</textarea>\n </div>\n </div>`;\n }\n });\n shadowRoot.querySelector('.tabs').innerHTML = content;\n // 3. Listen to tab activation\n const tabs = shadowRoot.querySelectorAll('.tab');\n if (tabs.length <= 1) {\n tabs.forEach((x) => (x.querySelector('.tab > label').style.display = 'none'));\n }\n else {\n shadowRoot.querySelectorAll('.tab label').forEach((x) => {\n x.addEventListener('click', activateTab);\n });\n }\n const firstTab = tabs[0];\n const lastTab = tabs[tabs.length - 1];\n if (tabs.length > 1) {\n firstTab.style.marginTop = '8px';\n }\n else {\n const tabContent = firstTab.querySelector('.content');\n tabContent.style.borderTopLeftRadius = '8px';\n tabContent.style.borderTopRightRadius = '8px';\n }\n if (!this.buttonBarVisible) {\n const tabContent = lastTab.querySelector('.content');\n tabContent.style.borderBottomLeftRadius = '8px';\n tabContent.style.borderBottomRightRadius = '8px';\n lastTab.style.marginBottom = '0';\n lastTab.style.paddingBottom = '0';\n }\n // 4. Setup editors\n if (typeof CodeMirror !== 'undefined') {\n this.resizeObserver.disconnect();\n shadowRoot\n .querySelectorAll('.tab .content textarea')\n .forEach((x) => {\n var _a;\n // Remove XML comments, including the <!-- htmlmin:ignore --> used to\n // indicate to terser to skip sections, so as to preserve the formatting.\n x.value = x.value.replace(/<!--.*-->\\n?/g, '');\n // Watch for re-layout and invoke CodeMirror refresh when they happen\n this.resizeObserver.observe(x.parentElement);\n const lang = {\n javascript: 'javascript',\n css: 'css',\n html: 'xml',\n }[(_a = x.dataset.language) !== null && _a !== void 0 ? _a : 'javascript'];\n const editor = CodeMirror.fromTextArea(x, {\n lineNumbers: this.showLineNumbers,\n lineWrapping: true,\n mode: lang,\n theme: 'tomorrow-night',\n });\n editor.setSize('100%', '100%');\n editor.on('change', () => {\n this.editorContentChanged();\n });\n });\n }\n // 5. Activate the previously active tab, or the first one\n this.activateTab(this.activeTab || tabs[0].dataset.name);\n // 6. Run the playground\n this.runPlayground();\n // Refresh the codemirror layouts\n // (important to get the linenumbers to display correctly)\n setTimeout(() => shadowRoot\n .querySelectorAll('textarea + .CodeMirror')\n .forEach((x) => { var _a; return (_a = x === null || x === void 0 ? void 0 : x['CodeMirror']) === null || _a === void 0 ? void 0 : _a.refresh(); }), 128);\n }", "function accessContent(tab, data) {\n if(scriptInTab[tab.id] === undefined) {\n scriptInTab[tab.id] = true;\n var options = {\n tab : tab,\n callback: function(){ AvastWRC.bs.messageTab(tab, data); }\n };\n _.extend(options, AvastWRC.bal.getInjectLibs());\n AvastWRC.bs.inject(options);\n }\n else {\n AvastWRC.bs.messageTab(tab, data);\n }\n }", "function About_svelte_create_fragment(ctx) {\n\tlet p0;\n\tlet p1;\n\tlet t3;\n\tlet p2;\n\tlet p3;\n\tlet t12;\n\tlet p4;\n\n\treturn {\n\t\tc() {\n\t\t\tp0 = (0,internal/* element */.bG)(\"p\");\n\n\t\t\tp0.innerHTML = `Thank you for using this open source solution for diy pedals. <br/>\r\n This is not to be sold its open and free for everyone to use. <br/> \r\n`;\n\n\t\t\tp1 = (0,internal/* element */.bG)(\"p\");\n\t\t\tt3 = (0,internal/* space */.Dh)();\n\t\t\tp2 = (0,internal/* element */.bG)(\"p\");\n\n\t\t\tp2.innerHTML = `You can find executable and arduino code in the following locations <br/>\r\n Gui executable: <a href=\"https://github.com/vospascal/pedal-gui\">pedal-gui</a> <br/>\r\n Arduino code that works with the gui exe file: <a href=\"https://github.com/vospascal/pedal-arduino/\">pedal-arduino</a> <br/> \r\n`;\n\n\t\t\tp3 = (0,internal/* element */.bG)(\"p\");\n\t\t\tt12 = (0,internal/* space */.Dh)();\n\t\t\tp4 = (0,internal/* element */.bG)(\"p\");\n\n\t\t\tp4.innerHTML = `If you like it please consider a donation to further development. <br/> \r\n <a href=\"paypal.com/donate/?business=TBPE6XCB2XBMW&amp;item_name=pedalbox&amp;currency_code=EUR\">donate on\r\n paypal</a>`;\n\t\t},\n\t\tm(target, anchor) {\n\t\t\t(0,internal/* insert */.$T)(target, p0, anchor);\n\t\t\t(0,internal/* insert */.$T)(target, p1, anchor);\n\t\t\t(0,internal/* insert */.$T)(target, t3, anchor);\n\t\t\t(0,internal/* insert */.$T)(target, p2, anchor);\n\t\t\t(0,internal/* insert */.$T)(target, p3, anchor);\n\t\t\t(0,internal/* insert */.$T)(target, t12, anchor);\n\t\t\t(0,internal/* insert */.$T)(target, p4, anchor);\n\t\t},\n\t\tp: internal/* noop */.ZT,\n\t\ti: internal/* noop */.ZT,\n\t\to: internal/* noop */.ZT,\n\t\td(detaching) {\n\t\t\tif (detaching) (0,internal/* detach */.og)(p0);\n\t\t\tif (detaching) (0,internal/* detach */.og)(p1);\n\t\t\tif (detaching) (0,internal/* detach */.og)(t3);\n\t\t\tif (detaching) (0,internal/* detach */.og)(p2);\n\t\t\tif (detaching) (0,internal/* detach */.og)(p3);\n\t\t\tif (detaching) (0,internal/* detach */.og)(t12);\n\t\t\tif (detaching) (0,internal/* detach */.og)(p4);\n\t\t}\n\t};\n}", "render() {\n var displayContent = () => {\n var activeTab = this.props.activeTab;\n if (activeTab === 1) {\n return <Text />;\n } else if (activeTab === 2) {\n return <Image />;\n } else if (activeTab === 3) {\n return <Video />;\n } else if (activeTab === 4) {\n return <Table />;\n } else if (activeTab === 5) {\n return <Email />;\n } else {\n return <Zoom />;\n }\n };\n return displayContent();\n }", "allTabs() {\n return [\n [\"Intro\", this.renderIntroTab()],\n [\"Globals\", this.renderGlobalsTab()],\n [\"Basic Interventions\", this.renderBasicsTab()],\n [\"Far Future\", this.renderFarFutureTab()],\n [\"Veg Advocacy\", this.renderVegTab()],\n [\"Cage Free\", this.renderCageFreeTab()],\n [\"AI Safety\", this.renderAISafetyTab()],\n [\"Targeted Values Spreading\", this.renderTargetedValuesSpreadingTab()],\n ]\n }", "function WhatWeDoDesign(props) {\n return (\n <div className=\"content\">\n <h1>\n What We Do Page\n </h1>\n \n <Tabs className=\"tab-content\">\n <TabList>\n <Tab>Info</Tab>\n <Tab>HTML</Tab>\n <Tab>CSS</Tab>\n <Tab>JavaScript</Tab>\n </TabList>\n\n\n <TabPanel>\n \n <div className=\"code-content\">\n \n <code>\n {whatWeDo[0].split(\"\\n\").map((i,key) => {\n return <div key={key}>{i}</div>;})}\n </code>\n </div>\n </TabPanel>\n <TabPanel>\n \n <div className=\"code-content\">\n <CopyToClipboard text={whatWeDo[1].split(\"\\n\").map((i,key) => { return String(i+\"\\n\")}).join(\"\")}>\n <button className=\"copy-button\">Copy to clipboard</button>\n </CopyToClipboard>\n <code>\n {whatWeDo[1].split(\"\\n\").map((i,key) => {\n return <div key={key}>{i}</div>;})}\n </code>\n </div>\n </TabPanel>\n <TabPanel>\n <CopyToClipboard text={whatWeDo[2].split(\"\\n\").map((i,key) => { return String(i+\"\\n\")}).join(\"\")}>\n <button className=\"copy-button\">Copy to clipboard</button>\n </CopyToClipboard>\n <div className=\"code-content\">\n <code>\n {whatWeDo[2].split(\"\\n\").map((i,key) => {\n return <div key={key}>{i}</div>;\n })}\n </code>\n </div>\n </TabPanel>\n <TabPanel>\n <div className=\"code-content\">\n <code>{whatWeDo[3]}</code>\n </div>\n </TabPanel>\n </Tabs>\n \n </div>\n );\n}", "buildTabView()\n {\n switch(this.state.selectedTab) {\n case \"main\" : return(<MainTab {...this.props} onUpdate={this.updateIndicator.bind(this)}\n onPrintDetails={this.onPrintDetails.bind(this)}/>)\n case \"expenses\" : return(<ExpensesTab {...this.props} \n onGoBack={this.goBack.bind(this)}/>)\n case \"depreciations\" : return(<DepreciationsTab {...this.props} \n onGoBack={this.goBack.bind(this)}/>)\n }\n }", "function compiletabbar(){\nvar content = document.getElementById(\"tabbarplaceholder\");\nvar pre=\"\";\npre+='<ons-tabbar var=\"tabbar\" animation=\"slide\">';\npre+='<ons-tabbar-item page=\"home.html\" icon=\"globe\" label=\"Explore\" onclick=\"querypost()\" active=\"true\"></ons-tabbar-item>';\npre+='<ons-tabbar-item page=\"project.html\" icon=\"home\" label=\"Project\" onclick=\"queryproject()\" ></ons-tabbar-item>';\npre+='<ons-tabbar-item page=\"search.html\" icon=\"search\" label=\"Search\" onclick=\"queryusers()\"></ons-tabbar-item>';\npre+='<ons-tabbar-item page=\"message.html\" icon=\"comment\" label=\"Messages\" ></ons-tabbar-item>';\npre+='<ons-tabbar-item page=\"profile.html\" icon=\"user\" label=\"profile\" onclick=\"populateprofile()\"></ons-tabbar-item>';\npre+='</ons-tabbar>'; \ncontent.innerHTML=pre;\nons.compile(content);\nquerypost();\n}", "static get tag() {\n return \"a11y-tabs\";\n }", "setupTabs() {\n const instanceTabs = global.hadronApp.appRegistry.getRole('Instance.Tab');\n const roles = filter(instanceTabs, (role) => {\n return !(this.props.isDataLake && role.name === 'Performance');\n });\n\n const tabs = roles.map((role) => role.name);\n const views = roles.map((role, i) => {\n return (\n <UnsafeComponent component={role.component} key={i} />\n );\n });\n\n this.tabs = tabs;\n this.views = views;\n }", "function contactTabs(evt, onglet) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(onglet).style.display = \"flex\";\n evt.currentTarget.className += \" active\";\n}", "function generatePage(tab){\n\t\t\tif (tab == \"education\"){\n\t\t\t\tcurrent_embedded_tab = \"total\";\n\t\t\t\ttyperfunction(defaultuniversity, 'university', 2, function() {\n\t\t\t\t\tregister_embeddedevents(module_results)\n\t\t\t\t})();\n\t\t\t\ttyperfunction(alevels, 'alevel',10)();\n\t\t\t\ttyperfunction(gcses, 'gcses',10)();\n\t\t\t}\n\t\t\telse if (tab == \"about\"){\n\t\t\t\ttyperfunction(about, 'about-info',5)();\n\t\t\t\ttyperfunction(biography, 'biography', 5)();\n\t\t\t}\n\t\t\telse if (tab == \"contact\"){\n\t\t\t\ttyperfunction(contact, 'contact-info',5,register_contactevents)();\n\t\t\t}\n\t\t\telse if (tab == \"experience\"){\n\t\t\t\tcurrent_embedded_tab = \"warwicktech\";\n\t\t\t\ttyperfunction(defaultexperience, 'experience-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(experiences)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"projects\"){\n\t\t\t\tcurrent_embedded_tab = \"year4\";\n\t\t\t\ttyperfunction(defaultproject, 'project-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(projects)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"loading\"){\n\t\t\t\tfillLoadingBar(34,100)();\n\t\t\t\ttyperfunction(terminal_info, 'terminal-info', 10)();\n\t\t\t\ttyperfunction(boot_text,'boot-loading', 10)();\n\t\t\t\ttyperfunction(boot_progress, 'boot-progress',100, loadSplashScreen)();\n\t\t\t}\n\t\t\telse if (tab == \"splash\"){\n\t\t\t\ttyperfunction(splash_text, \"splash-text\",50)();\n\t\t\t}\n\t\t}", "renderTabs() {\n const { active } = this.state;\n return (\n <View style={stylesLocation.tabs}>\n <View\n style={[\n stylesLocation.tab,\n active === \"all\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"all\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"all\")}\n >\n All\n </Text>\n </View>\n <View\n style={[\n stylesLocation.tab,\n active === \"hospital\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"hospital\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"hospital\")}\n >\n Hospital\n </Text>\n </View>\n <View\n style={[\n stylesLocation.tab,\n active === \"clinic\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"clinic\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"clinic\")}\n >\n Clinic\n </Text>\n </View>\n </View>\n );\n }", "function onClickTab(tab) {\n if (d3.select(\"#tab_\"+tab).classed(\"active\")) { return; }\n active_tab = tab;\n // hide all tab_content\n d3.selectAll(\".tab_content\").style(\"display\", \"none\");\n // show selected tab_content\n d3.select(\"#div_\"+tab).style(\"display\", \"unset\");\n // mark tab as selected\n d3.selectAll(\".tab\").classed(\"active\", false);\n d3.select(\"#tab_\"+tab).classed(\"active\", true);\n drawgraphs();\n}", "function TabView (tab, content) {\r\n\r\n function addClass() {\r\n tab.setAttribute(\"class\", \"active\");\r\n content.setAttribute(\"class\", \"tab-content active\");\r\n }\r\n if(tab.addEventListener) {\r\n tab.addEventListener('click', function () {\r\n clearClasses();\r\n addClass();\r\n });\r\n } else if (tab.attachEvent) {\r\n tab.attachEvent('onclick', function () {\r\n clearClasses();\r\n addClass();\r\n });\r\n }\r\n return {\r\n clearClass : function () {\r\n var classes = content.getAttribute(\"class\").split(\" \");\r\n tab.setAttribute(\"class\", \" \");\r\n content.setAttribute(\"class\", classes[0]);\r\n }\r\n }\r\n }", "render(){\n return(\n <div>\n {this.renderTab()}\n </div>\n );\n }", "render() {\n return (\n <div className='panel'>\n <button onClick={() => {this.selectTab(global.orgListTab)}}>Список организаций</button>\n <button onClick={() => {this.selectTab(global.empListTab)}}>Список сотрудников</button>\n <button onClick={() => {this.selectTab(global.orgTreeTab)}}>Дерево организаций</button>\n <button onClick={() => {this.selectTab(global.empTreeTab)}}>Дерево сотрудников</button>\n </div >\n );\n }", "function TabContent({ children, dir }) {\n\treturn (\n\t\t<Typography component=\"div\" dir={dir}>\n\t\t\t{children}\n\t\t</Typography>\n\t);\n}", "function updateContent() {\n function updateTab(tabs) {\n if (tabs[0]) {\n currentTab = tabs[0];\n console.log(\"updateTabs\");\n \n // executeScript(currentTab);\n loadFoundWords(currentTab);\n }\n }\n\n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function hideTabContent(a) {\n\t\tfor (let i = a; i < tabContent.length; i++){\n\t\t\ttabContent[i].classList.remove('show');\n\t\t\ttabContent[i].classList.add('hide');\n\t\t}\n\t}", "renderTabs() {\n return React.Children.map(this.props.children, (child, index) => {\n if (!child) return null;\n\n return React.cloneElement(child, {\n index,\n onClick: this.onTabClick,\n isActive: index === this.state.activeTab\n });\n });\n }", "_genTab(){\n const tabs = {}\n const {keys,theme} = this.props\n this.preKeys = keys\n keys.forEach((item,index) => {\n if(item.checked){\n tabs[`tab${index}`] = {\n screen: props => <TreadingTabPage theme={theme} {...props} timeSpan={this.state.timeSpan} tabLabel={item.name}/>, // 这是个不错的技巧\n navigationOptions:{\n title:item.name\n }\n }\n }\n });\n return tabs\n }", "function Tabs(props){\n const allTabs = ['synopsis', 'cast', 'episodes', 'related'];\n const tabNames = ['Story', 'Cast', 'Eps.', 'Related'];\n\n const tabs = allTabs.map((tab, index) => {\n const load = (tab === 'synopsis' ? null : 'MAL'); // Whether to load MAL or not\n const onTab = props.currentTab === tab // See if it's on\n const className = `tab-${tab} ` + (onTab ? 'on' : null); // If on, add \"on\"\n\n return(<div key={tab} className={className} onClick={() => props.handleTab(tab, load)}> {tabNames[index]}</div>)\n });\n\n return(\n <div className=\"window-tabs\">\n {tabs}\n </div>\n )\n }", "static get tag() {\n return \"a11y-tab\";\n }", "render() {\n const { page } = this.state;\n const tabberStyles = [styles.tabbar];\n// if (Platform.OS === 'android') tabbarStyles.push(styles.androidTabbar);\n\n\n\n return (\n\n <View style={styles.container}>\n <Tabs\n selected={page}\n style={styles.tabbar}\n selectedStyle={{color:'red'}} onSelect={el=>this.setState({page:el.props.name})}\n >\n <Text name=\"first\">Home - {Platform.OS}</Text>\n <Text name=\"second\">Settings</Text>\n <Text name=\"third\">[X]</Text>\n </Tabs>\n\n\n <Text>eCom App &nbsp; &nbsp; | &nbsp; &nbsp; {page}</Text>\n\n\n\n <Text style={styles.instructions}>\n {'\\n'}{'\\n'} Android {'\\n'}\n Double tap R on your keyboard to reload,{'\\n'}\n Shake or press menu button for dev menu{'\\n'}\n --{'\\n'}\n iOS {'\\n'}\n Press Cmd+R to reload,{'\\n'}\n Cmd+D or shake for dev menu\n {'\\n'}\n —{'\\n'} {'\\n'}\n Jose and Mayur, do a quick demo - Prof. Moskal 🏈\n\n Hey, real quick\n </Text>\n\n </View>\n )\n }", "_makeTabsFromPfTab () {\n let ul = this.querySelector('ul');\n let pfTabs = this.querySelectorAll('pf-tab');\n [].forEach.call(pfTabs, function (pfTab, idx) {\n let tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n } else {\n pfTab.style.display = 'none';\n }\n }.bind(this));\n }", "function Tabs(category) {\n var category = category;\n\n // Create the tab structure\n function htmlCode(tab_labels, msg) {\n var keys = Object.keys(tab_labels).sort();\n // Add tab buttons\n var tabs = '<ul class=\"tab-list\">';\n for (var idx in keys) {\n var d = keys[idx];\n var label = category === 'switches' ? 'SW_' + tab_labels[d] : tab_labels[d];\n tabs += '<li class=\"tab-control\" data-tab=\"tab-' + tab_labels[d] + '\">' + label + '</li>';\n }\n tabs += '</ul>';\n\n for (var idx in keys) {\n var s = keys[idx]\n tabs += '<div class=\"tab-panel\" id=\"tab-' + tab_labels[s] + '\"><h1>' + msg + '</h1></div>';\n }\n return tabs;\n }\n\n /**\n * Set listeners to user events.\n */\n function listenToEvents() {\n // only one tab list is allowed per page\n $('.tab-list').on('click', '.tab-control', function () {\n //var tab_id = $(this).attr('data-tab');\n var tab_id = $(this).data('tab');\n\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n $(this).addClass('active');\n $(\"#\" + tab_id).addClass('active');\n\n // Save active tab per category\n saveInSession('activetab', '', tab_id);\n })\n }\n\n // Append HTML\n function buildTabs(parent, tab_labels, msg) {\n var html_code = htmlCode(tab_labels, msg)\n $(parent).empty().append(html_code);\n listenToEvents();\n }\n\n // Fill tab panel\n function buildContent(id, envelope) {\n envelope.children('.tableframe').each(function (i, v) {\n $(v).data('order', i);\n })\n var order_list = getFromSession('order', 'tab-' + id);\n if (order_list) {\n var $cards = envelope.children('.tableframe');\n if ($cards.length != order_list.length) {\n // pass, a table added/removed so we cannot use the previous order\n saveInSession(\"order\", null);\n } else {\n //var $clone = envelope.clone().empty();\n for (var i in order_list) {\n var $card = $cards.eq(order_list[i]).detach();\n envelope.append($card);\n }\n //envelope = $clone;\n }\n }\n $('#tab-' + id).empty().append(envelope);\n }\n\n // Set active tab\n function setActive() {\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n var tab_id = getFromSession('activetab', '');\n if (tab_id) { // Active tab has been saved\n var $first = $('[data-tab=' + tab_id + ']')\n $first.addClass('active');\n $(\"#\" + tab_id).addClass('active');\n } else { // No active tab saved\n var $first = $('.tab-control').first();\n //var tab_id = $first.attr('data-tab');\n var tab_id = $first.data('tab');\n $first.addClass('active');\n $(\"#\" + tab_id).addClass('active');\n saveInSession('activetab', '', tab_id);\n }\n }\n\n return {\n buildTabs: buildTabs,\n buildContent: buildContent,\n setActive: setActive\n };\n}", "function setTab(i) {\n try {\n const gameTab = $(\"#game_tab\")[0];\n // back button\n const backBtn = ce(\"div\", gameTab, [\"back_button\"]);\n const spanx = ce(\"span\", backBtn, [\"v_arrow\", \"back_press\", \"tab_back\"]);\n const mki = ce(\"i\", spanx, [\"mk_arrowb\"]);\n const mki1 = ce(\"i\", spanx, [\"mk_line\"]);\n // game description\n const game_details = ce(\"div\", gameTab, [\"game_details\"]);\n const h2 = ce(\n \"h2\",\n game_details,\n [],\n project_data.all_games[`g${i}`].name\n );\n const h6 = ce(\n \"h6\",\n game_details,\n [],\n project_data.all_games[`g${i}`].details\n );\n // image box\n const tab_image_box = ce(\"div\", gameTab, [\"tab_image_box\"]);\n for (let j = 0; j < project_data.all_games[`g${i}`].images; j++) {\n const tab_image = ce(\"div\", tab_image_box, [\"tab_image\"]);\n tab_image.style.backgroundImage = `url(resource/imgs/g${i}/p${j}.jpg)`;\n }\n\n const gmabout = ce(\"div\", gameTab, [\"gm_about\"]);\n ce(\"h6\", gmabout, [], project_data.all_games[`g${i}`].released_date);\n ce(\n \"h6\",\n gmabout,\n [],\n \"Version : \" + project_data.all_games[`g${i}`].version\n );\n // play button\n const playNow = ce(\"div\", gameTab, [\"play_now\"]);\n const px = ce(\"p\", playNow, [], \"Play Now\");\n // download source code\n const downloadSrc = ce(\"div\", gameTab, [\"download_src\"]);\n const span = ce(\"span\", downloadSrc);\n const I = ce(\"i\", span, [\"fas\", \"fa-file-download\"]);\n const P = ce(\"p\", span, [], \"Download Source\");\n } catch (err) {\n console.log(err);\n }\n }", "function TabPanel(props) {\n const { children, value, index, ...other } = props;\n \n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`scrollable-force-tabpanel-${index}`}\n aria-labelledby={`scrollable-force-tab-${index}`}\n {...other}\n >\n {value === index && (\n <Box p={3}>\n <Typography>{children}</Typography>\n </Box>\n )}\n </div>\n );\n }", "getTabComponents() {\n let tabs = [\n {\n tabClassName: 'tab',\n panelClassName: 'panel',\n title: \"Evolution\",\n component: <MlInstitutionViewEvolution key=\"2\" portfolioDetailsId={this.props.portfolioDetailsId} tabName=\"evolution\"\n getSelectedAnnotations={this.props.getSelectedAnnotations}\n />\n },\n {\n tabClassName: 'tab',\n panelClassName: 'panel',\n title: \"Achievements\",\n component: <MlInstitutionViewAchievements key=\"1\" portfolioDetailsId={this.props.portfolioDetailsId}\n getSelectedAnnotations={this.props.getSelectedAnnotations}\n />\n },\n {\n tabClassName: 'tab',\n panelClassName: 'panel',\n title:\"Reports\" ,\n component:<MlInstitutionCSRReports key=\"3\" portfolioDetailsId={this.props.portfolioDetailsId} />},\n {\n tabClassName: 'tab',\n panelClassName: 'panel',\n title: \"Policy\",\n component: <MlInstitutionViewPolicy key=\"4\" portfolioDetailsId={this.props.portfolioDetailsId} tabName=\"policy\"\n getSelectedAnnotations={this.props.getSelectedAnnotations}\n />\n }\n ]\n return tabs;\n }", "renderActiveTabContent() {\n const { children } = this.props;\n const { activeTab } = this.state;\n\n if (children[activeTab]) {\n return children[activeTab].props.children;\n }\n }", "function selectTab( name ) {\n\n // Get all elements with class=\"tabcontent\" and hide them\n\n let tabcontent = document.getElementsByClassName(\"tabcontent\");\n\n for (let i = 0; i < tabcontent.length; i++) {\n if ( tabcontent[i].id == name ) tabcontent[i].style.display = \"block\";\n else tabcontent[i].style.display = \"none\";\n }\n }", "function tabSystem() {\n //define the variables\n const $wrapper = $('.tab-container'),\n $allTabs = $('.tab-inhalt > div'),\n $tabMenu = $('.tab-auswahl li')\n\n //hide tabs-content that are not the first tab\n $allTabs.not(':first-of-type').hide()\n\n //for every tab, assign a data attribute to the li (itterate)\n $tabMenu.each(function(i) {\n $(this).attr('data-tab', 'tab' + i)\n })\n\n //now do the same for the tabs themselves (the content)\n $allTabs.each(function(i) {\n $(this).attr('data-tab', 'tab' + i)\n })\n\n //when we click one of the tabs:\n $tabMenu.on('click', function() {\n const dataTab = $(this).data('tab'),\n $getWrapper = $(this).closest($wrapper)\n\n //we remove the active class of all tabs, add it to the one we clicked\n $getWrapper.find($tabMenu).removeClass('active')\n $(this).addClass('active')\n\n //we hide all the tabs\n $getWrapper.find($allTabs).hide()\n // show the tab which was clicked using the data attribute of the clicked menu\n $getWrapper.find($allTabs).filter(`[data-tab=\"${dataTab}\"]`).show()\n })\n\n }", "function showTab(tabData) {\n $('.tab__title').html(objAjax[tabData - 1].name + '<br/>');\n $('.name-service>span').text(objAjax[tabData - 1].name.toUpperCase());\n $('.tab-body').empty();\n var tr;\n var employees = objAjax[tabData - 1].employees;\n\n for (var i = 0; i < employees.length; ++i) {\n tr = $('<tr/>');\n var employee = employees[i];\n tr.append('<td class=\"employee\">' + employee.employeeName + '</td>');\n tr.append('<td class=\"price\">' + employee.price + '</td>');\n tr.append('<td class=\"price\">' + employee.commonPrice + '</td>');\n $('.tab-body').append(tr);\n }\n\n descriptionTitle = '<h3>' + objAjax[tabData - 1].name + '</h3>';\n description = '<p>' + objAjax[tabData - 1].description + '</p>';\n descriptionPs = '<p>' + objAjax[tabData - 1].descriptionPs + '</p>';\n $('.description-tab').html(descriptionTitle + description + descriptionPs);\n }", "function Tabs() {\n const [toggleState, setToggleState] = useState(1);\n\n const toggleTab = (index) => {\n setToggleState(index);\n };\n\n return (\n <div className=\"container\">\n <div className=\"bloc-tabs\">\n <button className={toggleState === 1 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(1)}>Upload Design</button>\n <button className={toggleState === 2 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(2)}>Manage Design</button>\n <button className={toggleState === 3 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(3)}>Find New Gig</button>\n </div>\n\n <div className=\"content-tabs\">\n <div className={toggleState === 1 ? \"content active-content\" : \"content\"}>\n <UploadDesign />\n </div>\n\n <div className={toggleState === 2 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n\n <div className={toggleState === 3 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n </div>\n </div>\n );\n}", "function SelectionTabs({ isLoading, settings, session }) {\n const selectedTab = useStore(store => store.getState().selectedTab);\n const noteCount = useStore(store => store.noteCount());\n const annotationCount = useStore(store => store.annotationCount());\n const orphanCount = useStore(store => store.orphanCount());\n const isWaitingToAnchorAnnotations = useStore(store =>\n store.isWaitingToAnchorAnnotations()\n );\n // actions\n const store = useStore(store => ({\n clearSelectedAnnotations: store.clearSelectedAnnotations,\n selectTab: store.selectTab,\n }));\n\n const isThemeClean = settings.theme === 'clean';\n\n const selectTab = function(type) {\n store.clearSelectedAnnotations();\n store.selectTab(type);\n };\n\n const showAnnotationsUnavailableMessage =\n selectedTab === uiConstants.TAB_ANNOTATIONS &&\n annotationCount === 0 &&\n !isWaitingToAnchorAnnotations;\n\n const showNotesUnavailableMessage =\n selectedTab === uiConstants.TAB_NOTES && noteCount === 0;\n\n const showSidebarTutorial = sessionUtil.shouldShowSidebarTutorial(\n session.state\n );\n\n return (\n <Fragment>\n <div\n className={classnames('selection-tabs', {\n 'selection-tabs--theme-clean': isThemeClean,\n })}\n >\n <Tab\n count={annotationCount}\n isWaitingToAnchor={isWaitingToAnchorAnnotations}\n selected={selectedTab === uiConstants.TAB_ANNOTATIONS}\n type={uiConstants.TAB_ANNOTATIONS}\n onChangeTab={selectTab}\n >\n Annotations\n </Tab>\n <Tab\n count={noteCount}\n isWaitingToAnchor={isWaitingToAnchorAnnotations}\n selected={selectedTab === uiConstants.TAB_NOTES}\n type={uiConstants.TAB_NOTES}\n onChangeTab={selectTab}\n >\n Page Notes\n </Tab>\n {orphanCount > 0 && (\n <Tab\n count={orphanCount}\n isWaitingToAnchor={isWaitingToAnchorAnnotations}\n selected={selectedTab === uiConstants.TAB_ORPHANS}\n type={uiConstants.TAB_ORPHANS}\n onChangeTab={selectTab}\n >\n Orphans\n </Tab>\n )}\n </div>\n {selectedTab === uiConstants.TAB_NOTES &&\n settings.enableExperimentalNewNoteButton && <NewNoteBtn />}\n {!isLoading && (\n <div className=\"selection-tabs__empty-message\">\n {showNotesUnavailableMessage && (\n <div className=\"annotation-unavailable-message\">\n <p className=\"annotation-unavailable-message__label\">\n There are no page notes in this group.\n {settings.enableExperimentalNewNoteButton &&\n !showSidebarTutorial && (\n <div className=\"annotation-unavailable-message__tutorial\">\n Create one by clicking the{' '}\n <i className=\"help-icon h-icon-note\" /> button.\n </div>\n )}\n </p>\n </div>\n )}\n {showAnnotationsUnavailableMessage && (\n <div className=\"annotation-unavailable-message\">\n <p className=\"annotation-unavailable-message__label\">\n There are no annotations in this group.\n {!showSidebarTutorial && (\n <div className=\"annotation-unavailable-message__tutorial\">\n Create one by selecting some text and clicking the{' '}\n <i className=\"help-icon h-icon-annotate\" /> button.\n </div>\n )}\n </p>\n </div>\n )}\n </div>\n )}\n </Fragment>\n );\n}", "function tabClick (event) {\n let clickedTab = event.target;\n let activePane = get(`#${clickedTab.getAttribute(\"data-tab\")}`);\n\n // remove all active tab classes\n for (let i = 0; i < tabs.length; i++) {\n tabs[i].classList.remove('active');\n }\n\n // remove all active pane classes\n for (var i = 0; i < panes.length; i++) {\n panes[i].classList.remove('active');\n }\n\n // apply active classes on desired tab and pane\n clickedTab.classList.add('active');\n activePane.classList.add('active');\n }", "function selectTab( name ) {\n\n let tabs = document.getElementsByClassName('tabs');\n\n for (let t of tabs ) {\n if( t.name == name ) {\n t.classList.toggle('selected');\n }\n else t.classList.remove('selected');\n }\n\n // Get all elements with class='tabcontent' and hide them\n // showing only the one selected\n let tabcontent = document.getElementsByClassName('tabcontent');\n\n for (let t of tabcontent ) {\n if ( t.id == name ) {\n t.style.display = 'block';\n }\n else t.style.display = 'none';\n }\n\n // Enable main tab contents if hidden\n\n tabs = document.getElementById('tab-contents');\n tabs.style.display = 'block';\n}", "_render({icon, label, href}) {\n return html`\n ${this._renderStyle()}\n <style>\n\n </style>\n <a class=\"mdc-tab mdc-tab--with-icon-and-text\" href=\"${href || '#'}\">\n ${icon ? html`<i class=\"material-icons mdc-tab__icon\" aria-hidden=\"true\">${icon}</i>` : ''}\n <span class=\"mdc-tab__icon-text\">${label}</span>\n </a>`;\n }", "function generateTabNav() {\n let tableContainerNode = document.getElementById(\"tableContainer\");\n let tabNav = document.createElement(\"ul\");\n\n tabNav.id = \"containerTabs\";\n tabNav.classList.add(\"tab\");\n page.whiteList.cookieWhiteList.forEach(function(value, key, map) {\n //Creates the tabbed navigation above the table\n let tab = document.createElement(\"li\");\n let aTag = document.createElement(\"a\");\n aTag.textContent = page.cache.getNameFromCookieID(key);\n aTag.classList.add(\"tablinks\");\n aTag.classList.add(key);\n aTag.addEventListener(\"click\", function(event) {\n openTab(event, key);\n });\n tab.appendChild(aTag);\n tabNav.appendChild(tab);\n\n\n });\n\n tableContainerNode.parentNode.insertBefore(tabNav, tableContainerNode);\n \n}", "function Tab(config={}) {\n let tab = document.createElement('div');\n tab.className = 'tab';\n tab.setAttribute('flex', '0');\n tab.setAttribute('align', 'center');\n\n let throbber = document.createElement('div');\n throbber.className = 'throbber';\n\n let favicon = document.createElement('img');\n favicon.className = 'favicon';\n\n let title = document.createElement('div');\n title.className = 'title';\n\n let button = document.createElement('button');\n button.className = 'close-button';\n button.title = 'Close Tab';\n\n button.onmouseup = (event) => {\n if (event.button == 0) {\n event.stopPropagation();\n Tabs.method('remove', config.uuid);\n }\n };\n\n tab.onmousedown = (event) => {\n if (event.button == 0) {\n Tabs.method('select', config.uuid);\n }\n };\n\n tab.onmouseup = (event) => {\n if (event.button == 1) {\n event.stopPropagation();\n Tabs.method('remove', config.uuid);\n }\n }\n\n tab.appendChild(throbber);\n tab.appendChild(favicon);\n tab.appendChild(title);\n tab.appendChild(button);\n\n this.config = config;\n this.dom = tab;\n\n tabscontainer.appendChild(this.dom);\n this.updateDom();\n }", "function selectTab(group, index)\n{\n let tabContents = group.getElementsByClassName('tabs-content');\n for (let i = 0, count = tabContents.length; i < count; i++)\n {\n let content = tabContents[i];\n if (i == index)\n {\n content.classList.remove('hidden');\n }\n else\n {\n content.classList.add('hidden');\n }\n }\n let titles = group.getElementsByClassName('tabs-title');\n for (let i = 0, count = titles.length; i < count; i++)\n {\n let content = titles[i];\n if (i == index)\n {\n content.classList.add('selected');\n }\n else\n {\n content.classList.remove('selected');\n }\n if (!content.classList.contains('inited'))\n {\n let pos = i;\n content.onclick = () =>\n {\n selectAllTabs(pos, true);\n };\n content.classList.add('inited');\n }\n }\n}", "@readOnly\n @computed('tabs.[]')\n _tabs (tabs) {\n if (isEmpty(tabs) || typeOf(tabs[0]) === 'object' || typeOf(tabs[0]) === 'instance') {\n const isMissingProperties = tabs.some(({id, label}) => {\n return !id || !label\n })\n\n if (isMissingProperties) {\n Logger.error('frost-detail-tabs: Objects provided to the tabs property must include an id and label')\n }\n\n return tabs.filter(({id}) => {\n // Strip the 'More' tab out of the set of scrollable tabs\n return id !== 'more'\n })\n }\n\n // Map tab strings to an {id, label} hash\n return tabs.map(label => {\n return {\n id: label,\n label\n }\n }).filter(({id}) => {\n // Strip the 'More' tab out of the set of scrollable tabs\n return id !== 'more'\n })\n }", "function App() {\n return (\n <div className=\"App\">\n <Tabs></Tabs>\n </div>\n );\n}", "function openTab() {\n tabName = createNewTab();\n createContent(tabName);\n var tab = {id: tabName}\n tabs.push(tab);\n\n // Simular o evento do click clicando na nova aba aberta\n document.querySelectorAll(\"[href='#\" + tabName + \"']\")[0].click();\n}", "function selectTab(tab) {\n $('#tabs').children().removeClass('selected');\n tab.addClass('selected');\n let contentId = '#' + tab.attr('id') + '-content';\n $('#tabs').children().each(function () {\n let ccid = '#' + $(this).attr('id') + '-content';\n if (ccid != contentId) {\n $(ccid).hide();\n }\n });\n $(contentId).show();\n}", "getTabs() {\n let tabList = []\n for (const tabLabel of Object.values(this.props.tabs)) {\n tabList.push(<Tab key={tabLabel} title={tabLabel} tabs={this.props.tabs} updateTabs={() => this.props.updateTabs(this.props.keywordsToSearch)}> </Tab>)\n }\n return tabList\n }", "function openTab(tab, success, table){\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n successcontent = document.getElementsByClassName(\"successcontent\");\n tablecontent = document.getElementsByClassName(\"tablecontent\");\n\n for (var i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n for (var i = 0; i < successcontent.length; i++) {\n successcontent[i].style.display = \"none\";\n }\n\n for (var i = 0; i < tablecontent.length; i++) {\n tablecontent[i].style.display = \"none\";\n }\n \n tab.style.display = \"block\";\n success.style.display = \"flex\";\n table.style.display = \"table\";\n }", "function fillTabPaneWithContent(city, tabPane) {\n if(!city.data && tabPane.childNodes.length === 0){\n city.fetchData().then((response) => {\n city.data = response.data;\n console.log(tabPane);\n tabPane.innerHTML = tabPaneContentTemplate(city);\n }).catch((error) => {\n console.log(error,city.id);\n toastr.error(`Sorry, We could not find data for ${city.name}.`);\n removeInvalidCity(city, tabPane);\n })\n }\n}", "function setupTabs(){\n const content = document.getElementById('content');\n buttons = Array.from(content.getElementsByTagName('button'));\n\n buttons.forEach(button => {\n button.addEventListener(\"click\", changeTab);\n });\n\n loadHome();\n buttons[0].classList.add('button-active');\n}", "function ColorsDesign() {\n return (\n <div className=\"content\">\n <h1>\n Colors\n </h1>\n <br/>\n <Tabs className=\"tab-content\">\n <TabList>\n <Tab>Colors Explaination</Tab>\n <Tab>Colors</Tab>\n </TabList>\n <TabPanel>\n <div>\n <img className=\"headings-text\" src={colorsExlainationImage} alt=\"Colors Explaination\"/>\n </div>\n </TabPanel>\n <TabPanel>\n <div>\n <img className=\"headings-text\" src={colorsImage} alt=\"Colors\"/>\n </div>\n </TabPanel>\n \n \n </Tabs>\n \n </div>\n )\n}", "renderProjs() {\n return (\n <div className=\"projs\">\n <PageHeader>All Projects</PageHeader>\n <Tabs defaultActiveKey={1} id=\"projtab\" >\n <Tab eventKey={1} title=\"All Projects\">\n <ListGroup>\n {this.renderProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={2} title=\"Completed Projects\">\n <ListGroup>\n {this.renderCompProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={3} title=\"Active Projects\">\n <ListGroup>\n {this.renderActiveProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={4} title=\"Pending Projects\">\n <ListGroup>\n {this.renderPendingProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n </Tabs>\n </div>\n );\n }", "AccessTab(tab) {\n cy.xpath(infoElmts.tabName(tab)).click()\n }", "function TabPanel(props) {\n const { children, value, index, ...other } = props;\n\n return (\n <Typography\n component=\"div\"\n role=\"tabpanel\"\n hidden={value !== index}\n id={`full-width-tabpanel-${index}`}\n {...other}\n >\n {value === index && <Box p={3}>{children}</Box>}\n </Typography>\n );\n}", "function tab(tab) {\n\tif ($.inArray(tab, availableTabs) == -1) {\n\t\tconsole.log(\"invalid tab. Please update your available tabs\");\n\t} else {\n\t\tvar arrayLength = availableTabs.length;\n\t\tfor (var i = 0; i < arrayLength; i++) {\n\t\t\t//maybe have problems where tab doesn't exist\n\t\t $(\"#\"+availableTabs[i] + 'Content').hide(); \n\t\t $(\"#\"+availableTabs[i] + 'Content').css({'class': ''});\n\t\t $(\"#\"+availableTabs[i]).css({'background': 'rgb(0, 45, 60)'});\n\t\t}\n\t\t$(\"#\" + tab + 'Content').show();\n\t\t$(\"#\" + tab + 'Content').css({'class': 'active'});\n\t\tactiveTab = tab;\n\t\t$(\"#\" + tab).css({'background': 'rgb(67, 153, 152)'});\n\t\tif ($.inArray(tab, loadedTabs) == -1) {\n\t\t\tloadTab(activeTab);\n\t\t}\n\t\tif (window.mobilecheck()) {\n\t\t\tlayoutMobileMasonry(activeTab + 'Grid');\n\t\t} else {\n\t\t\tlayoutMasonry(activeTab + 'Grid');\n\t\t}\n\t}\n}", "function openTab(evt, tabName) {\n let i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout.content_.querySelector('#' + href);\n layout.resetTabState_(tabs);\n layout.resetPanelState_(panels);\n tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n }", "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout.content_.querySelector('#' + href);\n layout.resetTabState_(tabs);\n layout.resetPanelState_(panels);\n tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n }", "function renderHome(){\n \n const content = document.getElementById('tab-content');\n content.classList.add('flex-lay');\n content.classList.remove('grid-lay');\n \n content.textContent = '';\n \n const aboutSection = createAboutSection();\n \n setBtnActive('home');\n \n content.appendChild(aboutSection);\n}", "function tabCreator(obj){\n let tabHolder = document.createElement('div');\n tabHolder.classList.add('tab');\n tabHolder.textContent = obj;\n let tabMainHolder = document.querySelector('.topics');\n tabMainHolder.appendChild(tabHolder);\n return tabMainHolder;\n}", "function TabbedPanel(props) {\n const { sections, currentSection } = props;\n\n const [tab, setTab] = React.useState(0);\n const handleChange = (evt, newTab) => {\n setTab(newTab);\n };\n\n if (sections && sections[currentSection]) {\n return (\n <div style={styling.tabbedPanels}>\n <AppBar\n position=\"static\"\n style={{\n backgroundColor: ProfileBackgroundColor,\n borderBottomRightRadius: \"20px\"\n }}\n >\n <Tabs value={tab} onChange={handleChange} aria-label=\"subtabs\">\n {getPanelTabs(sections, currentSection, SUBTAB_STR)}\n </Tabs>\n </AppBar>\n {getPanelStack(sections, currentSection, SUBTAB_STR, tab)}\n </div>\n );\n } else {\n return null;\n }\n}", "function switchToTab(value){\n /*Header Stuff*/\n //make sure that none of the tabs have a \"selected\" class\n //This will hide all the panel tabs.\n var listOfAllTabs = document.querySelectorAll(`.panel-section-tabs-button`);\n for (var i = 0; i < listOfAllTabs.length; i++){\n listOfAllTabs[i].classList.remove(`selected`);\n }\n \n //Adjust the classList of the desired Tab\n //By adding a \"selected\" class, we adjust the CSS so that only that tab is highlighted.\n var desiredTab = document.querySelector(`.panel-section-tabs-button[value=\"${value}\"]`);\n desiredTab.classList.add(`selected`);\n \n /*Content Stuff*/\n //hide everything that has a class of tabContent\n var listOfAllTabContents = document.querySelectorAll(`.tabContent`);\n for (var j = 0; j < listOfAllTabs.length; j++){\n listOfAllTabContents[j].classList.add(`hidden`);\n }\n \n //show the right tabContent with the ID of value\n var desiredTabContent = document.querySelector(`.tabContent#${value}`); \n desiredTabContent.classList.remove(`hidden`);\n}", "function tabClick (event) {\n let clickedTab = event.target;\n let activePane = get(`#${clickedTab.getAttribute(\"data-tab\")}`);\n\n // remove all active tab classes\n for (let i = 0; i < tabs.length; i++) {\n tabs[i].classList.remove('active');\n }\n\n // remove all active pane classes\n for (var i = 0; i < panes.length; i++) {\n panes[i].classList.remove('active');\n }\n\n // apply active classes on desired tab and pane\n clickedTab.classList.add('active');\n activePane.classList.add('active');\n }", "function openTab(evt, tabName) {\r\n let i, tabcontent, tablinks;\r\n tabcontent = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n tablinks = document.getElementsByClassName(\"tablinks\");\r\n for (i = 0; i < tablinks.length; i++) {\r\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\r\n }\r\n document.getElementById(tabName).style.display = \"block\";\r\n evt.currentTarget.className += \" active\";\r\n}", "static get properties() {\n return {\n /**\n * the unique identifier and anchor for the tab\n */\n id: {\n name: \"id\",\n type: String,\n value: null,\n observer: \"_tabChanged\"\n },\n /**\n * optional flag the tab, eg. `new`, `alert`, or `error`\n */\n flag: {\n name: \"flag\",\n type: String,\n value: null,\n observer: \"_tabChanged\",\n reflectToAttribute: true\n },\n /**\n * optional flag icon the tab, eg. `av:fiber-new`, `icons:warning`, or `icons:error`\n */\n flagIcon: {\n name: \"flagIcon\",\n type: String,\n value: null,\n observer: \"_tabChanged\"\n },\n /**\n * icon for this tab, eg. `maps:local-airport`, `maps:local-bar`, or `notification:wifi`\n */\n icon: {\n name: \"id\",\n type: String,\n value: null,\n observer: \"_tabChanged\"\n },\n /**\n * label for the tab\n */\n label: {\n name: \"label\",\n type: String,\n value: null,\n observer: \"_tabChanged\"\n },\n /**\n * whether the tab is hidden\n */\n hidden: {\n name: \"hidden\",\n type: Boolean,\n value: false,\n reflectToAttribute: true\n },\n /**\n * the anchor back to the top of the tab list (`a11y-tabs` id)\n */\n __toTop: {\n name: \"__toTop\",\n type: String,\n value: null\n },\n /**\n * tab x of y text, eg. `2 of 3`\n */\n __xOfY: {\n name: \"__xOfY\",\n type: String,\n value: null\n }\n };\n }", "get tabHeaders() {\n this.tabRefs = [];\n const tabTitles = this.children.map((child, index) => {\n const ref = `${child.props.tabId}-tab`;\n this.tabRefs.push(ref);\n const tabValidationValues = this.getTabValidationValues(child);\n const { tabHasError, tabHasWarning } = tabValidationValues;\n return (\n <TabTitle\n position={ this.props.position }\n className={ child.props.className || '' }\n dataTabId={ child.props.tabId }\n id={ ref }\n key={ child.props.tabId }\n onClick={ this.handleTabClick }\n onKeyDown={ this.handleKeyDown(index) }\n ref={ (node) => {\n this[ref] = node;\n } }\n tabIndex={ this.isTabSelected(child.props.tabId) ? '0' : '-1' }\n title={ child.props.title }\n isTabSelected={ this.isTabSelected(child.props.tabId) }\n tabHasError={ tabHasError }\n tabHasWarning={ tabHasWarning }\n />\n );\n });\n\n return (\n <TabsHeader\n align={ this.props.align } position={ this.props.position }\n role='tablist'\n >\n {tabTitles}\n </TabsHeader>\n );\n }", "function createAnnotationTabPages() {\n\n // Create a new cell for the tab page\n //var table_row = document\n // .getElementById(\"symbol_table\")\n // .getElementsByTagName(\"tbody\")[0]\n // .getElementsByTagName(\"tr\")[0];\n\n //var cell = document.createElement(\"td\");\n //cell.setAttribute(\"id\", \"tabpage_cell\");\n //table_row.insertBefore(cell, table_row.children[0]);\n\n // Create div elements for the tab page\n //var annotationsDiv = document.createElement(\"div\");\n //annotationsDiv.setAttribute(\"id\", \"annotationsTabDiv\");\n var annotationsDiv = document.getElementById(\"annotationsTabDiv\");\n \n //cell.appendChild(annotationsDiv);\n\n\n require([\"dijit/layout/TabContainer\", \"dijit/layout/ContentPane\", \"dojo/domReady!\"], function (TabContainer, ContentPane) {\n\n var tabContainerHeight = 270;\n\n var tc = new TabContainer({\n id: \"annotationsTabContainer\",\n style: \"height: \" + tabContainerHeight + \"px; width: 290px;\"\n }, \"annotationsTabDiv\");\n\n var breakoutDayList = document.createElement(\"ul\");\n breakoutDayList.setAttribute(\"id\", \"tabpane_breakoutday_list\");\n var cp1 = new ContentPane({\n id: \"breakoutDayTabContentPane\",\n title: \"Breakout Day\",\n content: breakoutDayList,\n startup: updateAnnotationsTabs,\n //style: \"height: 100%; width: 100%;\"\n });\n tc.addChild(cp1);\n\n var symbolList = document.createElement(\"ul\");\n symbolList.setAttribute(\"id\", \"tabpane_symbol_list\");\n var cp2 = new ContentPane({\n id: \"symbolsTabContentPane\",\n title: \"Symbols\",\n content: symbolList\n });\n tc.addChild(cp2);\n\n var annotationList = document.createElement(\"ul\");\n annotationList.setAttribute(\"id\", \"tabpane_annotation_list\");\n var cp3 = new ContentPane({\n id: \"annotationsTabContentPane\",\n title: \"Annotations\",\n content: annotationList\n });\n tc.addChild(cp3);\n\n tc.startup();\n\n // Center the tab container vertically\n var annotationsTabDiv = document.getElementById(\"annotationsTabContentDiv\");\n var marginTop = \"-\" + (tabContainerHeight / 2) + \"px\";\n annotationsTabDiv.style['marginTop'] = marginTop;\n\n\n hasTabPage = true;\n });\n}", "function TabContainer(props) {\n return <Typography component=\"div\">{props.children}</Typography>;\n}", "function Tab({\n children,\n count,\n isWaitingToAnchor,\n onChangeTab,\n selected,\n type,\n}) {\n return (\n <a\n className={classnames('selection-tabs__type', {\n 'is-selected': selected,\n })}\n onMouseDown={onChangeTab.bind(this, type)}\n onTouchStart={onChangeTab.bind(this, type)}\n >\n {children}\n {count > 0 && !isWaitingToAnchor && (\n <span className=\"selection-tabs__count\"> {count}</span>\n )}\n </a>\n );\n}", "function Tabs_Tabs_Tabs(_ref) {\n var items = _ref.items,\n activeTab = _ref.activeTab,\n dirtyTabs = _ref.dirtyTabs,\n onSelect = _ref.onSelect,\n styledProps = Tabs_objectWithoutProperties(_ref, [\"items\", \"activeTab\", \"dirtyTabs\", \"onSelect\"]);\n\n var $items = items.map(function (i, index) {\n var name = i.name;\n return /*#__PURE__*/react_default.a.createElement(Tabs_Tabs_TabItem, {\n name: name,\n key: index,\n dirty: dirtyTabs[index],\n active: index === activeTab,\n onClick: function onClick() {\n return onSelect(index);\n }\n });\n });\n return /*#__PURE__*/react_default.a.createElement(Tabs_StyledTab, Tabs_extends({\n bg: \"primary.dark\",\n typography: \"h5\",\n color: \"text.secondary\",\n bold: true,\n children: $items\n }, styledProps));\n}", "showTabContent(tabIndex) {\n\t\tlet scrollToEl;\n\n\t\tswitch(tabIndex) {\n\t\t\tcase 0:\n\t\t\t\tscrollToEl = document.getElementById(\"items\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tscrollToEl = document.getElementById(\"classes\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tscrollToEl = document.getElementById(\"champions\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tscrollToEl = document.getElementById(\"items\");\n\t\t}\n\n\t\tlet boundingBox = scrollToEl.getBoundingClientRect();\n\t\twindow.scrollTo(0, window.scrollY + boundingBox.y);\n\t}", "function TabPanel(props) {\n const { children, value, index, ...other } = props;\n\n return (\n <Typography\n component=\"div\"\n role=\"tabpanel\"\n hidden={value !== index}\n id={`full-width-tabpanel-${index}`}\n aria-labelledby={`full-width-tab-${index}`}\n {...other}\n >\n {value === index && <Box p={3}>{children}</Box>}\n </Typography>\n );\n}", "loadTabs() {\n // Remove any tabs that no longer have an associated header.\n this.tabs = this.tabs.filter(t => !!this._tabHeaders.find(tH => tH === t.header));\n this._tabHeaders\n // Filter out the loaded headers with attached tab instances.\n .filter(tH => !this.tabs.find(t => t.header === tH))\n .forEach(tH => {\n const content = this._tabContents.find(tC => tC.id === tH.id);\n if (!content) {\n // Error if an associated tab content cannot be found for the given header.\n throw new Error(\"A [suiTabHeader] must have a related [suiTabContent].\");\n }\n // Create a new tab instance for this header & content combo.\n const tab = new Tab(tH, content);\n // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input.\n tab.header.isActiveExternalChange.subscribe(() => this.onHeaderActiveChanged(tab));\n // Add the new instance to the list of tabs.\n this.tabs.push(tab);\n });\n // Assign each tab an index (which denotes the order they physically appear in).\n this._tabHeaders\n .forEach((tH, i) => {\n const tab = this.tabs.find(t => t.header === tH);\n if (tab) {\n tab.index = i;\n }\n });\n // Sort the tabs by their index.\n this.tabs.sort((a, b) => a.index - b.index);\n if (!this.activeTab) { // Check if there are no current existing active tabs.\n // If so, we must activate the first available tab.\n this.activateFirstTab();\n }\n else if (!this.tabs.find(t => t === this.activeTab)) { // O'wise check if current active tab has been deleted.\n // If so, we must find the closest.\n // Use `setTimeout` as this causes a 'changed after checked' error o'wise.\n setTimeout(() => this.activateClosestTab(this.activeTab));\n }\n if (this.tabs.length === 0) {\n // Error if there aren't any tabs in the tabset.\n throw new Error(\"You cannot have no tabs!\");\n }\n }", "function PublicTabs() {\n const [toggleState, setToggleState] = useState(1);\n\n const toggleTab = (index) => {\n setToggleState(index);\n };\n\n return (\n <div className=\"container\">\n <h3><center>Create Public Event</center></h3>\n <div className=\"bloc-tabs\">\n <button\n className={toggleState === 1 ? \"tabs active-tabs\" : \"tabs\"}\n onClick={() => toggleTab(1)}\n >\n Basic\n </button>\n <button\n className={toggleState === 2 ? \"tabs active-tabs\" : \"tabs\"}\n onClick={() => toggleTab(2)}\n >\n Image\n </button>\n <button\n className={toggleState === 3 ? \"tabs active-tabs\" : \"tabs\"}\n onClick={() => toggleTab(3)}\n >\n Confirm\n </button>\n </div>\n\n <div className=\"content-tabs\">\n <div\n className={toggleState === 1 ? \"content active-content\" : \"content\"}>\n <Box component=\"form\" sx={{'& .MuiTextField-root': { m: 1, width: '24ch' },}}\n noValidate\n autoComplete=\"off\">\n <div>\n <TextField\n required\n id=\"outlined-required\"\n label=\"Event Name\"\n /> \n <TextField\n required\n id=\"outlined-required\"\n label=\"Category\"\n /> \n <TextField\n required\n id=\"outlined-required\"\n type = \"Date\"\n /> \n \n <TextField\n required\n id=\"outlined-required\"\n type = \"Time\"\n /> \n <TextField\n required\n id=\"outlined-required\"\n label=\"Venue\"\n /> \n <TextField\n required\n id=\"outlined-required\"\n label=\"No of participants\"\n min=\"1\" max=\"100\"\n /> \n \n <Stack direction=\"row\" spacing={2}\n style = {{ display : \"flex\",justifyContent: \"center\",\n alignItems: \"center\"}}>\n <Button variant=\"contained\" onClick={() => toggleTab(2)}>Save and proceed</Button>\n \n </Stack>\n\n \n\n </div> \n </Box>\n </div>\n\n <div \n className={toggleState === 2 ? \"content active-content\" : \"content\"}>\n <Box component=\"form\" sx={{'& .MuiTextField-root': { m: 1, width: '24ch' },}}\n noValidate\n autoComplete=\"off\">\n <div>\n <Stack direction=\"row\" alignItems=\"center\" spacing={2}\n style = {{ display : \"flex\",justifyContent: \"center\",\n alignItems: \"center\"}}>\n <label htmlFor=\"contained-button-file\">\n <Input accept=\"image/*\" id=\"contained-button-file\" multiple type=\"file\" />\n <Button variant=\"contained\" component=\"span\">\n Browse\n </Button>\n </label>\n <label htmlFor=\"icon-button-file\">\n <Input accept=\"image/*\" id=\"icon-button-file\" type=\"file\" />\n <IconButton color=\"primary\" aria-label=\"upload picture\" component=\"span\">\n <PhotoCamera />\n </IconButton>\n </label>\n <Button variant=\"contained\" onClick={() => toggleTab(3)}>Save and proceed </Button>\n </Stack>\n \n \n </div> \n\n </Box>\n\n </div>\n\n <div\n className={toggleState === 3 ? \"content active-content\" : \"content\"}>\n <Box component=\"form\" sx={{'& .MuiTextField-root': { m: 1, width: '24ch' },}}\n noValidate\n autoComplete=\"off\">\n <div>\n <TextField\n required\n id=\"outlined-required\"\n label=\"Event Name\"\n //defaultValue=\"Hello World\"\n /> \n\n <TextField\n required\n id=\"outlined-required\"\n label=\"Category\"\n /> \n \n \n </div> \n </Box>\n\n </div>\n\n </div>\n\n </div>\n );\n}", "function tabs(){\n\t\tvar ul = document.createElement(\"ul\");\n\n\t\t//setting materialize's classes to 'ul' tag\n\t\tul.setAttribute(\"class\", \"tabs tabs-transparent\");\n\n\t\t//for each element inside 'clothingItems' do...\n\t\tclothingItems.forEach((item)=>{\n\n\t\t\t//creating 'a' and 'li' tags\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tvar a = document.createElement(\"a\");\n\n\t\t\t//setting 'tab' class(materialize) and \"href\", to 'li' and 'a' elements \n\t\t\tli.setAttribute(\"class\", \"tab\");\n\t\t\ta.setAttribute(\"href\", \"#\"+item.toLowerCase());\n\n\t\t\t//defining which is parent element and which is child element\n\t\t\ta.innerHTML = item;\n\t\t\tli.appendChild(a);\n\t\t\tul.appendChild(li);\n\t\t\tproductTab.appendChild(ul);\n\t\t});\n\t}", "function openTab(e, tabName) {\n // Declare variables\n let i, tabcontent, btnTab;\n // Get all elements with class -tabcontent and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class btnTab and remove class active\n btnTab = document.getElementsByClassName(\"btn-tab\");\n for (i = 0; i < btnTab.length; i++) {\n btnTab[i].className = btnTab[i].className.replace(\" active\", \"\");\n }\n // Show the current tab and add active class to the button that opened tab\n document.getElementById(tabName).style.display = \"block\";\n e.currentTarget.className += \" active\";\n}", "function addTabToPage() {\n\tfor (let index = 0; index < categories.length; index++) {\n\t\tpopulatePrototype(mainNavTabs, categories[index], protoItemLinkTab);\t\n\t}\n}", "render() {\n const { children } = this.props;\n return (\n <div className=\"tabs\">\n {Children.map(children, this._addChildRefs, this)}\n </div>\n );\n }", "function showTabContent(b) {\n if (tabContent[b].classList.contains('hide')) {\n tabContent[b].classList.remove('show');\n tabContent[b].classList.add('show');\n }\n }" ]
[ "0.6424573", "0.638433", "0.6185069", "0.6143935", "0.6136994", "0.6111044", "0.5904215", "0.5894308", "0.5869632", "0.58674836", "0.58598167", "0.5859411", "0.58085215", "0.57447934", "0.5737777", "0.57284594", "0.57153296", "0.5700014", "0.5686242", "0.56757814", "0.56525254", "0.56441927", "0.5643108", "0.56190926", "0.561823", "0.5611202", "0.5603359", "0.560003", "0.55960536", "0.5583019", "0.5574929", "0.55693996", "0.55682814", "0.5558598", "0.5547848", "0.5543478", "0.5540793", "0.5538866", "0.5538495", "0.5499511", "0.54905", "0.54880655", "0.5484417", "0.54823816", "0.5480057", "0.54697335", "0.5462335", "0.54386425", "0.54373354", "0.5436739", "0.54353964", "0.54345435", "0.54323924", "0.54214025", "0.54209685", "0.54166687", "0.5416133", "0.5414114", "0.5408267", "0.539823", "0.5381461", "0.5378369", "0.53780115", "0.53757346", "0.5373622", "0.5371048", "0.53706896", "0.5370213", "0.53688264", "0.53647923", "0.53587973", "0.53546405", "0.53464544", "0.5333773", "0.5324098", "0.53137416", "0.5311141", "0.5309153", "0.5296292", "0.5296292", "0.529522", "0.52930415", "0.52897346", "0.52859634", "0.5273072", "0.5266864", "0.52656317", "0.52569854", "0.5254382", "0.5253003", "0.5250078", "0.5247603", "0.52444786", "0.52436614", "0.5239924", "0.5239221", "0.52378666", "0.52365875", "0.52332366", "0.52329415", "0.5223364" ]
0.0
-1
This function will check if the user has visited the site before, and decides whether or not to toggle the popup
function checkVisits(){ if(localStorage.visits == 1){ //No class will be toggled, the popup will remain invisible to user and screenreader. console.log("User has visited this site before."); }else{ setTimeout(makeVisible, 3000); //Delays the popup for 3 seconds console.log("User has never visited this site before."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function desktopSite() {\n // Uses an element only visable on desktop site\n return $(\"#aboutBack\").is(\":visible\");\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 has_visited() {\n return document.cookie[0] = \"has_visited=true\";\n}", "function isFightPopOpen() {\r\n if (document.getElementById(\"fv2_widget_wrapper\")) {\r\n if (document.getElementById(\"fv2_widget_wrapper\").style.display != \"none\") {\r\n return true\r\n } else {\r\n return false\r\n }\r\n } else {\r\n return false\r\n }\r\n }", "function showOnThisPage(){\n\t\tvar url = window.location.href;\n\t\tvar path = window.location.pathname;\n\t\tif(url.match(/\\.com/i) && path.match(/learn-/i)){ return true; } // US language catalog pages\n\t\treturn false;\n\t}", "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 userIsGuest() {\n $('#header_guest').show();\n $('#header_loggedin').hide();\n mdl_toggleDrawer();\n}", "function isHotnessVote() {\n return location.href.indexOf( \"show=hotness\" ) != -1;\n }", "function isAtCamp() {\r\n\tvar url = window.location.toString().toLowerCase();\r\n\tif(url == 'http://apps.facebook.com/levynlight/' \r\n\t|| url == 'https://apps.facebook.com/levynlight/' \r\n\t|| url == 'http://apps.facebook.com/levynlight/index.php' \r\n\t|| url == 'https://apps.facebook.com/levynlight/index.php' \r\n\t|| url == 'http://apps.facebook.com/levynlight/turn.php' \r\n\t|| url == 'https://apps.facebook.com/levynlight/turn.php'\r\n\t)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "function isInPopUp() {\n try {\n return self === top && !!opener && opener !== self && !!window.name;\n } catch (e) {\n return false;\n }\n}", "function CheckCookie() {\n\t\tvar ie7toggle = cookieVal(\"ie7toggle\");\n\t\tif (ie7toggle == 0) { ie7toggle = 'on'; }\n\t\tif (ie7toggle == \"off\") { ie7_remove();\t}\n}", "makePromptVisible() {\n // Loads popup only if it is disabled.\n if (this.popupStatus === false) {\n $(\"#\" + this.options.popupID).hide().fadeIn(\"slow\");\n this.popupStatus = true;\n }\n }", "function getUserPreferenceCall() {\n var result = featureTourElements.firstTimeUser;\n if (result === \"True\") {\n $(\"#firstTimeLogin\").show();\n } else if (result === \"False\") {\n $(\"#firstTimeLogin\").hide();\n }\n}", "function followopen() {\n $(document.body).toggleClass('follow-on');\n $(document.body).removeClass('share-on');\n}", "isPopupOpen() { return this._windowRef != null; }", "function showPopups () {\n // @TODO enter the key that's stored for determining\n // whether your popup has been seen in this array\n var popupKeys = [\n 'plan-trip-update'\n ];\n localforage.getItem('returningUser', function (err, returningUser) {\n // If the user has used PVTrack before, show them any\n // other popups that they might need to see\n if (returningUser === true) {\n // @TODO Add a function to show your popup here!\n showPlanTripUpdatePopup();\n }\n else {\n // If they're a new user\n $ionicPopup.alert({\n title: 'Welcome to PVTrAck!',\n template: '<p aria-live=\"assertive\">This is My Buses, where your favorite routes and stops live for easy access.<br>Head to Routes and Stops to see where your bus is right now, or visit Schedule to plan your future bus trips!</p>'\n });\n localforage.setItem('returningUser', true);\n // Since this is a new user, we don't want them\n // to start seeing all of the popups for past updates.\n for (var i = 0; i < popupKeys.length; i++) {\n var key = popupKeys[i];\n localforage.setItem(key, true);\n }\n }\n });\n }", "function checkPageLocation() {\n if (window.top.location.href.toUpperCase().indexOf('POPUP.ASPX') == -1 &&\n window.top.location.href.toUpperCase().indexOf('HOME.ASPX') == -1)\n window.top.location.href = getBaseURL() + \"alerts.aspx?se=1\";\n}", "function hasVisited( venue ) {\n if ( World.visited.indexOf( venue.id ) === -1 ) {\n return false;\n }\n PubSub.publish( Actions.SHOW_FEEDBACK, {\n title: \"\", message: Copy.GAME.STATE.visited\n });\n return true;\n}", "static isPopupPage(win) {\r\n let h = win.location.href;\r\n let isPage = (\r\n this.isExtensionUri(h) &&\r\n (h.indexOf(C.PAGE.POPUP) !== -1)\r\n );\r\n\r\n return isPage;\r\n }", "function toggle() {\n if (ready) {\n chrome.extension.getBackgroundPage().toggle();\n window.close();\n }\n}", "function moveOnPopupSwitchOnly() {\n let s = localStorage[\"move_on_popup_switch_only\"];\n return s ? s === 'true' : true;\n}", "function checkInPublishPopup() {\r\n if (xpathFirst('//div[contains(@class,\"aid_' + SCRIPT.appNo +'\")]') &&\r\n /connect\\/uiserver/.test(window.location.href)) {\r\n setGMTime('postTimer', '00:10');\r\n window.setTimeout(handlePublishing, 3000);\r\n return true;\r\n }\r\n return false;\r\n}", "function closeFullPost() {\n if (!document.referrer || window.location == document.referrer) {\n window.location =\n document.getElementById('home_menu').children[0].pathname;\n } else if (window.location.hostname != document.referrer) {\n window.location = document.referrer;\n } else {\n window.location = document.referrer;\n }\n}", "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function check_cookie(){\r\n\tvar web = document.getElementById(\"webpage\");\r\n\tif(navigator.cookieEnabled == false){\r\n\t\t\r\n\t\tweb.style.display = \"none\";\r\n\t document.body.style.background = \"black\";\r\n\t document.body.style.color = \"white\";\r\n\t document.body.innerHTML = \"<h1 align='center' style='font-size:80px;'>Please enabled cookies and try again</h1>\";\r\n\t}\r\n}", "function userIsActive() {\n\t\t\tsettings.userActivityEvents = false;\n\t\t\t$document.off( '.wp-heartbeat-active' );\n\n\t\t\t$('iframe').each( function( i, frame ) {\n\t\t\t\tif ( isLocalFrame( frame ) ) {\n\t\t\t\t\t$( frame.contentWindow ).off( '.wp-heartbeat-active' );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfocused();\n\t\t}", "function userIsLoggedIn() {\n _localStorage('save', 'pihole_success', 1);\n $('#header_guest').hide();\n $('#header_loggedin').show();\n\n $('#logout').click(function (event) {\n event.preventDefault();\n _localStorage('remove', 'pihole_success');\n _localStorage('remove', 'pihole_host');\n _localStorage('remove', 'pihole_token');\n userIsGuest();\n pageAppSettings();\n });\n}", "function ExistingHelpSessionCheck() {\n\n var page = location.pathname.substring(1);\n\n // Little hack to remove the cookie if we're loading the first page\n // would need something better to be more generic\n if ((page == \"index.html\") || (page == PageLocation)) {\n SetCookie(CookieName, \"\", 1);\n return;\n }\n\n var userUID = GetCookie(CookieName);\n if (userUID != null) {\n SetUpSession(userUID);\n }\n}", "function openThanks () {\n if( $.cookie('PopupShown') == 1 && $.cookie('PopupSubscribed') == 1000 ) {\n console.log(\"Opening thanks popup.\");\n if ($(\"#NewsletterThanks\").length !== 0) {\n $.magnificPopup.open({\n items: {\n src: \"#NewsletterThanks\"\n },\n type: 'inline',\n removalDelay: 500,\n callbacks: {\n beforeOpen: function() {\n this.st.mainClass = \"mfp-zoom-in\";\n }\n },\n closeOnBgClick: true\n });\n $.cookie(\"PopupShown\", 2, {expires : 1800 }); \n } else {\n console.log(\"NewsletterThanks did not exist when calling the popup.\");\n } \n }\n}", "function dontShow(){\r\n\t$.fancybox.close(); // optional\r\n\t$.cookie('visited', 'yes', { expires: 365 }); // expiration in 365 days\r\n}", "hasBeenVisited (options) {\n return false\n }", "function Explore() {\n if (Explore_Panel.style.display ==\"none\" && Town_Panel.style.display == \"none\") {\n Explore_Panel.style.display = \"block\";\n Town_Button.style.display =\"none\";\n Explore_Button.innerHTML = \"Back to Town\"\n } else {\n Explore_Panel.style.display = \"none\";\n Town_Button.style.display =\"inline-block\";\n Explore_Button.innerHTML = \"Explore\"\n }\n}", "function exitPopup(){\n\t\t//console.log(\"You have clicked the exit button\");\n\t\tpopwrap.classList.add(\"no-read\");\n\t\tlocalStorage.visits = 1; //After the popup has been closed once, the visit is logged and it should not appear again.\n\t}", "get popupIsOpen() {\n return this.popupHTMLCollection.length > 0;\n }", "function justStarted() {\n var currentUrl = window.location.href.split('/')\n return currentUrl[currentUrl.length - 2] == 'easy'\n}", "function SavedSearchesCheck() {\n if ($.trim($(\"#hdnclass_wrap\").val()).toLowerCase() == \"anonymous\") {\n var _freepopup = \"http://\" + DomainName + \"/commonpopup/FreeRegistrationWithPwd\";\n if ($(\"#hdnallfreepop\").length > 0) { _freepopup = \"http://\" + DomainName + \"/\" + $(\"#hdnallfreepop\").val(); }\n if ($(\"#hdnPaymentMode\").length > 0 && ($(\"#hdnPaymentMode\").val() == \"PaidVersion\")) { top.window.location = _becomememberpage; }\n else { openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, false, true); }\n }\n else { window.location.href = \"http://\" + DomainName + \"/mysavedsearches\"; }\n}", "function checkCookieEnabled(){\r\n\t\tif(navigator.cookieEnabled == false)\r\n\t\t{\r\n\t\t\tvar webpage = document.getElementById(\"webpage\");\r\n\t\t\twebpage.style.display=\"none\";\r\n\t\t\tdocument.body.style.background=\"black\";\r\n\t\t\tdocument.body.innerHTML = \"<h1 align='center' style='font-family:sans-serif;font-size:100px;'>Please enable cookies..</h1>\";\r\n\t\t\tdocument.body.style.color=\"white\";\r\n\t\t}\r\n\t}", "function open_page(URL)\n { \n // check if we have GET param and hod it in url\n if (URL.match('=') != null) {\n \n return !window.open(URL+\"&gm=pop\",'_blank','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=600,screenX=90,screenY=90');\n return false;\n }\n\n // Check if the variable is empty or not\n else if (URL != '')\n { \n return !window.open(URL+'?gm=pop','_blank','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=600,screenX=90,screenY=90');\n return false;\n } \n \n // Else return false and href will take the deal\n else \n {\n return false;\n }\n }", "function showSite() {\n document.getElementById(\"impressum\").style.display = \"none\"\n\n\n document.getElementById(\"search_header\").style.display = \"block\";\n document.getElementById(\"loginStuff\").style.display = \"block\";\n document.getElementById(\"slideShow\").hidden = false;\n\n document.getElementById(\"videooverview\").style.display = \"block\";\n impressumCalled = false;\n}", "function disablePopup() {\r\n //disables popup only if it is enabled\r\n if (popupStatus == 1) {\r\n jQuery(\"#backgroundPopup\").fadeOut(\"slow\");\r\n jQuery(\"#popupContact\").fadeOut(\"slow\");\r\n popupStatus = 0;\r\n\t\t//setCookie('casanovaPopup', 'off', 1);\r\n }\r\n}", "function tourpopup()\n{\t\n\tMM_openBrWindow('/admission/flash/onlinetour_detect.html','flashpopup','width=768,height=500');\n\treturn false;\n\twindow.focus()\n}", "function checkGoTopArraw() {\n if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {\n document.getElementById(\"myBtn\").style.display = \"block\";\n } else {\n document.getElementById(\"myBtn\").style.display = \"none\";\n }\n }", "function checkProfile(){\n if(!loggedIn){\n alert(\"Please login before using Profile!\");\n\t\tdocument.getElementById('myProfile').style.display='none';\n }\n else{\n alert(\"Welcome!\");\n\t\t document.getElementById('myProfile').style.display='block';\n\t\tdocument.getElementById(\"defaultOpen2\").click();\n }\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 checkIfUserInitialized() {\n if (currentuser) {\n loadHomePage();\n } else {\n updateCurrentUser().then(function () {\n loadHomePage();\n }).catch(function () {\n loadSettingsPage();\n });\n }\n}", "function OpenPopover()\n{\n var haveSeen = getCookie(\"haveSeen\");\n if(haveSeen == \"false\") \n {\n var d = new Date();\n d.setTime(d.getTime() + (1*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = \"haveSeen=True;\" + expires;\n ShowPopover(); \n } \n else\n {\n //var d = new Date();\n //d.setTime(d.getTime() + (1*24*60*60*1000));\n //var expires = \"expires=\"+ d.toUTCString();\n //document.cookie = \"haveSeen=True; \" + expires;\n //ShowPopover();\n }\n clearInterval(myInterval);\n}", "verifyPopUp(Visibility) {\n if (Visibility === 'Can See'){\n this.popupContent('true').waitForDisplayed();\n }\n else if (Visibility === 'Cant See'){\n this.popupContent('false').waitForDisplayed();\n }\n }", "openPopUp(){\r\n // Hide the back panel.\r\n const element = document.getElementsByClassName(StylesPane.HideBackPanel)[0]\r\n element.className = StylesPane.BackPanel\r\n // Show the settings panel.\r\n }", "function disablePopup() {\n //disables popup only if it is enabled\n if (popupStatus == 1) {\n popupStatus = 0;\n }\n}", "function hasStarted() {\n return window.location.href.indexOf(\"http://www3.nhk.or.jp/\") > -1; \n}", "function openMyPage(requestDetails){\n\n var url = requestDetails.url;\n console.log(\"Debug: openMyPage: \" + url);\n\n if (url === \"https://testsfocus.com/\"){\n browser.tabs.update({\n \"url\": \"/tests.html\"\n });\n return {\"cancel\": true};\n }\n \n if(shouldBlockSite(url)){\n\n console.log(\"Debug: openMyPage: Blocked site: \" + url);\n\n browser.tabs.update({\n \"url\": \"/focus.html\"\n });\n\n lastBlockedPage = url;\n\n return {\"cancel\": true};\n }\n}", "function shareopen() {\n $(document.body).toggleClass('share-on');\n $(document.body).removeClass('follow-on');\n}", "function WhatPage(){\n if (window.location.href.includes(\"hackforums.net/member.php?action=profile&uid=\")){\n RunOnEveryPage();\n RunOnProfile();\n return;\n }\n if (window.location.href.includes(\"hackforums.net/managegroup.php?gid=\")){\n RunOnEveryPage();\n HighlightUser();\n return;\n }\n else{\n RunOnEveryPage();\n return;\n }\n}", "function handleClick() {\n setShowUserProfile((!showUserProfile))\n }", "function isLoggedIn() {\r\n //return document.querySelector(\"#SingOut1_lnkSignOut\") != null;\r\n //New web page version\r\n return document.querySelector(\".icon-sign-out\") != null;\r\n}", "function myProfil() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function checkAdminCookie() {\n if (Cookies.get('adminID') === undefined) {\n $(\"#jumbotron\").attr('style', 'display:none');\n $(\"#navbar\").attr('style', 'display:none');\n $(\"#btnDiv\").attr('style', 'display:none');\n $(\".container\").attr('style', 'display:none');\n window.location.href = 'login.html';\n }\n}", "function getUserVisit(){\n dataservice.getData(USER_VISIT_API, {}, config).then(function(data, status) {\n if (data) {\n if (data.status) {\n if(data.show_tutorial){\n setTutrorialValue();\n if(appFactory.detectIsMobile()){\n // console.info('mobile detected');\n startIntro('MobileOrTablet');\n }else{\n // console.info('desktop detected');\n startIntro('Desktop');\n }\n\n }\n \n }\n }\n\n }, function() {\n return false;\n });\n }", "function becomeFreeMemberOpenPopup() {\n var _freepopup = \"http://\" + DomainName + \"/commonpopup/FreeRegistrationWithPwd\";\n if ($(\"#hdnallfreepop\").length > 0) { _freepopup = \"http://\" + DomainName + \"/\" + $(\"#hdnallfreepop\").val(); }\n var PaymentVal = readCookieValue(\"NewspaperARCHIVE.com.User.PaymentAttempt\");\n if (PaymentVal != null && PaymentVal.length > 0) {\n var _PaymentCount = readFromString(PaymentVal, \"PaymentCount\");\n if (parseInt(_PaymentCount) > 1) {\n openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, true);\n }\n else {\n if ($(\"#hdnPaymentMode\").length > 0 && ($(\"#hdnPaymentMode\").val() == \"PaidVersion\")) { top.window.location = _becomememberpage; }\n else { openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, true); }\n }\n }\n else {\n if ($(\"#hdnPaymentMode\").length > 0 && ($(\"#hdnPaymentMode\").val() == \"PaidVersion\")) { top.window.location = _becomememberpage; }\n else { openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, true); }\n }\n}", "function ShowPreviousNews() {\n try {\n travelNewsHelper.loadLastState();\n } catch (Error) {\n }\n \n return false;\n}", "function loadPopup() {\r\n //loads popup only if it is disabled\r\n\tclearInterval(aTimer);\r\n jQuery(\"#backgroundPopup\").css({\r\n \"opacity\": \"0.7\"\r\n //\"opacity\": \"0\"\r\n });\r\n jQuery(\"#backgroundPopup\").fadeIn(\"slow\");\r\n jQuery(\"#popupContact\").fadeIn(\"slow\");\r\n popupStatus = 1;\r\n\t\tsetCookie('casanovaPopup', 'on', 1);\r\n}", "isLoginShowing() {\n this.loginLink.waitForDisplayed(3000);\n return this.loginLink.isDisplayed();\n }", "function onPopAndStart(){\n var l = location.href;\n //http://localhost/.../hash\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n // if no pageName set pageName to false\n pageName = pageName || false;\n switchToSection(pageName);\n }", "function inMTurkHITPage() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n}", "function checkCookie() {\n var visitor = getCookie(\"shiling_tracking\");\n if (visitor != \"\") {\n return visitor;\n } else {\n var visitor_id = make_tracking_id();\n if (visitor_id != \"\" && visitor_id != null) {\n setCookie(\"shiling_tracking\", visitor_id, 365);\n return false;\n }\n }\n }", "function displayIsInClientInfo() {\n if (liff.isInClient()) {\n document.getElementById('liffLoginButton').classList.toggle('hidden');\n document.getElementById('liffLogoutButton').classList.toggle('hidden');\n document.getElementById('isInClient').textContent = 'You are opening the app in the in-app browser of LINE.';\n } else {\n //document.getElementById('shareMeTargetPicker').classList.toggle('hidden');\n }\n}", "function checkUserActivity() {\n\t\t\tvar lastActive = settings.userActivity ? time() - settings.userActivity : 0;\n\n\t\t\t// Throttle down when no mouse or keyboard activity for 5 min.\n\t\t\tif ( lastActive > 300000 && settings.hasFocus ) {\n\t\t\t\tblurred();\n\t\t\t}\n\n\t\t\t// Suspend after 10 min. of inactivity when suspending is enabled.\n\t\t\t// Always suspend after 60 min. of inactivity. This will release the post lock, etc.\n\t\t\tif ( ( settings.suspendEnabled && lastActive > 600000 ) || lastActive > 3600000 ) {\n\t\t\t\tsettings.suspend = true;\n\t\t\t}\n\n\t\t\tif ( ! settings.userActivityEvents ) {\n\t\t\t\t$document.on( 'mouseover.wp-heartbeat-active keyup.wp-heartbeat-active touchend.wp-heartbeat-active', function() {\n\t\t\t\t\tuserIsActive();\n\t\t\t\t});\n\n\t\t\t\t$('iframe').each( function( i, frame ) {\n\t\t\t\t\tif ( isLocalFrame( frame ) ) {\n\t\t\t\t\t\t$( frame.contentWindow ).on( 'mouseover.wp-heartbeat-active keyup.wp-heartbeat-active touchend.wp-heartbeat-active', function() {\n\t\t\t\t\t\t\tuserIsActive();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tsettings.userActivityEvents = true;\n\t\t\t}\n\t\t}", "function checkUser(){\n //console.log('check user started');\n cumputerTurn = false;\n if(userClicked == true){\n \n }\n}", "function displayIsInClientInfo() {\n if (liff.isInClient()) {\n document.getElementById('liffLoginButton').classList.toggle('hidden');\n document.getElementById('liffLogoutButton').classList.toggle('hidden');\n }\n}", "function promptUserForBrowser() {\n if (!Cookies.get('viewedIEPrompt')) {\n showWarningModalPrompt(\"This site has been optimized for use in Google Chrome, Mozilla Firefox, and Safari.\"\n + \" For the best browsing experience, we recommend the use of one of the listed browsers.\", function() {\n Cookies.set('viewedIEPrompt', 'true', {expires: 365 * 20});\n });\n }\n}", "async verifyUserLoggedIn() {\n if ((await browser.getCurrentUrl()).includes('inventory')) {\n return true;\n }\n else { return false; }\n }", "function openShark() {\n var win = window.open('sharkvsrubbish', '_self');\n if (win) {\n //Browser has allowed it to be opened\n win.focus();\n } else {\n //Browser has blocked it\n console.log('Please allow popups for this website');\n }\n}", "function setNotificationPopupStatus() {\n if (notificationIsOpen == 0) {\n showNotifications();\n } else {\n hideNotifications();\n }\n}", "function checkSignIn(){\r\n if (getCookie(\"signedin\") == \"true\"){\r\n changeSignIn();\r\n return true;\r\n }\r\n return false;\r\n}", "function myProfil2() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function siteIsSupported() {\n // Check if the site is supported then set top bar\n return !!supportedSites.find(function (s) { return !!location.host.match(s.host); });\n}", "function helpLink() {\n\tif(jQuery('#mwTab-intro:visible').length > 0) {\n\t\tjQuery('#mwTab-intro').hide();\n\t\tjQuery('.help_link_show').show();\n\t\tjQuery('.help_link_hide').hide();\n\n\t\t//set pref to hidden\n\t\tjQuery.get('/?ajax=mWhois&call=setMyWhoisInfoVisible&args[0]=0');\n\t} else {\n\t\tjQuery('#mwTab-intro').show();\n\t\tjQuery('.help_link_hide').show();\n\t\tjQuery('.help_link_show').hide();\n\n\t\t//set pref to visible\n\t\tjQuery.get('/?ajax=mWhois&call=setMyWhoisInfoVisible&args[0]=1');\n\t}\n\n\treturn false;\n}", "function checkCookie() {\n var visitor = getCookie(\"shiling_tracking\");\n if (visitor != \"\") {\n return visitor;\n } else {\n var visitor_id = make_tracking_id();\n if (visitor_id != \"\" && visitor_id != null) {\n setCookie(\"shiling_tracking\", visitor_id, 365);\n return false;\n }\n }\n}", "function forgotPIN() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function checkPopupShown() {\n if ($(\".ui-popup-active\").length > 0) {\n popupID = $(\".ui-popup-active\")[0].children[0].id;\n return true;\n } else {\n popupID = \"\";\n return false;\n }\n}", "function myProfil3() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function displayPopup() {\n membershipPopup.classList.toggle(\"openPopup\");\n }", "function wireframeToggleCookie(){\n\t\t\tif ($.cookie('jn-hud-wireframe-toggle') === \"0\" )\n\t\t\t{\n\t\t\t\t$.cookie('jn-hud-wireframe-toggle', '1');\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$.cookie('jn-hud-wireframe-toggle', '0');\n\t\t\t}\n\t\t}", "function showLogInPopUp() {\n if(domLogIn.innerHTML != \"<strong>Logged in as guest</strong>\"){\n domLogInPopUp.style.visibility = \"visible\"; \n domLogInPopUp.style.opacity = \"1\";\n domLogInPopUp.style.top = \"150px\";\n } else {\n alert(\"You are already logged in\");\n }\n}", "function checkUser() {\n\tif (sessionStorage.getItem(\"userID\") === null) {\n\t\twindow.location.href = \"../../index.html\";\n\t} else {\n\t\tdocument.getElementById(\"signOutDiv\").setAttribute(\"style\", \"display:block;\");\n\t\tdocument.getElementById(\"signUpDiv\").setAttribute(\"style\", \"display:none;\");\n\t}\n}", "function clickTracker() {\n if (firstClick) {\n firstClick = false;\n clickUrl = getUrlParameter(\"click\");\n if (clickUrl == clickTrackerHolder || clickUrl == null) {\n return;\n }\n\n callClickTracker(clickUrl);\n }\n}", "function loadPopup() {\n //loads popup only if it is disabled\n if (popupStatus == 0) {\n\t\t$('#click-popup').trigger('click');\n popupStatus = 1;\n }\n}", "function checkUrl() {\n const address = window.location.href;\n\n if (address.indexOf('?message=') !== -1) {\n if (address.indexOf('not-verified') !== -1) {\n setModalContent('Tài khoản của bạn chưa được kích hoạt');\n }\n else if (address.indexOf('invalid-verified') !== -1) {\n setModalContent('Mã kích hoạt tài khoản không hợp lệ');\n }\n else if (address.indexOf('?message=verified') !== -1) {\n setModalContent('Kích hoạt tài khoản thành công');\n }\n else if (address.indexOf('?message=invalid-forgot-pass') !== -1) {\n setModalContent('Đường dẫn phục hồi tài khoản không hợp lệ');\n }\n setShow(true);\n }\n else if (address.indexOf('?token=') !== -1) {\n var token = address.substr(address.indexOf('?token=') + '?token='.length);\n if (token.indexOf('#nghiatq') !== -1) {\n token = token.substr(0, token.indexOf('#nghiatq'));\n }\n localStorage.setItem('token', token);\n window.location.href = '/';\n }\n }", "function displayIsInClientInfo() {\n if (liff.isInClient()) {\n document.getElementById('liffLoginButton').classList.toggle('hidden');\n document.getElementById('liffLogoutButton').classList.toggle('hidden');\n document.getElementById('isInClientMessage').textContent = 'You are opening the app in the in-app browser of LINE.';\n } else {\n document.getElementById('isInClientMessage').textContent = 'You are opening the app in an external browser.';\n document.getElementById('shareTargetPicker').classList.toggle('hidden');\n }\n}", "function isHighriseCredentialsEntered(){\n var iFrame = document.getElementById(\"onsip-options-iframe\");\n var pageDocument = iFrame.contentDocument;\n\n if( pageDocument.getElementById('onsip.call.setup.highrise.url').value != 0){\n return true;\n }\n if( pageDocument.getElementById('onsip.call.setup.highrise.token').value != 0){\n return true;\n }\n return false;\n}", "function checkDesktop() {\n if ($('#page0').css('display') != 'none') {\n console.log('true');\n return true;\n }\n console.log('false');\n return false;\n}", "function checkDirectLink() {\n\tvar hash = window.location.hash;\n\tif (hash.length > 1) {\n\t\tvar div = document.getElementById(hash.slice(1));\n\t\t\n\t\t$(\"body\").addClass(\"modal-open\"); // add class to help prevent scrolling when overlay is open\n\t\t$(div).find(\".studentInfoOverlay\").addClass(\"isOpen\"); // add isOpen class\n\t}\n}", "function LightenMasterPage() {\n var page_screen = top.window.document.getElementById('page_screen');\n\n if ((document.getElementById('divWindow') == null || document.getElementById('divWindow').style.display == 'none' || document.getElementById('divWindow').style.display == ''))\n page_screen.style.display = 'none';\n}", "_warnYesHandler() {\n navConfirmed = true;\n this.setState({ showModalConfirm: false });\n browserHistory.push(this.state.nextLocation.pathname);\n }", "function loadPopup(){\n\t//loads popup only if it is disabled\n\tif(popupStatus==0){\n\t\t$(\"#backgroundPopup\").css({\n\t\t\t\"opacity\": \"0.7\"\n\t\t});\n\t\t$(\"#backgroundPopup\").fadeIn(\"slow\");\n\t\t$(\"#popupContact\").fadeIn(\"slow\");\n\t\tpopupStatus = 1;\n\t}\n}", "function loadPopup(){\n\t//loads popup only if it is disabled\n\tif(popupStatus==0){\n\t\t$(\"#backgroundPopup\").css({\n\t\t\t\"opacity\": \"0.7\"\n\t\t});\n\t\t$(\"#backgroundPopup\").fadeIn(\"slow\");\n\t\t$(\"#popupContact\").fadeIn(\"slow\");\n\t\tpopupStatus = 1;\n\t}\n}", "function modalisshowing() {\n\n return isshowing;\n\n }", "function isReviewPage() {\n return window.location.href.match(/^(http|https):\\/\\/www.stumbleupon.com\\/url/i);\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 loadPopup()\r\n\t{\r\n\t//loads popup only if it is disabled\r\n\tif(popupStatus==0)\r\n\t\t{\r\n\t\tjQuery(\"#backgroundPopup\").css({\r\n\t\t\t\"opacity\": opac\r\n\t\t});\r\n\t\tjQuery(\"#backgroundPopup\").fadeIn(\"slow\");\r\n\t\tjQuery(\"#popupContact\").fadeIn(\"slow\");\r\n\t\tpopupStatus = 1;\r\n\t\t}\r\n\t}" ]
[ "0.65340424", "0.6345465", "0.6290756", "0.6242805", "0.60805815", "0.6073969", "0.6059425", "0.6028703", "0.5980151", "0.5967161", "0.59525716", "0.59186614", "0.5861938", "0.5853165", "0.58449024", "0.58416235", "0.5837869", "0.5833222", "0.5831223", "0.5830909", "0.58261955", "0.58061355", "0.5788903", "0.5787602", "0.57617944", "0.5754591", "0.5751628", "0.5745192", "0.5736798", "0.5728427", "0.57106483", "0.56993663", "0.56908077", "0.5686978", "0.5682606", "0.5675885", "0.5666675", "0.5665693", "0.56592387", "0.5655283", "0.5646285", "0.56338733", "0.56303024", "0.56289345", "0.56118333", "0.55943215", "0.55934244", "0.55858296", "0.5576161", "0.55760247", "0.5569434", "0.556433", "0.5560441", "0.55599916", "0.55387264", "0.55303806", "0.5527288", "0.5526901", "0.5523949", "0.5522309", "0.5520075", "0.5518791", "0.5515514", "0.55124766", "0.5503816", "0.55033463", "0.54994637", "0.5496661", "0.5495733", "0.5495144", "0.54917043", "0.5488779", "0.5481423", "0.5480246", "0.5470582", "0.5460052", "0.5455369", "0.545092", "0.54490453", "0.5445962", "0.54443747", "0.5439398", "0.54373395", "0.5432152", "0.5429612", "0.5428388", "0.5417166", "0.5413649", "0.5410366", "0.5407165", "0.54069495", "0.5403152", "0.53970206", "0.5390833", "0.53838724", "0.53838724", "0.53828835", "0.5378821", "0.537861", "0.5372759" ]
0.77089685
0
This will make the popup visible after 3 seconds
function makeVisible(){ popwrap.classList.remove("no-read"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showWithDelay() {\n\t\t\t\t\t\t\t\t\tif (scope.tt_popupDelay) {\n\t\t\t\t\t\t\t\t\t\tpopupTimeout = $timeout(show, scope.tt_popupDelay);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tscope.$apply(show);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}", "function myHidePopup(delay) {\n popupTimeout = setTimeout(function() {vispopup.style.visibility = 'hidden';}, delay);\n }", "function showPopup() {\n\tif(visible) return;\n\n\t//Do a fadein over 1000 milliseconds and set the visible variable to true\n\t$(\"div.popup\").fadeIn(1000);\n\tvisible = true;\n}", "function showModal() {\n setTimeout(() => {\n modal.style.display = \"block\";\n }, 10000);\n}", "function delayShow() {\n if (isManual.value || props.disabled)\n return;\n // renders out the teleport element root.\n showTeleport();\n registerTimeout(show, props.showAfter);\n }", "function show_popup() {\n\tdocument.getElementById(\"popup\").style.display=\"block\";\n}", "function myLocationCurtain(){\n locationCurtainDiv = $('<div id=\"intCurtain\"><div class=\"loader\"></div></div>');\n console.log(\"modal fire is working\");\n $(\"#intContainer\").html(locationCurtainDiv);\n $(\"#intCurtain\").show();\n setTimeout(function(){\n $(\"#intCurtain\").hide();\n }, 3000);\n }", "function showBox(){\r\n //Wait 10 seconds before showing message && hasn't been closed before\r\n if(document.cookie === \"false\")\r\n {\r\n setTimeout( function () {\r\n document.getElementsByClassName('FloatingBox')[0].style.display='block';\r\n }, 10000); //10 seconds\r\n }\r\n}", "function popup(selector) {\n $(\".fixed-overlay\").fadeIn(500)\n $(selector).delay(250).show(300)\n}", "function newsSubscribe(){\n document.getElementById(\"subscribe\").style.display = \"block\";\n setTimeout(function(){\n document.getElementById(\"subscribe\").style.display = \"none\";\n }, 3000);\n}", "function openPopUp() {\n\tdocument.getElementById(\"playTime\").style.display=\"block\";\n\tdocument.getElementById(\"yesno\").style.display=\"none\";\n}", "function successPopup(message) {\n $(\"#success\").text(message);\n $(\"#success\").show().delay(3000).hide(1);\n}", "function gameCreatedPop(){\r\n\t\t$(\"#popUp1\").html(\"<h2>Info</h2><p style='color:blue; text-align: center;'><b>New Game Has Been Created</b></p>\"+\r\n\t\t'<a href=\"#\" data-rel=\"back\" class=\"ui-btn ui-btn-right ui-btn-inline ui-icon-delete ui-btn-icon-notext ui-btn-a\"></a>').popup(\"open\"); \r\n\t\tsetTimeout(function(){ $(\"#popUp1\").popup(\"close\"); }, 5000);\r\n\t}", "function winAlert(){\n\t\tvar x = document.getElementById(\"winAlert\");\n\t\tx.style.visibility = \"visible\";\n\t\tsetTimeout(function(){x.style.visibility = \"hidden\";},2000);\t\n\t\n\t}//END winAlert()", "function displayPopupTimeout(cart){\n\tif (mouse_over){\n\t\treturn false;\n\t}else{\n\t\t//start 8sec Timeout\n\t\tclearTimeout( timer_8sec );\n\t\tclearTimeout( timer_3sec );\n\t\ti++;\n\n\t\tif(!started_wait_3sec){\n\t\t\ttimer_3sec = window.setTimeout(\"set_waited(3)\",3000);\n\t\t\tstarted_wait_3sec = true;\n\t\t}\n\t}\n}", "function popup() {\n\theading.style.cssText = 'opacity: 0.2';\n\tscorePanel.style.cssText = 'opacity: 0.2';\n\tdeck.style.cssText = 'opacity: 0.2';\n\tcopyright.style.cssText = 'opacity: 0.2';\n\tcMessage.style.cssText = 'display: block';\n\trestartButton.classList.add('disable');\n\tcopyright.classList.add('disable');\n\tcMoves.textContent = moves.textContent;\n\tcMin.textContent = minutes.textContent;\n\tcSec.textContent = seconds.textContent;\n}", "function start_popup_delay() {\n\t\tget_or_set_popup_delay(localStorage.getItem('wkof.Progress.popup_delay'), true /* silent */);\n\t\tif (!show_popup) return;\n\t\tpopup_delay_started = true;\n\t\tpopup_timer = setTimeout(function() {\n\t\t\tpopup_delay_expired = true;\n\t\t\tupdate_progress();\n\t\t}, popup_delay);\n\t}", "function showCreateProject() {\n domCreateProjectPopUp.style.visibility = \"visible\";\n domCreateProjectPopUp.style.opacity = \"1\";\n domCreateProjectPopUp.style.top = \"150px\";\n}", "function wePopup()\n{\n modal.style.display = \"block\";\n pagecontent.className += \" de-emphasized\";\n}", "function congratsPopup() {\n stopTimer();\n\n popup.style.visibility = 'visible'; //popup will display with game details//\n //display moves taken on the popup//\n document.getElementById(\"totalMoves\").innerHTML = moves;\n //display the time taken on the popup//\n finishTime = timer.innerHTML;\n document.getElementById(\"totalTime\").innerHTML = finishTime;\n //display the star rating on the popup//\n document.getElementById(\"starRating\").innerHTML = stars;\n console.log(\"Modal should show\"); //testing comment for console//\n }", "function popUp1() {\n /*var popup = document.getElementById(\"popup_slide\");\n popup.style.display = \"block\";*/\n}", "function showPopup() {\n\t\thtml = '<div class=\"etheme-popup-overlay\"></div><div class=\"etheme-popup\"><div class=\"etheme-popup-content\"></div></div>';\n\t\tjQuery('body').prepend(html);\n\t\tpopupOverlay = jQuery('.etheme-popup-overlay');\n\t\tpopupWindow = jQuery('.etheme-popup');\n\t\tpopupOverlay.one('click', function() {\n\t\t\t\thidePopup(popupOverlay, popupWindow);\n\t\t});\n}", "function popup(inAnim, outAnim, animTime, duration, message) {\r\n if (message != undefined) {\r\n pop.innerHTML = message;\r\n }\r\n\r\n pop.classList.add(\"show\", inAnim);\r\n setTimeout(function() { \r\n pop.classList.add(outAnim);\r\n setTimeout(function() {\r\n pop.classList.remove(\"show\", inAnim, outAnim);\r\n pop.innerHTML = \"\";\r\n }, animTime);\r\n }, animTime + duration);\r\n }", "function popup() {\n alertify.set('notifier', 'position', 'bottom-left');\n alertify.success('click the arrow button for the project').delay(3);\n // setTimeout(function () {\n // alertify.success('use scroll or spacebar for a new project');\n // }, 2000);\n // alertify.message('test')\n }", "function abrirPop(){\n document.getElementById(\"popup\").style.display = \"block\";\n}", "function abrirPop(){\n document.getElementById(\"popup\").style.display = \"block\";\n}", "function openFancy(){ \r\n\tsetTimeout( function() {$('#autoStart').trigger('click'); }, 1000); // [200000] = show after 20 seconds\r\n}", "function openFancy(){ \r\n\tsetTimeout( function() {$('#autoStart').trigger('click'); }, 1000); // [200000] = show after 20 seconds\r\n}", "function showJordi(){\n var jordi = document.getElementById(\"jordi\");\n jordi.style.opacity = 1;\n setTimeout(function(){\n jordi.style.opacity = 0;\n }, 700);\n }", "function popup() {\r\n$(\".pesolight\").css(\"display\", \"block\");\r\n}", "show() {\n css(document.body, {\n opacity: 1,\n animation: 'none'\n });\n this.isShow = true;\n this._showTiming = Date.now();\n this.trigger('show', this._showTiming);\n }", "function showPopupOnPpr()\n{\n //8824028 -bmetikal\n if(divid != null){\n removeAndSetPopupDiv();\n }\n \n if(popupDiv != null && popupDiv.style.display != '' && !isParameterizedPopup)\n displayPopup();\n}", "function showNotification() {\n notification.classList.add('show');\n setTimeout( () => {notification.classList.remove('show');}, 3000);\n}", "function popOpen () {\nsetTimeout(function() {//지정시간 뒤 내용을 실행. display:none이면 css자체도 적용을 안시키는 거 같다..(무시)\n\t$(\".popup-bg\").css(\"display\",\"flex\"); //두가지를 같이 진행시키면 위에거가 시작할때 같이 시작되면서 결과에 translate가 안먹힌다.\n\tsetTimeout(function() {//그래서 setTimeout을 두번돌려서 위에 작업 후에 진행이 된다.\n\t\t$(\".popup-wrap\").css({\"opacity\": 1, \"transform\":\"translateY(0)\"});\n\t},100);\n}, 500);\n}", "function show(mode) {\n\tobj = document.getElementById('popup-wrapper');\n\tif(mode)\n\t\tobj.style.visibility = 'visible';\n\telse\n\t\tobj.style.visibility = 'hidden'; \n}", "function showPopup($elm) {\n\n\t\tvar offset = $elm.offset();\n\n\t\t$popup.css({\n\t\t\t//top: offset.top + $elm.outerHeight(),\n\t\t\ttop: offset.top,\n\t\t\tleft: offset.left\n\t\t});\n\n\t\t$popupContent.html(templateLoading());\n\n\t\t$popup.addClass(\"is-visible\");\n\n\t}", "function showEvent() {\n document.getElementById(\"popup\").style.display = \"block\";\n}", "function div_show() {\ndocument.getElementById('popupContact').style.display = \"block\";\ndocument.getElementById(\"background\").style.opacity = \"0.1\";\n}", "function launchModal(delay) {\n var timer;\n var $modal = $('#join-newsletter-modal');\n\n if ($('.show-modal').length) {\n timer = setTimeout(function(){\n $modal.foundation('reveal', 'open');\n }, delay);\n }\n}", "function showModal() {\n\t\ttimer.className = 'modalTimer' ;\n\t\tmodal.className = 'modal-visible' ;\n\t}", "function newsTimeAppear(){\n if (newsHidden){\n setTimeout(newsDisplayTrue, 5000);\n newsHidden = false;\n } \n}", "function delay(objt,visible,time) {\n\tsetTimeout(function(){\n\t\tdocument.getElementById(objt).style.visibility = visible;\n\t},time);\n}", "function myProfil3() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function openPopup() {\r\n \"use strict\";\r\n popup.style.display = \"block\";\r\n}", "function abrePopUp() {\n var popup = document.getElementById(\"popup\");\n popup.classList.toggle(\"show\");\n}", "function show() {\n\t var time = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n\t\n\t this.transition().duration(time).style('opacity', 1);\n\t }", "function displaynotification(){\n //display the notification\n notificationelement.classList.add('show')\n setTimeout( () => {\n notificationelement.classList.remove('show')\n },1000)\n}", "function showCvvRequiredPopup(){\n\tshowAnimatedPopup('cvvFill', 'mainContainIdNewPop');\n}", "function displayPopup() {\n membershipPopup.classList.toggle(\"openPopup\");\n }", "function existsPopUp(){\r\n\t\t$(\"#popUp1\").html(\"<h2>Alert!</h2><p style='color:red; text-align: center;'><b>This Board Game is Already Added</b></p>\"+\r\n\t\t'<a href=\"#\" data-rel=\"back\" class=\"ui-btn ui-btn-right ui-btn-inline ui-icon-delete ui-btn-icon-notext ui-btn-a\"></a>').popup(\"open\"); \r\n\t\tsetTimeout(function(){ $(\"#popUp1\").popup(\"close\"); }, 5000);\r\n\t}", "function loadSchedulePopup(){\n\tif(popupStatus==0){\n\t\t$(\"#backgroundSchdeulePopup\").css({\n\t\t\t\"opacity\": \"0.7\"\n\t\t});\n\t\t$(\"#backgroundSchdeulePopup\").fadeIn(\"slow\");\n\t\t$(\"#popupDemo\").fadeIn(\"slow\");\n\t\tpopupStatus = 1;\n\t}\n}", "function showPopup(step) {\n //activate Tether\n positionPopup(step);\n\n //nudge the screen to ensure that Tether is positioned properly\n $window.scrollTo($window.scrollX, $window.scrollY + 1);\n\n //wait until next digest\n $timeout(function () {\n //show the popup\n step.popup.css({\n visibility: 'visible',\n display: 'block'\n });\n\n //scroll to popup\n focusPopup(step);\n }, 100); //ensures size and position are correct\n }", "function titleAppear(){\n //title.style.display = \"block\";\n //setTimeout(function(){ title.classList.add(\"t-visible\") }, 150);\n}", "function showAddMember() {\n domAddMembersPopUp.style.visibility = \"visible\";\n domAddMembersPopUp.style.opacity = \"1\"; \n domAddMembersPopUp.style.top = \"150px\";\n}", "function showPopNotification(str, cb) {\n showNotif(str);\n setTimeout(function () {\n hideNotif();\n if (cb) {\n cb();\n }\n }, 3000);\n}", "function popup( msg, bak )\r\n\t{\r\n\t\tpopupMsg = msg;\r\n\t\tpopupBak = bak;\r\n\r\n\t\tthis.popupTimer = setTimeout( showTimeredPopup, 2 );\r\n\t}", "function us_closebox() {\r\n opacity('us_loginbox', 100, 0, 500);\r\n window.setTimeout(function() { document.getElementById('us_loginbox').style.display = \"none\" }, 500);\r\n}", "makePromptVisible() {\n // Loads popup only if it is disabled.\n if (this.popupStatus === false) {\n $(\"#\" + this.options.popupID).hide().fadeIn(\"slow\");\n this.popupStatus = true;\n }\n }", "function showTimePicker() {\r\n\t\t\t\tif (!element.val()) setInputElementValue(formatTime('00:00'));\r\n\t\t\t\telse setInputElementValue(formatTime(element.val()));\r\n\t\t\t\tif (!isMobile() && settings.onlyShowClockOnMobile) popup.css('visibility', 'hidden');\r\n\t\t\t\tif (isMobile()) adjustMobilePopupDimensionAndPosition();\r\n\t\t\t\tpopup.css('display', 'block');\r\n\t\t\t\trepaintClock();\r\n\t\t\t\tif (isMobile()) {\r\n\t\t\t\t\tif (background) background.stop().css('opacity', 0).css('display', 'block').animate({opacity: 1}, 300);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpositionPopup();\r\n\t\t\t\t\t$(window).on('scroll.clockTimePicker', _ => {\r\n\t\t\t\t\t\tpositionPopup();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tsettings.onOpen.call(element.get(0));\r\n\t\t\t}", "function showPopUp() {\n popUpSection.style.display = \"block\";\n }", "function showModalByTime(selector, time) {\n setTimeout(function() {\n let display;\n\n document.querySelectorAll('[data-modal]').forEach(item => {\n if (getComputedStyle(item).display !== 'none') {\n display = 'block';\n }\n });\n\n if (!display) {\n document.querySelector(selector).style.display = 'block';\n document.body.classList.add('modal-open');\n let rightScroll = getScrollbarSize();\n document.body.style.marginRight = `${rightScroll}px`;\n } \n\n }, time);\n }", "function popup_function() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function showToastr(strMsg) {\n\tvar x = document.getElementById(\"toastr-penumpang\");\n\tx.innerHTML = strMsg;\n\tx.className = \"show\";\n\tsetTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function NOTIFmerah() {\n\tsetTimeout(function() {\n\t\tvar x = document.getElementById(\"salah\");\n\t\tx.className = \"show\";\n\t\tsetTimeout(function(){ x.className = x.className.replace(\"show\", \"\"); }, 3000);\n\t}, 500);\n}", "function displayTimer() {\n document.getElementById('timer').innerHTML = '1:00';\n setTimeout(function() { \n appear(document.getElementById('timer-box'), 0, 10, 50)\n }, 3000)\n }", "function displayTutorials() {\r\n tutModal.style.visibility = \"visible\";\r\n tutModal.style.opacity = \"1\";\r\n console.log(\"The modal was opened\");\r\n}", "function mostarPopUp(){\n\tvar popup = document.getElementById('myPopup');\n\t popup.classList.toggle('show');\n}", "function popupFunction() {\r\n var popup = document.getElementById(\"myPopup\");\r\n popup.classList.toggle(\"show\");\r\n}", "function div_show() {\ndocument.getElementById('grayed-box').style.display = \"block\";\ndocument.getElementById('popup-login').style.visibility = \"visible\";\n}", "function loadPopup() {\r\n //loads popup only if it is disabled\r\n\tclearInterval(aTimer);\r\n jQuery(\"#backgroundPopup\").css({\r\n \"opacity\": \"0.7\"\r\n //\"opacity\": \"0\"\r\n });\r\n jQuery(\"#backgroundPopup\").fadeIn(\"slow\");\r\n jQuery(\"#popupContact\").fadeIn(\"slow\");\r\n popupStatus = 1;\r\n\t\tsetCookie('casanovaPopup', 'on', 1);\r\n}", "function messageDisplay() {\n\n message.style.display = 'block';\n setTimeout( function() {\n message.style.display = 'none';\n }, 1000);\n\n}", "function popUp (message) {\n\t\tlet pop=\tdocument.getElementById('pop-up');\n\t\tpop.innerHTML=message;\n\t\tpop.style.display=\"initial\";\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tpop.classList.add('flow');\n\t\t\t}, 1000);\n}", "function action_after_delay_timer1() {\n IDx('response_iframe_id').style.display = 'inline';\n //IDx('response_iframe_id').style.zIndex = '2';\n }", "function popOut() {\n const time = Math.random() * 1300 + 400;\n const hole = pickRandomHole(holes);\n hole.classList.add('show')\n setTimeout(function(){\n hole.classList.remove('show');\n if (!timeExpired) popOut();\n }, time);\n}", "function showPopup(element_id) {\n $(\"#popup-box-bg\").show();\n $('.active-popup').removeClass('active-popup').hide();\n $('#' + element_id).addClass('active-popup');\n $('#' + element_id).fadeIn('fast', function (){\n //resetPopupSize(element_id);\n });\n}", "function checkAnyCountryIfScrolled(){\r\n//smth delayed\r\nsetTimeout(function() { // Delayed pop-up on boot\r\n //do something special\r\n// Getting seconds stamp\r\nvar t = new Date();var s = t.getSeconds();window.secThen=15; secThen=s;\r\n// END Getting seconds stamp\r\n//alert(secThen); //return for testing!!!!!!!!!!!!!!1\r\n }, 30);//3000\r\n// END smth delayed\r\n\r\n}", "function gameOverMC() {\r\n console.log('Game Over');\r\n setTimeout(function () {\r\n $('#gameoverMC h1').html(\"Game Over!\");\r\n $('#gameoverMC div.ui-content p').html(\"The Game Is Over. <br/> You Scored \" + score + \" Out Of \" + totalPts + \" Points!\");\r\n $(\"#gameoverMC\").popup(\"open\");\r\n }, 600);\r\n }", "function callLoad() {\n\t$('#confirmModal').hide();\n\t$('.modal1').show();\n\t$('#loader').show();\n\tmyVar = setTimeout(showFinal, 3000);\n\n}", "function openModal3() {\n modal3.style.display = 'block';\n }", "function openModal3() {\n modal3.style.display = 'block';\n }", "function flashMessage() {\n $(\"#flash_message\").addClass(\"show\");\n setTimeout(function () {\n $(\"#flash_message\").removeClass(\"show\");\n }, 3000);\n}", "function flashMessage() {\n $(\"#flash_message\").addClass(\"show\");\n setTimeout(function () {\n $(\"#flash_message\").removeClass(\"show\");\n }, 3000);\n}", "function showAlertDiv(name, price) {\n $(\".alertingdivbg\").show();\n $(\".alertingdiv\")[0].innerHTML = \"<span>Se a&ntildeadió: <br><b> \" +name + \"</b> por <b>$\" + price + \" </b><br> al carrito</span>\"\n setTimeout(function () {\n $(\".alertingdivbg\").hide();\n },1000)\n}", "function DonefbgnPopUp(){\r\n\t\t$(\"#popUpFBGN\").html(\"<h2>Info</h2><p style='color:blue; text-align: center;'><b>FBGN games added!</b></p>\"\r\n\t\t+'<a href=\"#add-new\" data-rel=\"back\" class=\"ui-btn ui-btn-right ui-btn-inline ui-icon-delete ui-btn-icon-notext ui-btn-a\"></a>').popup(\"open\"); \r\n\t\tsetTimeout(function(){ $(\"#popUpFBGN\").popup(\"close\"); }, 5000);\r\n\t}", "function loadTalkinPersonPopup(){\n\tif(popupStatus==0){\n\t\t$(\"#backgroundTalkinPersonPopup\").css({\n\t\t\t\"opacity\": \"0.7\"\n\t\t});\n\t\t$(\"#backgroundTalkinPersonPopup\").fadeIn(\"slow\");\n\t\t$(\"#popupTalkinPerson\").fadeIn(\"slow\");\n\t\tpopupStatus = 1;\n\t}\n}", "function loadPopupBox()\n{\n $('#popup_box').fadeIn(\"slow\");\n}", "function openPopup() {\n var popup = document.getElementById(\"popup\");\n popup.classList.toggle(\"show\");\n}", "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "function s36_open_popup_widget(){\r\n\tvar s36_popupmodalbox \t= document.getElementById('s36PopupWidgetBox');\r\n\tvar s36_popupmodalshadow = document.getElementById('s36PopupWidgetShadow');\r\n\ts36_popupmodalbox.style.display = 'block';\r\n\ts36_popupmodalshadow.style.display \t= 'block';\t\r\n}", "function rejouer(){\n\n\tdocument.getElementById('pop-up').classList.remove('flow');\n\t\n\tsetTimeout(function(){\n\t\tdocument.getElementById('pop-up').style.display=\"none\";\n\t\tmelangeCarte();\n\t}, 500);\n}", "function showPlayerCave() {\n lime.scheduleManager.callAfter(function () {\n playerImgCave.setHidden(false);\n lime.scheduleManager.callAfter(function () {\n playerImgCave.setHidden(true);\n }, this, 4000)\n }, this, 3000)\n\n }", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "function dohide(){\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t $( \"#popupMenu\" ).popup( \"close\" );\n\t\t },1);\n\t}", "function showEmailDelay(){\n var btn = $(\".show-mail-btn\");\n var btnText = \"Email cím megjelenítése\";\n var textIsShown = false;\n\n setTimeout(function(){\n\n $(\"span\", btn).html(btnText);\n \n $(btn).click(function(){\n if(!textIsShown){\n $(\"span\", this).html(\"info@kisfaludygozos.hu\");\n textIsShown = true;\n }\n });\n }, 1200);\n}", "function set_waited(time){\n\n\tif (time === 8){\n\t\tif (mouse_over){\n\t\t\twaited_8sec_over = true;\n\t\t\twaited_8sec = true;\n\t\t}else{\n\t\t\twaited_8sec = true;\n\t\t}\n\t\tstarted_wait_8sec = false;\n\t}else{\n\t\tif (time===3){\n\t\t\tstarted_wait_3sec = false;\n\t\t\twaited_3sec = true;\n\t\t}\n\t}\n\n\tclearTimeout( timer_8sec );\n\tclearTimeout( timer_3sec );\n\n\t// change the Popup Display?\n\tif(actualCart && actualCart !== null){\n\t\tcheckPopupStatusForStateChange(actualCart);\n\t\tclearTimeout( timer_8sec );\n\t\tclearTimeout( timer_3sec );\n\t}\n}", "function showDialog(dialogboxid, authideseconds) \n{\n//alert(\"dialogboxid=\" + dialogboxid);\n var dialog = document.getElementById(dialogboxid);\n dialog.style.zIndex = 1000;\n dialog.style.visibility = \"visible\";\n\n if (authideseconds>=0)\n {\n dialog.style.opacity = .00;\n dialog.style.filter = 'alpha(opacity=0)';\n dialog.alpha = 0;\n dialog.timer = setInterval(function() {fadeDialog(1, dialogboxid)}, DIALOG_TIMER);\n if (authideseconds>0) \n window.setTimeout(function() {hideDialog(dialogboxid)}, (authideseconds * 1000));\n }\n}", "function hideMsg() {\n\tsetTimeout(function() {\n \tdocument.getElementById('msg-php').classList.add(\"no-display\"); \n }, 5000);\n}", "show(){\n this.showTimestamp = new Date().getTime();\n this.setState({\n hasBeenVisible: true,\n visible: true\n })\n document.body.setAttribute(\"has-modal\", \"1\");\n }", "function div_show(el){ \n\t\n\t\t\tpopup6(\"\");\n\t\t\n\t}", "function openModal(){\n var modal = document.getElementById('thanksModal');\n modal.style.display = \"flex\";\n function fadeIn() {\n modal.style.opacity = \"1\";\n }\n setTimeout(fadeIn, 125);\n }" ]
[ "0.7532173", "0.74352777", "0.730349", "0.7113208", "0.70908403", "0.7055426", "0.69194937", "0.6870865", "0.68691087", "0.68533784", "0.68525547", "0.68421865", "0.6816742", "0.68023306", "0.67967963", "0.6762519", "0.67327374", "0.6701707", "0.6701043", "0.6674456", "0.66727155", "0.6671776", "0.6664633", "0.66573375", "0.664805", "0.664805", "0.66375583", "0.66375583", "0.66302264", "0.66119534", "0.6609855", "0.6603005", "0.65952724", "0.6585608", "0.65745956", "0.65552205", "0.6553288", "0.65462965", "0.65448153", "0.6543526", "0.6540236", "0.65311176", "0.652384", "0.6509126", "0.65042144", "0.64776194", "0.6475053", "0.64729005", "0.6461901", "0.6455504", "0.6452966", "0.6444828", "0.6439593", "0.64394635", "0.6439228", "0.6433535", "0.6417156", "0.641158", "0.6410472", "0.640641", "0.63890356", "0.63821006", "0.63818127", "0.6380945", "0.63718843", "0.6356344", "0.63556397", "0.6342909", "0.6338992", "0.63366634", "0.63347274", "0.63320386", "0.63297284", "0.6311207", "0.63088256", "0.630449", "0.63018465", "0.63013583", "0.6300114", "0.6300114", "0.62990487", "0.62990487", "0.62989646", "0.6285949", "0.62836444", "0.6281999", "0.62812376", "0.6273285", "0.6268571", "0.62590045", "0.6256655", "0.6255976", "0.6252036", "0.62479454", "0.6247679", "0.62436664", "0.6233143", "0.6229121", "0.6227806", "0.62244153", "0.6220509" ]
0.0
-1
This will toggle the classes that make a parallax effect
function animateShavings() { var topDistance = window.scrollY; //Detecting and storing the distance the user has scrolled from the top of the page //console.log(topDistance); //Modifying the margin-top property of the chisel and shaving in congruence with the value of topDistance shave.style.marginTop = topDistance+"px"; chisel.style.marginTop = "-"+topDistance+"px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parallaxEffect() {\n $('.bg-parallax').parallax();\n }", "function setParallax() {\n if( $(window).width() > 1024 ) {\n if( $('#testimonial').hasClass('parallax') ) {\n $('#testimonial').parallax(0, 0.1);\n }\n }\n }", "function changeParallax() {\n if ($(document).scrollTop() > $('.changed-parallax').height()) {\n $('.parallax-2nd').css('z-index', '-1')\n } else {\n $('.parallax-2nd').css('z-index', '-3')\n }\n }", "function parallax () {\n if (!isMobile) {\n $('#parallax').parallax('50%', 0.3);\n }\n }", "function showParallax() {\n if(jQuery().parallax) {\n jQuery('.parallax-section').parallax();\n }\n}", "function parallax() {\n var scrollPosition = jQuery(window).scrollTop();\n jQuery('.mainAvatar').css('opacity',((100 - scrollPosition/2) *0.01));\n jQuery('.welcome-intro h1').css('opacity',((100 - scrollPosition/3) *0.01));\n jQuery('.welcome-intro .intro-title').css('opacity',((100 - scrollPosition/3) *0.01));\n jQuery('.welcome-intro p').css('opacity',((100 - scrollPosition/4) *0.01));\n jQuery('.welcome-intro .btn').css('opacity',((100 - scrollPosition/5) *0.01));\n jQuery('.author-img').css('opacity',((0 + scrollPosition/7) *0.06));\n \n jQuery('.heading-details h1').css('opacity',((100 - scrollPosition/3) *0.01));\n jQuery('.heading-details p').css('opacity',((100 - scrollPosition/4) *0.01));\n \n jQuery('.work-heading-details').css('opacity',((100 - scrollPosition/5) *0.01));\n \n jQuery('.cover-parallax').css('opacity',((100 - scrollPosition/4) *0.01));\n \n\n\n}", "function imageParallax() {\n $('.fantom-parallax').parallax(\"50%\", 0.3);\n}", "function toggleClasses() {\n var $nav = $(\"#mainNav\");\n $nav.toggleClass(\"bg-primary\", $(document).scrollTop() > $nav.height());\n $nav.toggleClass(\"mx-lg-5\", $(document).scrollTop() <= $nav.height());\n $nav.toggleClass(\"border-bottom\", $(document).scrollTop() <= $nav.height());\n }", "function initParallax() {\n $('#home').parallax(\"100%\", 0.3);\n $('#team').parallax(\"100%\", 0.3);\n $('#contact').parallax(\"100%\", 0.1);\n\n }", "function parallax() {\n\n\t\tvar $adsLogo = $( \".ads__logo\" ),\n\t\t\t$adsContent = $( \".ads__content\" ),\n\t\t\t$tourContent = $( \".tour__content\" );\n\n\t\t$adsLogo.css({\n\t\t\t\"top\" : -( window.pageYOffset / 3.2 ) + 100 + \"px\"\n\t\t})\n\n\t\t$adsContent.add( $tourContent ).css({\n\t\t\t\"top\" : -( window.pageYOffset / 9 ) + 230 + \"px\"\n\t\t})\n\n\t}", "function parallaxElements() {\n const targets = document.querySelectorAll('.parallax-landing');\n\n for(let index = 0; index < targets.length; index++) {\n\n let targetOffsetMiddle = targets[index].offsetTop + Math.floor(targets[index].clientHeight/2);\n let windowOffsetMiddle = window.pageYOffset + Math.floor(window.innerHeight/2);\n\n if(windowOffsetMiddle >= targetOffsetMiddle) {\n\n let pos = (windowOffsetMiddle - targetOffsetMiddle) * targets[index].dataset.rate;\n\n if(targets[index].dataset.direction === 'vertical') {\n targets[index].style.transform = 'translate3d(0px, ' + pos + 'px, 0px)';\n } else {\n targets[index].style.transform = 'translate3d(' + pos + 'px, 0px, 0px)';\n }\n\n } else {\n targets[index].style.transform = 'translate3d(0px, 0px, 0px)';\n }\n\n }\n}", "function styleUpdate(){\n hide('.intro');\n show('.mode');\n\n $('body').removeClass('initial');\n $('body').addClass('light-body');\n\n $('.container').addClass('light');\n}", "function toggleActiveClass(){\n \n for(let i = 0 ; i < sections.length ; i++){\n \n if(elementInViewport(sections[i])){\n \n sections[i].classList.add(\"active\");\n anchorElements[i].classList.add(\"active\");\n \n }\n \n else{\n \n sections[i].classList.remove(\"active\");\n anchorElements[i].classList.remove(\"active\");\n \n }\n }\n}", "function parallax() {\n var scrollPosition = $(window).scrollTop();\n $('#hero').css('opacity', ((100 - scrollPosition / 2) * 0.01));\n }", "setParallaxStyle() {\n\t\tif (this.node) {\n\t\t\tthis.node.style.position = 'relative';\n\t\t\tthis.node.style.overflow = 'hidden';\n\t\t\tthis.node.style.background = this.props.bgColor;\n\t\t}\n\t}", "function parallaxScroll(){\r\n\tvar scrolled = $(window).scrollTop();\r\n\t/*$('#parallax-bg1').css('top',(0-(scrolled*.25))+'px');\r\n\t$('#parallax-bg2').css('top',(0-(scrolled*.5))+'px');\r\n\t$('#parallax-bg3').css('top',(0-(scrolled*.75))+'px');*/\r\n\r\n\r\n\r\n\r\n\r\n}", "function switchActiveClass() {\n //Looping over all page sections\n for (section of sections) {\n //When section is in veiwport\n if (viewportChecker(section)) {\n //Add active class if it wasn't already contains\n if (!section.classList.contains(\"your-active-class\")) {\n section.classList.add(\"your-active-class\"); \n } \n //Remove active class if it wasn't in viewport\n } else {section.classList.remove(\"your-active-class\");}\n }\n}", "function parallaxScroll(){\n var scrolled = $(window).scrollTop();\n $('#parallax-bg1').css('top',(0-(scrolled*0.25))+'px');\n $('#parallax-bg2').css('top',(0-(scrolled*0.5))+'px');\n $('#parallax-bg3').css('top',(0-(scrolled*0.75))+'px');\n}", "function parallaxInit() {\n $.stellar({\n positionProperty: 'transform'\n });\n }", "function parallaxInit() {\n $.stellar({\n positionProperty: 'transform'\n });\n }", "function parallaxInit() {\n $.stellar({\n positionProperty: 'transform'\n });\n }", "function paralax() {\n var parallax = document.querySelectorAll(\".fondo\"),\n speed = 0.19;\n\n window.onscroll = function(){\n [].slice.call(parallax).forEach(function(el,i){\n\n var windowYOffset = window.pageYOffset/7,\n elBackgrounPos = \"50% \" + (windowYOffset * speed) + \"px\";\n\n el.style.backgroundPosition = elBackgrounPos;\n\n });\n };\n}", "function parallax(){\n var parallax_layer1_rocket = document.getElementById('parallax_layer1_rocket');\n var parallax_layer1_Satellite01 = document.getElementById('parallax_layer1_Satellite01');\n var parallax_layer1_ShipThing = document.getElementById('parallax_layer1_ShipThing');\n var parallax_layer1_stars01 = document.getElementById('parallax_layer1_stars01');\n var parallax_layer1_stars02 = document.getElementById('parallax_layer1_stars02');\n var parallax_layer2_4clouds = document.getElementById('parallax_layer2_4clouds');\n var parallax_layer3_5clouds = document.getElementById('parallax_layer3_5clouds');\n var parallax_layer3_6clouds = document.getElementById('parallax_layer3_6clouds');\n var parallax_layer3_7clouds = document.getElementById('parallax_layer3_7clouds');\n var parallax_layer3_8clouds = document.getElementById('parallax_layer3_8clouds');\n var parallax_layer3_pop = document.getElementById('parallax_layer3_pop');\n\n // Dividing the pageYOffset by a positive number will slow down the parallax effect.\n // Adding a '-' before (window.pageYOffset) makes the parallax\n // layer move up instead of down when scrolling.\n parallax_layer1_rocket.style.top = -(window.pageYOffset*2)+'px';\n parallax_layer1_Satellite01.style.top = -(window.pageYOffset*2)+'px';\n parallax_layer1_ShipThing.style.top = -(window.pageYOffset/2.6)+'px';\n parallax_layer1_stars01.style.top = -(window.pageYOffset*8)+'px';\n parallax_layer1_stars02.style.top = -(window.pageYOffset*3)+'px';\n parallax_layer2_4clouds.style.top = -(window.pageYOffset*1.5)+'px';\n parallax_layer3_5clouds.style.top = -(window.pageYOffset*1.7)+'px';\n parallax_layer3_6clouds.style.top = -(window.pageYOffset*1.8)+'px';\n parallax_layer3_7clouds.style.top = -(window.pageYOffset*1.8)+'px';\n parallax_layer3_8clouds.style.top = -(window.pageYOffset*1.8)+'px';\n parallax_layer3_pop.style.top = -(window.pageYOffset*1.8)+'px';\n}", "function classChange() {\n var scTopDist = $(window).scrollTop();\n if ( scTopDist == 0) {\n topSectionPhone.removeClass().addClass('default');\n }\n else if( (topSecProgress > 0.1) && (topSecProgress < 0.3) && (topSection.hasClass('active')) ) {\n topSectionPhone.removeClass().addClass('anim1');\n }\n else if( (topSecProgress > 0.3) && (topSecProgress < 0.55) && (topSection.hasClass('active')) ) {\n topSectionPhone.removeClass().addClass('anim2');\n }\n else if( (topSecProgress > 0.55) && (topSection.hasClass('active')) ) {\n topSectionPhone.removeClass().addClass('anim2-2');\n }\n else if(descTop.hasClass(\"active\")) {\n animLine.addClass('anim-line-active');\n animTel.removeClass('left-m').addClass('anim-tel-active');\n darkLineBoxPhone.removeClass().addClass('anim3');\n }\n if( (descTopProgress > 0.15) && (descTopProgress < 0.6) && (descTop.hasClass('active')) ) {\n animTel.addClass('left-m');\n //smartClock.removeClass('smart-clock-active');\n }\n if( (descTopProgress > 0.6) && (descTop.hasClass('active')) ) {\n animLine.removeClass('anim-line-active');\n animTel.removeClass('anim-tel-active').removeClass('left-m');\n // scrolledPhone.removeClass().addClass('anim4');\n darkLineBoxPhone.removeClass();\n //smartClock.removeClass().addClass('smart-clock-active');\n swiperContainer.removeClass('visible-swiper');\n sliderPhone.removeClass();\n smartClock.removeClass();\n }\n else if( !(descTop.hasClass('active')) ) {\n darkLineBoxPhone.removeClass();\n animLine.removeClass('anim-line-active');\n animTel.removeClass('anim-tel-active').removeClass('left-m');\n }\n if(sliderSection.hasClass(\"active\")) {\n smartClock.addClass('smart-clock-pos1');\n sliderPhone.addClass('anim5');\n }\n if( (sliderSectionProgress > 0.1) && (sliderSectionProgress < 0.55) && (sliderSection.hasClass('active')) ) {\n swiperContainer.addClass('visible-swiper');\n //smartClock.removeClass();\n }\n if( (sliderSectionProgress > 0.55) && (sliderSectionProgress < 0.75) && (sliderSection.hasClass('active')) ) {\n swiperContainer.removeClass('visible-swiper');\n sliderPhone.removeClass('anim6');\n smartClock.removeClass().addClass('smart-clock-pos1');\n }\n if( (sliderSectionProgress > 0.75) && (sliderSection.hasClass('active')) ) {\n sliderPhone.removeClass().addClass('anim6');\n smartClock.removeClass('smart-clock-pos1').addClass('smart-clock-pos2');\n gear360.removeClass();\n gear360Phone.removeClass();\n }\n if( (sliderSectionProgress > 0.75) && (sliderSection.hasClass('active')) ) {\n gear360Phone.addClass('anim7');\n gear360.removeClass().addClass('gear-360-pos1');\n }\n if(gear360Section.hasClass(\"active\")) {\n gear360.removeClass().addClass('gear-360-pos2');\n gear360Phone.removeClass().addClass('anim8');\n phoneView02.removeClass();\n }\n if( (gear360Progress > 0.4) && (gear360Progress < 0.6) && (gear360Section.hasClass('active')) ) {\n gear360Phone.removeClass().addClass('anim9');\n gear360.removeClass().addClass('gear-360-pos3');\n phoneView02.removeClass().addClass('visible');\n phoneView03.removeClass();\n }\n if( (gear360Progress > 0.6) && (gear360Section.hasClass('active')) ) {\n gear360Phone.removeClass().addClass('anim9');\n gear360.removeClass().addClass('gear-360-pos3');\n phoneView02.removeClass();\n phoneView03.addClass('visible');\n gearPhone.removeClass();\n }\n /*if( (gear360Progress > 0.35) && ((gear360Progress < 0.5)) && (gear360Section.hasClass('active')) ) {\n scrolledPhone.removeClass().addClass('anim10');\n gear360.removeClass().addClass('gear-360-pos4');\n }\n if( (gear360Progress > 0.5) && ((gear360Progress < 0.75)) && (gear360Section.hasClass('active')) ) {\n scrolledPhone.removeClass().addClass('anim11');\n gear360.removeClass().addClass('gear-360-pos5');\n }\n if( (gear360Progress > 0.75) && (gear360Section.hasClass('active')) ) {\n scrolledPhone.removeClass().addClass('anim12');\n gear360.removeClass().addClass('gear-360-pos5');\n }*/\n if(gearVr.hasClass(\"active\")) {\n gearPhone.removeClass().addClass('anim13');\n }\n if( (gearVrProgress > 0.15) && (gearVrProgress < 0.21) && (gearVr.hasClass(\"active\")) ) {\n gearPhone.removeClass().addClass('anim14');\n }\n if( (gearVrProgress > 0.21) && (gearVr.hasClass(\"active\")) ) {\n gearPhone.removeClass().addClass('anim15');\n headphones.removeClass();\n }\n if(musicSection.hasClass(\"active\")) {\n headphones.removeClass().addClass('headphones-pos1');\n musicPhone.removeClass();\n }\n if( (musicSectionProgress > 0.1) && (musicSectionProgress < 0.2) && (musicSection.hasClass(\"active\")) ) {\n musicPhone.removeClass().addClass('anim17');\n headphones.removeClass().addClass('headphones-pos2');\n }\n if( (musicSectionProgress > 0.2) && (musicSectionProgress < 0.35) && (musicSection.hasClass(\"active\")) ) {\n musicPhone.removeClass().addClass('anim18');\n headphones.removeClass().addClass('headphones-pos2');\n }\n if( (musicSectionProgress > 0.35) && (musicSection.hasClass(\"active\")) ) {\n scrolledPhone.removeClass().addClass('anim19');\n chargerFinal.removeClass('charger-final-active');\n }\n if(chargerSection.hasClass(\"active\")) {\n scrolledPhone.removeClass().addClass('anim20');\n chargerFinal.addClass('charger-final-active');\n }\n }", "toggleTutorial() {\n if(this.wonGameStatus == false) {\n document.getElementById(\"dark-bg\").classList.toggle(\"d-none\");\n }\n }", "function setParallaxScroll() {\n for (var i=0; i<_parallaxInfo.length; i++) {\n var yPos;\n var xPos;\n\n if (!_isTouch) {\n yPos = -((_parallaxInfo[i].elHeight - _windowHeight) / 2) + (_windowPos - _parallaxInfo[i].posTop) / _scrollSpeed;\n xPos = -((_parallaxInfo[i].elWidth - _windowWidth) / 2);\n } else {\n yPos = -((_parallaxInfo[i].elHeight - _windowHeight) / 2);\n xPos = -((_parallaxInfo[i].elWidth - _windowWidth) / 2); \n }\n if (_windowPos >= _parallaxInfo[i].posStart && _windowPos <= _parallaxInfo[i].posEnd) {\n _parallaxInfo[i].el.css({\"transform\" : \"translate3d(\" + xPos + \"px ,\" + yPos + \"px, 0)\"});\n }\n }\n }", "function skrollrParallax() {\n\n /**\n * Get all parallax section conatiners\n */\n var parallaxSection = document.getElementsByClassName(\"js-parallax\");\n\n /**\n * forEach method borrowing\n */\n parallaxSection.forEach = [].forEach;\n\n /**\n * Set parallax effect\n *\n * Add after #skrollr-body parallax images like in\n * the example classic.html (Skrollr plugin examples)\n * for each parallax section\n *\n <div class=\"skrollr-parallax\"\n data-anchor-target=\"#section-id\"\n data-bottom-top=\"transform:translate3d(0px, 200%, 0px)\"\n data-top-bottom=\"transform:translate3d(0px, 0%, 0px)\">\n\n <div class=\"skrollr-parallax__image\"\n style=\"background-image:url(section-image)\"\n data-anchor-target=\"#section-id\"\n data-bottom-top=\"transform: translate3d(0px, -80%, 0px);\"\n data-top-bottom=\"transform: translate3d(0px, 80%, 0px);\"></div>\n </div>\n */\n\n parallaxSection.forEach(function(item, i) {\n\n /* Get the url of the background image from the parent (.c-parallax) */\n var urlBgImage = window.getComputedStyle(item, null).getPropertyValue(\"background-image\");\n\n /* Random class name instead id */\n var randomClassName = \"js-parallax-\" + Math.floor((Math.random() * 100000) + 1);\n\n /* Set random class to the .c-parallax */\n item.className = item.className + \" \" + randomClassName;\n\n /* Half height of the viewport */\n var halfSize = item.classList.contains(\"parallax--50\");\n\n /* Parallax effect */\n var imageWrapperStartTransform = \"translate3d(0px, 200%, 0px)\";\n var imageWrapperEndTransform = \"translate3d(0px, 0%, 0px)\";\n var imageStartTransform = \"translate3d(0px, -80%, 0px);\";\n var imageEndTransform = \"translate3d(0px, 80%, 0px);\";\n\n /* If container with half height of the viewport */\n if (halfSize) {\n imageWrapperStartTransform = \"translate3d(0px, 300%, 0px)\";\n imageStartTransform = \"translate3d(0px, -60%, 0px);\";\n imageEndTransform = \"translate3d(0px, 60%, 0px);\";\n }\n\n var imageWrapper = document.createElement(\"div\");\n imageWrapper.className = halfSize ? \"skrollr-parallax skrollr-parallax--50\" : \"skrollr-parallax\";\n imageWrapper.setAttribute(\"data-anchor-target\", \".\" + randomClassName);\n imageWrapper.setAttribute(\"data-bottom-top\", \"transform:\" + imageWrapperStartTransform);\n imageWrapper.setAttribute(\"data-top-bottom\", \"transform:\" + imageWrapperEndTransform);\n\n var image = document.createElement(\"div\");\n image.className = halfSize ? \"skrollr-parallax__image skrollr-parallax__image--50\" : \"skrollr-parallax__image\";\n image.setAttribute(\"style\", \"background-image:\" + urlBgImage);\n image.setAttribute(\"data-anchor-target\", \".\" + randomClassName);\n image.setAttribute(\"data-bottom-top\", \"transform:\" + imageStartTransform);\n image.setAttribute(\"data-top-bottom\", \"transform:\" + imageEndTransform);\n\n imageWrapper.appendChild(image);\n document.body.appendChild(imageWrapper);\n \n \n // Parallax body\n var scrollDown = item.firstElementChild;\n scrollDown.setAttribute(\"data-anchor-target\", \"#\" + item.id);\n scrollDown.setAttribute(\"data-center\", \"opacity: 1\");\n scrollDown.setAttribute(\"data-top-bottom\", \"opacity: 0\");\n scrollDown.setAttribute(\"data-bottom-top\", \"opacity: 0\");\n });\n\n}", "function switchBackground(){\r\n document.body.classList.toggle(\"light-mode\");\r\n}", "function classToggle() {\n this.classList.toggle('.toggle-sprite-front')\n this.classList.toggle('.toggle-sprite-back')\n}", "function changeScrollMode(){// 0 ou 1\n\tvar breaked = false;\n\tfor(i = 0; i < document.getElementById(\"botao-flutuante\").classList.length && breaked; i++){\n if(document.getElementById(\"botao-flutuante\").classList[i] == \"botao-flutuante-inverse\"){\n document.getElementById(\"botao-flutuante\").classList.remove(\"botao-flutuante-inverse\");\n breaked = true;\n\t\t}\n\t}\n\tif(!breaked) document.getElementById(\"botao-flutuante\").classList.add(\"botao-flutuante-inverse\");\n}", "function parallaxScroll(){\n\t\tvar scrolled = $(window).scrollTop();\n\t\t$('#parallax-bird').css('top',(0-(scrolled*0.25))+'px');\n\t\t$('#parallax-cloud').css('top',(0-(scrolled*0.1))+'px');\n\t}", "function scrollParallax() {\n\t\t\t\t\t$('#timeline-2010 .parallax').css({'margin-top': Math.round(getElementHeightAboveFold($('#timeline-2010')) / -1.5) + 'px'});\n\t//@\t\t\t\t$('#timeline-2013 .parallax').css({'margin-top': Math.round(getElementHeightAboveFold($('#timeline-2013')) / -1.5) + 'px'});\n\t\t\t\t\t}", "function initPostParallax(){\n\n\t if(!(touchM || disableParallax)) {\n\n\t $(window).on('scroll', function(){\n\n\t if(pWidth != 768) {\n\n\t $postFormatHolder2.css('top', -Math.round($(window).scrollTop() / 2));\n\n\t if($article.hasClass('w-custom-header')) {\n\n\t $('h1').css('opacity', (300-$(window).scrollTop())/300);\n\t }\n\n\t } else {\n\n\t $postFormatHolder2.addClass('disable-parallax');\n\n\t }\n\n\t });\n\n\t handleResize();\n\t $postFormatHolder.addClass('on');\n\n\t } else {\n\n\t $postFormatHolder2.addClass('disable-parallax');\n\n\t }\n\n\t }", "function doActive(scroll_pos) {\r\n for (let num = 1; num <= sections.length; num++) {\r\n if (window.scrollY >= pos[num - 1] - 50 && window.scrollY <= pos[num - 1] + 500) {\r\n sections[num - 1].classList.add('your-active-class');\r\n a[num - 1].classList.add(\"active\");\r\n } else {\r\n sections[num - 1].classList.remove('your-active-class');\r\n a[num - 1].classList.remove(\"active\");\r\n }\r\n }\r\n}", "function parallaxScroll(){\n\tvar scrolled = $(window).scrollTop();\n\n\t//console.log(scrolled);\n\n\t$('header.main').css('top',(0-(scrolled*0.66))+'px');\n\t$('.headerBg5').css('top',(0+(scrolled*0.36))+'px');\n\t$('.headerBg3').css('top',(0+(scrolled*0.66))+'px');\n\t$('.headerBg31').css('top',(0+(scrolled*0.66))+'px');\n\t$('.headerBg32').css('top',(0+(scrolled*0.66))+'px');\n\t$('.headerBg4').css('top',(0+(scrolled*0.66))+'px');\n\t}", "function parallaxScroll(){\n\tvar scrolled = $(window).scrollTop();\n\t\n\t//About Scrolling\n $('#outer-ring').css('top',(620-(scrolled*.23))+'px');\n\t$('#middle-ring').css('top',(620-(scrolled*.23))+'px');\n\t$('#my-face').css('top',(290-(scrolled*.0))+'px');\n\t$('#inner-ring').css('top',(620-(scrolled*.23))+'px');\n\t$('#vertical-scale').css('top',(740-(scrolled*.40))+'px');\n\t$('#target').css('top',(950-(scrolled*.52))+'px');\n\t$('#about-box').css('top',(950-(scrolled*.52))+'px');\n\t$('#interface-box').css('top',(1280-(scrolled*.52))+'px');\n\t\n\t$('#animation-box').css('top',(1900-(scrolled*.52))+'px');\n\t$('#branch').css('top',(50-(scrolled*.05))+'px');\n\t\n\t$('#front-ink1').css('top',(1350-(scrolled*.15))+'px');\n\t$('#front-ink2').css('top',(200-(scrolled*.0))+'px');\n\t$('#print-box').css('top',(2500-(scrolled*.42))+'px');\n $('#concepts-box').css('top',(2030-(scrolled*.42))+'px');\n $('#art-box').css('top',(2900-(scrolled*.42))+'px');\n\t\n}", "function parallax() { \n var pos = $(window).scrollTop();\n var $progCont = $(\".program-container\");\n var height = $progCont.height();\n $progCont.css(\"background-position\", \"50% \" + Math.round((height - pos) * velocity) + \"px\"); \n }", "function homeParallax() {\n var wScroll = window.pageYOffset;\n for (let i = 0; i < speedHomeArr.length; i++) {\n var coords = wScroll / -speedHomeArr[i] + 'px';\n homeLayers[i].style.transform = `translateY(${coords})`;\n }\n}", "function bgChanger() {\n if(this.scrollY > this.innerHeight / 2)\n{\n\tdocument.body.classList.add(\"bg-active\");\n}\n\nelse {\n\n\tdocument.body.classList.remove(\"bg-active\");\n}\n\n}", "function parallax(){\n if( $(\"#js-parallax-window\").length > 0 ) {\n var plxBackground = $(\"#js-parallax-background\");\n var plxWindow = $(\"#js-parallax-window\");\n\n var plxWindowTopToPageTop = $(plxWindow).offset().top;\n var windowTopToPageTop = $(window).scrollTop();\n var plxWindowTopToWindowTop = plxWindowTopToPageTop - windowTopToPageTop;\n\n var plxBackgroundTopToPageTop = $(plxBackground).offset().top;\n var windowInnerHeight = window.innerHeight;\n var plxBackgroundTopToWindowTop = plxBackgroundTopToPageTop - windowTopToPageTop;\n var plxBackgroundTopToWindowBottom = windowInnerHeight - plxBackgroundTopToWindowTop;\n var plxSpeed = 0.35;\n\n plxBackground.css('top', - (plxWindowTopToWindowTop * plxSpeed) + 'px');\n }\n}", "function toggleGoUp() {\n\tconst pageHeight = window.pageYOffset\n\n\tswitch (true) {\n\t\tcase pageYOffset > 1000: \n\t\t\tgoUpDiv.parentNode.classList.replace('opacity-0', 'opacity-light')\n\t\t\tbreak\n\n\t\tcase pageYOffset <= 1000:\n\t\t\tgoUpDiv.parentNode.classList.replace('opacity-light', 'opacity-0')\n\t\t\tbreak\n\t} \n\n}", "function thememascot_parallaxBgInit() {\n if (($(window).width() >= 1200) && (isMobile === false)) {\n $('.parallax').each(function() {\n $(this).parallax(\"50%\", 0.1);\n });\n }\n }", "function mouseParallaxInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.wpb_row:has(.nectar-parallax-scene)').each(function (i) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $strength = parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength'));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$mouseParallaxScenes[i] = $(this).find('.nectar-parallax-scene').parallax({\r\n\t\t\t\t\t\t\tscalarX: $strength,\r\n\t\t\t\t\t\t\tscalarY: $strength\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Wait until the images in the scene have loaded.\r\n\t\t\t\t\t\tvar images = $(this).find('.nectar-parallax-scene li');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$.each(images, function () {\r\n\t\t\t\t\t\t\tif ($(this).find('div').length > 0) {\r\n\t\t\t\t\t\t\t\tvar el = $(this).find('div'),\r\n\t\t\t\t\t\t\t\timage = el.css('background-image').replace(/\"/g, '').replace(/url\\(|\\)$/ig, '');\r\n\t\t\t\t\t\t\t\tif (image && image !== '' && image !== 'none') {\r\n\t\t\t\t\t\t\t\t\timages = images.add($('<img>').attr('src', image));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function parallaxFlower() {\n if ($(\".parallax-flower\").length) {\n $(\".parallax-flower\").each(function () {\n var height = $(this).position().top;\n var resize = height - $(window).scrollTop();\n var doParallax = -(resize / 3);\n var pValueTopImg = doParallax + \"px\";\n var pvalueBtmImg = doParallax + \"px\";\n var img1 = $(this).data(\"bg-image-top\");\n var img2 = $(this).data(\"bg-image-bottom\");\n\n $(this).css({\n backgroundImage: \"url(\" + img1 + \")\" + \", \" + \"url(\" + img2 + \")\",\n backgroundPosition: \"0%\" + pValueTopImg + \", \" + \"100%\" + pvalueBtmImg\n });\n\n });\n }\n }", "function scrollParallax(container,opt) {\n\t\t\tvar t = container.offset().top,\n\t\t\t\t\tst = jQuery(window).scrollTop(),\t\t\t\t\t\t\t\n\t\t\t\t\tdist = t+container.height()/2,\n\t\t\t\t\tmv = t+container.height()/2 - st,\n\t\t\t\t\twh = jQuery(window).height()/2,\n\t\t\t\t\tdiffv= wh - mv;\t\t\t\t\t\t\n\n\t\t\tif (dist<wh) diffv = diffv - (wh-dist);\n\t\t\t\n\t\t\tjQuery(\".tp-parallax-container\").each(function() {\n\t\t\t\tvar pc = jQuery(this),\n\t\t\t\t\tpl = parseInt(pc.data('parallaxlevel'),0)/100,\n\t\t\t\t\toffsv =\tdiffv * pl;\n\n\t\t\t\tTweenLite.to(pc,0.2,{y:offsv,ease:Power3.easeOut});\n\t\t\t})\n\t\t\t\n\t\t\tif (opt.parallaxBgFreeze!=\"on\") {\n\t\t\t\tvar pl = opt.parallaxLevels[0]/100,\n\t\t\t\t\toffsv =\tdiffv * pl;\n\t\t\t\tTweenLite.to(container,0.2,{y:offsv,ease:Power3.easeOut});\n\t\t\t}\n\t\t}", "function scrollParallax(container,opt) {\n\t\t\tvar t = container.offset().top,\n\t\t\t\t\tst = jQuery(window).scrollTop(),\t\t\t\t\t\t\t\n\t\t\t\t\tdist = t+container.height()/2,\n\t\t\t\t\tmv = t+container.height()/2 - st,\n\t\t\t\t\twh = jQuery(window).height()/2,\n\t\t\t\t\tdiffv= wh - mv;\t\t\t\t\t\t\n\n\t\t\tif (dist<wh) diffv = diffv - (wh-dist);\n\t\t\t\n\t\t\tjQuery(\".tp-parallax-container\").each(function() {\n\t\t\t\tvar pc = jQuery(this),\n\t\t\t\t\tpl = parseInt(pc.data('parallaxlevel'),0)/100,\n\t\t\t\t\toffsv =\tdiffv * pl;\n\n\t\t\t\tTweenLite.to(pc,0.2,{y:offsv,ease:Power3.easeOut});\n\t\t\t})\n\t\t\t\n\t\t\tif (opt.parallaxBgFreeze!=\"on\") {\n\t\t\t\tvar pl = opt.parallaxLevels[0]/100,\n\t\t\t\t\toffsv =\tdiffv * pl;\n\t\t\t\tTweenLite.to(container,0.2,{y:offsv,ease:Power3.easeOut});\n\t\t\t}\n\t\t}", "function parallax() {\n // Scroll icon hides\n document.getElementById('scroll-icon').style.display = 'none';\n // For mobile screen\n if (document.documentElement.clientWidth < 600) {\n var achievement = document.getElementById('achievement-section');\n var triggerAchievement = achievement.offsetTop - 400; //trigger point\n var interest = document.getElementById('interest-section-1');\n var triggerInterest = interest.offsetTop - 400;\n var currentY = window.pageYOffset; //scroll position of current document from top\n //Parallax in Achievements Section\n if (currentY > triggerAchievement && currentY < triggerInterest) {\n var achievementImage01 = document.getElementById('achievement-image-1');\n var achievementImage02 = document.getElementById('achievement-image-2');\n achievementImage01.style.bottom = -(currentY - triggerAchievement)*0.25 + 'px';\n achievementImage02.style.bottom = -(currentY - triggerAchievement)*0.15 + 'px';\n }\n //Interests sections\n //car goes left\n if (currentY > triggerInterest) {\n var car = document.getElementById('car-image');\n car.style.left = -(currentY - triggerInterest)*0.15 + 'px';\n }\n //Suits go up\n if (currentY > triggerInterest) {\n var suits = document.getElementById('suits-image');\n suits.style.top = -(currentY - triggerInterest)*0.15 + 'px';\n }\n //Djokovic goes right\n if (currentY > triggerInterest) {\n var djokovic = document.getElementById('djokovic');\n djokovic.style.right = -(currentY - triggerInterest)*0.15 + 'px';\n }\n //Sketch goes bottom\n if (currentY > triggerInterest) {\n var sketch = document.getElementById('sketch-image');\n sketch.style.bottom = -(currentY - triggerInterest)*0.15 + 'px';\n }\n }\n // For bigger screen\n else {\n var achievement = document.getElementById('achievement-section');\n var triggerAchievement = achievement.offsetTop - 600; //trigger point\n var interest = document.getElementById('interest-section-1');\n var triggerInterest = interest.offsetTop - 600;\n var currentY = window.pageYOffset; //scroll position of current document from top\n //Parallax in Achievements Section\n if (currentY > triggerAchievement && currentY < triggerInterest) {\n var achievementImage01 = document.getElementById('achievement-image-1');\n var achievementImage02 = document.getElementById('achievement-image-2');\n achievementImage01.style.bottom = -(currentY - triggerAchievement)*0.25 + 'px';\n achievementImage02.style.bottom = -(currentY - triggerAchievement)*0.15 + 'px';\n }\n //Interests sections\n if (currentY > triggerInterest) {\n //car goes left\n var car = document.getElementById('car-image');\n car.style.left = -(currentY - triggerInterest)*0.15 + 'px';\n //Suits go up\n var suits = document.getElementById('suits-image');\n suits.style.top = -(currentY - triggerInterest)*0.15 + 'px';\n //Djokovic goes right\n var djokovic = document.getElementById('djokovic');\n djokovic.style.right = -(currentY - triggerInterest)*0.15 + 'px';\n //Sketch goes bottom\n var sketch = document.getElementById('sketch-image');\n sketch.style.bottom = -(currentY - triggerInterest)*0.15 + 'px';\n }\n }\n}", "function resetParallax(thisDownPage) {\n\t//get the height of the main content pane\n\tvar mainHeight = $('.mainContentPane').height();\n\t//get the window height\n\tvar windowHeight = $(window).height();\n\t//get the parallax weight of the main content pane\n\tvar mainWeight = parseFloat($('.mainContentPane').attr(\"data-parallaxWeight\"));\n\t//calculate the maximum number of scroll steps\n\tmaxScrollStep = Math.floor((mainHeight)/((mainWeight/100)*windowHeight));\n\tminScrollStep = 0;\n\t//set the scroll steps to zero\n\tscrollStep = thisDownPage;\n\t//parallax to the current scroll step, not animating the transition\n\tparallaxTo(((scrollStep/maxScrollStep) * 100), false);\n}", "function onScroll() {\n\n //console.log(\"window.scrollY: \" + window.scrollY);\n\n if (window.scrollY >= 45) {\n //header.classList.add('slip');\n //breadcrumb.classList.add('slip');\n } else {\n //header.classList.remove('slip');\n //breadcrumb.classList.remove('slip');\n }\n\n if (window.scrollY >= origOffsetY) {\n pagehead.classList.add('stickit');\n\n inpagenav.classList.add('dropshadow'); // only on desktop\n } else {\n pagehead.classList.remove('stickit');\n\n inpagenav.classList.remove('dropshadow'); // only on desktop\n }\n\n}", "function bgChanger(){\n if(this.scrollY > this.innerHeight / 2){\n document.body.classList.add('bg-active');\n }else {\n document.body.classList.remove('bg-active');\n }\n}", "function ws_parallax(k,g,a){var c=jQuery;var f=c(this);var d=a.find(\".ws_list\");var b=k.parallax||0.25;var e=c(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_parallax\").appendTo(a);function j(l){return Math.round(l*1000)/1000}var i=c(\"<div>\").css({position:\"absolute\",left:0,top:0,overflow:\"hidden\",width:\"100%\",height:\"100%\",transform:\"translate3d(0,0,0)\"}).appendTo(e);var h=i.clone().appendTo(e);this.go=function(l,r,p){var s=c(g.get(r));s={width:s.width(),height:s.height(),marginTop:s.css(\"marginTop\"),marginLeft:s.css(\"marginLeft\")};p=p?1:-1;var n=c(g.get(r)).clone().css(s).appendTo(i);var o=c(g.get(l)).clone().css(s).appendTo(h);var m=a.width()||k.width;var q=a.height()||k.height;d.hide();wowAnimate(function(v){v=c.easing.swing(v);var x=j(p*v*m),u=j(p*(-m+v*m)),t=j(-p*m*b*v),w=j(p*m*b*(1-v));if(k.support.transform){i.css(\"transform\",\"translate3d(\"+x+\"px,0,0)\");n.css(\"transform\",\"translate3d(\"+t+\"px,0,0)\");h.css(\"transform\",\"translate3d(\"+u+\"px,0,0)\");o.css(\"transform\",\"translate3d(\"+w+\"px,0,0)\")}else{i.css(\"left\",x);n.css(\"margin-left\",t);h.css(\"left\",u);o.css(\"margin-left\",w)}},0,1,k.duration,function(){e.hide();n.remove();o.remove();f.trigger(\"effectEnd\")})}}", "function ws_parallax(k,g,a){var c=jQuery;var f=c(this);var d=a.find(\".ws_list\");var b=k.parallax||0.25;var e=c(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_parallax\").appendTo(a);function j(l){return Math.round(l*1000)/1000}var i=c(\"<div>\").css({position:\"absolute\",left:0,top:0,overflow:\"hidden\",width:\"100%\",height:\"100%\",transform:\"translate3d(0,0,0)\"}).appendTo(e);var h=i.clone().appendTo(e);this.go=function(l,r,p){var s=c(g.get(r));s={width:s.width(),height:s.height(),marginTop:s.css(\"marginTop\"),marginLeft:s.css(\"marginLeft\")};p=p?1:-1;var n=c(g.get(r)).clone().css(s).appendTo(i);var o=c(g.get(l)).clone().css(s).appendTo(h);var m=a.width()||k.width;var q=a.height()||k.height;d.hide();wowAnimate(function(v){v=c.easing.swing(v);var x=j(p*v*m),u=j(p*(-m+v*m)),t=j(-p*m*b*v),w=j(p*m*b*(1-v));if(k.support.transform){i.css(\"transform\",\"translate3d(\"+x+\"px,0,0)\");n.css(\"transform\",\"translate3d(\"+t+\"px,0,0)\");h.css(\"transform\",\"translate3d(\"+u+\"px,0,0)\");o.css(\"transform\",\"translate3d(\"+w+\"px,0,0)\")}else{i.css(\"left\",x);n.css(\"margin-left\",t);h.css(\"left\",u);o.css(\"margin-left\",w)}},0,1,k.duration,function(){e.hide();n.remove();o.remove();f.trigger(\"effectEnd\")})}}", "function ws_parallax(k,g,a){var c=jQuery;var f=c(this);var d=a.find(\".ws_list\");var b=k.parallax||0.25;var e=c(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_parallax\").appendTo(a);function j(l){return Math.round(l*1000)/1000}var i=c(\"<div>\").css({position:\"absolute\",left:0,top:0,overflow:\"hidden\",width:\"100%\",height:\"100%\",transform:\"translate3d(0,0,0)\"}).appendTo(e);var h=i.clone().appendTo(e);this.go=function(l,r,p){var s=c(g.get(r));s={width:s.width(),height:s.height(),marginTop:s.css(\"marginTop\"),marginLeft:s.css(\"marginLeft\")};p=p?1:-1;var n=c(g.get(r)).clone().css(s).appendTo(i);var o=c(g.get(l)).clone().css(s).appendTo(h);var m=a.width()||k.width;var q=a.height()||k.height;d.hide();wowAnimate(function(v){v=c.easing.swing(v);var x=j(p*v*m),u=j(p*(-m+v*m)),t=j(-p*m*b*v),w=j(p*m*b*(1-v));if(k.support.transform){i.css(\"transform\",\"translate3d(\"+x+\"px,0,0)\");n.css(\"transform\",\"translate3d(\"+t+\"px,0,0)\");h.css(\"transform\",\"translate3d(\"+u+\"px,0,0)\");o.css(\"transform\",\"translate3d(\"+w+\"px,0,0)\")}else{i.css(\"left\",x);n.css(\"margin-left\",t);h.css(\"left\",u);o.css(\"margin-left\",w)}},0,1,k.duration,function(){e.hide();n.remove();o.remove();f.trigger(\"effectEnd\")})}}", "function parallaxScroll(){\r\n\tvar scrolled = $(window).scrollTop();\r\n\t//console.log(scrolled);\r\n\t$('#image1').css( 'top', 200-(scrolled * 0.25) );\r\n\t$('#image2').css( 'top', 500-(scrolled * 0.5) );\r\n\t$('#image3').css( 'top', 800-(scrolled * 0.75) );\t\r\n}", "function dotToSlideOne() {\r\n slide1Image.className = slide2Image.className = slide3Image.className = \"hero-image\";\r\n blobBackgrounds.style.opacity = 1;\r\n toOne();\r\n}", "function setActiveClassNxtButton() {\r\n\r\n slide = currentItem;\r\n if (slide == 0) {\r\n\r\n nav1.classList.add('active');\r\n nav6.classList.remove('active');\r\n }\r\n\r\n if (slide == 1) {\r\n nav1.classList.remove('active');\r\n nav2.classList.add('active');\r\n }\r\n\r\n if (slide == 2) {\r\n nav2.classList.remove('active');\r\n nav3.classList.add('active');\r\n }\r\n\r\n if (slide == 3) {\r\n nav3.classList.remove('active');\r\n nav4.classList.add('active');\r\n }\r\n\r\n if (slide == 4) {\r\n nav4.classList.remove('active');\r\n nav5.classList.add('active');\r\n }\r\n\r\n if (slide == 5) {\r\n nav5.classList.remove('active');\r\n nav6.classList.add('active');\r\n }\r\n\r\n TweenLite.from(\".active\", .5, {opacity:.5, scale:2.5});\r\n\r\n\r\n}", "function classActive() {\n for (const section of sections2) {\n const item = section.getBoundingClientRect();\n if (item.top <= 150 && item.bottom >= 150) {\n section.classList.add('your-active-class');\n } else {\n section.classList.remove('your-active-class');\n }\n }\n}", "toggleAnimate() {\n this.carouselContent.classList.toggle('carousel-animate');\n }", "function toggleActiveClass()\r\n{\r\n for(let section of sections)\r\n {\r\n let sectionBorder=section.getBoundingClientRect()\r\n if(sectionBorder.top >=-300 && sectionBorder.top <=100)\r\n {\r\n section.classList.add('your-active-class');\r\n }\r\n else\r\n {\r\n section.classList.remove('your-active-class');\r\n }\r\n }\r\n}", "function toggleActiveClass() {\n for(section of sectionItems){\n if(isInViewport(section)){\n if(!section.classList.contains('your-active-class')){\n section.classList.add('your-active-class');\n }\n }else{\n section.classList.remove('your-active-class');\n }\n }\n}", "function settings() {\n document.querySelector(\".effect\").classList.toggle(\"settings_hide\");\n document.querySelector(\".content\").classList.toggle(\"content_expand\");\n}", "function parallax(){\n pos = $(window).scrollTop(); // get the position of the scrollbar\n \n\t// check to see where the scrollbar is (allow to pause between 1500 and 2500)\n\t// mod3, set3 and set5 never change\n\tif (pos <= 2600) {\n\t mod1 = 0.76923;\n\t mod2 = 0.23077;\n\t mod4 = -0.846;\n\t set1 = -1800;\n\t set2 = -400;\n\t set4 = 2400;\n\t} else if(pos > 2600 && pos <= 3200) {\n\t mod1 = -0.30769;\n\t mod2 = -0.30769;\n\t mod4 = -0.30769;\n\t set1 = 1000;\n\t set2 = 1000;\n\t set4 = 1000;\n\t} else if(pos > 3200) {\n\t mod1 = 0.76923;\n\t mod2 = 0.23077;\n\t mod4 = -0.846;\n\t set1 = -2445;\n\t set2 = -722;\n\t set4 = 2723;\n\t}\n\t\n\tlayer1 = set1 + pos * mod1; // create var for the starting position for .png's\n\tlayer2 = set2 + pos * mod2;\n\tlayer3 = set3 + pos * mod3;\n\tlayer4 = set4 + pos * mod4;\n\tlayer5 = set5 + pos * mod3;\n\tlayer6 = set5 + pos * mod3;\n\tlayer1 = Math.round(layer1); // round the values to a whole number\n\tlayer2 = Math.round(layer2);\n\tlayer3 = Math.round(layer3);\n\tlayer4 = Math.round(layer4);\n\tlayer5 = Math.round(layer5);\n\tlayer6 = Math.round(layer6);\n\t\n\tpdiv1.css({\"top\" : +layer1+ \"px\" }); // same as above\n\tpdiv2.css({\"top\" : +layer2+ \"px\" });\n\tpdiv3.css({\"top\" : +layer3+ \"px\" });\n\tpdiv4.css({\"top\" : +layer4+ \"px\" });\n\tpdiv5.css({\"top\" : +layer5+ \"px\" });\n\tpdiv6.css({\"top\" : +layer6+ \"px\" });\n }", "function fondo() {\n $(window).scroll(function () {\n if ($(this).scrollTop() > 350) {\n $(\"body\").addClass(\"cambio\");\n }\n if ($(this).scrollTop() < 350) {\n $(\"body\").removeClass(\"cambio\");\n }\n });\n}", "function parallaxIt() {\n\n if(window.innerHeight < $('.first-hero').innerHeight()) {\n return;\n }\n\n // create variables\n var $fwindow = $(window);\n var scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n\n // on window scroll event\n $fwindow.on('scroll resize', function() {\n scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n }); \n\n // for each of content parallax element\n $('[data-type=\"content\"]').each(function (index, e) {\n var $contentObj = $(this);\n var fgOffset = parseInt($contentObj.offset().top);\n var yPos;\n var speed = ($contentObj.data('speed') || 1 );\n\n $fwindow.on('scroll resize', function (){\n yPos = fgOffset - scrollTop / speed; \n\n $contentObj.css('top', yPos);\n });\n });\n\n // for each of background parallax element\n $('[data-type=\"background\"]').each(function(){\n var $backgroundObj = $(this);\n var bgOffset = parseInt($backgroundObj.offset().top);\n var yPos;\n var coords;\n var speed = ($backgroundObj.data('speed') || 0 );\n\n $fwindow.on('scroll resize', function() {\n yPos = - ((scrollTop - bgOffset) / speed); \n coords = '50% '+ yPos + 'px';\n\n $backgroundObj.css({ backgroundPosition: coords });\n }); \n }); \n\n // triggers winodw scroll for refresh\n $fwindow.trigger('scroll');\n}", "function toggleActiveState() {\n document.addEventListener(\"scroll\", function (event) {\n const sections = document.querySelectorAll(\"section\");\n let links = document.querySelectorAll(\".menu__link\");\n for (const section of sections) {\n if(isElementOnScreen(section)) {\n section.classList.add('your-active-class') //\n links.forEach((link) => {\n const isActiveLink = link.getAttribute(\"href\") === section.id;\n link.classList.toggle(\"link__active\", isActiveLink);\n });\n } else {\n section.classList.remove(\"your-active-class\");\n }\n }\n });\n }", "function toggleDarkness(){\n\t\n\tfor(var i=0; i<transformables.length; i++){\n\t\t$(transformables[i]).toggleClass(\"dark\");\n\t}\n}", "function parallaxOpacity() {\n\n const OPACITY_VALUE = 0.1;\n\n // Hide when we scroll down! The opacity is substracted from\n // our global opacity value.\n\n if (scrollDifference > 0) {\n\n console.log(\"Hide\");\n\n if (opacity > 0) {\n opacity -= OPACITY_VALUE;\n }\n\n // and Show when we scroll up. Added to our opacity value.\n\n } else if (scrollDifference < 0) {\n\n\n console.log(\"Show\");\n if (opacity < 1) {\n opacity += OPACITY_VALUE;\n }\n }\n\n $(\"#beginningtext\").css(\"opacity\", opacity);\n\n\n}", "function scrollingHeroFixed (){\n if (apolloConfig.heroStyle==\"fixed\"){\n if (window.innerHeight < window.pageYOffset){\n if (!document.getElementById(\"hero\").classList.contains(\"scroll-opacity\")){\n document.getElementById(\"hero\").classList.add(\"scroll-opacity\");\n }\n }else{\n if (document.getElementById(\"hero\").classList.contains(\"scroll-opacity\")){\n document.getElementById(\"hero\").classList.remove(\"scroll-opacity\");\n }\n }\n }\n}", "function BodyToggleClass(n){\n if(n === true){\n $body.toggleClass('mob-side-navbar-in');\n } else {\n $body.removeClass('mob-side-navbar-in'); \n }\n }", "function rouge(){\n\tToggleRectangle.classList.toggle('important');\n}", "function toggleActiveState(){\n let sectionBound = Math.min(Math.abs(sections[0].getBoundingClientRect().top), Math.abs(sections[1].getBoundingClientRect().top), Math.abs(sections[2].getBoundingClientRect().top), Math.abs(sections[3].getBoundingClientRect().top));\n sections.forEach(sec => {\n if (sec.getBoundingClientRect().top == sectionBound) { \n sec.classList.add('your-active-class') \n } else{\n sec.classList.remove('your-active-class');\n }\n })\n}", "function bgdia2(){\r\n var selector = document.getElementById(\"boody\");\r\n selector.className = '';\r\n selector.classList.toggle(\"dia2\");\r\n}", "function handler() {\n let scrpos=window.pageYOffset || document.scrollingElement.scrollTop;\n let vh=window.innerHeight\n let homePos=scrpos+home.getBoundingClientRect().top;\n let aboutPos=scrpos+about.getBoundingClientRect().top;\n let servicesPos=scrpos+services.getBoundingClientRect().top;\n let portfolioPos=scrpos+portfolio.getBoundingClientRect().top;\n let contactPos=scrpos+contact.getBoundingClientRect().top;\n\n if(scrpos>=homePos && scrpos<=(homePos+home.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.home a\").classList.add('active')\n document.querySelector(\".nav-item.home\").classList.add('active')\n\n //home paralax effect\n let parax=home.querySelectorAll('[data-paralax]');\n parax.forEach(elm=>{\n paralax(elm,scrpos)\n })\n }else{\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n }\n if(scrpos>=aboutPos && scrpos<=(aboutPos+about.clientHeight)){\n //just incase about me pGW DOES NOT occupiy the whole of viewport\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n \n //make it active\n document.querySelector(\".menu-item.about a\").classList.add('active')\n document.querySelector(\".nav-item.about\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.about a\").classList.remove('active')\n document.querySelector(\".nav-item.about\").classList.remove('active')\n }\n if(scrpos>=servicesPos && scrpos<=(servicesPos+services.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.services a\").classList.add('active')\n document.querySelector(\".nav-item.services\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.services a\").classList.remove('active')\n document.querySelector(\".nav-item.services\").classList.remove('active')\n }\n if(scrpos>=portfolioPos && scrpos<=(portfolioPos+portfolio.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.portfolio a\").classList.add('active')\n document.querySelector(\".nav-item.portfolio\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n }\n\n if(scrpos>=contactPos || scrpos>=(document.scrollingElement.scrollHeight-vh)){\n //make it active\n //disblae portfolio active class since contact me is not a full page section\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n\n document.querySelector(\".menu-item.contact-me a\").classList.add('active')\n document.querySelector(\".nav-item.contact-me\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.contact-me a\").classList.remove('active')\n document.querySelector(\".nav-item.contact-me\").classList.remove('active')\n }\n}", "function initParallax(){\n \"use strict\";\n\n if($j('.parallax_section_holder').length){\n $j('.parallax_section_holder').each(function() {\n var parallaxElement = $j(this);\n if(parallaxElement.hasClass('qode_full_screen_height_parallax')){\n parallaxElement.height($window_height);\n //parallaxElement.find('.qodef-parallax-content-outer').css('padding',0);\n }\n var speed = parallaxElement.data('speed')*0.4;\n parallaxElement.parallax(\"50%\", speed);\n });\n }\n}", "function togglePilihPenumpang(){\n\ttoggleByClass(\"slide-div-bottom-penumpang\");\n}", "function toggleActiveClass() {\r\n allSections.forEach(sec => {\r\n let location = sec.getBoundingClientRect(); // get the section dimensions\r\n let allAnchors = document.querySelectorAll('.menu__link'); // store all anchors\r\n if (location.top > -50 && location.top < 250) { // condition for selecting section in viewport\r\n removeActiveClass(); // remove active classs from sections\r\n addActiveClass(sec); // applying active class to the section in viewport\r\n }\r\n allAnchors.forEach(link => {\r\n link.classList.remove('active__class');\r\n if (sec.getAttribute('data-nav') == link.textContent ) {\r\n link.classList.add('active__class');\r\n }\r\n });\r\n });\r\n}", "function thememascot_topnav_animate() {\n if ($(window).scrollTop() > (50)) {\n $(\".navbar-sticky-animated\").removeClass(\"animated-active\");\n } else {\n $(\".navbar-sticky-animated\").addClass(\"animated-active\");\n }\n\n if ($(window).scrollTop() > (50)) {\n $(\".navbar-sticky-animated .header-nav-wrapper .container\").removeClass(\"pt-20\").removeClass(\"pb-20\");\n } else {\n $(\".navbar-sticky-animated .header-nav-wrapper .container\").addClass(\"pt-20\").addClass(\"pb-20\");\n }\n }", "function toggleIt() {\n img.classList.toggle(\"round\");\n}", "function bgStellar() {\n var stellarImg = $('.bg-img').find('img');\n //parallax background is turned off iOS, Android, BlackBerry, Windows Phone and for Firefox and Safari the plugin doesn't work properly\n if (iOS || Android || BlackBerry || Windows || isFirefox || isSafari) {\n stellarImg.attr(\"data-stellar-ratio\", 1);\n } else {\n $.stellar({\n horizontalScrolling: false,\n responsive: true,\n hideDistantElements: false,\n verticalOffset: 0,\n horizontalOffset: 0\n });\n }\n }", "function ToggleActiveClass3(){\n\n const react = sections[2].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[2].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[2].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[2].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[2].style.background = \"\";\n }\n }", "function goSwitch(e) {\n smoothScrollTo(spacing, 400);\n if (e.target.id == \"links1\") {\n aboutContent.classList.remove(\"hidden\");\n aboutContent.classList.add(\"fadeIn\", \"items\");\n philosophyContent.classList.add(\"hidden\");\n teamContent.classList.add(\"hidden\");\n\n //document.querySelector(\"#about-wrapper\").style.backgroundImage = \"url('http://i31.photobucket.com/albums/c355/zHiME/MSYG%20TEMP/about-us-bg-v2-1.jpg~original')\";\n }\n }", "toggleNav() {\n if ($(\"#offcanvas-menu-react\").hasClass(\"navslide-show\")) {\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n }\n else {\n $(\".nav-canvas\").css(\"position\", \"relative\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".navbar\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n }\n }", "function parallaxIt() {\n\t// create variables\n\tvar $fwindow = $(window);\n\tvar scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n\n\tvar $contents = [];\n\tvar $contentimages = [];\n\tvar $backgrounds = [];\n\n\t// for each of content parallax element\n\t$('[data-type=\"content\"]').each(function(index, e) {\n\t\tvar $contentObj = $(this);\n\n\t\t$contentObj.__speed = ($contentObj.data('speed') || 1);\n\t\t$contentObj.__fgOffset = $contentObj.offset().top;\n\t\t$contents.push($contentObj);\n\t});\n\n\t// for each of background parallax element\n\t$('[data-type=\"background\"]').each(function() {\n\t\tvar $backgroundObj = $(this);\n\n\t\t$backgroundObj.__speed = ($backgroundObj.data('speed') || 1);\n\t\t$backgroundObj.__fgOffset = $backgroundObj.offset().top;\n\t\t$backgrounds.push($backgroundObj);\n\t});\n\n\t// for each of image parallax element\n\t$('[data-type=\"image\"]').each(function(index, e) {\n\t\tvar $contentimageObj = $(this);\n\n\t\t$contentimageObj.__speed = ($contentimageObj.data('speed') || 1);\n\t\t$contentimageObj.__fgOffset = $contentimageObj.offset().top;\n\t\t$contentimages.push($contentimageObj);\n\t});\n\n\t// update positions\n\t$fwindow.on('scroll resize', function() {\n\t\tscrollTop = window.pageYOffset || document.documentElement.scrollTop;\n\n\t\t$contents.forEach(function($contentObj) {\n\t\t\tvar yPos = $contentObj.__fgOffset - scrollTop / $contentObj.__speed;\n\n\t\t\t$contentObj.css('top', yPos);\n\t\t});\n\n\t\t$contentimages.forEach(function($contentimageObj) {\n\t\t\tvar yPos = ( $contentimageObj.__fgOffset - scrollTop / $contentimageObj.__speed ) / 6;\n\n\t\t\t$contentimageObj.css('top', yPos);\n\t\t});\n\n\t\t$backgrounds.forEach(function($backgroundObj) {\n\t\t\tvar yPos = -((scrollTop - $backgroundObj.__fgOffset) / $backgroundObj.__speed);\n\n\t\t\t$backgroundObj.css({\n\t\t\t\tbackgroundPosition: '50% ' + yPos + 'px'\n\t\t\t});\n\t\t});\n\t});\n\n\t// triggers winodw scroll for refresh\n\t$fwindow.trigger('scroll');\n}", "function feedbackParallax(wScroll) {\n for (let i = 0; i < speedFeedbackArr.length; i++) {\n var coords = wScroll / -speedFeedbackArr[i] + 'px';\n feedbackLayers[i].style.transform = `translateY(${coords})`;\n }\n}", "function change_menu_class(){\n var scrollPos = $(document).scrollTop();\n if (scrollPos >= $('.main-navigation').outerHeight()) {\n $('.main-navigation').addClass(\"active-background\");\n } else {\n $('.main-navigation').removeClass(\"active-background\");\n $('body').css(\"padding-top:0;\");\n }\n if (scrollPos >= $('.main-header').outerHeight()) {\n $('body').addClass(\"padding-active\");\n } else {\n $('body').removeClass(\"padding-active\");\n }\n }", "changeActiveClass(){\n this.slideArray.forEach((item) => item.element.classList.remove(this.activeClass))\n this.slideArray[this.index.active].element.classList.add(this.activeClass);\n }", "function ws_glass_parallax(d,l,m){var f=jQuery;var i=f(this);var j=d.parallax||0.25;var k=f(\"<div>\").css({position:\"absolute\",display:\"none\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).addClass(\"ws_effect ws_glass_parallax\").appendTo(m);var h=!d.noCanvas&&!window.opera&&!!document.createElement(\"canvas\").getContext;if(h){try{document.createElement(\"canvas\").getContext(\"2d\").getImageData(0,0,1,1)}catch(q){h=0}}function t(e){return Math.round(e*1000)/1000}var u=f(\"<div>\").css({position:\"absolute\",left:0,top:0,overflow:\"hidden\",width:\"100%\",height:\"100%\",transform:\"translate3d(0,0,0)\",zIndex:1}).appendTo(k);var s=u.clone().appendTo(k);var r=u.clone().css({width:\"20%\"}).appendTo(k);var c;var p=u.clone().appendTo(k).css({zIndex:0});this.go=function(C,A,x){var e=f(l.get(A));e={position:\"absolute\",width:e.width(),height:e.height(),marginTop:e.css(\"marginTop\"),marginLeft:e.css(\"marginLeft\")};x=x?1:-1;var E=f(l.get(A)).clone().css(e).appendTo(u);var z=f(l.get(C)).clone().css(e).appendTo(s);var v=f(l.get(C)).clone().css(e).appendTo(r);if(x==-1){r.css({left:\"auto\",right:0});v.css({left:\"auto\",right:0})}else{r.css({left:0,right:\"auto\"});v.css({left:0,right:\"auto\"})}var D=(m.width()||d.width)*1.3;var B=m.height()||d.height;var y;if(h){if(!c){c=f(\"<canvas>\").css({position:\"absolute\",left:0,top:0}).attr({width:e.width,height:e.height}).appendTo(p)}c.css(e).attr({width:e.width,height:e.height});y=o(f(l.get(C)),e,10,c.get(0))}if(!h||!y){h=0}wowAnimate(function(G){G=f.easing.swing(G);var L=t(x*G*D),F=t(x*(-D+G*D-(1-G)*D*0.2)),J=t(x*(-D*1.4+G*(D*1.4+D/1.3))),w=t(-x*D*j*G),H=t(x*D*j*(1-G)),I=t(-x*D*(j+0.2)*G),K=t(x*(-D*0.2+G*D*0.4));if(d.support.transform){u.css(\"transform\",\"translate3d(\"+L+\"px,0,0)\");E.css(\"transform\",\"translate3d(\"+w+\"px,0,0)\");s.css(\"transform\",\"translate3d(\"+F+\"px,0,0)\");z.css(\"transform\",\"translate3d(\"+H+\"px,0,0)\");r.css(\"transform\",\"translate3d(\"+J+\"px,0,0)\");v.css(\"transform\",\"scale(1.6) translate3d(\"+I+\"px,0,0)\");p.css(\"transform\",\"translate3d(\"+K+\"px,0,0)\")}else{u.css(\"left\",L);E.css(\"margin-left\",w);s.css(\"left\",F);z.css(\"margin-left\",H);r.css(\"left\",J);v.css(\"margin-left\",I);p.css(\"left\",K)}},0,1,d.duration,function(){k.hide();E.remove();z.remove();v.remove();i.trigger(\"effectEnd\")})};function o(C,A,B,v){var F=(parseInt(C.parent().css(\"z-index\"))||0)+1;if(h){var I=v.getContext(\"2d\");I.drawImage(C.get(0),0,0,A.width,A.height);if(!a(I,0,0,v.width,v.height,B)){return 0}return f(v)}var J=f(\"<div></div>\").css({position:\"absolute\",\"z-index\":F,left:0,top:0}).css(A).appendTo(v);var H=(Math.sqrt(5)+1)/2;var w=1-H/2;for(var z=0;w*z<B;z++){var D=Math.PI*H*z;var e=(w*z+1);var G=e*Math.cos(D);var E=e*Math.sin(D);f(document.createElement(\"img\")).attr(\"src\",C.attr(\"src\")).css({opacity:1/(z/1.8+1),position:\"absolute\",\"z-index\":F,left:Math.round(G)+\"px\",top:Math.round(E)+\"px\",width:\"100%\",height:\"100%\"}).appendTo(J)}return J}var g=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259];var n=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a(am,U,S,v,w,ad){if(isNaN(ad)||ad<1){return}ad|=0;var ah;try{ah=am.getImageData(U,S,v,w)}catch(al){console.log(\"error:unable to access image data: \"+al);return false}var C=ah.data;var ab,aa,aj,ag,J,M,G,A,B,R,H,T,P,X,ac,K,F,L,N,W;var ak=ad+ad+1;var Y=v<<2;var I=v-1;var af=w-1;var E=ad+1;var ae=E*(E+1)/2;var V=new b();var Q=V;for(aj=1;aj<ak;aj++){Q=Q.next=new b();if(aj==E){var D=Q}}Q.next=V;var ai=null;var Z=null;G=M=0;var O=g[ad];var z=n[ad];for(aa=0;aa<w;aa++){X=ac=K=A=B=R=0;H=E*(F=C[M]);T=E*(L=C[M+1]);P=E*(N=C[M+2]);A+=ae*F;B+=ae*L;R+=ae*N;Q=V;for(aj=0;aj<E;aj++){Q.r=F;Q.g=L;Q.b=N;Q=Q.next}for(aj=1;aj<E;aj++){ag=M+((I<aj?I:aj)<<2);A+=(Q.r=(F=C[ag]))*(W=E-aj);B+=(Q.g=(L=C[ag+1]))*W;R+=(Q.b=(N=C[ag+2]))*W;X+=F;ac+=L;K+=N;Q=Q.next}ai=V;Z=D;for(ab=0;ab<v;ab++){C[M]=(A*O)>>z;C[M+1]=(B*O)>>z;C[M+2]=(R*O)>>z;A-=H;B-=T;R-=P;H-=ai.r;T-=ai.g;P-=ai.b;ag=(G+((ag=ab+ad+1)<I?ag:I))<<2;X+=(ai.r=C[ag]);ac+=(ai.g=C[ag+1]);K+=(ai.b=C[ag+2]);A+=X;B+=ac;R+=K;ai=ai.next;H+=(F=Z.r);T+=(L=Z.g);P+=(N=Z.b);X-=F;ac-=L;K-=N;Z=Z.next;M+=4}G+=v}for(ab=0;ab<v;ab++){ac=K=X=B=R=A=0;M=ab<<2;H=E*(F=C[M]);T=E*(L=C[M+1]);P=E*(N=C[M+2]);A+=ae*F;B+=ae*L;R+=ae*N;Q=V;for(aj=0;aj<E;aj++){Q.r=F;Q.g=L;Q.b=N;Q=Q.next}J=v;for(aj=1;aj<=ad;aj++){M=(J+ab)<<2;A+=(Q.r=(F=C[M]))*(W=E-aj);B+=(Q.g=(L=C[M+1]))*W;R+=(Q.b=(N=C[M+2]))*W;X+=F;ac+=L;K+=N;Q=Q.next;if(aj<af){J+=v}}M=ab;ai=V;Z=D;for(aa=0;aa<w;aa++){ag=M<<2;C[ag]=(A*O)>>z;C[ag+1]=(B*O)>>z;C[ag+2]=(R*O)>>z;A-=H;B-=T;R-=P;H-=ai.r;T-=ai.g;P-=ai.b;ag=(ab+(((ag=aa+E)<af?ag:af)*v))<<2;A+=(X+=(ai.r=C[ag]));B+=(ac+=(ai.g=C[ag+1]));R+=(K+=(ai.b=C[ag+2]));ai=ai.next;H+=(F=Z.r);T+=(L=Z.g);P+=(N=Z.b);X-=F;ac-=L;K-=N;Z=Z.next;M+=v}}am.putImageData(ah,U,S);return true}function b(){this.r=0;this.g=0;this.b=0;this.a=0;this.next=null}}", "function changeBGAct4 (){\n removeClasses();\n body.classList.add(\"act4\");\n}", "function activatingTheActiveClass() { \r\n // this loop will make everything inside of it work the exact way for every element in the \"sectionCollectio\" Array\r\n for (section of sectionCollection) {\r\n if(checkViewPort(section)) {\r\n // does it contain this class?\r\n if (!section.classList.contains('your-active-class')) {\r\n // if no, then this will add the class\r\n section.classList.add('your-active-class')\r\n }\r\n } else { // and here will remove the class when its out of the viewport\r\n section.classList.remove('your-active-class')\r\n }\r\n }\r\n}", "function changeBGAct3 (){\n removeClasses();\n body.classList.add(\"act3\");\n}", "function ToggleActiveClass4(){\n\n const react = sections[3].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[3].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[3].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[3].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[3].style.background = \"\";\n }\n }", "function changeStyle() {\n let $landing = $('#landing');\n flashWhite();\n\n // Switch from pixel to art\n if(!$landing.hasClass('landing-art')) {\n $landing.addClass('landing-art');\n $('#logo').html(`<img src=\"img/profile-art.png\">`);\n } else { // Switch from art to pixel\n $landing.removeClass('landing-art');\n $('#logo').html(`<img src=\"img/profile.png\">`);\n }\n}", "function ToggleActiveClass1(){\n\n const react = sections[0].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[0].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[0].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[0].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[0].style.background = \"\";\n }\n }", "function eltdInitParallax(){\n\n if($('.eltd-parallax-section-holder').length){\n $('.eltd-parallax-section-holder').each(function() {\n\n var parallaxElement = $(this);\n if(parallaxElement.hasClass('eltd-full-screen-height-parallax')){\n parallaxElement.height(eltd.windowHeight);\n parallaxElement.find('.eltd-parallax-content-outer').css('padding',0);\n }\n var speed = parallaxElement.data('eltd-parallax-speed')*0.4;\n parallaxElement.parallax(\"50%\", speed);\n });\n }\n}", "gameSlideIn() {\n this.gameContainer.classList.add('slideIn');\n }", "function caseSwitch(){\n\n\n if ($('body').hasClass('other')) {\n\n\n } else {\n\n $('#wet, #wet-link').on('click', function(){\n console.log('sdasdasd');\n $(\".anlagen-bild\").css({'transform':'translate(-480px, -250px) scale(4.3)'});\n\n })\n\n }\n }", "function changePossession() {\n leftDiv.classList.toggle(\"possessionIndicator\");\n rightDiv.classList.toggle(\"possessionIndicator\");\n}", "function toggleBG(){\n\t \n\t \n\t \n\t $(\".top-logo\").toggleClass(\"accesbilitie_theme\");\n\t\t\t$(\".content\").toggleClass(\"accesbilitie_theme\");\n\t\t\t$(\"body\").toggleClass(\"accesbilitie_theme\");\n\t\t\t$(\"footer\").toggleClass(\"footer_disble\");\n\t\t\t$(\".top-logo\").toggleClass(\"top-logo_disble\");\n\t\t\t$(\".navbar-default\").toggleClass(\"nav_dasability\");\n\t\t\t$(\"footer ul li a\").toggleClass(\"footer_disble_m\");\n\t\t\t$(\".ch-person\").toggleClass(\"nav_dasability\");\n\t\t\t$(\".ch-person h4\").toggleClass(\"nav_dasability\");\n\t\t\t$(\".ch-person a\").toggleClass(\"nav_dasability\");\n\t\t\t$(\".logo-sec\").toggleClass(\"logo-sec_accesibility\");\n\t\t\t$(\".ut_name\").toggleClass(\"ut_name_accesibility\");\n\t\t\t$(\".flipkart-navbar-button\").toggleClass(\"nav_btn_dasability\");\n\t\t\t$(\".news_cover\").toggleClass(\"news_cover_accebility\");\n\t\t\t$(\".navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover\").toggleClass(\"nav_active\");\n\t\t\t\n\t\n }", "function effectsSection() {\n // alert(\"effects clicked\");\n $(\"#effects\").addClass(\"actively_selected\");\n $(\"#solo_images, #all_panel, #videos\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n}", "function activarPegajoso(){\n\n let bajada = document.documentElement.scrollTop;\n\n if(bajada !=0){\n\n header.classList.add(\"cambio\");\n\n\n\n }else{\n\n header.classList.remove(\"cambio\");\n\n }\n\n}", "function cross(x) {\n\t\tx.classList.toggle('change');\n\t\t$('.main-menu').slideToggle();\n\t\t$('.main').toggleClass('dark');\n\t\t$('#about-icons').slideToggle();\n\t}" ]
[ "0.71267295", "0.67138356", "0.67019784", "0.67006934", "0.66072565", "0.66039675", "0.64794314", "0.64312214", "0.63257366", "0.6320193", "0.61819607", "0.6168852", "0.61629343", "0.61558247", "0.61356336", "0.6132324", "0.6131049", "0.60918564", "0.60825837", "0.60825837", "0.60825837", "0.606997", "0.6055601", "0.6039718", "0.6033699", "0.6018365", "0.6016582", "0.59802717", "0.5969899", "0.5968298", "0.5942884", "0.5936408", "0.5925977", "0.5912557", "0.590051", "0.58724606", "0.5855831", "0.58530605", "0.5852953", "0.5845718", "0.58379453", "0.5831326", "0.583067", "0.5795464", "0.5790901", "0.5790901", "0.57746243", "0.5767405", "0.5755184", "0.5752332", "0.57420117", "0.57420117", "0.57420117", "0.5736511", "0.5735933", "0.5724527", "0.5721496", "0.57132924", "0.57045174", "0.57006985", "0.56894964", "0.56884015", "0.5686253", "0.5679872", "0.56769174", "0.56665725", "0.5632481", "0.5629403", "0.56230605", "0.56230545", "0.56146115", "0.56116176", "0.5597978", "0.5597851", "0.559524", "0.55938864", "0.5591991", "0.55849737", "0.55822426", "0.5579132", "0.5578126", "0.55730677", "0.5568044", "0.5565915", "0.5563317", "0.55550426", "0.5550909", "0.555041", "0.55460393", "0.5545094", "0.5533347", "0.5529023", "0.55271494", "0.5526818", "0.5525735", "0.5512139", "0.55077004", "0.5505992", "0.55037713", "0.5501985", "0.54957664" ]
0.0
-1
This function will toggle a class that will hide the popup and remove it from the reach of screenreaders
function exitPopup(){ //console.log("You have clicked the exit button"); popwrap.classList.add("no-read"); localStorage.visits = 1; //After the popup has been closed once, the visit is logged and it should not appear again. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function togglePopUp() {\n const popUp = document.querySelector('.popup_bg');\n popUp.classList.toggle('hide');\n}", "function togglePopup() {\n const popup = document.querySelector('.popup-background');\n popup.classList.toggle('hide');\n}", "function abrePopUp() {\n var popup = document.getElementById(\"popup\");\n popup.classList.toggle(\"show\");\n}", "function makeVisible(){\n\t\tpopwrap.classList.remove(\"no-read\");\n\t}", "function myProfil2() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function myProfil3() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function mostarPopUp(){\n\tvar popup = document.getElementById('myPopup');\n\t popup.classList.toggle('show');\n}", "function hide() {\n document.querySelector(\".popup\").style.display = 'none'\n}", "function mostarPopUp2(){\n\tvar popup = document.getElementById('myPopup2');\n\t popup.classList.toggle('show');\n}", "function hide() {\n\n document.querySelector(\".popup\").style.display = 'none'\n}", "function myProfil() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function popupFunction() {\r\n var popup = document.getElementById(\"myPopup\");\r\n popup.classList.toggle(\"show\");\r\n}", "function displayPopup() {\n membershipPopup.classList.toggle(\"openPopup\");\n }", "function togglePopup(){\n document.getElementById(\"popup-1\").classList.toggle(\"active\");\n}", "function popup_function() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function closePopup() {\r\n document.querySelector(`.popup`).classList.remove(`open`)\r\n}", "function myFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function togglePopup() {\n\tconst modal = $('.popupBackground');\n\tmodal.toggleClass('hideit');\n}", "function myFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function openPopup() {\n var popup = document.getElementById(\"popup\");\n popup.classList.toggle(\"show\");\n}", "function closePopup() {\r\n popup.style.display = \"none\";\r\n blur.classList = \"\";\r\n}", "function close_popup_premises(){\r\n\tdocument.getElementById('popup_premises').className=\"inactive\";\r\n\t}", "function HideGainedLife() {\n\tvar panel = $(\"#1UpPopup\");\n\tpanel.SetHasClass(\"Play1Up\", false);\n}", "function toggleShow() {\n activityPage.classList.remove('hidden');\n}", "function hidePopup() {\n popup.classList.remove('show');\n containerRouteButtons.querySelector('[class*=\"active\"]').classList.remove('active');\n containerForm.querySelector('[class*=\"active\"]').classList.remove('active');\n}", "function closeClassesModal2() {\n document.getElementById('classes-pop-screen').style.display='none';\n}", "function closePreviewPopup() {\n /* hide popup, by adding hide class */\n removeClass(\"preview-popup\", \"show-preview-popup\");\n\n /* show button, by removing the hide class */\n removeClass(\"preview-button\",\"preview-button-expand\");\n removeClass(\"preview-button-icon\", \"hide-me\");\n\n}", "function toggleLeaderboard() {\n var popup = document.getElementById(\"leaderboard-popup\");\n var button = document.getElementById(\"leaderboard-button\");\n if(popup.classList.toggle(\"show\")) {\n button.value = \"Hide Leaderboard\";\n }\n else {\n button.value = \"Show Leaderboard\"\n } \n \n}", "function toggle(){\n var blur = document.getElementById('blur');\n blur.classList.toggle('active');\n \n var popup = document.getElementById('popup');\n popup.classList.toggle('active');\n}", "function close_popup_organisation(){\r\n\t\tdocument.getElementById('popup_organisation').className=\"inactive\";\r\n\t}", "function displayPopup() {\r\n popup.style.display = \"block\";\r\n blur.classList.toggle(\"active\");\r\n}", "function toggle_notification()\n{\n if($(\".notification-popup\").hasClass(\"hide\")) {\n $(\".notification-popup\").removeClass(\"hide\"); \n // unexpand profile popup\n $(\".profile\").removeClass(\"focus\"); \n $(\".profile-popup\").addClass(\"hide\");\n }else{\n $(\".notification-popup\").addClass(\"hide\");\n // unexpand profile popup\n $(\".profile\").removeClass(\"focus\"); \n $(\".profile-popup\").addClass(\"hide\");\n }\n\n // hide notification bubble\n $(\".buble-notification\").hide();\n}", "function notificationFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function notificationFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function HideLostLife() {\n\tvar panel = $(\"#1UpPopup\");\n\tpanel.SetHasClass(\"Play1Up\", false);\n\tpanel.SetHasClass(\"LifeLost\", false);\n}", "function closePrefect() {\n document.querySelector(\".prefect-container\").classList.add(\"hide\");\n document.querySelector(\".student-info\").classList.remove(\"hide\");\n document.querySelector(\".student-actions\").classList.remove(\"hide\");\n}", "openPopUp(){\r\n // Hide the back panel.\r\n const element = document.getElementsByClassName(StylesPane.HideBackPanel)[0]\r\n element.className = StylesPane.BackPanel\r\n // Show the settings panel.\r\n }", "function hide () {\n modal.classList.remove('modalOn');\n document.getElementById('modalOff').innerHTML = '';\n}", "function popupHide(elem){\n document.body.style.overflow = '';\n elem.classList.add('popup_hide');\n \n setTimeout(function(){\n elem.classList.remove('popup_error');\n elem.classList.remove('popup_show');\n elem.classList.remove('popup_hide');\n }, 700);\n}", "function hidePopup(clsName){\njQuery('.'+clsName).hide();\njQuery('.popupBg').hide();\n}", "function popup_profile()\n{\n if($(\".profile-popup\").hasClass(\"hide\"))\n {\n $(\".profile-popup\").removeClass(\"hide\");\n $(\".profile\").addClass(\"focus\");\n $(\".notification-popup\").addClass(\"hide\"); // hide notification\n }else{\n $(\".profile-popup\").addClass(\"hide\");\n $(\".profile\").removeClass(\"focus\");\n $(\".notification-popup\").addClass(\"hide\"); // hide notification\n }\n}", "function forgotPIN() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function openClosePopup() {\n var guidePane = document.getElementById(\"guideAreaInfo\");\n if(guidePane.style.visibility === \"hidden\"){\n guidePane.style.visibility = \"visible\";\n }\n else{\n guidePane.style.visibility = \"hidden\";\n }\n}", "function openBubble() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "close() {\n document.body.classList.remove(FolderSettings.CSS.panelOpenedModifier);\n this.opened = false;\n }", "function closeProfile() {\r\n // making user info box invisible----\r\n document.querySelector('.main').style.visibility = 'hidden';\r\n}", "close() {\n this._showPopup = false;\n }", "function TUI_toggle_class(className)\n{\n var hidden = toggleRule('tui_css', '.'+className, 'display: none !important');\n TUI_store(className, hidden ? '' : '1');\n TUI_toggle_control_link(className);\n}", "hide() {\n\t\tthis.panelEl.classList.remove(classes.panel.open);\n\t\tthis.panelEl.classList.add(classes.panel.closed);\n\t}", "function openLaserAttacks(){\n\tdocument.getElementById(\"modal-backdrop-laser-attack\").classList.remove(\"inactive\");\n\tdocument.getElementById(\"modal-laser-attack\").classList.remove(\"inactive\");\n}", "function PopUpHide(){\r\n $(\"#PopUp\").hide(250);\r\n}", "function closePopUp() {\n popUpSection.style.display = \"none\";\n }", "function openSonar(){\n\tdocument.getElementById(\"modal-sonar\").classList.remove(\"inactive\");\n}", "function PopUpHide(){\n let popup = document.getElementById('exit_confirmation');\n popup.style.display = 'none';\n}", "function showShareDesktop() {\n profile.classList.remove(\"profile-active\");\n shareDesktop.classList.toggle(\"active\");\n}", "function showShare() {\n shareDesktop.classList.remove(\"active\");\n profile.classList.toggle(\"profile-active\");\n}", "function hideForSubscribed() {\n js_cookie__WEBPACK_IMPORTED_MODULE_3___default.a.set('NL_POPUP_HIDE', 1, {\n expires: 7\n });\n}", "function hideCard(card) {\n card.classList.remove('open','show');\n}", "function closePopup()\n{\n modal.style.display = \"none\";\n pagecontent.className = pagecontent.className.replace(\n \" de-emphasized\", \"\");\n}", "function closeListPopup() {\r\n listPopup.style.display = \"none\";\r\n blur.classList = \"\";\r\n}", "function toggle(){\n var blur = document.getElementById('portfolio');\n blur.classList.toggle('active')\n\n var popup = document.getElementById('popup');\n popup.classList.toggle('active')\n}", "function show(e){\n e.classList.remove(\"Hide\");\n}", "function myFunction(aaa) {\n var popup = document.getElementById(aaa);\n popup.classList.toggle(\"show\"); \n}", "function closeCodeDescriptionPopUp(){\r\n $('#code_desc_popup').css('display','none'); \r\n}", "function followopen() {\n $(document.body).toggleClass('follow-on');\n $(document.body).removeClass('share-on');\n}", "function showToggleAlert() {\n document.getElementById(\"pop\").removeAttribute(\"hidden\");\n}", "function togglePop(obj){\n if (obj.className == \"hide\")\n obj.className = \"show\";\n setTimeout(function(){\n obj.className = \"hide\";\n }, 3000);\n}", "function closePopup() {\r\n checkoutSequenceContainer.classList.remove('show');\r\n showCheckoutSequenceBtn.parentElement.classList.remove('hide');\r\n overlay.classList.remove('active');\r\n }", "function showOrHide() {\n bild.classList.toggle('hide')\n}", "function closePopup() {\r\n \"use strict\";\r\n popup.style.display = \"none\";\r\n}", "function hideIDPrompt(){\r\n document.getElementById('IDPrompt').className = \"hidden\";\r\n}", "function hidePopup(step) {\n if (step.tether) {\n step.tether.disable();\n }\n step.popup[0].style.setProperty('display', 'none', 'important');\n }", "function showHideRanking () {\n if (!!document.querySelector('.opened')) {\n document.getElementById('ranking-container').classList.remove('opened');\n document.getElementById('ranking-container').classList.add('closed');\n document.querySelector('.arrow-up').classList.remove('arrow-open');\n document.querySelector('.arrow-up').classList.add('arrow-close');\n } else {\n document.getElementById('ranking-container').classList.remove('closed');\n document.getElementById('ranking-container').classList.add('opened');\n document.querySelector('.arrow-up').classList.remove('arrow-close');\n document.querySelector('.arrow-up').classList.add('arrow-open');\n \n }\n}", "function hideSettings() {\n settingsContainer.classList.add('hidden');\n}", "function hidePopup() {\r\n if ($('HTTPopupContainer')) {\r\n $('HTTPopupContainer').style.display = 'none';\r\n $('HTTShadow').style.display = 'none';\r\n }\r\n }", "function hideSignup(){\n document.getElementsByClassName('abc')[1].style.display = \"none\";\n}", "function hideDetails() {\r\n 'use strict';\r\n document.body.classList.add(HIDDEN_DETAIL_CLASS);\r\n}", "function hideDetails() {\n 'use strict';\n document.body.classList.add(HIDDEN_DETAIL_CLASS);\n}", "function hidePopups() {\n if (infoPopupActive) {\n $('.info-popup').remove();\n infoPopupActive = false;\n }\n}", "function Closing() {\n\tvar el = document.getElementById(\"MainOverlay\");\n\tvar box = document.getElementById(\"popup\");\n\tel.classList.add(\"Hidden\");\n\tbox.classList.add(\"Hidden\");\n\tconsole.log(\"closed\");\n\tdocument.getElementById(\"Pop1\").classList.add(\"Hidden\");\n\tdocument.getElementById(\"Pop2\").classList.add(\"Hidden\");\n\tdocument.getElementById(\"Pop3\").classList.add(\"Hidden\");\n\tdocument.getElementById(\"Pop4\").classList.add(\"Hidden\");\n\n}", "function hide_popupwindowbox(){\n\n\t\t\tvar container=$('#foodpress_popup');\n\t\t\tvar clearcontent = container.attr('clear');\n\n\t\t\tif(container.hasClass('active')){\n\t\t\t\tcontainer.animate({'margin-top':'70px','opacity':0},300).fadeOut().\n\t\t\t\t\tremoveClass('active')\n\t\t\t\t\t.delay(300)\n\t\t\t\t\t.queue(function(n){\n\t\t\t\t\t\tif(clearcontent=='true'){\n\t\t\t\t\t\t\t$(this).find('.foodpress_popup_text').html('');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn();\n\t\t\t\t\t});\n\t\t\t\t$('#fp_popup_bg').fadeOut();\n\t\t\t}\n\t\t}", "function toggleModalOff(){\n var modalWindow = document.querySelector('.modal')\n modalWindow.style.display = 'none';\n }", "function showSettings() {\n settingsContainer.classList.remove('hidden');\n}", "function toggleModalOff() {\n const modal = document.querySelector('.modal-background');\n modal.classList.add('hide');\n }", "toggleBodyClassForPopup() {\n const body = document.body;\n body.classList.toggle('ribs-popup-body');\n }", "hide() {\n super.hide();\n this.overlay.classList.add(\"hidden\");\n unblurBaseElements(this);\n }", "function openModal(){\n subscriptionMobileDisplay.classList.remove(\"not_visible\");\n }", "showVerifyInfo() {\n this.verifyInfo.classList.remove(\"hidden\");\n }", "function showContactInfoDiv(){classListRemove(document.getElementById('contactInfoDiv'),'hidden');}", "function closeLaserAttack(){\n\tdocument.getElementById(\"modal-backdrop-laser-attack\").classList.add(\"inactive\");\n\tdocument.getElementById(\"modal-laser-attack\").classList.add(\"inactive\");\n\topenSonar();\n}", "function hideWin() {\n winContainer.classList.remove('win-screen');\n}", "function hideSharePopUp () {\r\n if ( isSharePopUpShowing ){\r\n $('.pop-container').hide();\r\n isSharePopUpShowing = false;\r\n $('.rightButton').prop('disabled', false);\r\n\r\n // Disable previous functionality since we have only 1 slide\r\n if ( slidesSize == 1 ){\r\n $('.leftButton').prop('disabled', true);\r\n }\r\n }\r\n }", "function showManagePopup(){\n\t$(\"#tags-menu-popUp\").hide();\n\t$(\"#groups-menu-popUp\").hide();\n\t$(\".quickview-outer\").css(\"display\",\"none\");\n\t// $(\".quickview\").html(\"\");\n\t$(\".manage-pop\").css(\"display\",\"block\");\n\t$(\".manage-pop-outer\").fadeToggle();\n\t$(\".quickview-outer-second quickview-outer\").hide();\n\t$(\"#tag-manage-outertags\").hide(); \t\n\t$(\".msg-popup-outer\").hide();\n}", "function hideNotification() {\n notification.classList.add(CLASSES.HIDE_NOTIFICATION);\n}", "hide() {\n this.button.style.pointerEvents = \"none\";\n\n this.results.classList.add('open');\n \n this.expanded = !this.expanded;\n this.button.setAttribute('aria-expanded', this.expanded);\n\n this.timer = window.setTimeout(() => {\n this.results.classList.remove('open');\n this.results.classList.remove('close');\n this.button.style.pointerEvents = \"all\";\n this.timer = false;\n }, this.duration);\n this.open = false;\n }", "function shareopen() {\n $(document.body).toggleClass('share-on');\n $(document.body).removeClass('follow-on');\n}", "function hideSpotDetails() {\n spotDetailPanel.classList.remove(\"visible\");\n}", "function toggleOpen() {\n this.classList.toggle(\"open\"); // removes if there, adds if not\n}", "function showElement(element) {\n element.classList.remove(\"hide\");\n}", "function popupClear () {\n endMessage.classList.remove('.popup');\n endMessage.classList.add('hide');\n endMessage.style.top = \"-200%\";\n}", "function closeSonar(){\n\tdocument.getElementById(\"modal-sonar\").classList.add(\"inactive\");\n}" ]
[ "0.7655588", "0.75250065", "0.7509573", "0.7331084", "0.7328386", "0.73172617", "0.7310545", "0.73006773", "0.7299035", "0.72883826", "0.7263516", "0.7229421", "0.7197134", "0.7194573", "0.7152891", "0.7048279", "0.70073974", "0.69959456", "0.69944704", "0.6974485", "0.6935623", "0.6931474", "0.69053996", "0.69016445", "0.6873777", "0.68427294", "0.68039393", "0.67747635", "0.6767804", "0.67600656", "0.67462903", "0.67416686", "0.67175794", "0.67175794", "0.6687432", "0.6682754", "0.66601056", "0.66526496", "0.66500235", "0.657565", "0.6569046", "0.6546164", "0.65446377", "0.653059", "0.6496352", "0.64799404", "0.6479927", "0.6476793", "0.64566445", "0.6429978", "0.64187235", "0.6417884", "0.6404281", "0.63996285", "0.6391298", "0.6386721", "0.6365985", "0.636331", "0.63462347", "0.6344185", "0.6336787", "0.6336779", "0.6332054", "0.63303393", "0.63243085", "0.6323568", "0.63227326", "0.63143015", "0.62982875", "0.6298257", "0.6295543", "0.62732285", "0.62720364", "0.62615865", "0.6261295", "0.6258124", "0.6257832", "0.62508965", "0.6249552", "0.6247865", "0.6244674", "0.62389106", "0.6233962", "0.6233184", "0.62300074", "0.6227377", "0.6222212", "0.6222204", "0.6221076", "0.6216777", "0.6214174", "0.6209722", "0.6197501", "0.6189299", "0.61858445", "0.6185313", "0.6184089", "0.61839044", "0.6181712", "0.61793876", "0.6177257" ]
0.0
-1
Sends an asynchronous GET request to given url Input: theUrl the url to send the GET request to Output: None
function httpGetAsync(theUrl) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { // Use GET response to create map markers markbrewery(JSON.parse(xmlHttp.responseText)); } } xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpGetAsync(theUrl, callback) {\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "function httpGetAsync(theUrl, callback) {\n\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.onreadystatechange = function () {\n\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n\t\t\tcallback(xmlHttp.responseText);\n\t}\n\txmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n\txmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback)\n{\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function()\n {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "function httpGetAsync(theUrl, callback) {\n let xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) \n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n\t\tif(xmlHttp.status == 400)\n\t\t\terror();\n\t\tif(xmlHttp.status == 404)\n\t\t\terror();\n }\n xmlHttp.open(\"GET\", \"https://cors-anywhere.herokuapp.com/\" + theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback) {\n\tvar xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "httpGetAsync(theUrl, callback){\n var xmlHttp = new XMLHttpRequest()\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText)\n }\n xmlHttp.open(\"GET\", theUrl, true)\n xmlHttp.send(null)\n }", "function httpGetAsync(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n };\n xmlHttp.open('GET', url, true);\n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, keyword) {\n resetVariables();\n currentKeyword = keyword;\n $.getJSON(theUrl + keyword, function(result){\n processJsonResult(result, keyword);\n });\n}", "function httpGet(theUrl) {\n var xmlHttp = null;\n \n xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, true );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n }", "function httpGet(theUrl) {\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false);\n xmlHttp.send(null);\n return xmlHttp.responseText;\n }", "function doGet(url, callback) {\n\tmakeCall(\"GET\", url, null, callback);\n}", "function httpGet(theUrl)\r\n\t\t{\r\n\t\t\tvar textHttp = null;\r\n\r\n\t\t\ttextHttp = new XMLHttpRequest();\r\n\t\t\ttextHttp.open( \"GET\", theUrl, false );\r\n\t\t\ttextHttp.send();\r\n\t\t\treturn textHttp.responseText;\r\n\t\t}", "function request(url, request) {\r\n var syncResponse = undefined;\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = function () {\r\n if (xmlHttp.readyState == 4) {\r\n if (xmlHttp.status == 200) {\r\n switch (request.type) {\r\n case RequestType.Async:\r\n request.onComplete(xmlHttp.responseText);\r\n return;\r\n case RequestType.Sync:\r\n syncResponse = xmlHttp.responseText;\r\n return;\r\n default:\r\n throw new TypeError(\"Unhandled request type\");\r\n }\r\n }\r\n else if (xmlHttp.status == 0) {\r\n console.log(\"Server not available!\");\r\n }\r\n }\r\n };\r\n xmlHttp.open(\"GET\", url, request.type === RequestType.Async);\r\n xmlHttp.send(null);\r\n return syncResponse;\r\n }", "function httpGetAsync(url, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.response);\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous \n xmlHttp.send(null);\n}", "async call(url) {\n let response = await this.instance.get(url)\n return response\n }", "function httpGet(theUrl)\n{\n\tvar xmlHttp = null;\n\n\txmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", theUrl, false);\n\txmlHttp.send(null);\n\treturn xmlHttp.responseText;\n}", "function httpGetSync(theUrl) {\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open(\"GET\", theUrl, false);\r\n xmlHttp.send(null);\r\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\r\n return xmlHttp.responseText;\r\n } else {\r\n return \"\";\r\n }\r\n}", "function httpGet(theUrl) {\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open(\"GET\", theUrl, false);\r\n xmlHttp.send(null);\r\n return xmlHttp.response;\r\n}", "function httpGet(theUrl){\n var xmlHttp = new XMLHttpRequest();\n // console.log(theUrl);\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "get(url, callback) {}", "function httpGetAsync(theUrl, callback, expectedLength)\n{\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.onreadystatechange = function() { \n\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n\t\t\tcallback(xmlHttp.responseText, expectedLength);\n\t}\n\txmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n\txmlHttp.send(null);\n}", "function httpCoveoGetAsync(theUrl, callback) {\n try {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.setRequestHeader('HTTP_X_REQUESTED_WITH', 'XMLHttpRequest');//FY21-0702 eSupport call Changes\n xmlHttp.setRequestHeader(\"Content-Type\", \"text/plain; charset=utf-8\"); //FY21-0702 eSupport call Changes \n xmlHttp.setRequestHeader(\"X-Robots-Tag\", \"noindex\" ); //FY21-1003 eSupport call Changes\n xmlHttp.send(null);\n } catch (e) {\n console.log(\"Error in: \" + e);\n }\n}", "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "function httpSync(url) {\r\n\t\tvar requete = makeHttpObject();\r\n\t\trequete.open(\"GET\", url, false);\r\n\t\trequete.send(null);\r\n\t\treturn requete.responseText;\r\n\t}", "function get(url, callback)\n {\n getfunction(url, callback);\n }", "function httpGet(url) {\n\trequestHttp = new XMLHttpRequest();\n\trequestHttp.open(\"GET\", url, true);\n\trequestHttp.onreadystatechange = processRequest;\n\trequestHttp.send(null);\n}", "sendGetRequest(url) {\n return this.httpClient.get(url);\n }", "function requestAsync(url, onComplete) {\r\n request(url, { type: RequestType.Async,\r\n onComplete: onComplete });\r\n }", "function httpGetAsync(url, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous\n xmlHttp.setRequestHeader('cache-control', 'no-cache, must-revalidate, post-check=0, pre-check=0');\n xmlHttp.setRequestHeader('cache-control', 'max-age=0');\n xmlHttp.send(null);\n}", "get(url, data = {}, succCb = null, errCb = null) {\n return this.request('GET', url, data, succCb, errCb);\n }", "function httpGet(url)\r\n{\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open(\"GET\", url, false); // false for synchronous request\r\n xmlHttp.send(null);\r\n return xmlHttp.responseText;\r\n\r\n}", "function getDataAsync(url, callback) {\n \n /*global XMLHttpRequest: false */\n var httpRequest = new XMLHttpRequest();\n \n httpRequest.onreadystatechange = function () {\n \n // inline function to check the status\n // of our request, this is called on every state change\n if (httpRequest.readyState === 4 && httpRequest.status === 200) {\n\n callback.call(httpRequest.responseXML);\n }\n };\n \n httpRequest.open('GET', url, false);\n httpRequest.send();\n }", "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "function httpGet(theUrl, callback){\n request(theUrl, function (error, response, body){\n\n\t\tif (!error && response.statusCode == 200){\n\t\t \tcallback(body) // Call the callback function passed in\n\t\t}else if(response.statusCode == 403){\n\t\t\tconsole.log('ACCESS DENIED: This probably means you ran out of requests on your API key for now.')\n\t\t}\n\t})\n}", "function http_get(req_url){\n request.get(\n bal_query,\n function(error, response, body) {\n console.log(\"Clickatell GET:\")\n node.send(\"Clickatell GET:\");\n if (!error && response.statusCode == 200) {\n if (DEBUG){\n console.log(body, response)\n }\n console.log(req_url)\n console.log(body)\n node.send(body);\n }\n }\n );\n }", "function httpGet(theUrl)\n{\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "function httpGet(url) {\n return new Promise((resolve, reject) => {\n request(url, (err, res, body) => {\n if (err) {\n reject(err);\n } else {\n resolve(body);\n }\n });\n });\n}", "function httpGet(theUrl)\n{\n var xmlHttp = null;\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "function httpRequestAsync(url, callback) {\n console.log(\"Request was sent\");\n var httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = () => {\n if (httpRequest.readyState == 4 && httpRequest.status == 200)\n callback(httpRequest.responseText);\n };\n httpRequest.open(\"GET\", url, true); // true for asynchronous\n httpRequest.send();\n}", "function httpGet(url){\n\n return new Promise((resolve, reject)=>{\n // Load XMLHttpRequest module\n // XMLHttpRequest provides an easy way to retrieve data from a URL without having to do a full page refresh.\n var XMLHttpRequest = require(\"xmlhttprequest\").XMLHttpRequest;\n\n // instantiation\n var req = new XMLHttpRequest();\n\n // initializes a request.\n req.open('GET', url);\n\n // Assign funciton for HTTP request returns after successfully fetching content\n // and the load event is received by this object.\n req.onload = function() {\n // check the status\n if (req.status == 200) {\n // Resolve the promise with the response text\n resolve(req);\n }else {\n // Otherwise reject with the status text\n reject(Error(req.status));\n }\n };\n\n // Handle network errors\n req.onerror = function() {\n reject(req)\n };\n\n\n // make the request\n req.send();\n })\n\n}// func", "function get (url, query, done) {\n req('GET', url, query, null, done);\n}", "function get (url) {\n var request = NSURLRequest.requestWithURL(NSURL.URLWithString(url));\n var response = NSURLConnection.sendSynchronousRequest_returningResponse_error(request, null, null);\n return response;\n}", "async function httpGet(url){\n const res = await fetch(url);\n const response = await res.text();\n\n return response;\n}", "httpGet(url) {\n return new Promise((resolve, reject) => {\n if (this.develop) {\n console.log(\"URL sent to server: \" + this.server + url);\n }\n http.get(this.server + url, (res) => {\n var data = \"\";\n\n res.on('data', (chunk) => {\n data += chunk;\n }).on('end', () => {\n if (res.statusCode === 200) {\n resolve(data);\n } else {\n reject(data);\n }\n }).on('error', (e) => {\n reject(\"Got error: \" + e.message);\n });\n });\n });\n }", "get(url) {\n const req = this.client.get(url);\n\n return this.preRequest(req);\n }", "function fetch_url(){\n\t\t\tlet request = new XMLHttpRequest();\n\t\t\trequest.onreadystatechange = process_result;\n\t\t\trequest.open('GET', url, true);\n\t\t\trequest.send();\n\t\t\treturn fetch_promise;\n\t\t}", "static GET(url, cb) {\n jQuery.ajax({\n url: url,\n type: \"GET\",\n })\n .done(function(data, textStatus, jqXHR) {\n Layer.logs.save(\"AJAX get done : \" + jqXHR.statusText + \" \" + jqXHR.status);\n return cb(data);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n Layer.logs.save(\"AJAX get error : \" + errorThrown);\n return errorThrown;\n })\n .always(function() {\n /* ... */\n Layer.logs.save(\"Executed AJAX get with url : \" + url);\n });\n }", "function runUrlGet(urlString, callback){\n\tif (window.XMLHttpRequest){\n\t\txmlhttp=new XMLHttpRequest();\n\t} else {\n\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\n\ttry {\n\t\txmlhttp.open(\"GET\",\"http://yp.shoutcast.com/\"+urlString,false);\n\t\txmlhttp.send(null);\n\t\tif (xmlhttp.readyState==4 && xmlhttp.status==200){\n\t\t\tcallback();\n\t\t}\n\t} catch (e) {\n\t}\n}", "function httpGet(url, callback) {\n var request = http.get(url);\n\n request.on(\"response\", function(response) {\n var receivedData = \"\";\n\n response.setEncoding(\"utf8\");\n response.on(\"data\", function (chunk) {\n receivedData += chunk;\n });\n response.on(\"end\", function () {\n callback(response, receivedData);\n });\n });\n }", "function makeGetRequestAsync(targetUrl, params, cache) {\n var fullUrl = buildUrl(targetUrl, params);\n\n return queryAjaxAsync(fullUrl, {\n type: \"GET\",\n dataType: \"json\",\n contentType: \"application/json\",\n cache: !!cache\n });\n }", "async function get(url) {\n return new Promise(function (resolve, reject) {\n var userAgent = {\"User-Agent\": \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36\"};\n request({\n url: url,\n headers: userAgent\n },\n function (error, res, body) {\n if (!error && res.statusCode == 200) {\n resolve(body);\n } else {\n reject(error);\n }\n });\n });\n}", "function sendRequest(url, callback) {\n console.log(\"Sending GET to \" + url);\n request_lib.get(url, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(\"Fact is \" + body);\n callback(body);\n } else {\n console.log(\"Error=\" + error);\n }\n });\n }", "function doHttpRequest(url) {\n return request(url).then(function(resultParams) {\n var $ = cheerio.load(resultParams[1]);\n return url + \" - \" + $(\"title\").text();\n });\n\n }", "function AsyncAwaitRequest(url) {\n\n return new Promise(function(resolve, reject) {\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.send();\n xhr.onreadystatechange = function() {\n if (this.readyState != 4) return;\n\n if (xhr.status != 200) {\n var error = new Error(this.statusText);\n reject(error);\n } else {\n resolve(JSON.parse(this.response))\n }\n }\n })\n}", "function httpGet(url)\n{\n var xml = new XMLHttpRequest();\n xml.open(\"GET\", url, false);\n xml.send(null);\n return xml.responseText;\n}", "function fetch(url){\n var ch = chan();\n // make a request, put its response on a channel\n require('superagent').get(url).end((err, res)=> {putAsync(ch, err || res); ch.close();});\n return ch;\n}", "function get(url) {\n var deferred = q.defer();\n\n http.get(url, function(res) {\n var body = '';\n\n res.on('data', function(chunk) {\n body += chunk;\n });\n \n res.on('end', function() {\n deferred.resolve(body);\n }); \n })\n .on('error', function(e) {\n deferred.reject(e);\n });;\n return deferred.promise;\n}", "function get(url) {\n return processAjaxPromise($http.get(url));\n }", "async function callWeb(url) {\n let response;\n try {\n response = await fetch(url, {\n method: \"GET\",\n });\n } catch (err) {\n return new Response(\"Fetch Error: \" + response.status);\n }\n responseString = await response.text();\n try {\n result = JSON.parse(responseString);\n return result;\n } catch (err) {\n result = responseString;\n return result;\n }\n}", "function get(url, callback) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n callback(xhr.responseText);\n }\n };\n\n xhr.open(\"GET\", url, true);\n xhr.send();\n } catch (e) {\n console.log(e);\n }\n}", "function getUrlTextAsync(url,filename,callback){\n readURLAsync(url , function(value){\n if(value !== \"timeout\"){\n callback(value.responseText);\n }\n else{\n readURLAsync(filename , function(value){\n callback(value.responseText);\n });\n }\n });\n}", "function httpGetAsync(theUrl, callback, logenabled)\n{\t\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200){\n \t//Always a JSON ..\n \tvar rpcjson = JSON.parse(xmlHttp.responseText);\n \t\n \t//Do we log it..\n \tif(Minima.logging && logenabled){\n \t\tvar logstring = JSON.stringify(rpcjson, null, 2).replace(/\\\\n/g,\"\\n\");\n \t\tMinima.log(theUrl+\"\\n\"+logstring);\n \t}\n \t\n \t//Send it to the callback function..\n \tif(callback){\n \t\tcallback(rpcjson);\n \t}\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "sendGetRequestAsync(url, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const request = createPipelineRequest({\n url,\n method: \"GET\",\n body: options === null || options === void 0 ? void 0 : options.body,\n headers: createHttpHeaders(options === null || options === void 0 ? void 0 : options.headers)\n });\n const response = yield this.sendRequest(request);\n return {\n body: parse(response.bodyAsText),\n headers: response.headers.toJSON(),\n status: response.status\n };\n });\n }", "sendGETRequest(url){\n let requestContainer = new XMLHttpRequest();\n requestContainer.open('GET',url,true);\n requestContainer.onreadystatechange = this.processGETRequest.bind(this,requestContainer);\n requestContainer.send();\n }", "get(url, opt = {}) {\n opt.method = 'GET';\n return this.sendRequest(url, opt);\n }", "async get(url) {\n \n // Awaiting for fetch response\n const response = await fetch(url);\n \n // Awaiting for response.json()\n const resData = await response.json();\n \n // Returning result data\n return resData;\n }", "_request() {\n var options = url.parse(this._url);\n options.headers = {\n 'User-Agent': 'Benjamin Tambourine',\n 'If-None-Match': this._etag\n };\n https.get(options, this._onResponse.bind(this));\n }", "async get(url, headers = {}) {\r\n var response;\r\n if (HTTPRequest.prototype.isEmpty(headers))\r\n response = await fetch(url);\r\n else\r\n response = await fetch(url, { headers: headers });\r\n\r\n return response;\r\n }", "function get(url) {\n return new Promise( (resolve, reject) => {\n var req = new XMLHttpRequest(); \n req.open('GET', url);\n req.onload = function(){\n if ( req.status == 200){\n // resolve promise with response text\n resolve(req.response)\n } else {\n reject( Error( req.statusText))\n }\n };\n req.onerror = function(){\n reject( Error('Network error'))\n }; \n req.send();\n })\n}", "function Get(yourUrl){\n\t//create a http request\n var Httpreq = new XMLHttpRequest(); // a new request\n\n //making a GET request to the url\n Httpreq.open(\"GET\",yourUrl,false);\n Httpreq.send(null);\n\n //return responseText in JSON format\n return Httpreq.responseText;\n}", "function asyncRemoteGet(url) {\n return new Promise(resolve => {\n $http.get({\n url: url,\n handler: ({ data }) => resolve(data)\n });\n });\n}", "function httpGet(url, complete) {\n // CAP-0001\n http.get(url, function(response) {\n var content = \"\";\n response.on(\"data\", function(chunk) { content += chunk; });\n response.on(\"end\", function() {\n response.content = content;\n complete(response);\n });\n });\n}", "function fetchUrlAsync(url, callback) {\n var xhr = new XMLHttpRequest();\n\n // Callback for when fetching is complete.\n xhr.onreadystatechange = function() {\n if (this.readyState == 4) { // Icky magic number 4 for \"DONE\".\n if (xhr.status != 200) {\n var msg = \"Error fetching URL \" + url + \" (status: \" + xhr.status + \")\";\n alert(msg);\n throw {name: \"fetchUrlAsync\", message: msg};\n }\n\n callback(xhr.responseText);\n }\n };\n\n // Now start the fetch.\n xhr.open(\"GET\", url, true);\n xhr.send();\n}", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "function _myHttpGet (url, callback) {\n $http.get(serverAddr + url).success(function (data, status, headers, config) {\n if (callback)\n callback(null,data);\n }).error(function (err, status, header, config) {\n if (callback)\n callback(err);\n });\n }", "function promiseGet(url) {\n\t\tif (typeof Promise !== 'function') return null;\n\n\t\t// Return a new promise.\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tvar req = new XMLHttpRequest();\n\t\t\treq.open('GET', url);\n\n\t\t\treq.onload = function () {\n\t\t\t\tif (req.status == 200) {\n\t\t\t\t\t// Resolve the promise with the response text\n\t\t\t\t\tresolve(req.response);\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise reject with the status text which will hopefully be a meaningful error\n\t\t\t\t\treject(Error(req.statusText));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Handle network errors\n\t\t\treq.onerror = function () {\n\t\t\t\treject(Error('Network Error'));\n\t\t\t};\n\n\t\t\t// Make the request\n\t\t\treq.send();\n\t\t});\n\t}", "function get(url) {\n const requestOptions = {\n method: 'GET',\n };\n return fetch(url, requestOptions).then(handleResponse);\n}", "async get (url) {\n const res = await window.fetch(url);\n const resData = await res.json();\n return resData;\n }", "function httpGet(url) {\n return new Promise(function(resolve, reject) {\n // fetch is not available on iOS 9. Use XMLHttpRequest instead.\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.addEventListener('load', function () {\n var status = xhr.status;\n if (status < 200 || status >= 300) {\n reject({\n status: status,\n });\n return;\n }\n resolve(xhr.response);\n });\n xhr.addEventListener('error', function () {\n reject({\n status: xhr.status,\n });\n });\n xhr.send();\n });\n}", "async function main() {\n try {\n let response = await GET(url);\n console.log(\"GET: %o\", response);\n } catch (e) {\n console.log(e.name + \": \" + e.message);\n }\n}", "function httpGet(url, callback, params){\n \n console.log(\"Http GET to url: \"+url)\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText, params);\n }\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.send(null);\n}", "function ajaxGet(method, url, cb) {\n var callback = cb || function (data){};\n\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\n callback(this.responseText);\n\n }\n };\n\n request.open(method, url);\n request.send();\n\n}", "function _httpGet(url, callback) {\n return http.get(url, function(res) {\n res.setEncoding('utf8');\n var body = '';\n res.on('data', function(d) { body += d; });\n res.on('end', function() { return callback(undefined, body); });\n res.on('error', function(err) { return callback(new Exception({url:url}, \"Failed to execute HTTP request\", err)); });\n });\n }", "function getData(url, callback) {\n http.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n callback(this);\n }\n };\n http.open(\"GET\", url, true);\n http.send();\n}", "function GET(url) {\n return new Promise((resolve, reject) => {\n let k = https.get(url, d => {\n\n let data = \"\";\n\n d.on(\"data\", c => { data += c; });\n d.on(\"end\", () => {\n try {\n resolve(JSON.parse(data));\n } catch(e) {\n reject(data);\n }\n });\n });\n k.on(\"error\", e => { reject(e); });\n });\n}", "function get(url, options) {\n sendRequest(url, \"GET\", null, options);\n }", "static _GET(url, cb) {\n jQuery.ajax({\n url: url,\n type: \"GET\",\n })\n .done(function(data, textStatus, jqXHR) {\n Layer.logs.save(\"AJAX get done : \" + jqXHR.statusText + \" \" + jqXHR.status);\n if (jqXHR.responseJSON) {\n cb.setProps(jqXHR.responseJSON);\n } else {\n cb.setHtml(data);\n }\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n Layer.logs.save(\"AJAX get error : \" + errorThrown);\n })\n .always(function() {\n /* ... */\n Layer.logs.save(\"Executed AJAX get with url : \" + url);\n });\n }", "async sendGetRequestAsync(url, options) {\n const request = coreRestPipeline.createPipelineRequest({\n url,\n method: \"GET\",\n body: options === null || options === void 0 ? void 0 : options.body,\n headers: coreRestPipeline.createHttpHeaders(options === null || options === void 0 ? void 0 : options.headers),\n abortSignal: this.generateAbortSignal(noCorrelationId),\n });\n const response = await this.sendRequest(request);\n this.logIdentifiers(response);\n return {\n body: response.bodyAsText ? JSON.parse(response.bodyAsText) : undefined,\n headers: response.headers.toJSON(),\n status: response.status,\n };\n }", "async get(url) {\n const response = await fetch(url);\n\n const resData = await response.json();\n return resData;\n }", "async get(url){\n const getData = await fetch(url);\n\n const data = await getData.json();\n return data;\n\n }", "function ajax_get_request(callback, url) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange = function(){\r\n if (callback && xhr.readyState == XMLHttpRequest.DONE\r\n && (xhr.status == 200 || xhr.status == 0))\r\n {\r\n callback(xhr.responseText);\r\n }\r\n };\r\n xhr.open(\"GET\", url, true);\r\n xhr.send();\r\n}", "async get(url) {\n const response = await fetch(url);\n const resData = await response.json();\n return resData;\n }", "function Get(yourUrl) {\n var Httpreq = new XMLHttpRequest();\n Httpreq.open(\"GET\", yourUrl, false);\n Httpreq.send(null);\n return Httpreq.responseText;\n}", "function get(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('GET', url);\n\n req.onload = function() {\n if (req.status == 200) {\n resolve(req.response);\n }\n else {\n reject(Error(\"XMLHttpRequest Error: \"+req.statusText));\n }\n };\n req.onerror = function() {\n reject(Error(\"Network Error\"));\n };\n req.send();\n });\n}", "function get(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('GET', url);\n req.onload = function() {\n if (req.status == 200) {\n resolve(req.response);\n }\n else {\n reject(Error(req.statusText));\n }\n };\n req.onerror = function() {\n reject(Error(\"Network Error\"));\n };\n req.send();\n });\n}", "function get(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('GET', url);\n req.onload = function() {\n if (req.status == 200) {\n resolve(req.response);\n } else {\n reject(Error(req.statusText));\n }\n };\n req.onerror = function() {\n reject(Error(\"Network Error\"));\n };\n req.send();\n });\n}" ]
[ "0.77745205", "0.77059096", "0.76376075", "0.7568487", "0.7531437", "0.7522523", "0.75204927", "0.7380678", "0.736289", "0.71998364", "0.7192449", "0.712689", "0.70654875", "0.70123464", "0.70034814", "0.69854504", "0.6979662", "0.69178206", "0.6894386", "0.68795055", "0.68697315", "0.678089", "0.6762105", "0.67618436", "0.67605424", "0.67472196", "0.67472196", "0.67472196", "0.67259705", "0.6719461", "0.6710681", "0.6683182", "0.66827583", "0.66300666", "0.66180116", "0.66055703", "0.6595467", "0.65946203", "0.6565813", "0.6554522", "0.6545958", "0.654304", "0.652324", "0.6512076", "0.65086263", "0.65082735", "0.6500697", "0.6489699", "0.6470858", "0.645536", "0.6442671", "0.6438739", "0.6434733", "0.64141035", "0.6406688", "0.64053726", "0.636696", "0.6366384", "0.63604635", "0.6345915", "0.6340318", "0.63338923", "0.6333705", "0.6319625", "0.6314119", "0.6300599", "0.6293566", "0.62899023", "0.62871814", "0.62668276", "0.6262216", "0.62562907", "0.62445885", "0.6235632", "0.6228545", "0.6219795", "0.6216131", "0.6208038", "0.61886847", "0.61855423", "0.61742425", "0.61671597", "0.61656374", "0.6159258", "0.6153473", "0.61416763", "0.6138845", "0.61374485", "0.6131446", "0.61299515", "0.61276114", "0.6110412", "0.6108626", "0.61069113", "0.6102407", "0.609734", "0.6095538", "0.609408", "0.6092122", "0.6090918", "0.60863996" ]
0.0
-1
Initialize Google Map API Input: None Output: None
function initMap() { // Styles a map map = new google.maps.Map(document.getElementById('map'), { center: { lat: 41.878, lng: -87.629 }, zoom: 8, styles: [{ "elementType": "geometry", "stylers": [{ "color": "#ebe3cd" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#523735" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#f5f1e6" }] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{ "color": "#c9b2a6" }] }, { "featureType": "administrative.land_parcel", "elementType": "geometry.stroke", "stylers": [{ "color": "#dcd2be" }] }, { "featureType": "administrative.land_parcel", "elementType": "labels.text.fill", "stylers": [{ "color": "#ae9e90" }] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#93817c" }] }, { "featureType": "poi.business", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [{ "color": "#a5b076" }] }, { "featureType": "poi.park", "elementType": "labels.text", "stylers": [{ "visibility": "off" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#447530" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "color": "#f5f1e6" }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#fdfcf8" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#f8c967" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#e9bc62" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry", "stylers": [{ "color": "#e98d58" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.stroke", "stylers": [{ "color": "#db8555" }] }, { "featureType": "road.local", "elementType": "labels.text.fill", "stylers": [{ "color": "#806b63" }] }, { "featureType": "transit.line", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "transit.line", "elementType": "labels.text.fill", "stylers": [{ "color": "#8f7d77" }] }, { "featureType": "transit.line", "elementType": "labels.text.stroke", "stylers": [{ "color": "#ebe3cd" }] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{ "color": "#b9d3c2" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#92998d" }] } ] }); var curr_page = 1; //Current page of GET response var num_pages = 1; //Initialize number of pages response has var url = "http://api.brewerydb.com/v2/locations/?p=" + curr_page.toString() + "&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json"; //URL to get breweries in Illinois // Request first page of info var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { var response = JSON.parse(xmlHttp.responseText); //Parse json response num_pages = response["numberOfPages"]; //Set number of pages response has markbrewery(response); //Mark first page of response //Request and mark each page of response for (curr_page = 2; curr_page <= num_pages; curr_page++) { url = "http://api.brewerydb.com/v2/locations/?p=" + curr_page.toString() + "&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json"; httpGetAsync(url); } } } xmlHttp.open("GET", url, true); // true for asynchronous xmlHttp.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function googleMapSetup() {\n map.initialise();\n}", "function googleMapSetup() {\n map.initialise();\n}", "function gmap_initialize() {\n var gmap_options = {\n center: new google.maps.LatLng(40, -80),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n gmap = new google.maps.Map(document.getElementById(\"hud_gca_api_gmap_canvas\"), gmap_options);\n }", "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('container'), initialLocation);\n setMarkers();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.4419, lng: -122.1430},\n zoom: 9,\n mapTypeId: 'hybrid'\n });\n}", "function initMap() {\n var location = new google.maps.LatLng(29.7292957, -95.5481154);\n\n var mapoptions = {\n center: location,\n zoom: 17,\n };\n\n var map = new google.maps.Map(\n document.getElementById('map-container'),\n mapoptions\n );\n\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n title: 'Houston',\n });\n }", "function init() {\n\tmap = new google.maps.Map(document.getElementById('map-canvas'),\n myOptions);\n\tgetMyLocation();\n}", "function initMap() {\r\n\t\"use strict\";\r\n\t\tmap = new google.maps.Map(document.getElementById(\"map\"), {\r\n\t\t\tcenter: {lat: 12.971599, lng: 77.594563},\r\n\t\t\tzoom: 12,\r\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\r\n\t\t\tmapTypeControl: false\r\n\t\t});\r\n\t}", "function initialise() {\n\tvar myLatlng = new google.maps.LatLng(-27.4667, 153.0333);\n\tvar mapOptions = {\n center: myLatlng,\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\t\n\tvar map = new google.maps.Map(document.getElementById('Map'), mapOptions)\n}", "function initMap() {\n logger('function initMap is called');\n map = new gmap.Map(document.getElementById('map'), {\n center: {\n lat: 22.451754,\n lng: 114.164387\n },\n zoom: defaultZoomLevel\n });\n model.markers.forEach(function (marker) {\n createMarker(marker);\n });\n logger('function initMap is ended');\n }", "function initMap() {\n map = document.getElementById(\"map\");\n detailsService = new google.maps.places.PlacesService(map);\n /* here i am now setting default values for my map when it initially loads */\n map = new google.maps.Map(map, {\n center: {\n lat: -34.397,\n lng: 150.644\n },\n zoom: 8\n });\n loadApp();\n}", "function initMap() {\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 8,\n center: { lat: 35.717, lng: 139.731 },\n });\n}", "function initMap() {\n // Create a map object and specify the DOM element for display.\n // New map initiated, with some options, waiting for data updating.\n mapGoogle = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0.0, lng: 0.0},\n zoom: 17,\n mapTypeId: 'terrain',\n scaleControl: true,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: ['roadmap', 'hybrid'],\n }\n });\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 10,\n center: { lat: 41.8781, lng: -87.6298 },\n });\n \n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 8\n });\n \n}", "function initMap() {\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map-canvas'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 16\n })\n initAutocomplete(map)\n}", "function initMap() {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: -34.397, lng: 150.644},\r\n zoom: 8\r\n });\r\n}", "function initialize() {\n\t\tconsole.log(\"opt\");\n var mapOptions = {\n\t\t\tcenter: new google.maps.LatLng(elementObj[0], elementObj[1]),\n\t\t\tzoom: 8,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var map = new google.maps.Map(document.getElementById(\"geoinputMap\"),\n\t\t\t\t\t\t\t\t\t mapOptions);\n\t}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: 0, lng: 0 },\n zoom: 2,\n });\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0, lng: 0},\n zoom: 3\n });\n}", "function initMap() {\n map = new google.maps.Map(\n document.getElementById('map'),\n {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: { lat: 42.3601, lng: -71.0589 },\n zoom: 12\n }\n );\n}", "function initializeMap() {\n map = new google.maps.Map(document.getElementById('map_canvas'), {\n zoom: 18,\n center: mapCenter,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n }", "function initMap() {\r\n\tlet uluru = {\r\n\t\tlat: -36.879889,\r\n\t\tlng: 174.707658\r\n\t};\r\n\tconst map = new google.maps.Map(\r\n\t\tdocument.getElementById('googleMap'), {\r\n\t\t\tzoom: 12,\r\n\t\t\tcenter: uluru\r\n\t\t}\r\n\t);\r\n\tconst marker = new google.maps.Marker({\r\n\t\tposition: uluru,\r\n\t\tmap: map\r\n\t});\r\n}", "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n scrollwheel: false,\n zoom: 8\n });\n bounds = new google.maps.LatLngBounds();\n largeInfowindow = new google.maps.InfoWindow();\n initApp();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8\n });\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), { center: loc, zoom: z });\n}", "function initMap() {\n\t\t\t// The location\n\t\t\tconst centerMap = {\n\t\t\t\tlat: 48.015500,\n\t\t\t\tlng: 37.751331\n\t\t\t};\n\t\t\t// The map\n\t\t\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\n\t\t\t\tzoom: 15,\n\t\t\t\tcenter: centerMap,\n\t\t\t});\n\t\t\t// The marker\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: {\n\t\t\t\t\tlat: 48.015500,\n\t\t\t\t\tlng: 37.751331\n\t\t\t\t},\n\t\t\t\tmap: map,\n\t\t\t});\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: {\n\t\t\t\t\tlat: 48.017591,\n\t\t\t\t\tlng: 37.752336\n\t\t\t\t},\n\t\t\t\tmap: map,\n\t\t\t});\n\t\t}", "function initMap(){\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -3.0665, lng: 37.3507},\n zoom: 10\n })\n}", "function bp_element_google_map_init() {\n bp_element_google_map_create_map(window.jQuery);\n}", "function mapInitialize() {\n\t\t\tvar mapOptions = {\n\t\t\t\tscrollwheel: false,\n\t\t\t\tzoom: 15,\n\t\t\t\tcenter: center\n\t\t\t};\n\t\t\tmap = new google.maps.Map(map_canvas.get(0), mapOptions);\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: myLatlng,\n\t\t\t\tmap: map,\n\t\t\t\ticon: image\n\t\t\t});\n\t\t}", "function initMap() {\n var map;\n map = new google.maps.Map(document.getElementById(\"map-view\"), {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8\n });\n\n\n}", "function initMap() {\n\t\t// initialise map with coords and zoom level\n\t\tvar durban = new google.maps.LatLng(-29.728146, 31.083943);\n\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\tcenter: durban,\n\t\t\tzoom: 11\n\t\t});\n\t}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: {\n lat: 37.29723,\n lng: -122.0982877\n }\n });\n geocoder = new google.maps.Geocoder();\n\n\n return;\n}", "function initMap() {\n let mapOptions = { center: initialCoords, zoom: 14, styles: mapStyles.grey }\n myMap = new google.maps.Map(document.querySelector('#myMap'), mapOptions)\n getFilms(myMap)\n}", "function initMap() {\n\n map = new google.maps.Map(document.getElementById('map'), {\n // Fallback location for the map if geolocation is not enabled\n center: { lat: 1.290270, lng: 103.851959 },\n zoom: 10,\n });\n\n infoWindow = new google.maps.InfoWindow;\n\n // To find user's location and place an infowindow\n geolocate(infoWindow, map, geolocateResult);\n\n // To enable auto-complete in the search location input field\n autocomplete();\n\n // Used for Jasmine Testing\n return true;\n\n}", "function init_map(data) {\n\t\n var latlng = new google.maps.LatLng(38.98826233,-76.944944485);\t// define initial location\n var options = {\n zoom: 15,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n map = new google.maps.Map(document.getElementById(\"map\"), options);\n updateMap(data);\n}", "function initMap () {\n // Set basic map config up\n // These can be overridden by config options contained in\n // $scope.mapConfig\n var options = {};\n if ( $scope.mapConfig && $scope.mapConfig instanceof Object ) {\n Object.keys( $scope.mapConfig ).forEach( function ( key ) {\n options[ key ] = $scope.mapConfig[ key ];\n });\n }\n\n // Build the map and save a reference to the created map object in the\n // $scope for reference later from controller\n $scope.googleMap = new googleMaps.GoogleMap( $element[ 0 ].children[ 0 ].children[ 0 ], $scope, $compile, options );\n\n // Also set a scope variable for checking map loaded status\n $scope.mapLoaded = true;\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 3,\n center: { lat: 48.446913, lng: -3.3781 },\n mapTypeControl: false,\n panControl: false,\n zoomControl: true,\n streetViewControl: false\n });\n\n infoWindow = new google.maps.InfoWindow({\n content: document.getElementById('infoMapWindow')\n });\n // Resets textboxes and drop down list.\n resetData();\n // Create the autocomplete object and associate it with the UI input control.\n autocomplete = new google.maps.places.Autocomplete(\n (\n document.getElementById('locationSearch')), {\n types: ['(cities)']\n });\n places = new google.maps.places.PlacesService(map);\n autocomplete.addListener('place_changed', onPlaceChanged);\n}", "function initMap(){\n map = new google.maps.Map(document.getElementById(\"googlemap\"), {\n zoom: 13\n });\n}", "function initMap(){\n\n\t//Initializing the Map\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: coor,\n\t\tzoom: 12,\n\t\tstyles: [{\n\t\t\tstylers: [{ visibility: 'simplified' }]\n\t\t}, {\n\t\t\telementType: 'labels',\n\t\t\tstylers: [{ visibility: 'off' }]\n\t\t}]\n\t});\n\n\t//Initializing the InfoWindow\n\tinfoWindow = new google.maps.InfoWindow();\n\n\t//Initializing the Service\n\tservice = new google.maps.places.PlacesService(map);\n\n \t//The idle event is a debounced event, so we can query & listen without\n //throwing too many requests at the server.\n map.addListener('idle', performSearch);\n}", "function InitializeMap() {\n\n var mapCanvas=document.getElementById('map-canvas');\n\n var mapOptions={\n disableDefaultUI: true\n };\n\n mapElement=new google.maps.Map(mapCanvas, mapOptions);\n\n // fill map with markers\n\n // Sets the boundaries of the map based on pin locations\n window.mapBounds=new google.maps.LatLngBounds();\n\n // look for locations\n LocationFinder();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.6131516, lng:-58.3772316}, /* Coordenadas de la ciudad de Buenos Aires */\n zoom: 12\n });\n }", "function initMap() {\n // The location of Uluru\n const uluru = { lat: -25.344, lng: 131.036 };\n // The map, centered at Uluru\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n console.log(\"initmap map\");\n console.log(map);\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n} // end of function initMap", "function initialise() {\n\tvar myLatlng = new google.maps.LatLng(-27.4667, 153.0333);\n\tvar mapOptions = {\n center: myLatlng,\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\t\n \n\tvar map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions)\n\t\n\tvar marker = new google.maps.Marker({\n\t\tposition: myLatlng,\n\t\tmap: map,\n\t\ttitle: 'Brisbane'\n\t});\n}", "function initMap() {\n geocoder = new google.maps.Geocoder()\n\n map = new google.maps.Map(document.getElementById('map'), {\n // コントローラーで定義した変数から緯度経度を呼び出し、マップの中心に表示\n center: {\n lat: gon.user.latitude, \n lng: gon.user.longitude\n },\n zoom: 16,\n });\n\n marker = new google.maps.Marker({\n // コントローラーで定義した変数から緯度経度を呼び出し、マーカーを立てる\n position: {\n lat: gon.user.latitude,\n lng: gon.user.longitude\n },\n map: map\n });\n}", "initMap() {\n var uluru = {lat: -25.363, lng: 131.044};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "function initMap() {\n var defalutLocation = new google.maps.LatLng(42.4062040, -71.1188770);\n\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 16,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: defalutLocation\n });\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n // Christchurch location\n center: {lat: -43.532054, lng: 172.636225},\n zoom: 12\n });\n infowindow = new google.maps.InfoWindow({});\n }", "function initMap() {\n // Create a new Map and its configuration\n map = new google.maps.Map(document.getElementById('map'), {\n center: initialLL,\n zoom: 16,\n mapTypeId: 'terrain',\n mapTypeControl: true,\n styles: snazzyStyle,\n });\n findCoordinatesByName();\n}", "function initMap() {\n\tconst uluru = { lat: 41.611350, lng: -87.066910 };\n\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\n\t zoom: 4,\n\t center: uluru,\n\t});\n\t// The marker, positioned at Uluru\n\tconst marker = new google.maps.Marker({\n\t position: uluru,\n\t map: map,\n\t});\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 37.78,\n lng: -122.44\n },\n zoom: 6\n });\n\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"small-map\"), {\n center: {\n lat: 52.022,\n lng: 8.532,\n },\n zoom: 13,\n // mapTypeId: 'hybrid'\n });\n}", "function initMap() {\n\t// Constructor creates a new map.\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {\n\t\t\tlat: 12.971594,\n\t\t\tlng: 77.594561\n\t\t},\n\t\tzoom: 8,\n\t\tmapTypeControl: false,\n\t\tzoomControl: true\n\t});\n\n\tvar bounds = new google.maps.LatLngBounds();\n\tcreateMarkers(map, bounds);\n\n\n\tmap.fitBounds(bounds);\n}", "function initMap() {\n console.log(\"TEST\")\n let latitude = getMountain().latitude\n let longitude = getMountain().longitude\n \n\n const location = { lat: latitude, lng: longitude };\n\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: location,\n });\n\n const marker = new google.maps.Marker({\n position: location,\n map: map,\n });\n }", "function initMap() \n{\n\t// load the google map\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: mapcenter,\n\t\tzoom: 13,\n\t\tdisableDefaultUI: true\n\t});\n\t\n\t// load the custom marker libraries to put the custom markers on the screen\n\tInitCustomMarker();\n\tInitCustomLocationMarker();\n \n\t// load the checkboxes\n\tLoadData();\n\t\n\t// load the user location marker\n\tLoadUserMarker();\n\t\n\t// set the event for closing the marker\n\t$(\".contentDetails\").hide();\n\t$(\".exitContainer\").click(HideMarkerInfo);\n}", "function mapInit(){\n var center = {\n lat: 53.1683441,\n lng: 8.6510992\n };\n var map = new google.maps.Map(document.querySelector('.jacobshack-map'), {\n center: center,\n zoom: 16,\n scrollwheel: false,\n });\n var marker = new google.maps.Marker({\n position: center,\n map: map,\n title: 'jacobsHack!'\n });\n }", "function mapInitialize() {\n city = new google.maps.LatLng(52.520008, 13.404954);\n map = new google.maps.Map(document.getElementById('map'), {\n center: city,\n zoom: 12,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_CENTER,\n style: google.maps.ZoomControlStyle.SMALL\n },\n mapTypeControl: false,\n panControl: false\n });\n clearTimeout(self.mapRequestTimeout);\n\n google.maps.event.addDomListener(window, \"resize\", function() {\n var center = map.getCenter();\n google.maps.event.trigger(map, \"resize\");\n map.setCenter(center);\n });\n\n infowindow = new google.maps.InfoWindow({\n maxWidth: 300\n });\n getMeetups('berlin');\n }", "function initialize() {\n var mapProp = {\n center:new google.maps.LatLng(51.502784, -0.019059),\n zoom:15,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n };\n var map=new google.maps.Map(document.getElementById(\"googleMap\"), mapProp);\n}", "function initMap() {\n var uluru = {lat: 32.829620, lng:-117.278161};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "function initMap(){\n geocoder = new google.maps.Geocoder();\n}", "function gmInitialize() {\n $('#contents').html('<div id=\"map\"></div>');\n var myLatLng = new google.maps.LatLng(29.516596899999996, -95.71289100000001);\n GEO = new google.maps.Geocoder();\n MAP = new google.maps.Map(document.getElementById('contents'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: myLatLng,\n zoom: 4\n });\n}", "function map_initialize(latitude,longitude) {\n var mapCenter = new google.maps.LatLng(latitude,longitude);\n var mapOptions = {\n zoom: 12,\n center: mapCenter\n }\n var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n \n return map;\n}", "initialMap(){\n map = new BMap.Map(\"l-map\");\n map.centerAndZoom(\"武汉\",12); // 初始化地图,设置城市和地图级别。\n map.enableScrollWheelZoom(true);\n\n map.addEventListener('click', this.mapClick);\n\n new BMap.Autocomplete( //建立一个自动完成的对象\n {\n \"input\" : \"suggestId\",\n \"location\" : map,\n onSearchComplete: this.searchComplete\n },\n );\n }", "function initMap() {\n var map;\n var home = {lat: 39.581 , lng: -104.916};\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n center: home,\n zoom: 16\n });\n\n //var marker = new google.maps.Marker({map: map, position: home,title:\"ass eating capital of america2\"});\n\n Window.google_map = map;\n}", "function initMap() {\n var mapOptions = {\n center: { lat: 37.378285, lng: -121.966043 },\n zoom: 11,\n mapTypeId: 'roadmap'\n };\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n}", "function initialize() {\n const submit = document.getElementById(SUBMIT_ID);\n submit.addEventListener('click', submitDataListener);\n attachSearchValidation();\n\n const mapOptions = {\n center: {lat: 36.150813, lng: -40.352239}, // Middle of the North Atlantic Ocean\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n zoom: 4,\n mapTypeControl: false,\n styles: MAP_STYLES,\n };\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n map.addListener('click', toggleFocusOff);\n\n // Add autocomplete capability for address input\n const addressInput = document.getElementById('addressInput');\n let autocomplete = new google.maps.places.Autocomplete(addressInput);\n \n // Initialize API service objects\n distanceMatrixService = new google.maps.DistanceMatrixService();\n geocoder = new google.maps.Geocoder();\n placesService = new google.maps.places.PlacesService(map);\n}", "function initMap() {\n // create a container to draw the map inside a <div>\n const mapCanvas = (document.getElementById(\"map-container\"));\n\n // define some map properties\n const mapOptions = {\n center: {lat: 43.011987, lng: -81.200276},\n zoom: 7\n };\n\n // call the constructor to create a new map object\n // and then get your geo location\n map = new google.maps.Map(mapCanvas, mapOptions);\n\n //create new infoWindow object to get information about the place\n infoWindow = new google.maps.InfoWindow;\n\n // close infoWindow in case there are some open infoWindows\n google.maps.event.addListener(map, \"click\", function() {\n infoWindow.close();\n });\n\n //set new map position\n getLocation();\n\n }", "loadMap() {\n this.loadScript = false\n loadScript(\"https://maps.googleapis.com/maps/api/js?key=AIzaSyBsBLzRJXJvP71hA4Mw3HqILtRQmX_1zBs&callback=initMap\")\n window.initMap = this.initMap;\n window.google = {}\n }", "function initMap() {\n // The location of Uluru\n const uluru = { lat: 6.574399, lng: 3.34028 };\n // The map, centered at Uluru\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n }", "function initialize() {\n var mapOptions = {\n center: new google.maps.LatLng(37.765, -122.440),\n zoom: 12\n };\n map = new google.maps.Map(document.getElementById(\"map-canvas\"),mapOptions);\n\n // Create the search box and link it to the UI element.\n var input = /** @type {HTMLInputElement} */(\n document.getElementById('pac-input'));\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);\n\n // callback to refresh map when the bounds change\n google.maps.event.addListener(map, 'idle', function(event) {\n refreshMap();\n });\n\n refreshMap();\n}", "function initMap() {\n\t// The location of Uluru\n\tvar uluru = { lat: 49.411791, lng: 32.021873 };\n\t// The map, centered at Uluru\n\tvar map = new google.maps.Map(\n\t\tdocument.getElementById('map'), { zoom: 17, center: uluru });\n\t// The marker, positioned at Uluru\n\tvar marker = new google.maps.Marker({ position: uluru, map: map });\n}", "function initMap() {\r\n // The location of Uluru\r\n const uluru = { lat: 55.74303813644981, lng: 37.58454627585226 };\r\n // The map, centered at Uluru\r\n const map = new google.maps.Map(document.getElementById(\"map\"), {\r\n zoom: 14,\r\n center: uluru,\r\n });\r\n // The marker, positioned at Uluru\r\n const marker = new google.maps.Marker({\r\n position: uluru,\r\n map: map,\r\n });\r\n }", "function initMap() {\n console.log('initMap');\n\n // ======= map styles =======\n var styleArray = [\n { featureType: \"all\",\n stylers: [\n { saturation: -80 }\n ]\n },\n { featureType: \"road.arterial\",\n elementType: \"geometry\",\n stylers: [\n { hue: \"#00ffee\" },\n { saturation: 50 }\n ]\n },\n { featureType: \"poi.business\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n }\n ];\n\n // ======= map object =======\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 38.89, lng: -77.00},\n disableDefaultUI: true,\n draggable: false,\n scrollwheel: false,\n styles: styleArray, // styles for map tiles\n mapTypeId: google.maps.MapTypeId.TERRAIN,\n zoom: 10\n });\n\n }", "function initMap() {\n\tvar myLatLng = {lat: 37.856365, lng: -98.341694};\n\n var googleMap = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.856365, lng: -98.341694},\n zoom: 5\n }); \n \n app.init(googleMap);\n}", "function initMap() {\n\t\tvar myLatlng = new google.maps.LatLng(55.82566289, 37.7838707);\n\t\t// var myMarker = new google.maps.LatLng(55.824587, 37.780106);\n\t\tvar mapOptions = {\n\t\t zoom: 17,\n\t\t center: myLatlng,\n\t\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t scrollwheel: false,\n\t\t disableDefaultUI: true\n\t\t};\n\t\tvar map = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n\n\t\t// var marker = new google.maps.Marker({\n\t\t// position: myMarker,\n\t\t// icon: 'assets/images/footer/marker.png'\n\t\t// });\n\n\t\t// To add the marker to the map, call setMap();\n\t\t// marker.setMap(map);\n\n\t}", "function initGoogleMap() {\n console.log(\"map loaded\")\n // set the address by providing lat and lng \n var uluru = {lat: 51.4809440, lng:-0.1281286};\n\n // give map the class and set map's position\n var map = new google.maps.Map(\n document.getElementById('map2'), { zoom: 15, center: uluru });\n\n // adjust the map so that the marker is in the center\n var marker = new google.maps.Marker({position: uluru, map: map});\n}", "function initMap() {\n\t// The location of Uluru\n\tvar uluru = {lat: 19.387584, lng: -99.223988};\n\t// The map, centered at Uluru\n\tvar map = new google.maps.Map(\n\t\t\tdocument.getElementById('map'), {zoom: 15, center: uluru});\n\t// The marker, positioned at Uluru\n\tvar marker = new google.maps.Marker({position: uluru, map: map});\n}", "function my_initial()\n\t{\n\t\tgeo=new google.maps.Geocoder();\n\t\tvar mymap={\n\t\tcenter:new google.maps.LatLng(28.613939,77.209021),\n\t\tzoom:3,\n\tmapTypeId:google.maps.MapTypeId.ROADMAP\n\t}\n\tmap=new google.maps.Map(document.getElementById(\"googlemaps\"),mymap);\n\t}", "function initialize() {\n geocoder = new google.maps.Geocoder();\n var latlng = new google.maps.LatLng(40.781346, -73.966614);\n var mapOptions = {\n zoom: 12,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: true\n }\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n}", "function initMap() {\n\tvar $map = $('#map').removeClass('center-text')[0];\n\n\tmap = new google.maps.Map($map, {\n\t\tcenter: {lat: 40.7413549, lng: -73.99802439999996},\n\t\tzoom: 13,\n\t\t// hide style/zoom/streetview UI\n\t\tdisableDefaultUI: true,\n\t\tstyles: mapStyle\n\t});\n\n\tinfoWindow = new google.maps.InfoWindow();\n\tinitMarkers();\n}", "function initialize() {\n var mapOptions = {\n zoom: 10\n };\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n // HTML5 geolocation\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n setMap(position.coords.latitude, position.coords.longitude);\n }, function() {\n //Geolocation service failed. Default to Detroit\n setMap(42.3314285278,-83.0457534790);\n });\n } else { //Browser doesn't support Geolocation. Default to Detroit\n setMap(42.3314285278,-83.0457534790);\n }\n}", "function initMap() {\n var uluru = {lat: 47.2357137, lng: 39.701505};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n}", "function initMap()\r\n{\r\n\tmap = new google.maps.Map(document.getElementById('map'), {\r\n\t\tcenter: { lat: 40.7, lng: -74 },\r\n\t\tzoom: 11\r\n\t});\r\n\t\r\n\tmarkers = [];\r\n}", "function mapInit() {\n var lat_lng = [36.52855210000001, -87.3528402]\n\n var mapOpts = {\n center: new google.maps.LatLng(lat_lng[0], lat_lng[1]),\n zoom: 14\n }\n var map = new google.maps.Map(document.getElementById(\"gmap\"), mapOpts)\n\n var markerOpts = {\n position: new google.maps.LatLng(lat_lng[0], lat_lng[1]),\n map: map\n }\n var marker = new google.maps.Marker(markerOpts)\n }", "function initMap() {\n\tmap = new google.maps.Map(document.getElementById('map'), {\n \t\t// Centers on SF\n \t\tcenter: {lat: 37.7749, lng: -122.4194},\n \t\tzoom: 4\n\t});\n}", "function initMap() {\n\tvar location ={lat: 21.035000, lng: 105.826950};\n\tvar map = new google.maps.Map(document.getElementById(\"map\"), {\n\t\tzoom: 15,\n\t\tcenter: location\n\t});\n\n\tvar marker = new google.maps.Marker({\n\t\tposition: location, \n\t\tmap: map\n\t});\n}", "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: {lat: 37.652223, lng: -119.026379},\n mapTypeId: 'terrain'\n });\n plotMap(map);\n }", "function initialize() {\n\t\"use strict\";\n\n\t// set initial location to whole of continental U.S.\n\tvar loc = new google.maps.LatLng(37.1, -95.7);\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: loc,\n\t\tzoom: 3,\n\t\tmayTypeControl: false,\n\t\tzoomControl: false,\n\t\tstreetViewControl:false\n\t}); \n\n\t//gets autocomplete input for city\n\tgetCityInput();\n}", "function initMap() {\n\tvar mapProp = {\n\t\t\tcenter : new google.maps.LatLng(-34.9038055, -57.9392111, 18),\n\t\t\tzoom : 10,\n\t\t\tmapTypeId : google.maps.MapTypeId.ROADMAP\n\t\t};\n\tif (document.getElementById(\"map\") != null){\n\t\tmap = new google.maps.Map(document.getElementById(\"map\"), mapProp);\n\n\t\tmap.addListener('click', function(e) {\n\t\t\tagregarMarker(e.latLng, map);\n\n\t\t});\n\t\tpuntos = [];\n\t\tinitPolyline();\n\t\tobtenerMarkers();\n\t\t\n\t}\n\t\n\t//loadKmlLayer(src, map);\n\t\n}", "_initMap() {\n if (this.isDestroying || this.isDestroyed) { return; }\n\n const canvas = get(this, 'canvas.element');\n const options = get(this, '_options');\n\n const map = new google.maps.Map(canvas, options);\n const publicAPI = this.publicAPI;\n\n google.maps.event.addListenerOnce(map, 'idle', () => {\n if (this.isDestroying || this.isDestroyed) { return; }\n\n set(this, 'map', map);\n\n this.registerEvents();\n tryInvoke(this, 'onLoad', [{ map, publicAPI }]);\n\n let componentInitPromises =\n Object.values(this.components)\n .reduce((a, b) => a.concat(b))\n .map((a) => a.isInitialized.promise);\n\n all(componentInitPromises)\n .then(() => {\n tryInvoke(this, 'onComponentsLoad', [\n { map: this.map, publicAPI: this.publicAPI }\n ]);\n });\n });\n }", "function initMap() {\r\n\r\n\t//Map start init - location New York\r\n var mapOptions = {\r\n scaleControl: true,\r\n center: new google.maps.LatLng(40.705002, -73.983450),\r\n zoom: 9,\r\n disableDefaultUI: true,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP\r\n };\r\n \r\n var map = new google.maps.Map(document.getElementById('map'),mapOptions);\r\n var marker = new google.maps.Marker({\r\n map: map,\r\n position: map.getCenter() \r\n });\r\n}", "function initMap() {\n const myLatLng = { lat: 44.59824417, lng: -110.5471695 };\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 8,\n center: myLatLng,\n });\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 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() {\n map = new google.maps.Map(document.getElementById('map'), {\n \tcenter: new google.maps.LatLng(58.7897104,-96.0892755),\n \tzoom: 4,\n \tmapTypeId: 'terrain',\n\t\t\tmapTypeControl: true,\n \t\tmapTypeControlOptions: {\n \tstyle: google.maps.MapTypeControlStyle.DROPDOWN_MENU,\n \tposition: google.maps.ControlPosition.RIGHT_TOP\n \t\t}\t\t\t\n });\n\t\n\t\tgetJSONData();\n \n}", "function initialize() {\n // create a google map and center it on the city of portland\n\n var myOptions = {\n center: new google.maps.LatLng(45.5200, -122.6819),\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n\n };\n var map = new google.maps.Map(document.getElementById(\"map\"),\n myOptions);\n\n //setMarkers(map);\n\n }", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function initMap() {\n // The area where the map would center on\n const cary_NC = {lat: 35.7881812, lng: -78.7951261};\n\n // Constructor creates a new map - only center and zoom are required.\n return new google.maps.Map(document.getElementById('map'), {\n center: cary_NC,\n zoom: 12,\n style: myMapStyles\n });\n }", "function initMap() {\n\t\t\t // The location of Uluru\n\t\t\t var uluru = {lat: -25.344, lng: 131.036};\n\t\t\t // The map, centered at Uluru\n\t\t\t var map = new google.maps.Map(\n\t\t\t document.getElementById('map'), {zoom: 4, center: uluru});\n\t\t\t // The marker, positioned at Uluru\n\t\t\t var marker = new google.maps.Marker({position: uluru, map: map});\n\t\t\t\t}" ]
[ "0.80599904", "0.80599904", "0.7980042", "0.7723783", "0.77199185", "0.77018386", "0.7700086", "0.76938725", "0.7669481", "0.7656553", "0.7645756", "0.7644751", "0.76354754", "0.76334745", "0.7612384", "0.7602398", "0.7601075", "0.75961095", "0.7591788", "0.75827205", "0.75813234", "0.75749826", "0.7564091", "0.7541754", "0.75295603", "0.75212884", "0.75209665", "0.75101763", "0.7505084", "0.7502641", "0.74812436", "0.7479514", "0.7477485", "0.74450153", "0.74412847", "0.7438861", "0.7423751", "0.74204904", "0.7414059", "0.7400664", "0.7400086", "0.7396941", "0.73962474", "0.7395501", "0.73874927", "0.7382865", "0.7375239", "0.7375028", "0.73678875", "0.7363955", "0.735933", "0.7355025", "0.7354736", "0.7353155", "0.7352608", "0.7349842", "0.7347408", "0.7346075", "0.73442286", "0.73354906", "0.7330878", "0.7317046", "0.731258", "0.7310674", "0.73095316", "0.7304132", "0.7293379", "0.729204", "0.7290212", "0.7289049", "0.7285906", "0.7285182", "0.7277796", "0.7276603", "0.72735834", "0.7270719", "0.7270639", "0.7270393", "0.7270272", "0.72666514", "0.72662795", "0.7266043", "0.7265898", "0.7260131", "0.7259645", "0.72570276", "0.7252409", "0.7249739", "0.7246566", "0.7240867", "0.7237602", "0.72267807", "0.7225129", "0.7224673", "0.7216011", "0.72148454", "0.72074425", "0.7204884", "0.7204884", "0.71999216", "0.7198242" ]
0.0
-1
PRIVATE FUNCTIONS Only for testing!
function getRandomActivities() { var activities = []; var id = 1000; var date = new Date().getTime() - 60 * 60 * 10000; var x; for (var i = 0; i < 1053; i++) { var track = [ { speed : (Math.random() + 0.1) * 30 } ]; var rand = Math.random() + 0.1; var start = Math.floor(date - Math.random() * 60 * 60 * 10); var end = Math .floor(start + rand * 60 * 60 * 2); date = start - 14400; if (rand < 0.5) { activities.push(new Activity(id--, 'Running', start, end, track, '', (Math.random() + 0.1) * 12000, user.userId)); } else { activities.push(new Activity(id--, 'Biking', start, end, track, '', (Math.random() + 0.1) * 12000, user.userId)); } } return activities; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static private internal function m121() {}", "static final private internal function m106() {}", "static private protected internal function m118() {}", "transient final protected internal function m174() {}", "function _____SHARED_functions_____(){}", "static transient final private internal function m43() {}", "transient private protected public internal function m181() {}", "static transient final protected internal function m47() {}", "static transient private protected internal function m55() {}", "transient final private protected internal function m167() {}", "static transient final protected public internal function m46() {}", "static transient final private protected internal function m40() {}", "transient final private internal function m170() {}", "static transient private protected public internal function m54() {}", "static private protected public internal function m117() {}", "static protected internal function m125() {}", "obtain(){}", "static transient private internal function m58() {}", "function DWRUtil() { }", "transient private public function m183() {}", "prepare() {}", "static final private protected internal function m103() {}", "static transient private public function m56() {}", "transient final private protected public internal function m166() {}", "static final private protected public internal function m102() {}", "static final protected internal function m110() {}", "static transient final protected function m44() {}", "function StupidBug() {}", "static final private public function m104() {}", "function Utils() {}", "function Utils() {}", "function AeUtil() {}", "lastUsed() { }", "static transient final private protected public internal function m39() {}", "_read () {}", "_read () {}", "_read () {}", "prepare() {\n }", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static transient final private protected public function m38() {}", "static transient final private public function m41() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "static private public function m119() {}", "__previnit(){}", "function Utils(){}", "transient final private public function m168() {}", "function __it() {}", "_read() {}", "_read() {}", "static transient protected internal function m62() {}", "apply () {}", "_read() {\n }", "_read() {\n\n }", "function customHandling() { }", "function Util() {}", "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 }", "function dummy(){}", "function dummy(){}", "function dummy(){}", "attempt() {}", "analyze(){ return null }", "_get () {\n throw new Error('_get not implemented')\n }", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function fm(){}", "fakeScanComplete() {}", "function oi(){}", "function _privateFn(){}", "function kp() {\n $log.debug(\"TODO\");\n }", "static ready() { }", "function miFuncion (){}", "function test_candu_graphs_datastore_vsphere6() {}", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "updated() {}", "patch() {\n }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function TMP() {\n return;\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }" ]
[ "0.717471", "0.7081855", "0.68225026", "0.66627", "0.6637731", "0.65628535", "0.6459469", "0.631019", "0.6303821", "0.62679374", "0.6217863", "0.6200486", "0.61943644", "0.61411273", "0.6085985", "0.601497", "0.60118306", "0.59402305", "0.58367556", "0.58319014", "0.58152074", "0.5805909", "0.58054584", "0.57585365", "0.5710802", "0.56995606", "0.5634372", "0.56327194", "0.5608234", "0.56035876", "0.559888", "0.5587509", "0.55557215", "0.5397551", "0.5382079", "0.5355804", "0.5355804", "0.53246194", "0.5316339", "0.53133965", "0.5289303", "0.5289303", "0.5289303", "0.52748", "0.5260008", "0.5260008", "0.52577156", "0.52499205", "0.5249513", "0.5249513", "0.5249513", "0.5249513", "0.5249513", "0.5249513", "0.52390474", "0.5235404", "0.52307796", "0.52291673", "0.52269846", "0.51945424", "0.51945424", "0.5172025", "0.5165162", "0.51581", "0.51496285", "0.5137517", "0.51362103", "0.513115", "0.513115", "0.513115", "0.5112277", "0.5112277", "0.5112277", "0.50968164", "0.5092115", "0.5064667", "0.5046872", "0.50423133", "0.50402004", "0.5026613", "0.5026287", "0.50243205", "0.50219095", "0.5021704", "0.5016935", "0.5011561", "0.49994957", "0.4990292", "0.49898776", "0.49898776", "0.49898776", "0.49882936", "0.49882936", "0.49882936", "0.49882936", "0.49882936", "0.49882936", "0.49882936", "0.49873906", "0.49867278", "0.49867278" ]
0.0
-1
just to make sure the generate code works
function display() { generate(); // generate 36,000 combinations var data = "<h1> Data </h1>"; data += "<table border=2>"; data += "<caption> <strong>Rolling Dice</strong></caption>"; data += "<thead><tr><th>Sum</th><th># Rolls</th><th>Percentage</th></tr>"; data += "<tbody>"; for(var j = 2; j < 13; j++) { data += "<tr><td>"+ j + "</td>"; // the sum. data += "<td>" + sumDict[j] +"</td>";// total occurance of the sum data += "<td>" + (sumDict[j] / 36000).toFixed(2) + "</td></tr>" // percentage of that sum } data += "</tbody></table>"; document.getElementById('stats').innerHTML = data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCode(){\n\n}", "function generateTest() {\n // TODO\n}", "async buildCode() {\n\t\tawait this._codeSource.generated.generate();\n\t}", "function cw_generationZero() {\n cw_materializeGeneration();\n\n}", "generate (type) {\n return generate(type)\n }", "function genStart() {\n if (!generate) {\n setGenerate(true)\n } else {\n setGenerate(false)\n }\n }", "async generate(){\r\n return this.call('generate',...(Array.from(arguments)));\r\n }", "async genAccomodations(){\n //Not yet implemented\n }", "generate() {\n // Make sure the temporary directory is empty before starting\n gen_utils_1.deleteDirRecursive(this.tempDir);\n fs_extra_1.default.mkdirsSync(this.tempDir);\n try {\n // Generate each model\n const models = [...this.models.values()];\n for (const model of models) {\n this.write('model', model, model.fileName, 'models');\n }\n // Generate each service\n const services = [...this.services.values()];\n for (const service of services) {\n this.write('service', service, service.fileName, 'services');\n }\n // Context object passed to general templates\n const general = {\n services: services,\n models: models\n };\n // Generate the general files\n this.write('configuration', general, this.globals.configurationFile);\n this.write('response', general, this.globals.responseFile);\n this.write('requestBuilder', general, this.globals.requestBuilderFile);\n this.write('baseService', general, this.globals.baseServiceFile);\n if (this.globals.moduleClass && this.globals.moduleFile) {\n this.write('module', general, this.globals.moduleFile);\n }\n const modelImports = this.globals.modelIndexFile || this.options.indexFile\n ? models.map(m => new imports_1.Import(m.name, './models', m.options)) : null;\n if (this.globals.modelIndexFile) {\n this.write('modelIndex', Object.assign(Object.assign({}, general), { modelImports }), this.globals.modelIndexFile);\n }\n if (this.globals.serviceIndexFile) {\n this.write('serviceIndex', general, this.globals.serviceIndexFile);\n }\n if (this.options.indexFile) {\n this.write('index', Object.assign(Object.assign({}, general), { modelImports }), 'index');\n }\n // Now synchronize the temp to the output folder\n gen_utils_1.syncDirs(this.tempDir, this.outDir, this.options.removeStaleFiles !== false);\n console.info(`Generation from ${this.options.input} finished with ${models.length} models and ${services.length} services.`);\n }\n finally {\n // Always remove the temporary directory\n gen_utils_1.deleteDirRecursive(this.tempDir);\n }\n }", "function generateSeq() {\r\n\r\n}", "function GeneratorClass () {}", "function initGenerate(TheBigAST) {\n var globalItems = TheBigAST[0];\n var functionBox = TheBigAST[1];\n allFuncs = findAllFuncs(functionBox[0].body);\n //strLiteralSection = generateStrLiteralSection();\n var funcsAsm = findFunctionNames(functionBox[0].body);\n var headers = includeHeaders(globalItems);\n var dataSection = generateDataSection(globalItems);\n var textHeader = generateTextHeader(TheBigAST[1]);\n var compiled = textHeader + funcsAsm + dataSection;\n console.log(compiled);\n return 0;\n}", "build () {}", "function skipSingleGeneration() {\n nextGenerationCalculated();\n}", "generate() {\n return {\n instructions: 'instructions here',\n question: 'question here',\n diagram: 'diagram here',\n answer: 'answer here',\n }\n }", "constructor() { super(new GeneratorParser(true)) }", "function generators() {\n\t\t\t\tBlockly.JavaScript.fw = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.rr = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.rl = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.lt = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.start = function(block) {\n\t\t\t\t\treturn '';\n\t\t\t\t};\n\t\t\t}", "getCpp(){ return this.program.generateCpp(); }", "function Generator() {} // 84", "function Generator() {} // 80", "function generate() {\n fs.writeFileSync(outputPath, render(teamMembers), \"utf-8\");\n process.exit(0);\n}", "_reload() {\n js2py = require(\"../../shift-codegen-py/src\");\n this._generator = new js2py.PyCodeGen({\n topLevelComment: false,\n });\n }", "function codeGenerated(err, code){\n\tconsole.log(code);\n}", "function Generator() {\n // YOUR CODE HERE\n}", "function Generator() {\n // YOUR CODE HERE\n}", "function generate(node) {\n return escodegen.generate(node);\n}", "static generateCode() {\n let parserSource = parser.generate();\n return parserSource;\n }", "async onGenerated() {\n try {\n if (PLUGIN.good_to_go(plugin_options, context)) {\n await new generator_1.default(PLUGIN.pages, PLUGIN.options, context).generate();\n }\n }\n catch (err) {\n log_1.default.error(err.message);\n }\n }", "function GeneratePath()\n{\n\n\n\n}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "generateClassCode(elem) {\n let modelName = elem.model.name;\n var classCodeGenerator = this;\n\n let className = `${modelName}`;\n const modelTags = this.extractTags(elem.model.tags);\n let generator = new classGenerator.ClassGenerator(className);\n generator.addImport('Illuminate\\\\Database\\\\Eloquent\\\\Model;');\n\n Object.keys(modelTags).forEach(tagName => {\n const importStatment = MODEL_IMPORTS[tagName];\n const trait = MODEL_USE_STMT[tagName];\n if (importStatment) {\n generator.addImport(importStatment);\n }\n if (trait) {\n generator.addTrait(trait);\n }\n });\n\n if (modelTags['authenticatable']) {\n generator.addExtend('Authenticatable');\n } else {\n generator.addExtend('Model');\n }\n\n const fillable = new classGenerator.ClassVariableGenerator('fillable', 'protected',\n this.generateModelAttributes(elem), '');\n // fillable.addVariable('name')\n generator.addVariableGenerator(fillable);\n\n (new codeClassGen.CodeBaseClassGenerator(generator, this.writer)).generate();\n }", "Compile() {\n\n }", "static generate(){\n return new Words().randomWordGenerator()\n }", "function generateEncounter()\r\n{\r\n\t\r\n}", "function genInstaller(require){\n if (true){\n return '>'+require; \n }\n}", "function generate() {\n // Last time validation, in case user ends up messing with vars\n adjustMines();\n \n generateBoard();\n \n generateJSON();\n \n board = [];\n}", "function main() {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var sourceFile, generatedFileName, apiName, error_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4 /*yield*/, Ambrosia.initializeAsync(Ambrosia.LBInitMode.CodeGen)];\n case 1:\n _b.sent();\n sourceFile = Utils.getCommandLineArg(\"sourceFile\");\n generatedFileName = (_a = Utils.getCommandLineArg(\"generatedFileName\", \"TestOutput\")) !== null && _a !== void 0 ? _a : \"TestOutput\";\n apiName = Path.basename(generatedFileName).replace(Path.extname(generatedFileName), \"\");\n // If want to run as separate generation steps for consumer and publisher\n //Meta.emitTypeScriptFileFromSource(sourceFile, { fileKind: Meta.GeneratedFileKind.Consumer, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFileName: generatedFileName+\"_Consumer\" });\n //Meta.emitTypeScriptFileFromSource(sourceFile, { fileKind: Meta.GeneratedFileKind.Publisher, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFileName: generatedFileName+\"_Publisher\" });\n // Use this for single call to generate both consumer and publisher\n Meta.emitTypeScriptFileFromSource(sourceFile, { apiName: apiName, fileKind: Meta.GeneratedFileKind.All, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFilePrefix: generatedFileName, strictCompilerChecks: false });\n return [3 /*break*/, 3];\n case 2:\n error_1 = _b.sent();\n Utils.tryLog(error_1);\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "registerGenerator ({ module_path, relative_path, absolute_path }) {\n\n // Resolves path to generator\n let engine_path = ''\n\n // Generator is located in node_modules\n if (module_path) {\n engine_path = path.join(this.options.cwd, MODULES_ROOT, module_path)\n } else if (relative_path) {\n engine_path = path.join(this.options.cwd, relative_path)\n } else {\n engine_path = absolute_path\n }\n\n // Construct the module path\n const generator_path = path.join(engine_path, GENERATOR_CLASS_PATH)\n const generator_meta_path = path.join(engine_path, GENERATOR_META_FILENAME)\n const generator_readme_path = path.join(engine_path, GENERATOR_README_FILENAME)\n\n // console.log(generator_path)\n // console.log(generator_meta_path)\n // console.log(generator_readme_path)\n\n // Try to load up the generator & associated metadata, catch error\n try {\n // Require the class dynamically\n const GeneratorClass = require(generator_path); // eslint-disable-line import/no-dynamic-require\n const GeneratorMeta = require(generator_meta_path); // eslint-disable-line import/no-dynamic-require\n\n // Pull in the generator's README.md\n const foundReadme = fs.existsSync(generator_readme_path);\n\n // Adds generator to this.generators if requirements are met\n // if (GeneratorClass && GeneratorMeta && foundReadme) {\n if (GeneratorClass && GeneratorMeta && foundReadme) {\n\n // Adds generator_path (VERY IMPORTANT) to GeneratorMeta\n GeneratorMeta.generator_path = generator_path\n\n // Adds readme_markown to GeneratorMeta\n GeneratorMeta.readme = fs.readFileSync(generator_readme_path, 'utf8')\n\n // Tracks GeneratorMeta in this.generators\n this.generators.push(GeneratorMeta)\n\n // Logs\n // console.info(`Registered ${GeneratorClass.name} generator`)\n // console.info(`Registered generator`)\n return\n }\n\n // Logs which generator is being run\n } catch (err) {\n if (err.code === 'MODULE_NOT_FOUND') {\n console.log('REGISTRATION ERROR - GENERATOR NOT FOUND')\n throw err;\n } else {\n console.log('REGISTRATION ERROR - OTHER')\n throw err;\n }\n }\n }", "private public function m246() {}", "function genEnv() {\n\n\n}", "function genCode(objType,appEnv,rowData){var columns=Object.keys(rowData);var pgm=Object(_optCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(objType,appEnv);var caslStatements=\"\\n\\n\\taction table.dropTable/\\n\\t\\tcaslib='\".concat(appEnv.WORKLIBNAME,\"' name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"' quiet=TRUE;\\n\\n\\ttable.save /\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tname='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\ttable='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\treplace=TRUE;\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights_attr\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS_ATTR.sashdat\\\";\\n\\n\\ttable.attribute /\\n\\t name=\\\"model_weights\\\"\\n\\t table=\\\"model_weights_attr\\\";\\n\\n\\tloadactionset 'deepLearn';\\n\\tdeepLearn.dlScore table={name='\").concat(appEnv.OPTABLENAME,\"'} initWeights={name=\\\"model_weights\\\"}\\n\\t modelTable={name=\\\"model\\\"}\\n\\t\\tcopyVars={'Horizon', 'StartUpDelay', 'Site1StartUpDelay', 'Site1IDDelay', 'Site1Capacity', 'Site2StartUpDelay', 'Site2IDDelay', 'Site2Capacity', 'Site3StartUpDelay', 'Site3IDDelay', 'Site3Capacity', 'Site4StartUpDelay', 'Site4IDDelay', 'Site4Capacity', 'Site5StartUpDelay', 'Site5IDDelay', 'Site5Capacity', 'Site6StartUpDelay', 'Site6IDDelay', 'Site6Capacity', 'Site7StartUpDelay', 'Site7IDDelay', 'Site7Capacity', 'Site8StartUpDelay', 'Site8IDDelay', 'Site8Capacity', 'Site9StartUpDelay', 'Site9IDDelay', 'Site9Capacity', 'Site10StartUpDelay', 'Site10IDDelay', 'Site10Capacity', 'Site1Interarrival', 'Site2Interarrival', 'Site3Interarrival', 'Site4Interarrival', 'Site5Interarrival', 'Site6Interarrival', 'Site7Interarrival', 'Site8Interarrival', 'Site9Interarrival', 'Site10Interarrival', 'Site1ScreenFailP', 'Site2ScreenFailP', 'Site3ScreenFailP', 'Site4ScreenFailP', 'Site5ScreenFailP', 'Site6ScreenFailP', 'Site7ScreenFailP', 'Site8ScreenFailP', 'Site9ScreenFailP', 'Site10ScreenFailP'}\\n\\t\\tcasout={name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"', caslib='\").concat(appEnv.INPUTLIBNAME,\"', replace=TRUE};\\n\\n\\n\\n\\taction table.save /\\n\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\treplace = TRUE\\n\\t\\ttable= {\\n\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t};\\n\\n\\n\\n\\taction table.fetch r=result / to= 1000\\n\\t\\t\\t\\tfetchVars={'_DL_Pred_','Horizon'}\\n\\t\\t\\t\\ttable= {\\n\\t\\t\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\trun;\\n\\n\\n\\n\\tr = {A= result};\\n\\tsend_response( r) ;\\n\\trun;\\n\\n\\t\");return caslStatements;}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}" ]
[ "0.6754435", "0.6682694", "0.6527891", "0.6449227", "0.6251575", "0.6236547", "0.61819977", "0.61348766", "0.61144525", "0.60363275", "0.6018648", "0.60072106", "0.5992213", "0.5939109", "0.59282625", "0.5920184", "0.5901952", "0.58872604", "0.58656126", "0.57781905", "0.57742", "0.5750538", "0.57337564", "0.568318", "0.568318", "0.56638074", "0.5651634", "0.56487536", "0.56330305", "0.562293", "0.562293", "0.562293", "0.562293", "0.562293", "0.562293", "0.55939823", "0.5571747", "0.5565443", "0.55477625", "0.55430585", "0.55288863", "0.5527448", "0.552029", "0.55105925", "0.55088335", "0.54934275", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365", "0.54873365" ]
0.0
-1
Callback for when the open dialog animation has finished. Intended to be called by subclasses that use different animation implementations.
_openAnimationDone(totalTime) { if (this._config.delayFocusTrap) { this._trapFocus(); } this._animationStateChanged.next({ state: 'opened', totalTime }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animcompleted() {\n\t\t\t\t\t\t}", "notifyAnimationEnd() {}", "onAnimationEnd() {\n\n }", "#onAnimationFinish(state) {\n\t\t// Set the open attribute based on the parameter\n\t\tthis.state = state;\n\t\t// Clear the stored animation\n\t\tthis.animation = null;\n\t\t// Reset isClosing & isExpanding\n\t\tthis.isClosing = false;\n\t\tthis.isExpanding = false;\n\t\t// Remove the overflow hidden and the fixed height\n\t\tthis.element.style.height = this.element.style.overflow = '';\n\t}", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._openAnimationDone(totalTime);\n }\n else if (toState === 'exit') {\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._openAnimationDone(totalTime);\n }\n else if (toState === 'exit') {\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "function modalAnimation() {}", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._trapFocus();\n this._animationStateChanged.next({ state: 'opened', totalTime });\n }\n else if (toState === 'exit') {\n this._restoreFocus();\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "function animationComplete() {\n\t\t\t\t\t\tself._setHashTag();\n\t\t\t\t\t\tself.active = false;\n\t\t\t\t\t\tself._resetAutoPlay(true, self.settings.autoPlayDelay);\n\t\t\t\t\t}", "_animationDoneListener(event) {\n this._animationEnd.next(event);\n }", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid garbage\n // collection during the animation and because the black box updates need it.\n if (this._oldContainer) {\n this._oldContainer.removeFromParent();\n this._oldContainer.destroy();\n this._oldContainer = null;\n }\n\n if (this._delContainer) {\n this._delContainer.removeFromParent();\n this._delContainer.destroy();\n this._delContainer = null;\n }\n\n // Fire ready event saying animation is finished.\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "transitionCompleted() {\n // implement if needed\n }", "function openAnimation() {\n //\n // First, determine if we're in the middle of animation.\n //\n if ( !locked ) {\n //\n // We're not animating, let's lock the modal for animation.\n //\n lockModal();\n //\n // Close any opened modals.\n //\n closeOpenModals();\n //\n // Now, add the open class to this modal.\n //\n modal.addClass( \"open\" );\n\n //\n // Are we executing the 'fadeAndPop' animation?\n //\n if ( options.animation === \"fadeAndPop\" ) {\n //\n // Yes, we're doing the 'fadeAndPop' animation.\n // Okay, set the modal css properties.\n //\n //\n // Set the 'top' property to the document scroll minus the calculated top offset.\n //\n cssOpts.open.top = $doc.scrollTop() - topOffset;\n //\n // Flip the opacity to 0.\n //\n cssOpts.open.opacity = 0;\n //\n // Set the css options.\n //\n modal.css( cssOpts.open );\n //\n // Fade in the background element, at half the speed of the modal element.\n // So, faster than the modal element.\n //\n modalBg.fadeIn( options.animationSpeed / 2 );\n\n //\n // Let's delay the next animation queue.\n // We'll wait until the background element is faded in.\n //\n modal.delay( options.animationSpeed / 2 )\n //\n // Animate the following css properties.\n //\n .animate( {\n //\n // Set the 'top' property to the document scroll plus the calculated top measure.\n //\n \"top\": $doc.scrollTop() + topMeasure + 'px',\n //\n // Set it to full opacity.\n //\n \"opacity\": 1\n\n },\n /*\n * Fade speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal reveal:opened event.\n // This should trigger the functions set in the options.opened property.\n //\n modal.trigger( 'reveal:opened' );\n\n }); // end of animate.\n\n } // end if 'fadeAndPop'\n\n //\n // Are executing the 'fade' animation?\n //\n if ( options.animation === \"fade\" ) {\n //\n // Yes, were executing 'fade'.\n // Okay, let's set the modal properties.\n //\n cssOpts.open.top = $doc.scrollTop() + topMeasure;\n //\n // Flip the opacity to 0.\n //\n cssOpts.open.opacity = 0;\n //\n // Set the css options.\n //\n modal.css( cssOpts.open );\n //\n // Fade in the modal background at half the speed of the modal.\n // So, faster than modal.\n //\n modalBg.fadeIn( options.animationSpeed / 2 );\n\n //\n // Delay the modal animation.\n // Wait till the modal background is done animating.\n //\n modal.delay( options.animationSpeed / 2 )\n //\n // Now animate the modal.\n //\n .animate( {\n //\n // Set to full opacity.\n //\n \"opacity\": 1\n },\n\n /*\n * Animation speed.\n */\n options.animationSpeed,\n\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal reveal:opened event.\n // This should trigger the functions set in the options.opened property.\n //\n modal.trigger( 'reveal:opened' );\n\n });\n\n } // end if 'fade'\n\n //\n // Are we not animating?\n //\n if ( options.animation === \"none\" ) {\n //\n // We're not animating.\n // Okay, let's set the modal css properties.\n //\n //\n // Set the top property.\n //\n cssOpts.open.top = $doc.scrollTop() + topMeasure;\n //\n // Set the opacity property to full opacity, since we're not fading (animating).\n //\n cssOpts.open.opacity = 1;\n //\n // Set the css property.\n //\n modal.css( cssOpts.open );\n //\n // Show the modal Background.\n //\n modalBg.css( { \"display\": \"block\" } );\n //\n // Trigger the modal opened event.\n //\n modal.trigger( 'reveal:opened' );\n\n } // end if animating 'none'\n\n }// end if !locked\n\n }// end openAnimation", "function openAnimation() {\n //\n // First, determine if we're in the middle of animation.\n //\n if ( !locked ) {\n //\n // We're not animating, let's lock the modal for animation.\n //\n lockModal();\n //\n // Close any opened modals.\n //\n closeOpenModals();\n //\n // Now, add the open class to this modal.\n //\n modal.addClass( \"open\" );\n\n //\n // Are we executing the 'fadeAndPop' animation?\n //\n if ( options.animation === \"fadeAndPop\" ) {\n //\n // Yes, we're doing the 'fadeAndPop' animation.\n // Okay, set the modal css properties.\n //\n //\n // Set the 'top' property to the document scroll minus the calculated top offset.\n //\n cssOpts.open.top = $doc.scrollTop() - topOffset;\n //\n // Flip the opacity to 0.\n //\n cssOpts.open.opacity = 0;\n //\n // Set the css options.\n //\n modal.css( cssOpts.open );\n //\n // Fade in the background element, at half the speed of the modal element.\n // So, faster than the modal element.\n //\n modalBg.fadeIn( options.animationSpeed / 2 );\n\n //\n // Let's delay the next animation queue.\n // We'll wait until the background element is faded in.\n //\n modal.delay( options.animationSpeed / 2 )\n //\n // Animate the following css properties.\n //\n .animate( {\n //\n // Set the 'top' property to the document scroll plus the calculated top measure.\n //\n \"top\": $doc.scrollTop() + topMeasure + 'px',\n //\n // Set it to full opacity.\n //\n \"opacity\": 1\n\n },\n /*\n * Fade speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal reveal:opened event.\n // This should trigger the functions set in the options.opened property.\n //\n modal.trigger( 'reveal:opened' );\n\n }); // end of animate.\n\n } // end if 'fadeAndPop'\n\n //\n // Are executing the 'fade' animation?\n //\n if ( options.animation === \"fade\" ) {\n //\n // Yes, were executing 'fade'.\n // Okay, let's set the modal properties.\n //\n cssOpts.open.top = $doc.scrollTop() + topMeasure;\n //\n // Flip the opacity to 0.\n //\n cssOpts.open.opacity = 0;\n //\n // Set the css options.\n //\n modal.css( cssOpts.open );\n //\n // Fade in the modal background at half the speed of the modal.\n // So, faster than modal.\n //\n modalBg.fadeIn( options.animationSpeed / 2 );\n\n //\n // Delay the modal animation.\n // Wait till the modal background is done animating.\n //\n modal.delay( options.animationSpeed / 2 )\n //\n // Now animate the modal.\n //\n .animate( {\n //\n // Set to full opacity.\n //\n \"opacity\": 1\n },\n\n /*\n * Animation speed.\n */\n options.animationSpeed,\n\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal reveal:opened event.\n // This should trigger the functions set in the options.opened property.\n //\n modal.trigger( 'reveal:opened' );\n\n });\n\n } // end if 'fade'\n\n //\n // Are we not animating?\n //\n if ( options.animation === \"none\" ) {\n //\n // We're not animating.\n // Okay, let's set the modal css properties.\n //\n //\n // Set the top property.\n //\n cssOpts.open.top = $doc.scrollTop() + topMeasure;\n //\n // Set the opacity property to full opacity, since we're not fading (animating).\n //\n cssOpts.open.opacity = 1;\n //\n // Set the css property.\n //\n modal.css( cssOpts.open );\n //\n // Show the modal Background.\n //\n modalBg.css( { \"display\": \"block\" } );\n //\n // Trigger the modal opened event.\n //\n modal.trigger( 'reveal:opened' );\n\n } // end if animating 'none'\n\n }// end if !locked\n\n }// end openAnimation", "function closeAnimation() {\n //\n // First, determine if we're in the middle of animation.\n //\n if ( !locked ) {\n //\n // We're not animating, let's lock the modal for animation.\n //\n lockModal();\n //\n // Clear the modal of the open class.\n //\n modal.removeClass( \"open\" );\n\n //\n // Are we using the 'fadeAndPop' animation?\n //\n if ( options.animation === \"fadeAndPop\" ) {\n //\n // Yes, okay, let's set the animation properties.\n //\n modal.animate( {\n //\n // Set the top property to the document scrollTop minus calculated topOffset.\n //\n \"top\": $doc.scrollTop() - topOffset + 'px',\n //\n // Fade the modal out, by using the opacity property.\n //\n \"opacity\": 0\n\n },\n /*\n * Fade speed.\n */\n options.animationSpeed / 2,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css hidden options.\n //\n modal.css( cssOpts.close );\n\n });\n //\n // Is the modal animation queued?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Fade out the modal background.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed property.\n //\n modal.trigger( 'reveal:closed' );\n\n });\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fadeAndPop'\n\n //\n // Are we using the 'fade' animation.\n //\n if ( options.animation === \"fade\" ) {\n //\n // Yes, we're using the 'fade' animation.\n //\n modal.animate( { \"opacity\" : 0 },\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css close options.\n //\n modal.css( cssOpts.close );\n\n }); // end animate\n\n //\n // Are we mid animating the modal(s)?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Let's fade out the modal background element.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n }); // end fadeOut\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fade'\n\n //\n // Are we not animating?\n //\n if ( options.animation === \"none\" ) {\n //\n // We're not animating.\n // Set the modal close css options.\n //\n modal.css( cssOpts.close );\n //\n // Is the modal in the middle of an animation queue?\n //\n if ( !modalQueued ) {\n //\n // It's not mid queueu. Just hide it.\n //\n modalBg.css( { 'display': 'none' } );\n }\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if not animating\n //\n // Reset the modalQueued variable.\n //\n modalQueued = false;\n } // end if !locked\n\n }", "function closeAnimation() {\n //\n // First, determine if we're in the middle of animation.\n //\n if ( !locked ) {\n //\n // We're not animating, let's lock the modal for animation.\n //\n lockModal();\n //\n // Clear the modal of the open class.\n //\n modal.removeClass( \"open\" );\n\n //\n // Are we using the 'fadeAndPop' animation?\n //\n if ( options.animation === \"fadeAndPop\" ) {\n //\n // Yes, okay, let's set the animation properties.\n //\n modal.animate( {\n //\n // Set the top property to the document scrollTop minus calculated topOffset.\n //\n \"top\": $doc.scrollTop() - topOffset + 'px',\n //\n // Fade the modal out, by using the opacity property.\n //\n \"opacity\": 0\n\n },\n /*\n * Fade speed.\n */\n options.animationSpeed / 2,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css hidden options.\n //\n modal.css( cssOpts.close );\n\n });\n //\n // Is the modal animation queued?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Fade out the modal background.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed property.\n //\n modal.trigger( 'reveal:closed' );\n\n });\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fadeAndPop'\n\n //\n // Are we using the 'fade' animation.\n //\n if ( options.animation === \"fade\" ) {\n //\n // Yes, we're using the 'fade' animation.\n //\n modal.animate( { \"opacity\" : 0 },\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css close options.\n //\n modal.css( cssOpts.close );\n\n }); // end animate\n\n //\n // Are we mid animating the modal(s)?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Let's fade out the modal background element.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n }); // end fadeOut\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fade'\n\n //\n // Are we not animating?\n //\n if ( options.animation === \"none\" ) {\n //\n // We're not animating.\n // Set the modal close css options.\n //\n modal.css( cssOpts.close );\n //\n // Is the modal in the middle of an animation queue?\n //\n if ( !modalQueued ) {\n //\n // It's not mid queueu. Just hide it.\n //\n modalBg.css( { 'display': 'none' } );\n }\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if not animating\n //\n // Reset the modalQueued variable.\n //\n modalQueued = false;\n } // end if !locked\n\n }", "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "function clonedAnimationDone(){\n // scroll body\n anime({\n targets: \"html, body\",\n scrollTop: 0,\n easing: easingSwing, // swing\n duration: 150\n });\n\n // fadeOut oldContainer\n anime({\n targets: this.oldContainer,\n opacity : .5,\n easing: easingSwing, // swing\n duration: 300\n })\n\n // show new Container\n anime({\n targets: $newContainer.get(0),\n opacity: 1,\n easing: easingSwing, // swing\n duration: 300,\n complete: function(anim) {\n triggerBody()\n _this.done();\n }\n });\n\n $newContainer.addClass('one-team-anim')\n }", "function frameAnimationEnd() {\n f.animatedFrames = f.animatedFrames || 0;\n f.animatedFrames++;\n if(f.animatedFrames == f.frameItems.length){\n f.finished = true;\n f.o.cbFinished.call(f);\n }\n \n }", "animationEnded(e) {\n // wipe the slot of our drawer\n this.title = \"\";\n while (dom(this).firstChild !== null) {\n dom(this).removeChild(dom(this).firstChild);\n }\n if (this.invokedBy) {\n async.microTask.run(() => {\n setTimeout(() => {\n this.invokedBy.focus();\n }, 500);\n });\n }\n }", "function afterShowAnimation(scope, element, options) {\n\t\t\t\t// post-show code here: DOM element focus, etc.\n\t\t\t\t// console.log(scope);\n\t\t\t\tconsole.log(\"showing dialog\");\n\t\t\t}", "function afterShowAnimation(scope, element, options) {\n\t\t\t\t// post-show code here: DOM element focus, etc.\n\t\t\t\t// console.log(scope);\n\t\t\t\tconsole.log(\"showing dialog\");\n\t\t\t}", "function afterShowAnimation(scope, element, options) {\n\t\t\t\t// post-show code here: DOM element focus, etc.\n\t\t\t\t// console.log(scope);\n\t\t\t\tconsole.log(\"showing dialog\");\n\t\t\t}", "function afterShowAnimation(scope, element, options) {\n\t\t\t\t// post-show code here: DOM element focus, etc.\n\t\t\t\t// console.log(scope);\n\t\t\t\tconsole.log(\"showing dialog\");\n\t\t\t}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "static complete() {\n\t\tconsole.log('Animation.complete()')\n\t\tVelvet.capture.adComplete()\n\n\t}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function initLayerAnimationDialog() {\n var curAnimHandle = (currentAnimationType == 'customin') ? jQuery('#layer_animation').val() : jQuery('#layer_endanimation').val();\n var curAnimText = (currentAnimationType == 'customin') ? jQuery('#layer_animation option:selected').text() : jQuery('#layer_endanimation option:selected').text();\n var isOriginal = (curAnimHandle.indexOf('custom') > -1) ? false : true;\n var layerEasing = (currentAnimationType == 'customin') ? jQuery('#layer_easing option:selected').val() : jQuery('#layer_endeasing option:selected').val();\n var layerSpeed = (currentAnimationType == 'customin') ? jQuery('#layer_speed').val() : jQuery('#layer_endspeed').val();\n if (layerEasing == 'nothing') layerEasing = jQuery('#layer_easing option:selected').val();\n jQuery('#caption-easing-demo').val(layerEasing);\n if (parseInt(layerSpeed) == 0) layerSpeed = 600;\n jQuery('input[name=\"captionspeed\"]').val(layerSpeed);\n var cic = jQuery('#caption-inout-controll');\n cic.data('direction', 0);\n jQuery('#revshowmetheinanim').addClass(\"reviconinaction\");\n jQuery('#revshowmetheoutanim').removeClass(\"reviconinaction\");\n //set the transition direction to out\n if (currentAnimationType == 'customout') jQuery('#caption-inout-controll').click();\n jQuery(\"#layeranimeditor_wrap\").dialog({\n modal: true,\n resizable: false,\n title: 'Layer Animation Editor',\n minWidth: 700,\n minHeight: 500,\n closeOnEscape: true,\n open: function() {\n jQuery(this).closest(\".ui-dialog\").find(\".ui-button\").each(function(i) {\n var cl;\n if (i == 0) cl = \"revgray\";\n if (i == 1) cl = \"revgreen\";\n if (i == 2) cl = \"revred\";\n if (i == 3) cl = \"revred\";\n jQuery(this).addClass(cl).addClass(\"button-primary\").addClass(\"rev-uibuttons\");\n })\n },\n close: function() {\n setInAnimOfPreview();\n },\n buttons: {\n \"Save/Change\": function() {\n var animObj = createNewAnimObj();\n UniteAdminRev.setErrorMessageID(\"dialog_error_message\");\n jQuery('#current-layer-handle').text(curAnimText);\n jQuery('input[name=\"layeranimation_save_as\"]').val(curAnimText);\n jQuery(\"#dialog-change-layeranimation\").dialog({\n modal: true,\n buttons: {\n 'Save as': function() {\n jQuery(\"#dialog-change-layeranimation-save-as\").dialog({\n modal: true,\n buttons: {\n 'Save as new': function() {\n var id = checkIfAnimExists(jQuery('input[name=\"layeranimation_save_as\"]').val());\n var update = true;\n if (id !== false) {\n update = false;\n if (confirm(\"Animation already exists, overwrite?\")) {\n updateAnimInDb(jQuery('input[name=\"layeranimation_save_as\"]').val(), animObj, id);\n update = true;\n }\n } else {\n updateAnimInDb(jQuery('input[name=\"layeranimation_save_as\"]').val(), animObj, false);\n }\n if (update) {\n jQuery(\"#dialog-change-layeranimation-save-as\").dialog(\"close\");\n jQuery(\"#dialog-change-layeranimation\").dialog(\"close\");\n jQuery(this).dialog(\"close\");\n jQuery(\"#layeranimeditor_wrap\").dialog(\"close\");\n setInAnimOfPreview();\n }\n }\n }\n });\n },\n Save: function() {\n var id = checkIfAnimExists(jQuery('input[name=\"layeranimation_save_as\"]').val());\n if (id !== false) {\n if (confirm(\"Really overwrite animation?\")) {\n updateAnimInDb(jQuery('input[name=\"layeranimation_save_as\"]').val(), animObj, id);\n jQuery(this).dialog(\"close\");\n jQuery(\"#layeranimeditor_wrap\").dialog(\"close\");\n setInAnimOfPreview();\n }\n } else {\n updateAnimInDb(jQuery('input[name=\"layeranimation_save_as\"]').val(), animObj, false);\n jQuery(this).dialog(\"close\");\n jQuery(\"#layeranimeditor_wrap\").dialog(\"close\");\n setInAnimOfPreview();\n }\n }\n }\n });\n },\n \"Cancel\": function() {\n jQuery(this).dialog(\"close\");\n setInAnimOfPreview();\n },\n Delete: function() {\n if (isOriginal) {\n alert(\"Default animations can't be deleted\");\n } else {\n if (confirm('Really delete the animation \"' + curAnimText + '\"?')) {\n deleteAnimInDb(curAnimHandle);\n setInAnimOfPreview();\n jQuery(\"#layeranimeditor_wrap\").dialog(\"close\");\n }\n }\n }\n }\n });\n jQuery(\"#caption-rotationx-slider\").slider({\n range: \"min\",\n min: -980,\n max: 980,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"rotationx\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-rotationy-slider\").slider({\n range: \"min\",\n min: -980,\n max: 980,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"rotationy\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-rotationz-slider\").slider({\n range: \"min\",\n min: -980,\n max: 980,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"rotationz\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-movex-slider\").slider({\n range: \"min\",\n min: -2000,\n max: 2000,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"movex\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-movey-slider\").slider({\n range: \"min\",\n min: -2000,\n max: 2000,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"movey\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-movez-slider\").slider({\n range: \"min\",\n min: -2000,\n max: 2000,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"movez\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-scalex-slider\").slider({\n range: \"min\",\n min: 0,\n max: 800,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"scalex\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-scaley-slider\").slider({\n range: \"min\",\n min: 0,\n max: 800,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"scaley\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-skewx-slider\").slider({\n range: \"min\",\n min: -180,\n max: 180,\n step: 1,\n slide: function(event, ui) {\n jQuery('input[name=\"skewx\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-skewy-slider\").slider({\n range: \"min\",\n min: -180,\n max: 180,\n step: 1,\n slide: function(event, ui) {\n jQuery('input[name=\"skewy\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-opacity-slider\").slider({\n range: \"min\",\n min: -0,\n max: 100,\n step: 1,\n slide: function(event, ui) {\n jQuery('input[name=\"captionopacity\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-perspective-slider\").slider({\n range: \"min\",\n min: -3000,\n max: 3000,\n step: 1,\n slide: function(event, ui) {\n jQuery('input[name=\"captionperspective\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-originx-slider\").slider({\n range: \"min\",\n min: -200,\n max: 200,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"originx\"]').val(ui.value);\n }\n });\n jQuery(\"#caption-originy-slider\").slider({\n range: \"min\",\n min: -200,\n max: 200,\n step: 10,\n slide: function(event, ui) {\n jQuery('input[name=\"originy\"]').val(ui.value);\n }\n });\n }", "animationReadyToClose() {\n if (this.animationEnabled()) {\n // set default view visible before content transition for close runs\n if (this.getDefaultTabElement()) {\n const eleC = this.getDefaultTabElement() ? this.getDefaultTabElement().querySelector(ANIMATION_CLASS) :\n this.getDefaultTabElement().querySelector(ANIMATION_CLASS);\n if (eleC) {\n eleC.style.position = 'unset';\n eleC.classList.remove('hide');\n }\n }\n }\n }", "onAnimationFinish(isNavMenuOpen) {\n this.isNavMenuOpen = isNavMenuOpen;\n this.menu.classList.toggle('menu-open', this.isNavMenuOpen);\n this.animation = null;\n this.isClosing = false;\n this.isExpanding = false;\n\n if (this.isNavMenuOpen) {\n this.menu.style.height = 'auto';\n }\n }", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "handleAnimationEnd() {\n this.isAnimating = false;\n this.index = (this.index + 1) % this.greetings.length;\n\n setTimeout(() => this.updateGreeting(), 500);\n }", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "function _onAnimationEnd () {\n clearTimeout(transitionEndTimeout);\n $target.off(events);\n animationEnded();\n deferred.resolve();\n }", "pageAnimatingInCompleted() {\n eventBus.trigger(eventBus.eventKeys.PAGE_ANIMATED_IN_COMPLETE);\n }", "handleAnimationEnded ( result ) {\n \n if( result ) {\n this.props.handleOnChangeSurvey(this.state);\n }\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function animateRemoval(){return dialogPopOut(element,options);}", "_onEndAnim() {\n if (this._indicator) {\n this._indicator.getParent().removeChild(this._indicator);\n this._indicator = null;\n }\n }", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "dialogFadeOut() {\r\n $('#dialog').fadeOut()\r\n }", "function loadAnimationComplete() {\n circleLoader.hide();\n\n // Fade out the black background\n TweenMax.to(preloadBg, 0.3, { opacity : 0, onComplete : bgAnimationComplete } );\n }", "onFinish() {}", "onAnimationEnd_() {\n if (this.isOpen_()) {\n // On open sidebar\n const children = this.getRealChildren();\n this.scheduleLayout(children);\n this.scheduleResume(children);\n tryFocus(this.element);\n } else {\n // On close sidebar\n this.vsync_.mutate(() => {\n toggle(this.element, /* display */false);\n this.schedulePause(this.getRealChildren());\n });\n }\n }", "function endprogressLoader() {\n\n circle.animate(1.0, {\n duration: 800,\n easing: 'easeOutExpo',\n step: updatePercentage\n }, function() {\n\n window.scrollTo(0, 0);\n overlayFadeOut();\n });\n\n}", "OnAnimationEnd() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "handleAnimation (callback) {\n let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n $('.card').addClass('animated fadeOutDown').one(animationEnd, function() {\n $('.card').removeClass('animated fadeOutDown ');\n callback(true);\n\n $('.card').addClass('animated fadeInRight').one(animationEnd, function() {\n $('.card').removeClass('animated fadeInRight ');\n \n });\n \n });\n }", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "function handleOpen() {\n $.background.animate({\n opacity: 0.5,\n duration: animationSpeed\n });\n menuWrapper.animate({\n left: 0,\n duration: animationSpeed\n });\n}", "function TweenComplete() {\n tweenSlide.eventComplete(function () {\n // Reset 'style' & 'transform' for slide\n that.ResetTFSlideCss();\n // Update the variable in toggle-end\n that.TOSLIDE.End();\n fxCSS.status = null;\n });\n }", "function _finish(){\n logger.logEvent({'msg': 'animation finished'});\n if(logHeartbeat){\n clearInterval(logHeartbeat);\n }\n $('#finished-bg').fadeIn();\n if(currentMusicObj){\n __musicFade(currentMusicObj, false,1/(2000/MUSIC_ANIMATION_INTERVAL), false); //Fadeout animation for 2 seconds\n }\n for(var i=0; i<animationFinishObserver.length; i++){\n animationFinishObserver[i]();\n }\n _stopAllQueues();\n\n //Change pause button to replay\n var button = $('#play-toggle');\n button.removeClass('icon-pause');\n button.addClass('icon-repeat');\n button.unbind('click');\n button.bind('click', function(){location.reload();});\n\n for(var i = 0; i< currentAnimation.length; i++){ //Stop active animations (i.e. background)\n for(var j = 0; j<currentAnimation[i].length; j++){\n var node = currentAnimation[i][j];\n if('animation' in node){\n var _animation = node['animation'];\n if('object' in _animation){\n var _obj=_animation['object'];\n if(_obj){\n _obj.stop();\n }\n }\n }\n }\n }\n }", "function processOpenComplete() {\r\n if (flagContentOpenComplete_ && flagAdOpenComplete_) {\r\n // Emit event to outer.\r\n updateState('opened');\r\n\r\n if (context_.cfg.autoplay) {\r\n play();\r\n }\r\n }\r\n }", "onDialogClose() {\n var nextDialogState = this.state.dialog;\n nextDialogState.open = false;\n this.setState({ dialog: nextDialogState })\n }", "onFinish() {\n\t\tif (this.props.onFinish) {\n\t\t\tthis.props.onFinish();\n\t\t}\n\t}", "function onCloseClick() {\n // remove the open class so the page content animates out\n openContent.className = openContent.className.replace(' open', '');\n // animate the cover back to the original position card and size\n animateCoverBack(currentCard);\n // animate in other cards\n animateOtherCards(currentCard, false);\n}", "function onAnimationEnd(e) {\n if ($element.hasClass('mos-hiding')) {\n // If it's a TransitionEvent and there is a timer, cancel it (otherwise the events will be fired twice)\n if (e && hideTimer) $timeout.cancel(hideTimer);\n\n $element.addClass('mos-hidden');\n $element.removeClass('mos-hiding');\n dispatch('onFinish');\n }\n }", "playAnimation() {\n \n document.body.classList.add('splash');\n this.animObj.addEventListener(\"complete\", () => {\n //handles switching fadeIn and fadeOut className to Logo\n this.setState({ animationFinished: true })\n EventEmitter.emit(Signals.splashIsDone);\n //delay so we don't jump directly to home page after animation finishes\n setTimeout(() => {\n this.setState({ popup: false });\n console.log(\"finished animation\")\n document.body.classList.remove('splash');\n this.props.handleSplashDone();\n }, 2000);\n });\n \n //added delay so animation can load a bit properly\n setTimeout(() => {\n this.animObj.play(this.animationName);\n }, 2000);\n }", "function onFinish() {\n // There is the possibility that we are calling this more than once\n if (!_self.loading)\n return;\n\n _self.loading = false;\n\n // Re-select the last selected item\n if(_self.treeSelection.path) {\n var xmlNode = trFiles.$model.queryNode('//node()[@path=' +\n util.escapeXpathString(_self.treeSelection.path) + ' and @type=\"' +\n _self.treeSelection.type + '\"]');\n if (xmlNode)\n trFiles.select(xmlNode);\n }\n else {\n trFiles.select(trFiles.getFirstTraverseNode());\n }\n\n // Scroll to last set scroll pos\n if (_self.scrollPos && _self.scrollPos > -1) {\n if (animateScrollOnFinish) {\n apf.tween.single(trFiles, {\n type: \"scrollTop\",\n from: 0,\n to: _self.scrollPos\n });\n }\n else {\n trFiles.$ext.scrollTop = _self.scrollPos;\n }\n }\n\n // Now set the \"get\" attribute of the <a:insert> rule so the tree\n // knows to ask webdav for expanded folders' contents automatically\n self[\"trFilesInsertRule\"] && trFilesInsertRule.setAttribute(\"get\", \"{davProject.readdir([@path])}\");\n\n settings.save();\n }", "animateAppear() {\n if (defined(this._selectionIndicatorTween)) {\n if (this._selectionIndicatorIsAppearing) {\n // Already appearing; don't restart the animation.\n return;\n }\n this._selectionIndicatorTween.cancelTween();\n this._selectionIndicatorTween = undefined;\n }\n\n this._selectionIndicatorIsAppearing = true;\n\n var that = this;\n this._selectionIndicatorTween = this._tweens.add({\n startObject: {\n scale: 2.0,\n opacity: 0.0,\n rotate: -180\n },\n stopObject: {\n scale: 1.0,\n opacity: 1.0,\n rotate: 0\n },\n duration: 0.8,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n update: function(value) {\n that.opacity = value.opacity;\n that.transform =\n \"scale(\" + value.scale + \") rotate(\" + value.rotate + \"deg)\";\n that.updateStyle();\n },\n complete: function() {\n that._selectionIndicatorTween = undefined;\n },\n cancel: function() {\n that._selectionIndicatorTween = undefined;\n }\n });\n }", "function AnimComplete() {\n // Add timer to mark sure at end place\n setTimeout(function () {\n VariableModule(that);\n va.$capLast.css('visibility', '');\n va.$capInner.css('height', '');\n }, 10);\n }", "function animationCallback() {\n current = nextSlide;\n\n if (nextSlide === 0) {\n current = orgNumSlides;\n\n if (options.animation !== 'fade') {\n inner.css('left', -current * width);\n }\n } else if (nextSlide === numSlides - 1) {\n current = 1;\n\n if (options.animation !== 'fade') {\n inner.css('left', -width);\n }\n }\n\n // Fix for Zepto hiding the slide\n if (options.animation === 'fade') {\n slides.eq(current).show();\n }\n\n if (options.showBullets) {\n slider.next('.as-nav').find('a').removeClass('as-active').eq(current - 1).addClass('as-active');\n }\n\n running = false;\n\n options.afterChange.call(slider[0]);\n }", "function handleAnimationEnd() {\r\n node.classList.remove(`${prefix}animated`, animationName);\r\n node.removeEventListener('animationend', handleAnimationEnd);\r\n\r\n resolve('Animation ended');\r\n }", "get waitForAnimationsPromise()\n {\n return this.dragger.finished;\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n } // Resets transitions and removes motion-specific classes", "function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName);\n node.removeEventListener('animationend', handleAnimationEnd);\n\n resolve('Animation ended');\n }", "fadeOutDialog() {\n if (this.scene.fadeOut) //Process if fadeout was activated in the child class\n {\n if (this.dialogBox.closing) //Process if dialog Box should be closing (because button a or b was toggled)\n {\n //If title box is not completely off the canvas (at exit position), it should continue to go down with textBox and answerBox\n if (this.dialogBox.titleBox.position.y <= this.dialogBox.titleBox.exitPosition.y) {\n this.dialogBox.titleBox.position.y += this.dialogBox.titleBox.slideOutSpeed;\n this.dialogBox.textBox.position.y += this.dialogBox.titleBox.slideOutSpeed;\n this.dialogBox.answerButton.position.y += this.dialogBox.titleBox.slideOutSpeed;\n }\n //Otherwise, if the titleBox is at its exit position, dialogBox.closed is turn true\n else if (this.dialogBox.titleBox.position.y >= this.dialogBox.titleBox.exitPosition.y) {\n this.dialogBox.closed = true; // Set dialog Box as closed to toggle either button a or b;\n }\n }\n\n // if all dialog (title, text, buttons) are off the canvas, the reaction of the button (a or b) should be toggled\n if (this.dialogBox.closed) {\n this.dialogBox.closing = false; //resets closing to false to be safe\n //button a toggle\n if (this.dialogBox.answerButton.a.toggle === true) {\n this.toggleButtonA();\n }\n //button b toggle\n else if (this.dialogBox.answerButton.b.toggle === true) {\n this.toggleButtonB();\n }\n }\n }\n }", "function animationCompleted()\n{\n // Remove the tick event listener.\n TweenMax.ticker.removeEventListener(\"tick\");\n\n // Reenable the test button.\n animationTest.disabled = false;\n}", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animationHandler() {\n if (opened === \"menu \") {\n setOpened(\"menu opened\");\n setAriaExpanded(\"opened\");\n } else {\n setOpened(\"menu \");\n setAriaExpanded(\"\");\n }\n }", "_finishDismiss() {\n this._overlayRef.dispose();\n if (!this._onAction.closed) {\n this._onAction.complete();\n }\n this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });\n this._afterDismissed.complete();\n this._dismissedByAction = false;\n }", "function closeDialog()\n\t\t{\n\t\t\t$(\"#dialog\").fadeOut(\"slow\", function()\n\t\t\t\t{\n\t\t\t\t\t$(\"#dialog\").empty();\n\t\t\t\t});\n\t\t}", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "function ConvFinished({openConvFinishedDialog, setOpenConvFinishedDialog}) {\n function handleClose() {setOpenConvFinishedDialog(false)}\n // Render\n return (\n <div>\n <Dialog\n open={openConvFinishedDialog}\n onClose={handleClose}\n aria-labelledby=\"InitCompDialog-title\"\n aria-describedby=\"InitCompDialog-description\"\n >\n <DialogTitle id=\"InitCompDialog-title\">{\"Conversion complete!\"}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n The converted epub file can be found in the directory of your pdf file.\n </DialogContentText>\n <Alert severity=\"warning\">\n Some converted epub files may not be viewable as text but images. \n Reed recommends you to buy/get the epub book directly without converting.\n In the next update there will be another option to convert pdf file to epub ensuring text, but will be a bit dirty and contain no images.\n </Alert>\n </DialogContent>\n <DialogActions>\n <Button color=\"primary\" variant=\"contained\" style={{fontWeight: 'bold'}} onClick={()=>{handleClose()}}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n}", "function handleAnimationEnd(event) {\n event.stopPropagation();\n node.classList.remove(`${prefix}animated`, animationName);\n resolve('Animation ended');\n }", "close() {\n // start animation => look at the css\n this.show = false;\n setTimeout(() => {\n // end animation\n this.start = false;\n // deactivate the backdrop visibility\n this.contentSource.displayHandle.classList.toggle('_active');\n\n // notify furo-backdrop that it is closed now\n this.contentSource.dispatchEvent(new Event('closed', { composed: true, bubbles: true }));\n }, this.toDuration);\n }", "function motionDialog(choose, sw)\n\t\t{\n\t closeDialog();\n\t $(\"#dialog\").fadeIn(\"slow\", function()\n\t\t\t\t{\n\t\t\t\t\tshowDialog(choose);\n\t\t\t\t});\n\t\t}", "function openOffersDialog(callback, dur, msgHtml) {\r\n\t$('#overlay').fadeIn(dur, function() {\r\n\t\t$(\"#contentMsg\").html(msgHtml);\r\n\t\t$('#boxpopup').css('display','block');\r\n $('#boxpopup').animate({'left':'30%'},\r\n \t{\r\n \t\tduration: dur,\r\n \t\tcomplete: function(){\r\n \tif(callback!=null)\r\n \t\tcallback();\r\n },\r\n queue: false \r\n \t}\r\n );\r\n });\r\n}", "function finishAllAnimations() {\n runningAnimations.forEach(function (animation) {\n animation.finishNow();\n });\n clearTimeout(fadeInTimer);\n clearTimeout(animateHeightTimer);\n clearTimeout(animationsCompleteTimer);\n runningAnimations.length = 0;\n }", "function handleAnimationEnd(event) {\n event.stopPropagation();\n if(animationName !== event.animationName)\n {\n //ended other animation => ignore it callback now\n //console.error(animationName);\n //console.error(event);\n\n log('Animation end '+event.animationName+'; Expected: '+animationName );\n return;\n }\n\n node.classList.remove(animationName);\n\n log('Animation ended '+animationName );\n resolve('Animation ended '+animation);\n }", "animateOut (callback) {\n // Declare that the notice is animating out.\n this.set({'_animating': 'out'});\n const finished = () => {\n this.refs.elem.removeEventListener('transitionend', finished);\n const {_animTimer, _animating, _moduleIsNoticeOpen} = this.get();\n if (_animTimer) {\n clearTimeout(_animTimer);\n }\n if (_animating !== 'out') {\n return;\n }\n let visible = _moduleIsNoticeOpen;\n if (!visible) {\n const domRect = this.refs.elem.getBoundingClientRect();\n for (let prop in domRect) {\n if (domRect[prop] > 0) {\n visible = true;\n break;\n }\n }\n }\n if (!this.refs.elem.style.opacity || this.refs.elem.style.opacity === '0' || !visible) {\n this.set({'_animatingClass': ''});\n const {stack} = this.get();\n if (stack && stack.overlay) {\n // Go through the modal stack to see if any are left open.\n // TODO: Rewrite this cause it sucks.\n let stillOpen = false;\n for (let i = 0; i < PNotify.notices.length; i++) {\n const notice = PNotify.notices[i];\n if (notice !== this && notice.get().stack === stack && notice.get()._state !== 'closed') {\n stillOpen = true;\n break;\n }\n }\n if (!stillOpen) {\n removeStackOverlay(stack);\n }\n }\n if (callback) {\n callback.call();\n }\n // Declare that the notice has completed animating.\n this.set({'_animating': false});\n } else {\n // In case this was called before the notice finished animating.\n this.set({'_animTimer': setTimeout(finished, 40)});\n }\n };\n\n if (this.get().animation === 'fade') {\n this.refs.elem.addEventListener('transitionend', finished);\n this.set({'_animatingClass': 'ui-pnotify-in'});\n // Just in case the event doesn't fire, call it after 650 ms.\n this.set({'_animTimer': setTimeout(finished, 650)});\n } else {\n this.set({'_animatingClass': ''});\n finished();\n }\n }", "function openCloseModal() {\n console.log(542, \"Modal was fired\");\n $(\"#ModalInfo\").modal(\"show\");\n setTimeout(function () {\n animateBar();\n }, 100);\n setTimeout(function () {\n $(\"#ModalInfo\").modal(\"hide\");\n }, 2300);\n}", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function handleAnimationEnd(event) {\n event.stopPropagation();\n node.classList.remove(`${prefix}animated`, animationName);\n resolve('Animation ended');\n }", "handleAnimation() {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 1000,\n }).start();\n }", "function handleAnimationEnd(event) {\n event.stopPropagation();\n node.classList.remove(`${prefix}animated`, animationName);\n resolve('Animation ended');\n }", "function closedialog(){\n\tif($('#maindialog').css(\"visibility\")==\"visible\"){\n\t\t$(\"#maindialog\").css(\"visibility\",\"hidden\");\n\t\t$(\"#drop\").css(\"visibility\",\"hidden\").css(\"top\",\"69\").css(\"left\",\"77\");\n \tvar $this = $(\"#maindialog\");\n \t\t\t $this\n .effect(\"transfer\", {\n to: \"#home\",\n className: \"close-transfer-effect\"\n\n },340, function(){});}\n\t}", "onFinishChange ( f ) {\n\n if( this.isSpace ) return;\n\n this.callback = null;\n this.endCallback = f;\n return this;\n\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "function onEnd(cancelled) {\n element.off(css3AnimationEvents, onAnimationProgress);\n element.removeClass(activeClassName);\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "pauseAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(true);\n }\n }\n }", "onClose() {\n\t\t}", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }" ]
[ "0.6741527", "0.6605322", "0.65447015", "0.64482516", "0.63265663", "0.63265663", "0.6319347", "0.6309637", "0.6224005", "0.6187193", "0.61681455", "0.61416805", "0.6082098", "0.6034852", "0.6005933", "0.6005933", "0.5998334", "0.5998334", "0.59752095", "0.5930326", "0.5916141", "0.58600795", "0.5851985", "0.5851985", "0.5851985", "0.5851985", "0.5834435", "0.58272624", "0.5802536", "0.5802536", "0.5802536", "0.5801406", "0.5797664", "0.57869524", "0.5774754", "0.5739273", "0.5733802", "0.57253504", "0.57028764", "0.5696498", "0.5683362", "0.56754196", "0.5674757", "0.56701607", "0.56535214", "0.5640316", "0.5623666", "0.5603311", "0.5593196", "0.557727", "0.55662817", "0.5552429", "0.5536899", "0.54724944", "0.54711026", "0.54608524", "0.5460503", "0.54557115", "0.544847", "0.5435403", "0.54326403", "0.5431214", "0.5429473", "0.5428684", "0.54275674", "0.541637", "0.5414908", "0.54018366", "0.5395282", "0.5393988", "0.5381665", "0.5372345", "0.5356871", "0.5356871", "0.5356871", "0.5356871", "0.53528225", "0.53414685", "0.5322388", "0.5312725", "0.5305082", "0.5287309", "0.52835166", "0.52801925", "0.5273087", "0.52702045", "0.5265451", "0.5264693", "0.52646136", "0.52627766", "0.5257991", "0.52568805", "0.5245159", "0.5232816", "0.5230344", "0.5229343", "0.5226277", "0.52255857", "0.52255046", "0.5221694" ]
0.6350242
4
Callback, invoked whenever an animation on the host completes.
_onAnimationDone({ toState, totalTime }) { if (toState === 'enter') { this._openAnimationDone(totalTime); } else if (toState === 'exit') { this._animationStateChanged.next({ state: 'closed', totalTime }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "notifyAnimationEnd() {}", "onAnimationEnd() {\n\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "static complete() {\n\t\tconsole.log('Animation.complete()')\n\t\tVelvet.capture.adComplete()\n\n\t}", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid garbage\n // collection during the animation and because the black box updates need it.\n if (this._oldContainer) {\n this._oldContainer.removeFromParent();\n this._oldContainer.destroy();\n this._oldContainer = null;\n }\n\n if (this._delContainer) {\n this._delContainer.removeFromParent();\n this._delContainer.destroy();\n this._delContainer = null;\n }\n\n // Fire ready event saying animation is finished.\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "_animationDoneListener(event) {\n this._animationEnd.next(event);\n }", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "transitionCompleted() {\n // implement if needed\n }", "function animationComplete() {\n\t\t\t\t\t\tself._setHashTag();\n\t\t\t\t\t\tself.active = false;\n\t\t\t\t\t\tself._resetAutoPlay(true, self.settings.autoPlayDelay);\n\t\t\t\t\t}", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "function animationCompleted()\n{\n // Remove the tick event listener.\n TweenMax.ticker.removeEventListener(\"tick\");\n\n // Reenable the test button.\n animationTest.disabled = false;\n}", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "pageAnimatingInCompleted() {\n eventBus.trigger(eventBus.eventKeys.PAGE_ANIMATED_IN_COMPLETE);\n }", "function loadAnimationComplete() {\n circleLoader.hide();\n\n // Fade out the black background\n TweenMax.to(preloadBg, 0.3, { opacity : 0, onComplete : bgAnimationComplete } );\n }", "function _onAnimationEnd () {\n clearTimeout(transitionEndTimeout);\n $target.off(events);\n animationEnded();\n deferred.resolve();\n }", "function AnimComplete() {\n // Add timer to mark sure at end place\n setTimeout(function () {\n VariableModule(that);\n va.$capLast.css('visibility', '');\n va.$capInner.css('height', '');\n }, 10);\n }", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }", "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }", "OnAnimationEnd() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "animationEnded(e) {\n // wipe the slot of our drawer\n this.title = \"\";\n while (dom(this).firstChild !== null) {\n dom(this).removeChild(dom(this).firstChild);\n }\n if (this.invokedBy) {\n async.microTask.run(() => {\n setTimeout(() => {\n this.invokedBy.focus();\n }, 500);\n });\n }\n }", "onTransitionEnd() {\n this.nextKeyframe();\n }", "handleAnimationEnd() {\n this.isAnimating = false;\n this.index = (this.index + 1) % this.greetings.length;\n\n setTimeout(() => this.updateGreeting(), 500);\n }", "playAnimation() {\n \n document.body.classList.add('splash');\n this.animObj.addEventListener(\"complete\", () => {\n //handles switching fadeIn and fadeOut className to Logo\n this.setState({ animationFinished: true })\n EventEmitter.emit(Signals.splashIsDone);\n //delay so we don't jump directly to home page after animation finishes\n setTimeout(() => {\n this.setState({ popup: false });\n console.log(\"finished animation\")\n document.body.classList.remove('splash');\n this.props.handleSplashDone();\n }, 2000);\n });\n \n //added delay so animation can load a bit properly\n setTimeout(() => {\n this.animObj.play(this.animationName);\n }, 2000);\n }", "function frameAnimationEnd() {\n f.animatedFrames = f.animatedFrames || 0;\n f.animatedFrames++;\n if(f.animatedFrames == f.frameItems.length){\n f.finished = true;\n f.o.cbFinished.call(f);\n }\n \n }", "updateAnimation() {\n this.animator.animate();\n }", "function clonedAnimationDone(){\n // scroll body\n anime({\n targets: \"html, body\",\n scrollTop: 0,\n easing: easingSwing, // swing\n duration: 150\n });\n\n // fadeOut oldContainer\n anime({\n targets: this.oldContainer,\n opacity : .5,\n easing: easingSwing, // swing\n duration: 300\n })\n\n // show new Container\n anime({\n targets: $newContainer.get(0),\n opacity: 1,\n easing: easingSwing, // swing\n duration: 300,\n complete: function(anim) {\n triggerBody()\n _this.done();\n }\n });\n\n $newContainer.addClass('one-team-anim')\n }", "updateAnimation() {\n return;\n }", "update() {\n this.animation.update()\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "function _finish(){\n logger.logEvent({'msg': 'animation finished'});\n if(logHeartbeat){\n clearInterval(logHeartbeat);\n }\n $('#finished-bg').fadeIn();\n if(currentMusicObj){\n __musicFade(currentMusicObj, false,1/(2000/MUSIC_ANIMATION_INTERVAL), false); //Fadeout animation for 2 seconds\n }\n for(var i=0; i<animationFinishObserver.length; i++){\n animationFinishObserver[i]();\n }\n _stopAllQueues();\n\n //Change pause button to replay\n var button = $('#play-toggle');\n button.removeClass('icon-pause');\n button.addClass('icon-repeat');\n button.unbind('click');\n button.bind('click', function(){location.reload();});\n\n for(var i = 0; i< currentAnimation.length; i++){ //Stop active animations (i.e. background)\n for(var j = 0; j<currentAnimation[i].length; j++){\n var node = currentAnimation[i][j];\n if('animation' in node){\n var _animation = node['animation'];\n if('object' in _animation){\n var _obj=_animation['object'];\n if(_obj){\n _obj.stop();\n }\n }\n }\n }\n }\n }", "handleAnimationEnd() {\n clearTimeout(this.animEndLatchTimer_);\n this.animEndLatchTimer_ = setTimeout(() => {\n this.adapter_.removeClass(this.currentAnimationClass_);\n this.adapter_.deregisterAnimationEndHandler(this.animEndHandler_);\n }, numbers$1.ANIM_END_LATCH_MS);\n }", "pauseAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(true);\n }\n }\n }", "function afterAnimationEnds(afterAnimation) {\n document\n .querySelector(buildingPathSelector)\n .addEventListener(\"animationiteration\", () => afterAnimation(), false);\n}", "handleAnimation (callback) {\n let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n $('.card').addClass('animated fadeOutDown').one(animationEnd, function() {\n $('.card').removeClass('animated fadeOutDown ');\n callback(true);\n\n $('.card').addClass('animated fadeInRight').one(animationEnd, function() {\n $('.card').removeClass('animated fadeInRight ');\n \n });\n \n });\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._trapFocus();\n this._animationStateChanged.next({ state: 'opened', totalTime });\n }\n else if (toState === 'exit') {\n this._restoreFocus();\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "handleAnimation() {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 1000,\n }).start();\n }", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function OnComplete()\n{\nvideoContainer.style.visibility = \"hidden\";\naddClass(animation, 'start');\nvideoComplete = true;\n}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "onTransitionEnd() {\n this.isInAnimation = false;\n // if any method in queue, then invoke it\n if (this.visualEffectQueue.length) {\n let action = this.visualEffectQueue.shift(); // remove method from queue and invoke it\n this.isInAnimation = action.isAnimated;\n action.action();\n }\n }", "function finished(ev){if(ev&&ev.target!==element[0])return;if(ev)$timeout.cancel(timer);element.off($mdConstant.CSS.TRANSITIONEND,finished);// Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n\tresolve();}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function _sh_switch_workspace_tween_completed( ){\n\tTweener.removeTweens( this );\n}", "function handleAnimationEnd() {\r\n node.classList.remove(`${prefix}animated`, animationName);\r\n node.removeEventListener('animationend', handleAnimationEnd);\r\n\r\n resolve('Animation ended');\r\n }", "onFinish() {}", "function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName);\n node.removeEventListener('animationend', handleAnimationEnd);\n\n resolve('Animation ended');\n }", "_complete() {\n this.wrapperEl.addClass(this.options.classes.completed);\n this.element.addClass(this.options.classes.completed);\n this.element.trigger(SnapPuzzleEvents.complete, this);\n }", "function TweenComplete() {\n tweenSlide.eventComplete(function () {\n // Reset 'style' & 'transform' for slide\n that.ResetTFSlideCss();\n // Update the variable in toggle-end\n that.TOSLIDE.End();\n fxCSS.status = null;\n });\n }", "async wait() {\n this.waitingAnimationFinish = true;\n await Utils.delay(1000);\n this.waitingAnimationFinish = false;\n }", "_onEndAnim() {\n if (this._indicator) {\n this._indicator.getParent().removeChild(this._indicator);\n this._indicator = null;\n }\n }", "onComplete() {\n this.stopAudio();\n if (this.chains > 0) {\n this.chains--;\n }\n if (this.debug) {\n console.log('Animation completed chains left: ', this.chains);\n }\n if (this.destroyOnComplete && this.chains === 0) {\n if (this.destroyDelay > 0) {\n if (this.debug) {\n console.log(`Wall will be removed after ${ this.destroyDelay } seconds`);\n }\n setTimeout(() => {\n this.disposeWall();\n }, this.destroyDelay * 1000);\n } else {\n this.disposeWall();\n }\n }\n }", "function callbackDone() {\n module.presentation.set('contents', module.contents);\n module.callback(module.command);\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function bgAnimationComplete() {\n preloadBg.hide();\n\n site = new Site();\n site.init();\n }", "function onAnimationEnd(e) {\n if ($element.hasClass('mos-hiding')) {\n // If it's a TransitionEvent and there is a timer, cancel it (otherwise the events will be fired twice)\n if (e && hideTimer) $timeout.cancel(hideTimer);\n\n $element.addClass('mos-hidden');\n $element.removeClass('mos-hiding');\n dispatch('onFinish');\n }\n }", "animation() {}", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "complete() {\n if (this.element.renderTransform) {\n this.refreshTransforms();\n this.element.renderTransform.reset();\n }\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n } // Resets transitions and removes motion-specific classes", "begin () {\n this.container.classList.remove('visible')\n this.callback(this.cargo)\n }", "animationEnd() {\n if (this.movements.length !== 0) {\n this.nextMove()\n } else {\n this.orchestrator.camera.startAnimation(\"position\", 1.5, () => {\n this.orchestrator.changeState(new GameOverState(this.orchestrator))\n },\n [...this.orchestrator.camera.originalPosition],\n [\n this.orchestrator.gameboardProperties.x,\n this.orchestrator.gameboardProperties.y,\n this.orchestrator.gameboardProperties.z\n ])\n }\n\n }", "function finished(ev) {\n if (ev && ev.target !== element[0]) return;\n\n if (ev) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "#onAnimationFinish(state) {\n\t\t// Set the open attribute based on the parameter\n\t\tthis.state = state;\n\t\t// Clear the stored animation\n\t\tthis.animation = null;\n\t\t// Reset isClosing & isExpanding\n\t\tthis.isClosing = false;\n\t\tthis.isExpanding = false;\n\t\t// Remove the overflow hidden and the fixed height\n\t\tthis.element.style.height = this.element.style.overflow = '';\n\t}", "handleAnimationEnded ( result ) {\n \n if( result ) {\n this.props.handleOnChangeSurvey(this.state);\n }\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "get waitForAnimationsPromise()\n {\n return this.dragger.finished;\n }", "OnAnimationEnd() {\n // Before the animation, the treemap nodes will remove their bevels and selection\n // effects. If the animation is complete (and not stopped), then rerender to restore.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container);\n\n // Reselect the nodes using the selection handler's state\n this.ReselectNodes();\n }\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "exit() {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n }\n }", "function Animation (callback) {\n this.callback = callback;\n }", "fadeOut() {\n const self = this;\n // \"Unload\" Animation - onComplete callback\n TweenMax.to($(this.oldContainer), 0.4, {\n opacity: 0,\n onComplete: () => {\n this.fadeIn();\n }\n });\n }", "wait_GM_Camera_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.scene.camera_rotation == 0) {\n this.state = 'GAME_MOVIE';\n }\n }", "function onFinish() {\n console.log('finished!');\n}", "onAnimationEnd_() {\n if (this.isOpen_()) {\n // On open sidebar\n const children = this.getRealChildren();\n this.scheduleLayout(children);\n this.scheduleResume(children);\n tryFocus(this.element);\n } else {\n // On close sidebar\n this.vsync_.mutate(() => {\n toggle(this.element, /* display */false);\n this.schedulePause(this.getRealChildren());\n });\n }\n }", "function animatedChanged() {\n \t\tif (input.animated) {\n \t\t\t$$invalidate(0, input.frameWidth = input.width, input);\n \t\t}\n \t}", "function animationCallback() {\n current = nextSlide;\n\n if (nextSlide === 0) {\n current = orgNumSlides;\n\n if (options.animation !== 'fade') {\n inner.css('left', -current * width);\n }\n } else if (nextSlide === numSlides - 1) {\n current = 1;\n\n if (options.animation !== 'fade') {\n inner.css('left', -width);\n }\n }\n\n // Fix for Zepto hiding the slide\n if (options.animation === 'fade') {\n slides.eq(current).show();\n }\n\n if (options.showBullets) {\n slider.next('.as-nav').find('a').removeClass('as-active').eq(current - 1).addClass('as-active');\n }\n\n running = false;\n\n options.afterChange.call(slider[0]);\n }", "animateAppear() {\n if (defined(this._selectionIndicatorTween)) {\n if (this._selectionIndicatorIsAppearing) {\n // Already appearing; don't restart the animation.\n return;\n }\n this._selectionIndicatorTween.cancelTween();\n this._selectionIndicatorTween = undefined;\n }\n\n this._selectionIndicatorIsAppearing = true;\n\n var that = this;\n this._selectionIndicatorTween = this._tweens.add({\n startObject: {\n scale: 2.0,\n opacity: 0.0,\n rotate: -180\n },\n stopObject: {\n scale: 1.0,\n opacity: 1.0,\n rotate: 0\n },\n duration: 0.8,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n update: function(value) {\n that.opacity = value.opacity;\n that.transform =\n \"scale(\" + value.scale + \") rotate(\" + value.rotate + \"deg)\";\n that.updateStyle();\n },\n complete: function() {\n that._selectionIndicatorTween = undefined;\n },\n cancel: function() {\n that._selectionIndicatorTween = undefined;\n }\n });\n }", "function contentAnimation() {\n\n var tl = gsap.timeline();\n tl.from('.is-animated', { duration: 1, translateY: 60, opacity: 0, stagger: 0.4 });\n tl.from('.fadein', { duration: 0.5, opacity: 0.9 });\n}", "async onFinished() {}", "_parseComplete() {\n var callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n }", "function WaitForAnimation() {\r\n if (animating) {\r\n setTimeout(\"WaitForAnimation()\", 50);\r\n return;\r\n }\r\n ActionAfterAnimation();\r\n}", "function handleAnimationEnd(event) {\n event.stopPropagation();\n if(animationName !== event.animationName)\n {\n //ended other animation => ignore it callback now\n //console.error(animationName);\n //console.error(event);\n\n log('Animation end '+event.animationName+'; Expected: '+animationName );\n return;\n }\n\n node.classList.remove(animationName);\n\n log('Animation ended '+animationName );\n resolve('Animation ended '+animation);\n }", "update() {\n if(this.animation.isDone()) {\n this.removeFromWorld = true;\n }\n }", "function gifContainerAnimation() {\n gifContainer.classList.add('rotate-vert-center');\n gifContainer.addEventListener('animationend', gifContainerListener);\n}", "function initAnimation() {\n}", "endAll() {\n this.animations.forEach((anim) => anim.onEnd());\n this.animations = [];\n }", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "function _complete() {\n\t if (!_iscomplete) {\n\t _iscomplete = true;\n\t _status = scriptloader.loaderstatus.COMPLETE;\n\t _this.trigger(events.COMPLETE);\n\t }\n\t }", "function detectAnimation() {\n for (let i = 0; i <= shownCards.length - 1; i++) {\n card1.addEventListener('webkitAnimationEnd', removeclasses);\n card1.addEventListener('animationend', removeclasses)\n }\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }" ]
[ "0.8057842", "0.78386694", "0.7649008", "0.73289657", "0.7301747", "0.7249075", "0.7248529", "0.7237071", "0.7159387", "0.701882", "0.6959625", "0.6929186", "0.68912584", "0.68254286", "0.6811096", "0.6809392", "0.6793606", "0.6724227", "0.66507226", "0.66507226", "0.6615359", "0.660382", "0.66022533", "0.6581481", "0.6561599", "0.6541846", "0.65325814", "0.65255636", "0.6419928", "0.63070077", "0.6294044", "0.62878567", "0.6282964", "0.62785137", "0.62759286", "0.62611485", "0.6257834", "0.6257433", "0.6250521", "0.62450397", "0.62424946", "0.6226767", "0.6211848", "0.6207802", "0.62039125", "0.62017834", "0.62017834", "0.62017834", "0.6201481", "0.619983", "0.6185866", "0.6172624", "0.61646795", "0.61507875", "0.6144896", "0.61380774", "0.6128687", "0.61144066", "0.611437", "0.6109983", "0.6106432", "0.6104748", "0.6104569", "0.6104569", "0.609959", "0.6083598", "0.6081066", "0.6079309", "0.60641193", "0.6063464", "0.60533595", "0.604385", "0.60393876", "0.6036855", "0.6031459", "0.60260487", "0.60235304", "0.5990874", "0.59908557", "0.5965197", "0.59602165", "0.59597313", "0.595028", "0.5941867", "0.5910182", "0.5904986", "0.5897586", "0.58952934", "0.58925045", "0.5888182", "0.58855104", "0.58741057", "0.5872643", "0.58562374", "0.58533627", "0.58456874", "0.584457", "0.584249", "0.5841402" ]
0.63677025
30
Callback, invoked when an animation on the host starts.
_onAnimationStart({ toState, totalTime }) { if (toState === 'enter') { this._animationStateChanged.next({ state: 'opening', totalTime }); } else if (toState === 'exit' || toState === 'void') { this._animationStateChanged.next({ state: 'closing', totalTime }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initAnimation() {\n}", "function start () {\n animationInt = window.setInterval(animationManager, animatorIntervalTime);\n }", "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "_animationStartListener(event) {\n this._animationStarted.next(event);\n }", "notifyAnimationEnd() {}", "_startAnimation() {\n // @breaking-change 8.0.0 Combine with _resetAnimation.\n this._panelAnimationState = 'enter';\n }", "animation() {}", "playAnimation() {\n \n document.body.classList.add('splash');\n this.animObj.addEventListener(\"complete\", () => {\n //handles switching fadeIn and fadeOut className to Logo\n this.setState({ animationFinished: true })\n EventEmitter.emit(Signals.splashIsDone);\n //delay so we don't jump directly to home page after animation finishes\n setTimeout(() => {\n this.setState({ popup: false });\n console.log(\"finished animation\")\n document.body.classList.remove('splash');\n this.props.handleSplashDone();\n }, 2000);\n });\n \n //added delay so animation can load a bit properly\n setTimeout(() => {\n this.animObj.play(this.animationName);\n }, 2000);\n }", "onAnimationEnd() {\n\n }", "function init() {\n animation.Initialize();\n }", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "function contentAnimation() {\n\n var tl = gsap.timeline();\n tl.from('.is-animated', { duration: 1, translateY: 60, opacity: 0, stagger: 0.4 });\n tl.from('.fadein', { duration: 0.5, opacity: 0.9 });\n}", "function startAnimation() {\n timerId = setInterval(updateAnimation, 16);\n }", "handleAnimation() {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 1000,\n }).start();\n }", "pageAnimatingInCompleted() {\n eventBus.trigger(eventBus.eventKeys.PAGE_ANIMATED_IN_COMPLETE);\n }", "function animateStartup(){\n var myElement = document.getElementById(\"pageTitle\");\n console.log(\"animation block started\")\n document.getElementById(\"pageTitle\").style.animation=\n \"startupAnimation 1s 1\";\n myElement.style.transition=\"top 1.0s linear 0s\";\n myElement.style.top=\"0px\";\n \n}", "function start() {\n console.log(\"Animation Started\");\n\n let masterTl = new TimelineMax();\n\n //TODO: add childtimelines to master\n masterTl\n .add(clearStage(), \"scene-clear-stage\")\n .add(enterFloorVegetation(), \"scene-floor-vegitation\")\n .add(enterTreeStuff(), \"tree-stuff\");\n }", "function initScene() {\n animate();\n}", "run() {\n\t\tif(this.element.style.webkitAnimationPlayState !== 'running'){\n\t\t\tthis.element.style.webkitAnimationPlayState = 'running';\n\t\t\tthis.startTime = (new Date()).getTime();\n\t\t}\n\t}", "onTransitionEnd() {\n this.nextKeyframe();\n }", "function start() {\n startSeconds = new Date().getTime() / 1000;\n animating = true;\n }", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "function trigger_animation() {\n\t\t\tvar $this = $('#slide-num' + brick.to + ' a');\n\t\t\t\n\t\t\t$num.removeClass('slide-on');\n\t\t\t$this.addClass('slide-on');\n\t\t\t\n\t\t\tgotohere = -((brick.to - 1) * 1024);\n\t\t\t\n\t\t\t$scrollable.stop().animate({\n\t\t\t\tleft: gotohere},\n\t\t\t\t1000,\n\t\t\t\tfunction(){\n\t\t\t\t\tif (!$('#swf-' + brick.from).hasClass('image-loaded')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//var image = $('<img>').attr('src', brick.images[function_objs.lang][brick.from]);\n\t\t\t\t\t\tvar useimage = '<img src=\"' + brick.images[function_objs.lang][brick.from] + '\" alt=\"\" />'\n\t\t\t\t\t\t//console.log(useimage);\n\t\t\t\t\t\t$('#swf-' + brick.from)\n\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t.addClass('image-loaded')\n\t\t\t\t\t\t\t.attr('id','swf-' + brick.from)\n\t\t\t\t\t\t\t.innerHTML = useimage;\n\t\t\t\t\t\t\t//.html(useimage);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!$('#swf-' + brick.to).hasClass('image-loaded')) {\n\t\t\t\t\t\t//call function to start flash animation\n\t\t\t\t\t\tvar swf = document.getElementById(\"swf-\" + brick.to);\n\t\t\t\t\t\tswf.replay();\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbrick.from = brick.to;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "begin () {\n this.container.classList.remove('visible')\n this.callback(this.cargo)\n }", "function fireInitialAnimations() {\n $mdUtil.nextTick(function() {\n $animate.addClass($element, 'md-noop');\n });\n }", "if (m_bInitialAnim) { return; }", "function animcompleted() {\n\t\t\t\t\t\t}", "function Start () { \r\n animation.wrapMode = WrapMode.Loop; \r\n animation.Stop(); \r\n Idle();\r\n}", "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n var $parent = $document.find($parentSelector);\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent);\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent);\n }\n\n _set(startSize);\n }", "function loadAnimationStartedCb(event) {\n progressCellColorToDefault(event);\n }", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "onStartApplication() {\n this.switchDrawJoints = true;\n this.animationFrame();\n }", "animate_start(frame) {\r\n this.sprite.animate = true;\r\n }", "updateAnimation() {\n this.animator.animate();\n }", "enter() {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.detectChanges();\n this._screenReaderAnnounce();\n }\n }", "function initElementsAnimation() {\n if ($(\".animated\").length > 0) {\n $(\".animated\").each(function() {\n var $this = $(this);\n $this.appear(function() {\n $this.addClass(\"go\");\n }, {\n accX: 0,\n accY: -200\n });\n })\n };\n}", "start() {\n\n // Initialize if necessary.\n if (!this.isInitialized) {\n this.init();\n }\n\n // Start the interval for the animation. Store the interval ID for being\n // able to stop it later.\n this.intervalID = window.setInterval(function() {\n\n // Optimize the animation.\n window.requestAnimationFrame(this.step.bind(this));\n }.bind(this), this.interval);\n }", "function startAnimation() {\n $('#start').addClass(animationBounceOutLeft).one(animationEnd, function () {\n $(this).removeClass(animationBounceOutLeft);\n $(this).hide();\n });\n }", "mounted() {\n this.animation = new Animation(this);\n this.animation.createMainTimeline();\n this.animation.play();\n }", "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n var document = $document[0];\n var parent = document.querySelector ?\n document.querySelector($parentSelector)\n : $document.find($parentSelector)[0]\n ;\n\n if (! parent) {\n parent = document.getElementsByTagName('body')[0];\n }\n\n var $parent = angular.element(parent);\n var $after = parent.lastChild && angular.element(parent.lastChild);\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent, $after);\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent, loadingBarContainer);\n }\n\n _set(startSize);\n }", "function resumeAnimation() {\n startAnimation()\n}", "function startAnimation() {\n waited += new Date().getTime() - stopTime\n stopAnim = false;\n Animation();\n}", "play() {\n if (this.el) {\n this.el.style[this.__playState] = \"running\";\n this.el.$$animation.__playing = true;\n // in case the animation is based on JS\n if (this.i != undefined && qx.bom.element.AnimationJs) {\n qx.bom.element.AnimationJs.play(this);\n }\n }\n }", "function startAnimation(){\n //5. Start the animation using animationisonLoop function\n requestId=requestAnimationFrame(animationLoop);\n}", "function start() {\n classes.isTransition = true;\n original.addEventListener('transitionend', end);\n }", "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n var $parent = $document.find($parentSelector).eq(0);\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent, angular.element($parent[0].lastChild));\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent, angular.element($parent[0].lastChild));\n }\n\n _set(startSize);\n }", "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animation',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function Animated() {\n this.payload = void 0;\n // This makes \"isAnimated\" return true.\n setAnimated(this, this);\n }", "update() {\n this.animation.update()\n }", "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n var $parent = $document.find($parentSelector).eq(0);\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent, angular.element($parent[0].lastChild));\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent, angular.element($parent[0].lastChild));\n }\n\n _set(startSize);\n }", "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n var $parent = $document.find($parentSelector).eq(0);\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent, angular.element($parent[0].lastChild));\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent, angular.element($parent[0].lastChild));\n }\n\n _set(startSize);\n }", "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n var $parent = $document.find($parentSelector).eq(0);\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent, angular.element($parent[0].lastChild));\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent, angular.element($parent[0].lastChild));\n }\n\n _set(startSize);\n }", "function startAnimation() {\n if (!animating) {\n prevTime = Date.now();\n\t animating = true;\n prevMixerTime = Date.now();\n\t requestAnimationFrame(doFrame);\n\t}\n}", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "function startAnimation () {\n on = true; // Animation angeschaltet\n timer = setInterval(paint,40); // Timer mit Intervall 0,040 s aktivieren\n t0 = new Date(); // Neuer Anfangszeitpunkt \n }", "function startAnimation () {\n on = true; // Animation angeschaltet\n timer = setInterval(paint,40); // Timer mit Intervall 0,040 s aktivieren\n t0 = new Date(); // Neuer Anfangszeitpunkt \n }", "function startAnimation () {\n on = true; // Animation angeschaltet\n timer = setInterval(paint,40); // Timer mit Intervall 0,040 s aktivieren\n t0 = new Date(); // Neuer Anfangszeitpunkt \n }", "function startAnimation() {\n stopAnimation();\n animation = animate(slider.values[0]);\n playButton.classList.add(\"toggled\");\n }", "function Start() {\n /**\n * INSERT STYLE 'OVERFLOW' AT FIRST: FIXED FOR OLD BROWSER\n */\n var style = $anim.attr('style');\n isOverflowOnNode = style && style.indexOf('overflow') !== -1;\n // Unavailable\n // !isOverflowOnNode && $anim.css('overflow', 'hidden');\n /**\n * EXECUTE FUNCTION 'START' AT FIRST\n */\n !!an.optsEnd.start && an.optsEnd.start();\n }", "function start() {\n lastTime = null;\n frameId = requestAnimationFrame(onFrame);\n }", "function Animation (callback) {\n this.callback = callback;\n }", "animate() {\n if (!window.actionDrivenRender)\n this.render();\n //aktualisiert die Camera\n //this.controls.update();\n //Zeichnet das Bild zum naechsten Visualisierungszeitpunkt (requestanimationFrame) und nimmt eine Callbackfunktion\n requestAnimationFrame(this.animate);\n }", "function startAnimation () {\r\n on = true; // Animation angeschaltet\r\n timer = setInterval(paint,40); // Timer mit Intervall 0,040 s aktivieren\r\n t0 = new Date(); // Neuer Bezugszeitpunkt \r\n }", "_handleEnter() {\n this._enterAnimation.start();\n this.fireAncestors(\"$addTask\");\n }", "#startHeaderAnimation() {\n this.intervalId = setInterval(() => {\n this.timeTickCounter++;\n if (this.timeTickCounter <= Object.keys(this.headerAnimation.frames).length) {\n this.pixels.togglePixels(this.headerAnimation.frames[this.timeTickCounter], 'snake1');\n }\n }, this.timeTick);\n }", "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animat',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function fireNextFrame() {\n // Trigger event for animator.\n // Notice, when animator handles the event, it also gives the callback event back.\n // Then, the flow automatically continues also here.\n firePause();\n changeToNextFrame();\n }", "function fireNextFrame() {\n // Trigger event for animator.\n // Notice, when animator handles the event, it also gives the callback event back.\n // Then, the flow automatically continues also here.\n firePause();\n changeToNextFrame();\n }", "function animationReady(revealContent) {\n if (continueAnimation) {\n if (angular.isDefined(revealContent)) continueAnimation = revealContent;\n continueAnimation.run(continueAnimation.args);\n continueAnimation = false;\n } else if (angular.isDefined(revealContent)) continueAnimation = revealContent;\n else continueAnimation = true;\n }", "start() {\n this.frames=0,this.second=0,this.wait=0;\n console.log(this.scene);\n this.onWindowResize(this.camera, this.renderer, this.postprocessing);\n this.postprocessing.composer.renderer.setAnimationLoop(async () => {\n // tell every animated object to tick forward one frame\n const delta =this.clock.getDelta();\n this.tick(delta);\n this.Framerate(delta)\n this.postprocessing.composer.render(this.clock.getDelta());\n \n });\n }", "_onLoadStart() {\n let state = this.state;\n state.loading = true;\n this.loadAnimation()\n this.setState( state );\n\n if ( typeof this.props.onLoadStart === 'function' ) {\n this.props.onLoadStart(...arguments);\n }\n }", "function startAnimating() {\n fpsInterval = 1000 / fps;\n then = Date.now();\n startTime = then;\n animate();\n}", "enter() {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.detectChanges();\n }\n }", "enter() {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.detectChanges();\n }\n }", "startAnimation() {\r\n this.anims.play(this.animationName, true);\r\n\r\n //Play walk sound\r\n this.walk = this.scene.sound.add('walk');\r\n this.walk.play();\r\n }", "setupTween() {\n this.tween = this.getInitialTweenInstance(this.wall.position);\n this.tween.onStart(() => {\n this.onStart();\n if (this.debug) {\n console.log('Animation start');\n console.log(this.tween);\n }\n if (this.wall.position.distanceTo(this.tween._valuesEnd) > 0) {\n this.playAudio();\n }\n });\n this.tween.onComplete(() => this.onComplete());\n }", "initiateAnimation() {\n let previousPosition = this.gameOrchestrator.gameboard.getPiecePosition(this.firstTile.col, this.firstTile.row);\n previousPosition[1] = 0; //in the start position, the height is not needed \n\n let nextPosition = this.gameOrchestrator.gameboard.getPiecePosition(this.secondTile.col, this.secondTile.row)\n\n let animation = new PieceAnimation(this.gameOrchestrator.scene, previousPosition, nextPosition, MOVE_SPEED);\n\n this.animations.push(animation);\n\n this.gameOrchestrator.gameboard.setPieceAnimation(this.firstTile.col, this.firstTile.row, animation);\n }", "function animate() {\n\twindow.requestAnimationFrame(animate);\n\trender();\n\t\n\tif(drillImage != null && hasFinishedInit == false && welcomePageUp == false){\n\t\thasFinishedInit = true;\n\t\tgenerateMapLevel(currentLevel);\n\t\tcreateLevel(currentLevel);\n\t}\n}", "set importAnimation(value) {}", "runAnimation() {\n const animate = () => {\n const duration = this.getAnimationDuration();\n setStyle(this.slider, 'transform', 'translateX(0%)');\n setStyle(this.slider, 'transition', `transform ${duration}ms linear`);\n setStyle(this.slider, 'transform', 'translateX(-100%)');\n\n this.animationTimer = setTimeout(() => {\n this.stopAnimation();\n requestAnimationFrame(() => animate());\n }, duration / 2);\n };\n\n animate();\n }", "animateAppear() {\n if (defined(this._selectionIndicatorTween)) {\n if (this._selectionIndicatorIsAppearing) {\n // Already appearing; don't restart the animation.\n return;\n }\n this._selectionIndicatorTween.cancelTween();\n this._selectionIndicatorTween = undefined;\n }\n\n this._selectionIndicatorIsAppearing = true;\n\n var that = this;\n this._selectionIndicatorTween = this._tweens.add({\n startObject: {\n scale: 2.0,\n opacity: 0.0,\n rotate: -180\n },\n stopObject: {\n scale: 1.0,\n opacity: 1.0,\n rotate: 0\n },\n duration: 0.8,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n update: function(value) {\n that.opacity = value.opacity;\n that.transform =\n \"scale(\" + value.scale + \") rotate(\" + value.rotate + \"deg)\";\n that.updateStyle();\n },\n complete: function() {\n that._selectionIndicatorTween = undefined;\n },\n cancel: function() {\n that._selectionIndicatorTween = undefined;\n }\n });\n }", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "re_animate_ghost() {\r\n\r\n this.sprite.status = this.statusEnum.ALIVE;\r\n this.set_animation_frame(0, 0);\r\n this.animate_start();\r\n \r\n }", "function firePlay() {\n if (_requestAnimationTime === undefined) {\n _requestAnimationTime = new Date();\n setPlayAndPauseImage();\n // Start to play animation.\n playAnimation();\n }\n }", "function firePlay() {\n if (_requestAnimationTime === undefined) {\n _requestAnimationTime = new Date();\n setPlayAndPauseImage();\n // Start to play animation.\n playAnimation();\n }\n }", "function checkAnimation() {\r\n var $elem = $('.bar .level');\r\n\r\n // If the animation has already been started\r\n if ($elem.hasClass('start')) return;\r\n\r\n if (isElementInViewport($elem)) {\r\n // Start the animation\r\n $elem.addClass('start');\r\n }\r\n}", "updateAnimation() {\n return;\n }", "function initializeAnimationFramework(view) {\n view.on('frame', function() {\n for (const animation of _activeAnimations) {\n animation.step(animation);\n }\n });\n}", "function startAnimation(){\n\tif (carIsRunning === true){\n\t\treturn;\n\t}\n\t$(\"#streetImg\").animate({\n\t\tbackgroundPositionY: '+=200px'\n\t}, 500, 'linear', startAnimation);\n}", "function arrivalCallback()\n{\n inIdle = true;\n canIdle = true; \n curvedPointVal = undefined; \n if(script.idleAnimScript != null && script.idleAnimScript.api.animMixer != null)\n {\n script.idleAnimScript.api.idleAnimInitFunc(); \n script.api.inArrival = false; \n } \n resetDrawingVars(); \n clearMesh(); \n}", "function animationCompleted()\n{\n // Remove the tick event listener.\n TweenMax.ticker.removeEventListener(\"tick\");\n\n // Reenable the test button.\n animationTest.disabled = false;\n}", "function animate() {\n requestAnimationFrame(animate);\n renderer.render(stage);\n //checkHelp();\n}", "function startTimeAnimation() {\n\n\t// reset the time slider\n\t$('#time_slider').slider('value', 0);\n\t\n\t// update the map\n\tupdateMapTimePeriod(0);\n\t\n\t// update the time marker\n\tcurrentTimeInterval = 1;\n\t\n\t// set a timeout for the continue time animation\n\tnextTimeout = setTimeout('continueTimeAnimation()', 3000);\n\t\n\t// update the message\n\t$('#animation_message').empty().append('Animation running…');\n\n}", "function OnComplete()\n{\nvideoContainer.style.visibility = \"hidden\";\naddClass(animation, 'start');\nvideoComplete = true;\n}", "function Update()\n\t{\n\t\t//If the animation is enabled\n\t\tif (canAnimate)\n\t\t{\n\t\t\t//Start the animation coroutine\n\t\t\tStartCoroutine(Animate());\n\t\t}\n\t}", "function homeAnim() { //homepage animation on load \n qsCl(\"home__logo-fill\").left = '-177px';\n qsCl(\"home__logo-dolya\").color = 'black';\n qsCl(\"home__logo-consulting\").color = 'black';\n qsCl(\"home__logo-frame\").opacity = '1';\n qsCl(\"home__tagline-line\").width = '60px';\n qsCl(\"home__mission-statement\").color = '#303030';\n qsCl(\"home__tagline\").color = '#303030';\n qsCl(\"home__golden-thread\").color = 'var(--gold)';\n qsCl(\"path-logo\").animation = 'dash 3s ease-in forwards 1s'\n qsCl(\"path-home\").animation = 'dash 5s ease-in-out forwards 4s';\n drawn.home = true;\n}", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }" ]
[ "0.71801573", "0.69497263", "0.69406104", "0.6932655", "0.687876", "0.6804701", "0.67395705", "0.6734049", "0.6663561", "0.6655559", "0.652832", "0.6419603", "0.64195", "0.64070904", "0.6376037", "0.6369497", "0.63631326", "0.63578624", "0.63562286", "0.6339053", "0.63387954", "0.6310415", "0.6305978", "0.62517214", "0.624035", "0.6214164", "0.6211785", "0.61966705", "0.6190856", "0.618889", "0.61846274", "0.61702585", "0.6169131", "0.61596733", "0.61513376", "0.61371356", "0.61327714", "0.61275244", "0.61249197", "0.6116213", "0.6113051", "0.6104498", "0.608877", "0.60829854", "0.6073874", "0.6071282", "0.6069547", "0.60687613", "0.6062109", "0.604277", "0.60405606", "0.60405606", "0.60405606", "0.6030006", "0.60265476", "0.6004755", "0.6004755", "0.6004755", "0.59960455", "0.5981483", "0.5980922", "0.5977297", "0.597638", "0.5967641", "0.5963888", "0.5950207", "0.5932429", "0.59265405", "0.59265405", "0.591758", "0.5913029", "0.5911595", "0.59081006", "0.5905069", "0.5905069", "0.5898901", "0.58984905", "0.5896693", "0.5894547", "0.5893108", "0.58897996", "0.58853656", "0.58843774", "0.5883697", "0.58828723", "0.58828723", "0.5881333", "0.5879832", "0.5878457", "0.5871414", "0.5864459", "0.5854357", "0.5854273", "0.58523136", "0.5851932", "0.5840028", "0.58376443", "0.5832708" ]
0.618038
33
Starts the dialog exit animation.
_startExitAnimation() { this._state = 'exit'; // Mark the container for check so it can react if the // view container is using OnPush change detection. this._changeDetectorRef.markForCheck(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exit() {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n }\n }", "function dismiss() {\n $.background.animate({\n opacity: 0,\n duration: animationSpeed\n }, () => {\n // Second parameter for the animation is the callback when it is done\n // In this case we're closing the window after menu has faded away\n $.getView().close();\n });\n\n menuWrapper.animate({\n left: -menuWidth,\n duration: animationSpeed\n });\n}", "exit(gui, final) {}", "exit(gui, final) {}", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "exit(guiManager, final) {}", "exit(guiManager, final) {}", "function closeModal() {\n close.click(function(e) {\n gameEnd.removeClass('show');\n start();\n });\n}", "exit() {\n // Note: this one transitions to `hidden`, rather than `void`, in order to handle the case\n // where multiple snack bars are opened in quick succession (e.g. two consecutive calls to\n // `MatSnackBar.open`).\n this._animationState = 'hidden';\n // Mark this element with an 'exit' attribute to indicate that the snackbar has\n // been dismissed and will soon be removed from the DOM. This is used by the snackbar\n // test harness.\n this._elementRef.nativeElement.setAttribute('mat-exit', '');\n return this._onExit;\n }", "exit() {\n this.exit();\n }", "function Exit() {\n _super.call(this);\n this._initialize();\n this.start();\n }", "function onExitAlertOkClick() {\n app.exit();\n }", "exit() {\n const {\n options,\n viewer,\n image,\n list,\n } = this;\n\n if (!this.isShown || this.played || !this.fulled || !options.inline) {\n return this;\n }\n\n this.fulled = false;\n this.close();\n removeClass(this.button, CLASS_FULLSCREEN_EXIT);\n\n if (options.transition) {\n removeClass(list, CLASS_TRANSITION);\n\n if (this.viewed) {\n removeClass(image, CLASS_TRANSITION);\n }\n }\n\n if (options.focus) {\n this.clearEnforceFocus();\n }\n\n viewer.removeAttribute('role');\n viewer.removeAttribute('aria-labelledby');\n viewer.removeAttribute('aria-modal');\n removeClass(viewer, CLASS_FIXED);\n setStyle(viewer, {\n zIndex: options.zIndexInline,\n });\n\n this.viewerData = assign({}, this.parentData);\n this.renderViewer();\n this.renderList();\n\n if (this.viewed) {\n this.initImage(() => {\n this.renderImage(() => {\n if (options.transition) {\n setTimeout(() => {\n addClass(image, CLASS_TRANSITION);\n addClass(list, CLASS_TRANSITION);\n }, 0);\n }\n });\n });\n }\n\n return this;\n }", "function close()\n\t{\n\t\tthat.fadeOut(200, 0, fadeComplete);\n\t}", "function end() {\n document.getElementById(\"quitOverlay\").style.display = \"block\";\n document.getElementById(\"main\").style.display = \"none\";\n document.getElementById(\"hide\").style.display = \"none\";\n document.getElementById(\"memo\").style.display = \"none\";\n document.getElementById(\"start\").style.display = \"none\";\n document.getElementById(\"quitOverlay\").style.background = 'none';\n document.getElementById(\"quitOverlay\").style.backgroundImage = 'url(\"paw-print-941498_1920.jpg\")';\n}", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n } // Resets transitions and removes motion-specific classes", "exit() {\n // It's common for snack bars to be opened by random outside calls like HTTP requests or\n // errors. Run inside the NgZone to ensure that it functions correctly.\n this._ngZone.run(() => {\n // Note: this one transitions to `hidden`, rather than `void`, in order to handle the case\n // where multiple snack bars are opened in quick succession (e.g. two consecutive calls to\n // `MatSnackBar.open`).\n this._animationState = 'hidden';\n // Mark this element with an 'exit' attribute to indicate that the snackbar has\n // been dismissed and will soon be removed from the DOM. This is used by the snackbar\n // test harness.\n this._elementRef.nativeElement.setAttribute('mat-exit', '');\n // If the snack bar hasn't been announced by the time it exits it wouldn't have been open\n // long enough to visually read it either, so clear the timeout for announcing.\n clearTimeout(this._announceTimeoutId);\n });\n return this._onExit;\n }", "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "function end() {\r\n bg.visible = false;\r\n monkey.visible = false;\r\n\r\n bananaGroup.destroyEach();\r\n stoneGroup.destroyEach();\r\n}", "fadeOut(callback) {\n this.recipeWindow\n .animate(\n { opacity: [1, 0] },\n { duration: this.animationTime, easing: \"ease-out\" }\n )\n .finished.then(() => {\n this.hide(callback);\n });\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function animateRemoval() {\n return dialogPopOut(element, options);\n }", "function exit(result) {\n clearInterval(MODEL.timeInterval);\n const modal = document.querySelector('.message');\n const fragment = document.createDocumentFragment();\n const header = document.createElement('header');\n const h4 = document.createElement('h4');\n const div = document.createElement('div');\n const playAgain = document.querySelector('.play-again');\n const containers = document.querySelectorAll('.container');\n containers[1].classList.add('hide');\n containers[2].classList.remove('hide');\n (result == 'success')\n ?VIEW.popupWin(modal, fragment, header, h4, div)\n :VIEW.popupLose(modal, fragment, header, h4, div);\n playAgain.addEventListener('click', () => window.open('index.html', '_self'));\n}", "dialogFadeOut() {\r\n $('#dialog').fadeOut()\r\n }", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function exitTrading() {\n \"use strict\";\n\n $(\"#trading\").fadeOut(500, function () {\n updateDisplayNoAnimate();\n $(\"#main-content\").fadeIn(500);\n });\n}", "function animateRemoval(){return dialogPopOut(element,options);}", "close() {\n // start animation => look at the css\n this.show = false;\n setTimeout(() => {\n // end animation\n this.start = false;\n // deactivate the backdrop visibility\n this.contentSource.displayHandle.classList.toggle('_active');\n\n // notify furo-backdrop that it is closed now\n this.contentSource.dispatchEvent(new Event('closed', { composed: true, bubbles: true }));\n }, this.toDuration);\n }", "animationReadyToClose() {\n if (this.animationEnabled()) {\n // set default view visible before content transition for close runs\n if (this.getDefaultTabElement()) {\n const eleC = this.getDefaultTabElement() ? this.getDefaultTabElement().querySelector(ANIMATION_CLASS) :\n this.getDefaultTabElement().querySelector(ANIMATION_CLASS);\n if (eleC) {\n eleC.style.position = 'unset';\n eleC.classList.remove('hide');\n }\n }\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "notifyAnimationEnd() {}", "slideOut(callback) {\n this.recipeWindow\n .animate(\n {\n transform: [\"translateX(0px)\", \"translateX(-20vw)\"],\n opacity: [1, 0],\n },\n { duration: this.animationTime, easing: \"ease-out\" }\n )\n .finished.then(() => {\n this.hide(callback);\n });\n }", "exitElements(){\n this.itemg.exit()\n .transition(this.transition)\n .style(\"opacity\", 0)\n .remove();\n }", "function exitGame(){\n selectModalButton($('#exit'));\n window.location.assign(\"../start.html\");\n }", "function finishAnimations() {\n var stepsRemaining = Maze.executionInfo.stepsRemaining();\n\n // allow time for additional pause if we're completely done\n var waitTime = (stepsRemaining ? 0 : 1000);\n\n // run after all animations\n timeoutList.setTimeout(function () {\n if (stepsRemaining) {\n stepButton.removeAttribute('disabled');\n } else {\n Maze.animating_ = false;\n if (studioApp().isUsingBlockly()) {\n // reenable toolbox\n Blockly.mainBlockSpaceEditor.setEnableToolbox(true);\n }\n // If stepping and we failed, we want to retain highlighting until\n // clicking reset. Otherwise we can clear highlighting/disabled\n // blocks now\n if (!singleStep || Maze.result === ResultType.SUCCESS) {\n reenableCachedBlockStates();\n studioApp().clearHighlighting();\n }\n displayFeedback();\n }\n }, waitTime);\n }", "function end () {\n //the page goes white\n $('body').css({\n backgroundColor: 'white',\n });\n $('#canvas').css({\n visibility: 'hidden',\n });\n\n //the final package downloads\n window.open('https://whogotnibs.github.io/dart450/assignment02/downloads/package03.zip', '_blank');\n\n //the game functions stop running\n end = true;\n\n //the music stops\n Gibber.clear();\n}", "function closeDialog()\n\t\t{\n\t\t\t$(\"#dialog\").fadeOut(\"slow\", function()\n\t\t\t\t{\n\t\t\t\t\t$(\"#dialog\").empty();\n\t\t\t\t});\n\t\t}", "function dialogOff() {\n\n if (dialog !== null) {\n if (typeof uiVersion !== 'undefined' && uiVersion === 'Minuet') {\n hideSection('percDialogTarget', 'fadeOut', true);\n }\n else {\n dialog.remove();\n }\n dialog = null;\n }\n isDialogOn = false;\n\n }", "_onEndAnim() {\n if (this._indicator) {\n this._indicator.getParent().removeChild(this._indicator);\n this._indicator = null;\n }\n }", "function modalAnimation() {}", "stop() {\n this._enableAnimation = false;\n }", "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }", "function closeAnimation() {\n //\n // First, determine if we're in the middle of animation.\n //\n if ( !locked ) {\n //\n // We're not animating, let's lock the modal for animation.\n //\n lockModal();\n //\n // Clear the modal of the open class.\n //\n modal.removeClass( \"open\" );\n\n //\n // Are we using the 'fadeAndPop' animation?\n //\n if ( options.animation === \"fadeAndPop\" ) {\n //\n // Yes, okay, let's set the animation properties.\n //\n modal.animate( {\n //\n // Set the top property to the document scrollTop minus calculated topOffset.\n //\n \"top\": $doc.scrollTop() - topOffset + 'px',\n //\n // Fade the modal out, by using the opacity property.\n //\n \"opacity\": 0\n\n },\n /*\n * Fade speed.\n */\n options.animationSpeed / 2,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css hidden options.\n //\n modal.css( cssOpts.close );\n\n });\n //\n // Is the modal animation queued?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Fade out the modal background.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed property.\n //\n modal.trigger( 'reveal:closed' );\n\n });\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fadeAndPop'\n\n //\n // Are we using the 'fade' animation.\n //\n if ( options.animation === \"fade\" ) {\n //\n // Yes, we're using the 'fade' animation.\n //\n modal.animate( { \"opacity\" : 0 },\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css close options.\n //\n modal.css( cssOpts.close );\n\n }); // end animate\n\n //\n // Are we mid animating the modal(s)?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Let's fade out the modal background element.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n }); // end fadeOut\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fade'\n\n //\n // Are we not animating?\n //\n if ( options.animation === \"none\" ) {\n //\n // We're not animating.\n // Set the modal close css options.\n //\n modal.css( cssOpts.close );\n //\n // Is the modal in the middle of an animation queue?\n //\n if ( !modalQueued ) {\n //\n // It's not mid queueu. Just hide it.\n //\n modalBg.css( { 'display': 'none' } );\n }\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if not animating\n //\n // Reset the modalQueued variable.\n //\n modalQueued = false;\n } // end if !locked\n\n }", "function closeAnimation() {\n //\n // First, determine if we're in the middle of animation.\n //\n if ( !locked ) {\n //\n // We're not animating, let's lock the modal for animation.\n //\n lockModal();\n //\n // Clear the modal of the open class.\n //\n modal.removeClass( \"open\" );\n\n //\n // Are we using the 'fadeAndPop' animation?\n //\n if ( options.animation === \"fadeAndPop\" ) {\n //\n // Yes, okay, let's set the animation properties.\n //\n modal.animate( {\n //\n // Set the top property to the document scrollTop minus calculated topOffset.\n //\n \"top\": $doc.scrollTop() - topOffset + 'px',\n //\n // Fade the modal out, by using the opacity property.\n //\n \"opacity\": 0\n\n },\n /*\n * Fade speed.\n */\n options.animationSpeed / 2,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css hidden options.\n //\n modal.css( cssOpts.close );\n\n });\n //\n // Is the modal animation queued?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Fade out the modal background.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed property.\n //\n modal.trigger( 'reveal:closed' );\n\n });\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fadeAndPop'\n\n //\n // Are we using the 'fade' animation.\n //\n if ( options.animation === \"fade\" ) {\n //\n // Yes, we're using the 'fade' animation.\n //\n modal.animate( { \"opacity\" : 0 },\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Set the css close options.\n //\n modal.css( cssOpts.close );\n\n }); // end animate\n\n //\n // Are we mid animating the modal(s)?\n //\n if ( !modalQueued ) {\n //\n // Oh, the modal(s) are mid animating.\n // Let's delay the animation queue.\n //\n modalBg.delay( options.animationSpeed )\n //\n // Let's fade out the modal background element.\n //\n .fadeOut(\n /*\n * Animation speed.\n */\n options.animationSpeed,\n /*\n * End of animation callback.\n */\n function () {\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n }); // end fadeOut\n\n } else {\n //\n // We're not mid queue.\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if !modalQueued\n\n } // end if animation 'fade'\n\n //\n // Are we not animating?\n //\n if ( options.animation === \"none\" ) {\n //\n // We're not animating.\n // Set the modal close css options.\n //\n modal.css( cssOpts.close );\n //\n // Is the modal in the middle of an animation queue?\n //\n if ( !modalQueued ) {\n //\n // It's not mid queueu. Just hide it.\n //\n modalBg.css( { 'display': 'none' } );\n }\n //\n // Trigger the modal 'closed' event.\n // This should trigger any method set in the options.closed propety.\n //\n modal.trigger( 'reveal:closed' );\n\n } // end if not animating\n //\n // Reset the modalQueued variable.\n //\n modalQueued = false;\n } // end if !locked\n\n }", "function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "fadeOutDialog() {\n if (this.scene.fadeOut) //Process if fadeout was activated in the child class\n {\n if (this.dialogBox.closing) //Process if dialog Box should be closing (because button a or b was toggled)\n {\n //If title box is not completely off the canvas (at exit position), it should continue to go down with textBox and answerBox\n if (this.dialogBox.titleBox.position.y <= this.dialogBox.titleBox.exitPosition.y) {\n this.dialogBox.titleBox.position.y += this.dialogBox.titleBox.slideOutSpeed;\n this.dialogBox.textBox.position.y += this.dialogBox.titleBox.slideOutSpeed;\n this.dialogBox.answerButton.position.y += this.dialogBox.titleBox.slideOutSpeed;\n }\n //Otherwise, if the titleBox is at its exit position, dialogBox.closed is turn true\n else if (this.dialogBox.titleBox.position.y >= this.dialogBox.titleBox.exitPosition.y) {\n this.dialogBox.closed = true; // Set dialog Box as closed to toggle either button a or b;\n }\n }\n\n // if all dialog (title, text, buttons) are off the canvas, the reaction of the button (a or b) should be toggled\n if (this.dialogBox.closed) {\n this.dialogBox.closing = false; //resets closing to false to be safe\n //button a toggle\n if (this.dialogBox.answerButton.a.toggle === true) {\n this.toggleButtonA();\n }\n //button b toggle\n else if (this.dialogBox.answerButton.b.toggle === true) {\n this.toggleButtonB();\n }\n }\n }\n }", "function Exit() {\n _super.call(this);\n }", "function exitDemo() {\n\tdemo_msgs = undefined;\n\tdemo_goal = undefined;\n\talertArea.style.display = 'none';\n\tloadWorkspace();\n\tstopCode();\n}", "function exitToMenu() {\n\t$('#finishedModal').hide();\n\t$('#mainBox').css({'width':'500px','height':'200px'});\n\t$('#gameArea').hide();\n\t$('#mainMenu').delay(200).show(0);\n\tsetTimeout(function(){ location.reload(true); }, 500);\n}", "function stop() {\r\n animating = false;\r\n }", "function exit () {\n windowStack.forEach(function(window){\n window.hide();\n });\n}", "stop() {\n this.renderer.setAnimationLoop(null);\n }", "function closeAnimWindow() {\n document.getElementById(\"animWindow\").style.display = \"none\";\n document.getElementById(\"animResult\").style.display = \"none\";\n document.getElementById(\"toAnimate\").style.width = \"0px\";\n document.getElementById(\"toAnimate\").style.height = \"0px\";\n}", "quitInteraction() {\n this.room2_map.alpha = 0.0;\n this.room2_notebook.alpha = 0.0;\n this.hideActivities();\n this.room2_activityLocked.alpha = 0.0;\n this.room2_character_north.alpha = 1.0;\n this.room2_character_east.alpha = 1.0;\n this.room2_character_south.alpha = 1.0;\n this.room2_character_west.alpha = 1.0;\n this.room2_characterMoveable = true;\n this.room2_activityOneOpened = false;\n this.room2_activityTwoOpened = false;\n this.room2_activityThreeOpened = false;\n this.room2_activityFourOpened = false;\n this.room2_activityFiveOpened = false;\n this.room2_activitySixOpened = false;\n this.room2_help_menu.alpha = 0.0;\n this.room2_activatedQuiz = false;\n this.rightArrow.setVisible(false);\n this.leftArrow.setVisible(false);\n }", "_dismiss() {\n\t\tthis.unbind();\n\t\tthis._isVisible = false;\n\t}", "function endMove(event) {\n current.win.style.opacity = 1;\n }", "function maybeExit() {\n\t// 'this' here is Controller instance\n\tif ( this.get( 'select' ) && this.get( 'start' ) ) {\n\t\tstopEvent();\n\t\tsceneBack();\n\t}\n}", "function closeModal() {\n if(clickOut == false){\n return\n }\n $('.text_box').css('font-size','25px')\n $('.modal').css('display','none')\n $('.text_box').toggleClass('result')\n $('.text_box').empty()\n clickCounter++\n if(clickCounter == 25){\n endStage()\n }\n clickOut = false\n }", "function _finish(){\n logger.logEvent({'msg': 'animation finished'});\n if(logHeartbeat){\n clearInterval(logHeartbeat);\n }\n $('#finished-bg').fadeIn();\n if(currentMusicObj){\n __musicFade(currentMusicObj, false,1/(2000/MUSIC_ANIMATION_INTERVAL), false); //Fadeout animation for 2 seconds\n }\n for(var i=0; i<animationFinishObserver.length; i++){\n animationFinishObserver[i]();\n }\n _stopAllQueues();\n\n //Change pause button to replay\n var button = $('#play-toggle');\n button.removeClass('icon-pause');\n button.addClass('icon-repeat');\n button.unbind('click');\n button.bind('click', function(){location.reload();});\n\n for(var i = 0; i< currentAnimation.length; i++){ //Stop active animations (i.e. background)\n for(var j = 0; j<currentAnimation[i].length; j++){\n var node = currentAnimation[i][j];\n if('animation' in node){\n var _animation = node['animation'];\n if('object' in _animation){\n var _obj=_animation['object'];\n if(_obj){\n _obj.stop();\n }\n }\n }\n }\n }\n }", "exit(direction) {\n this.stepExit.emit(direction);\n }", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "endLoading() {\n this.modal.jQueryModalFade.removeClass('modal_fade_trick');\n this.modal.jQueryModalAwait.css('display', 'none');\n }", "function exit() {\n for (i = 0; i < 128; i++) {\n host.getMidiOutPort(0).sendMidi(MIDI_CC, i, BUTTON_OFF);\n }\n}", "function endGame(){\n\tspawnBall();\n\tcenterBall();\n\tspawnPlayerOne();\n\tspawnPlayerTwo();\n\tupdateScore();\n\t$('#menuCanvas').show();\n}", "function stop_animation(mark) {\r\n win.mark.setIcon(null);\r\n win.mark.setAnimation(null);\r\n}", "stop() {\n this.finishAll();\n }", "clickBook() {\n\n this.dialogueBox.visible = true;\n this.dialogueBook.visible = true;\n this.xButton.visible = true;\n //for when clicking exit, everything disappears\n }", "function exitContainer() {\n formContainer.classList.remove(\"block\");\n startContainer.classList.remove(\"none\");\n clickSound.play();\n}", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function close_ok_dialog() {\r\n\t \tdialog.hide();\r\n\t \treturn_focus.focus();\r\n\t }", "function closeDialog() {\n setDialogOpen(false)\n }", "function endCardAnimation() {\n\t$(\".computer-card\").removeClass(\"animated-card\");\n\tanimating = false;\n\tif (!training && disabled) {\n\t\tenableButtons();\n\t}\n}", "function modalEnd() {\n\tconst href = \"#modal-end\";\n\twindow.open(href, \"_self\");\n}", "function enableExitButton() {\n exit.prop(\"disabled\", false);\n }", "function end() {\n menuScene.visible = false;\n musicPacmanBeginning.stop();\n soundPacmanIntermission.stop();\n// gameSceneLevel2.visible = false;\n gameSceneLevel1.visible = false;\n gameOverScene.visible = true;\n}", "pauseAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(true);\n }\n }\n }", "animationEnded(e) {\n // wipe the slot of our drawer\n this.title = \"\";\n while (dom(this).firstChild !== null) {\n dom(this).removeChild(dom(this).firstChild);\n }\n if (this.invokedBy) {\n async.microTask.run(() => {\n setTimeout(() => {\n this.invokedBy.focus();\n }, 500);\n });\n }\n }", "function closeLoadingScreen() {\n\t$('.loading-screen').transition({'opacity': '0'}, {duration: 300, complete: function() {\n\t\t$(this).css('display', 'none');\n\t}});\n}", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function exitInfoText() {\n $(\".gamearea_info_text\").removeClass(\"button_enter_anim\");\n $(\".gamearea_info_text\").addClass(\"button_exit_anim\");\n}", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function bookingConfirmationClose(){\n\n\t\t$bookingOverlay.velocity('fadeOut', 100);\n\t\t$bookConfirm.velocity('fadeOut', 200);\n\n\t}", "function endTurnUI (update) {\n // debugmsg(\"In endTurnUI\");\n if (settings.panes !== 'None' && update) {\n // set the lang.exit_list\n for (const exit of lang.exit_list) {\n if (game.room.hasExit(exit.name, { excludeScenery: true }) || exit.nocmd) {\n $('#exit' + exit.name).show();\n } else {\n $('#exit' + exit.name).hide();\n }\n }\n io.updateStatus();\n if (typeof ioUpdateCustom === 'function') ioUpdateCustom();\n io.updateUIItems();\n }\n\n // scroll to end\n setTimeout(io.scrollToEnd, 1);\n // give focus to command bar\n if (settings.textInput) { $('#textbox').focus(); }\n }", "onAnimationEnd() {\n\n }", "function handleGameEndDialogClose() {\n setGameEndDialogOpen(false);\n setCurrentRound(1);\n setScore(0);\n }" ]
[ "0.6604248", "0.6442514", "0.62992615", "0.62992615", "0.62651527", "0.6246106", "0.6246106", "0.62339425", "0.62141335", "0.61103755", "0.6090828", "0.60824037", "0.6032996", "0.5962788", "0.5953788", "0.59476644", "0.59216994", "0.590694", "0.590559", "0.59020495", "0.5897475", "0.5897475", "0.5897475", "0.5897475", "0.58946145", "0.58864427", "0.5874312", "0.5872843", "0.586089", "0.58529305", "0.5841935", "0.5838639", "0.5835363", "0.5835363", "0.5835363", "0.5830156", "0.5801891", "0.5801751", "0.579419", "0.5778176", "0.5769967", "0.57661355", "0.5760093", "0.57597023", "0.574161", "0.5734314", "0.57099104", "0.5708486", "0.5708486", "0.57020146", "0.5688664", "0.5688664", "0.56762594", "0.5674315", "0.56730527", "0.56562406", "0.5651602", "0.56185013", "0.55998474", "0.559742", "0.55965096", "0.5577868", "0.55724365", "0.5567967", "0.5564142", "0.55574363", "0.5556176", "0.5554855", "0.5544053", "0.5544053", "0.551951", "0.5505616", "0.549978", "0.54900527", "0.5487452", "0.5485594", "0.54854184", "0.54836917", "0.54836917", "0.54836917", "0.54836917", "0.5480512", "0.54777765", "0.54717565", "0.5471406", "0.54689103", "0.54661924", "0.54654884", "0.5455334", "0.5446022", "0.54433006", "0.5439161", "0.5437989", "0.5437989", "0.5437488", "0.5433669", "0.54327714", "0.54318196" ]
0.6357485
4
Gets an observable that is notified when the dialog is finished opening.
afterOpened() { return this._afterOpened; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get afterOpen() {\n return this.mcAfterOpen.asObservable();\n }", "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "signalComplete() {\n this.observableFunctions.complete();\n }", "get hasStableDialog() {\n return this.dlg && this.dlg.connected;\n }", "get isOpened() {\n return this._isOpened;\n }", "get initialized$() {\n return this.initializedSubject.asObservable();\n }", "_emitClosedEvent() {\n this.closed.next();\n this.closed.complete();\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "afterClosed() {\n return this._afterClosed;\n }", "get onDidOpen() {\r\n return this._onDidOpen.event;\r\n }", "get onDidOpen() {\r\n return this._onDidOpen.event;\r\n }", "get afterOpened() {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }", "get afterOpened() {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }", "get afterOpened() {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }", "_onClosed() {\n this.emit(\"closed\");\n }", "onOpen () {\n this.callback()\n }", "afterClosed() {\n return this._ref.closed;\n }", "afterClosed() {\n return this._ref.closed;\n }", "accept() {\n this._dialog_ref.close('done');\n this.event.emit({ reason: 'done' });\n }", "onClosed() {\r\n // Stub\r\n }", "get closed() {\n return this._closed;\n }", "get closed() {\n return this._closed;\n }", "get closed() {\n return this._closed;\n }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "subscribeToFileOpen() {\n return atom.workspace.onDidOpen(event => {\n this.activeEditor = event.item;\n });\n }", "open() {\n this.$.sourceDialog.opened = true;\n }", "function dialogOpened(result) {\n self.onReady && self.onReady(result);\n args.onServiceActivated && args.onServiceActivated(self);\n\n }", "close() {\n if (!this.isOpen) {\n return;\n }\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }", "getFinished() {\n return this.finished;\n }", "get isConnected() {\n Observable.track(this, \"isConnected\");\n return this._isConnected;\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "get wrapperReady$() {\n return this.wrapperReadySubject.asObservable();\n }", "function complete() {\n /* jshint validthis:true */\n if (!this._isDisposed) {\n this._subject.complete();\n }\n}", "openNewUserModal() {\n const ref = this._dialog.open(_users_src_lib_new_user_modal_new_user_modal_component__WEBPACK_IMPORTED_MODULE_8__[\"NewUserModalComponent\"], {\n width: 'auto',\n height: 'auto',\n data: {}\n });\n ref.componentInstance.event\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"first\"])((_) => _.reason === 'done'))\n .subscribe((event) => {\n this.addUser(event.metadata);\n ref.close();\n });\n }", "isOpen() {\n return this._opened;\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "ngOnDestroy() {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n }", "getObservable()\n {\n return this.subject.asObservable();\n }", "_open() {\n if (!this._afterOpened.closed) {\n this._afterOpened.next();\n this._afterOpened.complete();\n }\n }", "get initState() {\n return this._initState.asObservable();\n }", "isOpen() { return this._open; }", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "get disposed() {\n return this._wasDisposed;\n }", "get bindingCompleted () { return true }", "get bindingCompleted () { return true }", "beforeClosed() {\n return this._beforeClosed;\n }", "beforeClosed() {\n return this._beforeClosed;\n }", "beforeClosed() {\n return this._beforeClosed;\n }", "function onClosed()\n\t{\n\t\t//cancel dialog with no data\n\t\tModalDialog.close();\n\t}", "getOpenProperty() {\n return this.__openProperty;\n }", "isOpen() {\n return this.open;\n }", "get finished() {\n return this.response.finished;\n }", "function Modal(){\n var self = this;\n self.info = ko.observable();\n self.message = ko.observable();\n self.footer = ko.observable();\n self.error = ko.observable();\n self.isDismissVisible = ko.observable();\n self.imageModal = ko.observable();\n\n\n\n self.error.subscribe(function(val){\n $('.modal').css('width', '400px');\n self.isDismissVisible(true);\n console.log('..', val);\n if (val === 'ok'){\n self.isDismissVisible(false);\n self.info(\"Please wait ...\")\n self.message(\"<b>Processing request.</b>\");\n self.footer(\"<b>Thank you for your patience.</b>\");\n }\n else {\n self.info('Error!');\n self.message(\"<b>An error occurred: \"+val+\" </b>\");\n }\n });\n\n self.imageModal.subscribe(function(imageurl){\n $('.modal').css('width', '850px');\n self.isDismissVisible(true);\n self.info('Image');\n self.message(imageurl);\n });\n}", "isClosed() {\r\n return this._closed;\r\n }", "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "function onOpen() {\n file.pipe(res);\n\n onFinished(res, onResFinished);\n }", "afterOpened() {\n return this.containerInstance._onEnter;\n }", "setOnClosedListener(callback) {\n\t\tthis.mOnClose = callback;\n\t}", "function ConvFinished({openConvFinishedDialog, setOpenConvFinishedDialog}) {\n function handleClose() {setOpenConvFinishedDialog(false)}\n // Render\n return (\n <div>\n <Dialog\n open={openConvFinishedDialog}\n onClose={handleClose}\n aria-labelledby=\"InitCompDialog-title\"\n aria-describedby=\"InitCompDialog-description\"\n >\n <DialogTitle id=\"InitCompDialog-title\">{\"Conversion complete!\"}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n The converted epub file can be found in the directory of your pdf file.\n </DialogContentText>\n <Alert severity=\"warning\">\n Some converted epub files may not be viewable as text but images. \n Reed recommends you to buy/get the epub book directly without converting.\n In the next update there will be another option to convert pdf file to epub ensuring text, but will be a bit dirty and contain no images.\n </Alert>\n </DialogContent>\n <DialogActions>\n <Button color=\"primary\" variant=\"contained\" style={{fontWeight: 'bold'}} onClick={()=>{handleClose()}}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n}", "onResultsOpen() {\n state = 'opened';\n\n run(() => {\n debug(`Flexberry Lookup::autocomplete state = ${state}`);\n });\n }", "onCloseDialog(isTrue) {\n\t\tthis.setState({ open: false });\n\t\tthis.props.onConfirm(isTrue)\n\t}", "get disposed() {\n return this._disposed;\n }", "get disposed() {\n return this._disposed;\n }", "dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n\n this._confirmPromiseWrapper.resolve(false);\n this.unblock();\n\n this._onDisposed.fire(this);\n }", "attached() {\r\n const that = this;\r\n\r\n super.attached();\r\n\r\n if (that.isCompleted && that._dialog) {\r\n that._addDialogHandlers();\r\n that.getShadowRootOrBody().appendChild(that._dialog);\r\n }\r\n }", "get closing() {\n return this[kInternalState].closePromise !== undefined;\n }", "get done() {\n return Boolean(this._set);\n }", "setCompleted() {\nreturn this.isComplete = true;\n}", "closeDialog_(event) {\n this.userActed('close');\n }", "componentDidMount() {\n this.dialog.addEventListener('transitionend', this.handleTransitionEnd);\n }", "async onComplete() {\n this.props.onComplete();\n this.hideModal();\n }", "_subscribeToMenuOpen() {\n const exitCondition = merge(this._allItems.changes, this.closed);\n this._allItems.changes\n .pipe(startWith(this._allItems), mergeMap((list) => list\n .filter(item => item.hasMenu())\n .map(item => item.getMenuTrigger().opened.pipe(mapTo(item), takeUntil(exitCondition)))), mergeAll(), switchMap((item) => {\n this._openItem = item;\n return item.getMenuTrigger().closed;\n }), takeUntil(this.closed))\n .subscribe(() => (this._openItem = undefined));\n }", "get closed() {\n return this.ftp.closed;\n }", "connectedCallback() {\n\t\tthis._modal = this.shadowRoot.querySelector(\".modal\");\n\n\t\tthis.shadowRoot.querySelector(\".button-open\").addEventListener('click', this._toggleModalVisible.bind(this));\n\t\tthis.shadowRoot.querySelector(\".button-close\").addEventListener('click', this._toggleModalVisible.bind(this));\n\t}", "onDialog(handler) {\n return this.on('Dialog', handler);\n }", "open() {\n this.visible = true;\n console.log(\"Modal opened\");\n }", "openDialog() {\n\t\tthis.setState({ open: true });\n\t}", "showModal() {\n this.open = true;\n }", "_onOpen() {\n this.state.connected = true;\n console.log(\"Connected...\");\n this.notify(\"open\");\n }", "get isCompleted() { return this.result.isDefined }", "function onClose(){\n if( ctrl.isUpdated ){\n var deferred = $q.defer();\n\n modal_service.open({\n reference: document.activeElement,\n label: 'Leave this element ?',\n template:'app/shared/custom_elements/course/item_panel_edition/confirm_modal.html',\n is_alert: true,\n scope: {\n desc: 'All changes will be canceled',\n cancel: function(){\n modal_service.close();\n deferred.reject();\n },\n confirm: function(){\n modal_service.close();\n deferred.resolve();\n },\n savequit: function(){\n if( ctrl.editedItem.id ){\n ctrl.update().then(function(){\n modal_service.close();\n deferred.resolve();\n });\n }else{\n ctrl.create().then(function(){\n modal_service.close();\n deferred.resolve();\n });\n }\n }\n }\n });\n\n return deferred.promise;\n }else{\n return $q.resolve();\n }\n }", "onCompleted() {\n super.onCompleted();\n\n // this finishSendFrame can be sent directly to websocket and not via the\n // sendFrame function.\n this.send(finishSendFrame);\n }", "finishStream() {\n const result = binding.FinishStream(this._impl);\n this._impl = null;\n return result;\n }", "focus(){\n\n // pass stream of favorite\n // places to knockout observable\n this._filterSub =\n this._placesService\n .favorites()\n .subscribe(favorites => {\n this.places(favorites);\n });\n }", "onResultsOpen() {\n state = 'opened';\n Ember.Logger.debug(`Flexberry Lookup::autocomplete state = ${state}`);\n }", "get openModals() {\n return this.modalControl.openModals;\n }", "get isDisposed() {\n return isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }" ]
[ "0.6235541", "0.57292295", "0.544824", "0.5104611", "0.50832826", "0.5079857", "0.50388193", "0.50360566", "0.50360566", "0.5029044", "0.5024414", "0.5024414", "0.5012694", "0.5012694", "0.5012694", "0.49499366", "0.49229214", "0.48979545", "0.48979545", "0.48709005", "0.4852717", "0.48320228", "0.48320228", "0.48320228", "0.4810612", "0.4810612", "0.4810612", "0.48049122", "0.47883382", "0.476686", "0.4766821", "0.47561717", "0.47453594", "0.47272933", "0.47272933", "0.4706505", "0.46942478", "0.4672819", "0.46407455", "0.46404606", "0.46404606", "0.4627948", "0.4620881", "0.46192926", "0.45776856", "0.45718777", "0.4537442", "0.4537442", "0.45363456", "0.45347857", "0.45347857", "0.45283613", "0.45283613", "0.45283613", "0.45193824", "0.45188397", "0.45151436", "0.45110542", "0.45088014", "0.4503723", "0.44963095", "0.4475018", "0.4469751", "0.44146675", "0.4413516", "0.44016543", "0.43958294", "0.4392196", "0.4392196", "0.43907547", "0.43889332", "0.4379301", "0.43770927", "0.43704718", "0.43638235", "0.4346448", "0.4342682", "0.43260336", "0.4308095", "0.4299317", "0.42894152", "0.42807683", "0.4279859", "0.42711845", "0.42658454", "0.42650744", "0.426327", "0.42578846", "0.42550752", "0.42501238", "0.4242195", "0.4240333", "0.42327678", "0.4230969", "0.4230969", "0.4230969", "0.4230969", "0.4230969" ]
0.5032514
10
Gets an observable that is notified when the dialog is finished closing.
afterClosed() { return this._ref.closed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "close() {\n if (!this.isOpen) {\n return;\n }\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }", "_onClosed() {\n this.emit(\"closed\");\n }", "afterClosed() {\n return this._afterClosed;\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "setOnClosedListener(callback) {\n\t\tthis.mOnClose = callback;\n\t}", "onClosed() {\r\n // Stub\r\n }", "_emitClosedEvent() {\n this.closed.next();\n this.closed.complete();\n }", "function onClosed()\n\t{\n\t\t//cancel dialog with no data\n\t\tModalDialog.close();\n\t}", "closeDialog_(event) {\n this.userActed('close');\n }", "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "close() {\n \n // The close function will hide the modal...\n this.visible = false;\n\n // ...and dispatch an event on the modal that the view model can listen for.\n this.el.dispatchEvent(\n new CustomEvent('closed', { bubbles: true })\n );\n }", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "function handleClose() {\n props.handleDialog(false);\n }", "disconnectBroker$() {\n return Rx.from(this.mqttClient.end());\n }", "get afterOpen() {\n return this.mcAfterOpen.asObservable();\n }", "dispose() {\n if (this.subscriptions) {\n this.subscriptions.dispose()\n }\n\n if (this.bindings && this.bindings.dispose) {\n this.bindings.dispose()\n }\n this.emitter.emit('did-dispose')\n return this.emitter.dispose()\n }", "emitClose () {\n this.readyState = WebSocket$1.CLOSED;\n\n this.emit('close', this._closeCode, this._closeMessage);\n\n if (this.extensions[PerMessageDeflate_1.extensionName]) {\n this.extensions[PerMessageDeflate_1.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n }", "disconnect () {\n return this.close()\n }", "get closing() {\n return this[kInternalState].closePromise !== undefined;\n }", "close(returnValue) {\n this.returnValue = returnValue || this.returnValue;\n this.style.pointerEvents = 'auto';\n this.open = false;\n this.dispatchEvent(new CustomEvent('close')); // MDN: \"Fired when the dialog is closed.\"\n }", "ngOnDestroy() {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n }", "signalComplete() {\n this.observableFunctions.complete();\n }", "get disposed() {\n return this._disposed;\n }", "get disposed() {\n return this._disposed;\n }", "onClose(callback) {\n this.onCloseCb = callback;\n }", "get disposed() {\n return this._wasDisposed;\n }", "close() {\n this.$emit('close');\n }", "_onClose(event) {\n this.state.connected = false;\n console.log(\"Disconnected...\");\n this.notify(\"closed\");\n }", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "handleWindowClose() {\n\t\tthis.runFinalReport()\n\t}", "onClose() {\n\t\t}", "get closed() {\n return this._closed;\n }", "get closed() {\n return this._closed;\n }", "get closed() {\n return this._closed;\n }", "finishStream() {\n const result = binding.FinishStream(this._impl);\n this._impl = null;\n return result;\n }", "function closeModal() {\n return runGuardQueue(modalQueue.value.map(function (modalObject) {\n return function () {\n return modalObject.close();\n };\n }));\n}", "close() {\n this.state_ = WindowState.CLOSING;\n this.appWindow_.close();\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "function onClose(arg) {\n if (arg.id === this._id || arg.event === 'close-all') {\n log.send(logLevels.INFO, 'closing notification, id=' + this._id);\n this.emitter.queue('close', {\n target: this\n });\n this.destroy();\n }\n }", "function onClose() {\n\t\t\t$mdDialog.hide()\n\t\t}", "get afterAllClose() {\n return this.parentService ? this.parentService.afterAllClose : this.rootAfterAllClose;\n }", "function disconnect() {\n return subscribe('disconnect');\n }", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "disconnect() {\n this.observer.disconnect();\n }", "function onclose() {\r\n dest.removeListener('finish', onfinish);\r\n unpipe();\r\n }", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "onDialogClose() {\n var nextDialogState = this.state.dialog;\n nextDialogState.open = false;\n this.setState({ dialog: nextDialogState })\n }", "close() {\n\t\tthis.$modal.removeClass(this.options.classes.open);\n\t\tthis.isOpen = false;\n\n // remove accessibility attr\n this.$body.attr('aria-hidden', false);\n\n\t\t// After starting fade-out transition, wait for it's end before setting hidden class\n\t\tthis.$modal.on(transitionEndEvent(), (e) => {\n\t\t\tif (e.originalEvent.propertyName === 'opacity') {\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tthis.$body.removeClass(this.options.classes.visible);\n\t\t\t\tthis.$modal\n\t\t\t\t\t.addClass(this.options.classes.hidden)\n\t\t\t\t\t.detach().insertAfter(this.$el)\n\t\t\t\t\t.off(transitionEndEvent());\n\t\t\t}\n\t\t});\n\n this.$closeBtn.off('click');\n this.$backdrop.off('click');\n this.$modal.off('keydown');\n this.$el.focus();\n\t}", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "handleWebsocketClosed() {\n this.reportCompleted();\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n if (this.extensions[PerMessageDeflate.extensionName]) {\n this.extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n this.on('error', constants.NOOP); // Catch all errors after this.\n }", "closeModal() {\n this.close();\n }", "exit() {\n // Note: this one transitions to `hidden`, rather than `void`, in order to handle the case\n // where multiple snack bars are opened in quick succession (e.g. two consecutive calls to\n // `MatSnackBar.open`).\n this._animationState = 'hidden';\n // Mark this element with an 'exit' attribute to indicate that the snackbar has\n // been dismissed and will soon be removed from the DOM. This is used by the snackbar\n // test harness.\n this._elementRef.nativeElement.setAttribute('mat-exit', '');\n return this._onExit;\n }", "$onclose(e) {\n this.state.connected = false;\n if ( typeof this.onclose === 'function' ) {\n this.onclose(e);\n }\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._disposed.emit(void 0);\n Signal.clearData(this);\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }" ]
[ "0.6678862", "0.6028456", "0.5999963", "0.59336567", "0.59089553", "0.59089553", "0.5831476", "0.58273757", "0.58273757", "0.5818462", "0.58016217", "0.5769973", "0.5590012", "0.55193794", "0.55115783", "0.550094", "0.54051006", "0.53953403", "0.53724563", "0.5359441", "0.531612", "0.5290578", "0.52641344", "0.52600276", "0.5246259", "0.52371025", "0.52135515", "0.5211998", "0.5211998", "0.5207768", "0.5205619", "0.5202627", "0.5193334", "0.5187748", "0.5187748", "0.5183784", "0.5183784", "0.5179274", "0.515919", "0.5120696", "0.5120696", "0.5120696", "0.511807", "0.5108843", "0.51081437", "0.50986195", "0.50949806", "0.50732195", "0.50706434", "0.50646627", "0.5064422", "0.50634396", "0.50533044", "0.50511706", "0.50498366", "0.50497735", "0.5043144", "0.5043144", "0.50390744", "0.5037552", "0.5025552", "0.501864", "0.50111896", "0.50099146", "0.50099146", "0.50099146", "0.5004187", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094", "0.50034094" ]
0.577739
12
Gets an observable that is notified when the dialog has started closing.
beforeClosed() { return this._beforeClosed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "_onClosed() {\n this.emit(\"closed\");\n }", "onClosed() {\r\n // Stub\r\n }", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "close() {\n if (!this.isOpen) {\n return;\n }\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "_emitClosedEvent() {\n this.closed.next();\n this.closed.complete();\n }", "get afterOpen() {\n return this.mcAfterOpen.asObservable();\n }", "setOnClosedListener(callback) {\n\t\tthis.mOnClose = callback;\n\t}", "afterClosed() {\n return this._afterClosed;\n }", "function onClosed()\n\t{\n\t\t//cancel dialog with no data\n\t\tModalDialog.close();\n\t}", "_onClose(event) {\n this.state.connected = false;\n console.log(\"Disconnected...\");\n this.notify(\"closed\");\n }", "close() {\n \n // The close function will hide the modal...\n this.visible = false;\n\n // ...and dispatch an event on the modal that the view model can listen for.\n this.el.dispatchEvent(\n new CustomEvent('closed', { bubbles: true })\n );\n }", "closeDialog_(event) {\n this.userActed('close');\n }", "function disconnect() {\n return subscribe('disconnect');\n }", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "disconnectBroker$() {\n return Rx.from(this.mqttClient.end());\n }", "disconnect () {\n return this.close()\n }", "disconnect() {\n this.observer.disconnect();\n }", "afterClosed() {\n return this._ref.closed;\n }", "afterClosed() {\n return this._ref.closed;\n }", "dispose() {\n if (this.subscriptions) {\n this.subscriptions.dispose()\n }\n\n if (this.bindings && this.bindings.dispose) {\n this.bindings.dispose()\n }\n this.emitter.emit('did-dispose')\n return this.emitter.dispose()\n }", "get disposed() {\n return this._wasDisposed;\n }", "get closed() {\n return this._closed;\n }", "get closed() {\n return this._closed;\n }", "get closed() {\n return this._closed;\n }", "get closing() {\n return this[kInternalState].closePromise !== undefined;\n }", "get disposed() {\n return this._disposed;\n }", "get disposed() {\n return this._disposed;\n }", "close() {\n this.$emit('close');\n }", "dispose() {\n this.dispatchEvent(Event_1.Event.getEvent(\"dispose\"));\n // this.emit('dispose', this);\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "signalComplete() {\n this.observableFunctions.complete();\n }", "cancelClose () {\n const {_timer, _animTimer, _state, animation} = this.get();\n if (_timer) {\n clearTimeout(_timer);\n }\n if (_animTimer) {\n clearTimeout(_animTimer);\n }\n if (_state === 'closing') {\n // If it's animating out, stop it.\n this.set({\n '_state': 'open',\n '_animating': false,\n '_animatingClass': animation === 'fade' ? 'ui-pnotify-in ui-pnotify-fade-in' : 'ui-pnotify-in'\n });\n }\n return this;\n }", "ngOnDestroy() {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n }", "dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._disposed.emit(void 0);\n Signal.clearData(this);\n }", "close(returnValue) {\n this.returnValue = returnValue || this.returnValue;\n this.style.pointerEvents = 'auto';\n this.open = false;\n this.dispatchEvent(new CustomEvent('close')); // MDN: \"Fired when the dialog is closed.\"\n }", "close() {\n this.state_ = WindowState.CLOSING;\n this.appWindow_.close();\n }", "dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n\n this._confirmPromiseWrapper.resolve(false);\n this.unblock();\n\n this._onDisposed.fire(this);\n }", "disconnect() {\n if (!this.active) return;\n this.observer.disconnect();\n this.active = false;\n }", "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "disconnect() {\n this.#clean.emit();\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "emitClose () {\n this.readyState = WebSocket$1.CLOSED;\n\n this.emit('close', this._closeCode, this._closeMessage);\n\n if (this.extensions[PerMessageDeflate_1.extensionName]) {\n this.extensions[PerMessageDeflate_1.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n }", "$onclose(e) {\n this.state.connected = false;\n if ( typeof this.onclose === 'function' ) {\n this.onclose(e);\n }\n }", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n\n this._disconnect();\n }", "function handleClose() {\n props.handleDialog(false);\n }", "close() {\n if (this._open) {\n this._open = false;\n this._resetContainer();\n this._closed$.next();\n this.openChange.emit(false);\n this._changeDetector.markForCheck();\n }\n }", "onClose() {\n\t\t}", "deactivate () {\n this.subscriptions.dispose()\n this.modalService.deactivate()\n }", "dismiss () {\n this.modalService.close()\n }", "function onClose(arg) {\n if (arg.id === this._id || arg.event === 'close-all') {\n log.send(logLevels.INFO, 'closing notification, id=' + this._id);\n this.emitter.queue('close', {\n target: this\n });\n this.destroy();\n }\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "isClosed() {\r\n return this._closed;\r\n }", "onClose(callback) {\n this.onCloseCb = callback;\n }", "_close() {\n set(this, 'isOpen', false);\n set(this, 'isToStep', false);\n\n let action = get(this, 'attrs.closeAction');\n let vals = get(this, '_dates');\n let isRange = get(this, 'range');\n\n if (action) {\n action(isRange ? vals : vals[0] || null);\n }\n\n this._destroyOutsideListener();\n }", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "onCloseDialog(isTrue) {\n\t\tthis.setState({ open: false });\n\t\tthis.props.onConfirm(isTrue)\n\t}", "onClose(){}", "closeModal() {\n this.close();\n }", "handleWebsocketClosed() {\n this.reportCompleted();\n }", "handleWindowClose() {\n\t\tthis.runFinalReport()\n\t}", "dispose () {\n this._disconnectEvents();\n }", "handleCloseDialog() {\n this.setState({ openDialog: false });\n }", "closeConfirmationDialog(confirmationDialogId) {\n this.setProperties({ showConfirmationDialog: false, confirmationDialogId: null, confirmationData: null, confirmCallback: NOOP, cancelCallback: NOOP });\n this.get('eventBus').trigger(`rsa-application-modal-close-${confirmationDialogId}`);\n }", "disconnect() {\n this.unsubscribe()\n }", "get triggerGlobalClose() {\r\n return this._triggerGlobalClose;\r\n }", "disconnectedCallback() {\n unsubscribe(this.subscription);\n this.subscription = null;\n }", "dispose() {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n\n this._externalMessageListener.dispose();\n this._registrationUpdater.dispose();\n\n if (this._lastWaitForShutdownPromiseResolve) {\n this._lastWaitForShutdownPromiseResolve(false);\n this._lastWaitForShutdownPromiseResolve = null;\n }\n this._beforeUnloadListener.dispose();\n\n this._onDisposed.fire(this);\n }", "onDialogClose() {\n var nextDialogState = this.state.dialog;\n nextDialogState.open = false;\n this.setState({ dialog: nextDialogState })\n }", "closeModal(){\n this.showModal = false\n }", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "handleCloseModal(){\n this.bShowModal = false;\n }", "onClose() {}", "onClose() {}", "function disconnect() {\n\t\tthis._observer.disconnect();\n\t}", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "get onClosing() {\n this.document.documentElement.classList.remove(DIALOG_OPEN_HTML_CLASS);\n }", "_onDisconnected() {\n this._watcher.stop();\n this.emit(\"disconnected\");\n }", "deferredClose() {\n const owner = this.owner;\n this.close().then(() => {\n if (owner && owner.onMaskAutoClose) {\n owner.onMaskAutoClose(this);\n }\n });\n\n if (owner && owner.onMaskAutoClosing) {\n owner.onMaskAutoClosing(this);\n }\n }", "accept() {\n this._dialog_ref.close('done');\n this.event.emit({ reason: 'done' });\n }", "handleCloseClick()\n {\n invokeCloseModal() \n this.close()\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n if (this.extensions[PerMessageDeflate.extensionName]) {\n this.extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n this.on('error', constants.NOOP); // Catch all errors after this.\n }", "dispose() {\n if (this.eventTarget) {\n this.removeListeners(this.eventTarget);\n this.eventTarget = null;\n }\n this.messageManager = null;\n\n Services.obs.removeObserver(this, \"message-manager-close\");\n }", "get afterAllClose() {\n return this.parentService ? this.parentService.afterAllClose : this.rootAfterAllClose;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "get isDisposed() {\n return this._isDisposed;\n }", "closeDialog() {\n this.setState({dialogVisible: false});\n }", "function onclose() {\r\n dest.removeListener('finish', onfinish);\r\n unpipe();\r\n }", "close () {\n this.opened = false;\n }", "function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }" ]
[ "0.64080805", "0.606997", "0.59130985", "0.5909122", "0.59062463", "0.57707673", "0.57707673", "0.56869036", "0.556136", "0.5535582", "0.5488211", "0.5380322", "0.5365876", "0.53258806", "0.52992374", "0.5269795", "0.52052695", "0.5198437", "0.51977926", "0.51956517", "0.51929337", "0.51929337", "0.5183541", "0.5180093", "0.51581633", "0.51581633", "0.51581633", "0.51555586", "0.5106361", "0.5106361", "0.50991595", "0.5060631", "0.5038514", "0.5038514", "0.50111043", "0.50058556", "0.4993746", "0.49734673", "0.4969213", "0.49678522", "0.49335513", "0.49108937", "0.49099678", "0.48971343", "0.48936516", "0.4876827", "0.48684257", "0.48386514", "0.48360205", "0.48346776", "0.48224783", "0.48167872", "0.48011538", "0.47881362", "0.47768602", "0.47768602", "0.47694513", "0.47627556", "0.47616217", "0.47606587", "0.47606587", "0.47478908", "0.47452292", "0.4740181", "0.47381902", "0.47360602", "0.47358122", "0.4723976", "0.4723708", "0.47224462", "0.47193918", "0.47178546", "0.47132963", "0.47038773", "0.47009152", "0.46971148", "0.4695246", "0.46952003", "0.46952003", "0.46925244", "0.46900097", "0.4689183", "0.46818212", "0.46771044", "0.46741346", "0.466339", "0.46616974", "0.46528146", "0.46430713", "0.4642793", "0.4642793", "0.4642793", "0.4642793", "0.4642793", "0.46407652", "0.46386725", "0.46331432", "0.46314847" ]
0.5162402
26
Gets an observable that emits when the overlay's backdrop has been clicked.
backdropClick() { return this._ref.backdropClick; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "backdropClick() {\n return this._overlayRef.backdropClick();\n }", "backdropClick() {\n return this._backdropClick;\n }", "function handleBackdropClick(event) {\n overlays.forEach(function(overlay) {\n if (typeof overlay.instance.backdropClickedCallback === 'function') {\n overlay.instance.backdropClickedCallback(event);\n }\n });\n }", "get backdropElement() {\n return this._backdropElement;\n }", "function clickOnBackdrop(event) {\n if (event.target === lightbox__overlay ) { closeModal()\n }\n}", "function onClickOverlay() {\n if (__WEBPACK_IMPORTED_MODULE_2__context__[\"a\" /* context */].top) {\n var vm = __WEBPACK_IMPORTED_MODULE_2__context__[\"a\" /* context */].top.vm;\n vm.$emit('click-overlay');\n\n if (vm.closeOnClickOverlay) {\n if (vm.onClickOverlay) {\n vm.onClickOverlay();\n } else {\n vm.close();\n }\n }\n }\n}", "get shouldBackdropClose() {\n return this._shouldBackdropClose;\n }", "_closeViaBackdropClick() {\n // If the drawer is closed upon a backdrop click, we always want to restore focus. We\n // don't need to check whether focus is currently in the drawer, as clicking on the\n // backdrop causes blurring of the active element.\n return this._setOpen(/* isOpen */ false, /* restoreFocus */ true);\n }", "function onBackdropClick() {\n close();\n }", "detachBackdrop() {\n let backdropToDetach = this._backdropElement;\n if (!backdropToDetach) {\n return;\n }\n let timeoutId;\n let finishDetach = () => {\n // It may not be attached to anything in certain cases (e.g. unit tests).\n if (backdropToDetach) {\n backdropToDetach.removeEventListener('click', this._backdropClickHandler);\n backdropToDetach.removeEventListener('transitionend', finishDetach);\n if (backdropToDetach.parentNode) {\n backdropToDetach.parentNode.removeChild(backdropToDetach);\n }\n }\n // It is possible that a new portal has been attached to this overlay since we started\n // removing the backdrop. If that is the case, only clear the backdrop reference if it\n // is still the same instance that we started to remove.\n if (this._backdropElement == backdropToDetach) {\n this._backdropElement = null;\n }\n if (this._config.backdropClass) {\n this._toggleClasses(backdropToDetach, this._config.backdropClass, false);\n }\n clearTimeout(timeoutId);\n };\n backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');\n this._ngZone.runOutsideAngular(() => {\n backdropToDetach.addEventListener('transitionend', finishDetach);\n });\n // If the backdrop doesn't have a transition, the `transitionend` event won't fire.\n // In this case we make it unclickable and we try to remove it after a delay.\n backdropToDetach.style.pointerEvents = 'none';\n // Run this outside the Angular zone because there's nothing that Angular cares about.\n // If it were to run inside the Angular zone, every test that used Overlay would have to be\n // either async or fakeAsync.\n timeoutId = this._ngZone.runOutsideAngular(() => setTimeout(finishDetach, 500));\n }", "function overlayClick(event) {\n if (event.target === modal) {\n toggleModal();\n }\n }", "get hasBackdrop() { return this._hasBackdrop; }", "get hasBackdrop() { return this._hasBackdrop; }", "_attachBackdrop() {\n const showingClass = 'cdk-overlay-backdrop-showing';\n this._backdropElement = this._document.createElement('div');\n this._backdropElement.classList.add('cdk-overlay-backdrop');\n if (this._config.backdropClass) {\n this._toggleClasses(this._backdropElement, this._config.backdropClass, true);\n }\n // Insert the backdrop before the pane in the DOM order,\n // in order to handle stacked overlays properly.\n this._host.parentElement.insertBefore(this._backdropElement, this._host);\n // Forward backdrop clicks such that the consumer of the overlay can perform whatever\n // action desired when such a click occurs (usually closing the overlay).\n this._backdropElement.addEventListener('click', this._backdropClickHandler);\n // Add class to fade-in the backdrop after one frame.\n if (typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n if (this._backdropElement) {\n this._backdropElement.classList.add(showingClass);\n }\n });\n });\n }\n else {\n this._backdropElement.classList.add(showingClass);\n }\n }", "_outsideClickListener(event){if(-1!==event.composedPath().indexOf(this.$.overlay)||this._mouseDownInside||this._mouseUpInside){this._mouseDownInside=!1;this._mouseUpInside=!1;return}if(!this._last){return}const evt=new CustomEvent(\"vaadin-overlay-outside-click\",{bubbles:!0,cancelable:!0,detail:{sourceEvent:event}});this.dispatchEvent(evt);if(this.opened&&!evt.defaultPrevented){this.close(event)}}", "function handleBackdropClick (event) {\n if(this !== event.target) return;\n hideModal();\n}", "modalBgClick() {\n PubSub.publish('modal.bgClick');\n }", "_outsideClickListener(event) {\n const eventPath = event.composedPath();\n\n if (eventPath.indexOf(this.positionTarget) < 0 && eventPath.indexOf(this.$.overlay) < 0) {\n this.opened = false;\n }\n }", "_outsideClickListener(event) {\n if (event.composedPath().indexOf(this.$.overlay) !== -1 || this._mouseDownInside || this._mouseUpInside) {\n this._mouseDownInside = false;\n this._mouseUpInside = false;\n return;\n }\n\n if (!this._last) {\n return;\n }\n\n const evt = new CustomEvent('vaadin-overlay-outside-click', {\n bubbles: true,\n cancelable: true,\n detail: {\n sourceEvent: event\n }\n });\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }", "function listenForClose(event) {\n if (event.target.id === `overlay` || event.key === `Escape`) {\n closeModal();\n }\n }", "_attachOverlay() {\n if (!this._overlayRef) {\n this._createOverlay();\n }\n else {\n // Update the overlay size, in case the directive's inputs have changed\n this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;\n }\n if (!this._overlayRef.hasAttached()) {\n this._overlayRef.attach(this._templatePortal);\n }\n if (this.hasBackdrop) {\n this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {\n this.backdropClick.emit(event);\n });\n }\n else {\n this._backdropSubscription.unsubscribe();\n }\n this._positionSubscription.unsubscribe();\n // Only subscribe to `positionChanges` if requested, because putting\n // together all the information for it can be expensive.\n if (this.positionChange.observers.length > 0) {\n this._positionSubscription = this._position.positionChanges\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__[\"takeWhile\"])(() => this.positionChange.observers.length > 0))\n .subscribe(position => {\n this.positionChange.emit(position);\n if (this.positionChange.observers.length === 0) {\n this._positionSubscription.unsubscribe();\n }\n });\n }\n }", "_menuClosingActions() {\n const backdrop = this._overlayRef.backdropClick();\n const detachments = this._overlayRef.detachments();\n const parentClose = this._parentMenu ? this._parentMenu.closed : Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"of\"])();\n const hover = this._parentMenu ? this._parentMenu._hovered().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"filter\"])(active => active !== this._menuItemInstance), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"filter\"])(() => this._menuOpen)) : Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"of\"])();\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"merge\"])(backdrop, parentClose, hover, detachments);\n }", "stateChanged(event) {\r\n if (!this.withBackdrop.length) {\r\n if (this.backdrop >= 0) {\r\n this.backdrop = -1;\r\n }\r\n return;\r\n }\r\n switch (event) {\r\n case 'mounted':\r\n if (this.backdrop < 0) {\r\n this.backdrop = 0;\r\n }\r\n break;\r\n case 'beforeShow':\r\n this.backdrop = this.withBackdrop[this.withBackdrop.length - 1].config.backdrop;\r\n break;\r\n case 'beforeHide':\r\n if (this.withBackdrop.length === 1) {\r\n this.backdrop = 0;\r\n }\r\n break;\r\n case 'hidden':\r\n if (this.withBackdrop.length === 1) {\r\n this.backdrop = -1;\r\n }\r\n break;\r\n }\r\n }", "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "close() {\n // start animation => look at the css\n this.show = false;\n setTimeout(() => {\n // end animation\n this.start = false;\n // deactivate the backdrop visibility\n this.contentSource.displayHandle.classList.toggle('_active');\n\n // notify furo-backdrop that it is closed now\n this.contentSource.dispatchEvent(new Event('closed', { composed: true, bubbles: true }));\n }, this.toDuration);\n }", "get afterClose() {\n return this.mcAfterClose.asObservable();\n }", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "function backdrop ( callback ) {\n var that = this\n , animate = this.$element.hasClass('fade') ? 'fade' : ''\n if ( this.isShown && this.settings.backdrop ) {\n var doAnimate = $.support.transition && animate\n\n this.$backdrop = $('<div class=\"modal-backdrop ' + animate + '\" />')\n .appendTo(document.body)\n\n if ( this.settings.backdrop != 'static' ) {\n this.$backdrop.click($.proxy(this.hide, this))\n }\n\n if ( doAnimate ) {\n this.$backdrop[0].offsetWidth // force reflow\n }\n\n this.$backdrop.addClass('in')\n\n doAnimate ?\n this.$backdrop.one(transitionEnd, callback) :\n callback()\n\n } else if ( !this.isShown && this.$backdrop ) {\n this.$backdrop.removeClass('in')\n\n function removeElement() {\n that.$backdrop.remove()\n that.$backdrop = null\n }\n\n $.support.transition && this.$element.hasClass('fade')?\n this.$backdrop.one(transitionEnd, removeElement) :\n removeElement()\n } else if ( callback ) {\n callback()\n }\n }", "dismiss(e) {\n //TODO this tap still highlights the menu icon behind it :/\n e.stopPropagation();\n this.opened = false;\n this.dispatchEvent(new CustomEvent(\"iron-overlay-closed\", {\n bubbles: true,\n composed: true,\n detail: { canceled: true },\n }));\n }", "_closeModal( e ) {\n if ( document.body.contains( this._overlay ) ) {\n this._overlay.classList.remove( 'visible' );\n setTimeout( () => { document.body.removeChild( this._overlay ); }, 1000 );\n }\n }", "confirm() {\n this.opened = false;\n this.dispatchEvent(new CustomEvent(\"iron-overlay-closed\", {\n bubbles: true,\n detail: { confirmed: true },\n }));\n }", "modalBackdropClicked(event) { \n this.setState({\n visible: !this.state.visible\n }); \n }", "popoverClosingActions() {\n const backdrop = this.backdrop.pipe(mapTo('backdrop'));\n const close = this.popover.close.pipe(mapTo('x'));\n const escape = this.overlayRef.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE), mapTo('escape'));\n return merge(backdrop, close, escape);\n }", "get overlayRef() {\n return this._overlayRef;\n }", "get afterOpen() {\n return this.mcAfterOpen.asObservable();\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "get onDidClose() {\r\n return this._onDidClose.event;\r\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "function outsideClick(e){\n if(e.target === modal){\n modal.style.display = \"none\";\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n}", "get closeOnMaskClick() {\n\t\treturn this.nativeElement ? this.nativeElement.closeOnMaskClick : undefined;\n\t}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "handleClickOutside(event) {\n if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {\n\n this.closeModal();\n }\n }", "function onShowHideSide(isOpen) {\n var parent = $element.parent();\n\n $element.toggleClass('open', !!isOpen);\n\n if (isOpen) {\n parent.append(backdrop);\n backdrop.on( EVENT.CLICK, onBackdropClick );\n parent.on( EVENT.KEY_DOWN, onKeyDown );\n } else {\n backdrop.remove();\n backdrop.off( EVENT.CLICK, onBackdropClick);\n parent.off( EVENT.KEY_DOWN, onKeyDown );\n }\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n}", "handleOutsideClick(e) {\n if (this.node) {\n if (!this.node.contains(e.target)) {\n this.props.model.props.model.viewState.showOverlayContainer = false;\n this.props.model.props.model.viewState.overlayContainer = {};\n this.context.editor.update();\n }\n }\n }", "function outsideClick(e) {\r\n if (e.target == modal) {\r\n modal.style.display = 'none';\r\n }\r\n}", "function outsideClick (e) {\n if(e.target == modal) {\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\r\n if (e.target == modal) {\r\n modal.style.display = 'none';\r\n }\r\n}", "function outsideClick(e) {\r\n\tif (e.target == modal) {\r\n\t\tmodal.style.display = 'none';\r\n\t}\r\n}", "function outsideClick(e){\n if(e.target == modal){\n modal.style.display = 'none';\n }\n}", "function outsideClick(e){\n if(e.target == modal){\n modal.style.display = 'none';\n }\n}", "function outsideClick(e) {\n if(e.target === modal) {\n modal.style.display = 'none';\n }\n}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function _handleClickOutside(event) {\r\n if (this.options.closeMethods.indexOf('overlay') !== -1 && !_findAncestor(event.target, 'ef-modal') &&\r\n event.clientX < this.modal.clientWidth) {\r\n this.close();\r\n }\r\n }", "function outsideClick(e){\r\n if(e.target == modal){\r\n modal.style.display = 'none';\r\n }\r\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n }", "createModalOverlay() {\n const modalOverlay = document.createElement('div')\n modalOverlay.classList.add('modal__overlay')\n \n modalOverlay.addEventListener('click', () => {\n this.destroyModal()\n })\n \n return modalOverlay\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n }", "function outsideClick(e){\n if(e.target == modal){\n modal.style.display = 'none';\n }\n}", "function outsideClick(e){\n if(e.target == modal){\n modal.style.display = 'none';\n }\n}", "_createOverlay() {\n if (!this._overlayRef) {\n const config = this._getOverlayConfig();\n this._subscribeToPositions(config.positionStrategy);\n this._overlayRef = this._overlay.create(config);\n // Consume the `keydownEvents` in order to prevent them from going to another overlay.\n // Ideally we'd also have our keyboard event logic in here, however doing so will\n // break anybody that may have implemented the `MatMenuPanel` themselves.\n this._overlayRef.keydownEvents().subscribe();\n }\n return this._overlayRef;\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n }", "clickOutModal(event) {\n if (event.target === this.modalContainer) this.toggleModal();\n }", "onClick(e) {\n\t\tconst { onClose } = this.props;\n\t\tlet targetElement = e.target; // Clicked element\n\n\t\tdo {\n\t\t\tif (targetElement === this.overlayElement) {\n\t\t\t\t// Click inside overlay\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Move up the DOM\n\t\t\ttargetElement = targetElement.parentNode;\n\t\t} while (targetElement);\n\n\t\t// Click outside overlay\n\t\tonClose();\n\t}", "addClickAwayEvent(id) {\n // clicking anywhere in main tag will close panel.\n $('main').on('click.atkPanel', atk.createDebouncedFx((evt) => {\n this.closePanel(id);\n }, 250));\n }", "onDidDismiss() {\n return overlays.eventMethod(this.el, 'ionPickerDidDismiss');\n }", "function checkForBackdropClick() {\n\n var open = vm.variants.find(variant => variant.releaseDatePickerOpen || variant.expireDatePickerOpen);\n\n if(open) {\n $scope.model.disableBackdropClick = true;\n } else {\n $scope.model.disableBackdropClick = false;\n }\n }", "function closeOverlay() {\r\n $('.ev-overlay').on('click', function() {\r\n $(this).removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n \r\n $('.ev-overlay-content').on('click', function(event) {\r\n event.stopPropagation();\r\n });\r\n $('.ev-vote-cancel').on('click', function() {\r\n $('.ev-overlay').removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n $('.ev-vote-yes').on('click', function() {\r\n $('.ev-overlay').removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n}", "function outsideclick(e){\n if(e.target == modal){\n modal.style.display = 'none';\n }\n}", "handleOutsideClick(e) {\n if (this.node) {\n if (!this.node.contains(e.target)) {\n this.props.model.props.model.viewState.overlayContainer = {};\n this.props.model.props.model.viewState.showOverlayContainer = false;\n this.props.model.props.editor.update(true);\n }\n }\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n }", "onWillDismiss() {\n return overlays.eventMethod(this.el, 'ionPickerWillDismiss');\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none'\n }\n }", "onDidDismiss() {\n return (0,_overlays_36d3475d_js__WEBPACK_IMPORTED_MODULE_6__.g)(this.el, 'ionModalDidDismiss');\n }", "get overlayElement() {\n return this._pane;\n }", "function onClick(ev) {\n if (ev.target.id === overlayId) overlayOff();\n}", "get hasBackdrop() {\n if (this._backdropOverride == null) {\n return !this._start || this._start.mode !== 'side' || !this._end || this._end.mode !== 'side';\n }\n return this._backdropOverride;\n }", "get hasBackdrop() {\n if (this._backdropOverride == null) {\n return !this._start || this._start.mode !== 'side' || !this._end || this._end.mode !== 'side';\n }\n return this._backdropOverride;\n }", "constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {\n this._overlay = _overlay;\n this._dir = _dir;\n this._hasBackdrop = false;\n this._lockPosition = false;\n this._growAfterOpen = false;\n this._flexibleDimensions = false;\n this._push = false;\n this._backdropSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__[\"Subscription\"].EMPTY;\n this._attachSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__[\"Subscription\"].EMPTY;\n this._detachSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__[\"Subscription\"].EMPTY;\n this._positionSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__[\"Subscription\"].EMPTY;\n /** Margin between the overlay and the viewport edges. */\n this.viewportMargin = 0;\n /** Whether the overlay is open. */\n this.open = false;\n /** Event emitted when the backdrop is clicked. */\n this.backdropClick = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n /** Event emitted when the position has changed. */\n this.positionChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n /** Event emitted when the overlay has been attached. */\n this.attach = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n /** Event emitted when the overlay has been detached. */\n this.detach = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n /** Emits when there are keyboard events that are targeted at the overlay. */\n this.overlayKeydown = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n /** Emits when there are mouse outside click events that are targeted at the overlay. */\n this.overlayOutsideClick = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n this._templatePortal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__[\"TemplatePortal\"](templateRef, viewContainerRef);\n this._scrollStrategyFactory = scrollStrategyFactory;\n this.scrollStrategy = this._scrollStrategyFactory();\n }", "function outsideClick(e) {\n \t\t\tif (e.target == modal) {\n \t\tmodal.style.display = 'none';\n \t\t}\n \t\t}", "function outsideClick(e) {\n \t\t\tif (e.target == modal) {\n \t\tmodal.style.display = 'none';\n \t\t}\n \t\t}", "_detachOverlay() {\n if (this._overlayRef) {\n this._overlayRef.detach();\n }\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n }", "onWillDismiss() {\n return (0,_overlays_36d3475d_js__WEBPACK_IMPORTED_MODULE_6__.g)(this.el, 'ionModalWillDismiss');\n }", "function closeHandler() {\n $('#sf_close').click(() => {\n closeOverlay();\n });\n}", "function handleClickOutside(e) {\n if (e.target === e.currentTarget) closeModal();\n}", "onOverlayClicked() {\n let handler = this.props.onOverlayClicked;\n if (typeof handler === 'function') {\n handler();\n }\n }", "created() {\n this.listenForClickOut = true\n }", "mounted(el, binding) {\n const onClick = e => directive(e, el, binding);\n\n const onMousedown = e => {\n el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);\n };\n\n handleShadow(el, app => {\n app.addEventListener('click', onClick, true);\n app.addEventListener('mousedown', onMousedown, true);\n });\n el._clickOutside = {\n lastMousedownWasOutside: true,\n onClick,\n onMousedown\n };\n }", "function outsideClick(e) {\n modals.forEach(function (modal) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n });\n}", "getEddyBeacons() {\n return self._eddyBeaconsSubject.asObservable();\n }" ]
[ "0.6887702", "0.65635705", "0.6365651", "0.61065006", "0.59164095", "0.5809578", "0.5785322", "0.5737036", "0.5669105", "0.564863", "0.5517033", "0.55141735", "0.55141735", "0.5461777", "0.54358107", "0.5408771", "0.5369369", "0.5363778", "0.529492", "0.5140833", "0.5129217", "0.51289517", "0.5125612", "0.5078436", "0.50761265", "0.5067638", "0.5062281", "0.50557435", "0.5052037", "0.4977845", "0.49715012", "0.49275744", "0.488319", "0.4879832", "0.4875006", "0.47904024", "0.47904024", "0.47889405", "0.4739515", "0.4736594", "0.4736594", "0.4736594", "0.4731555", "0.47305813", "0.47305813", "0.47305813", "0.47305813", "0.47305813", "0.47305813", "0.47261757", "0.4723324", "0.47188315", "0.47179183", "0.47163036", "0.47139624", "0.4712657", "0.4707221", "0.4699623", "0.4699623", "0.46981022", "0.4692834", "0.46903086", "0.4685887", "0.46856815", "0.46854687", "0.4683707", "0.46820694", "0.46820694", "0.4677266", "0.46708813", "0.46688807", "0.46672547", "0.46477988", "0.46446338", "0.4642602", "0.4636913", "0.46312997", "0.46180534", "0.46108872", "0.46108872", "0.459762", "0.4596147", "0.4593875", "0.45854944", "0.4582989", "0.4576444", "0.4576444", "0.45739773", "0.45653108", "0.45653108", "0.45646796", "0.45634586", "0.45616975", "0.45414817", "0.45322984", "0.4531255", "0.45299488", "0.45178345", "0.45013106" ]
0.6537389
3
Gets an observable that emits when keydown events are targeted on the overlay.
keydownEvents() { return this._ref.keydownEvents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keydownEvents() {\n return this._overlayRef.keydownEvents();\n }", "keydownEvents() {\n return this._keydownEvents;\n }", "getKeyControlDown() {\nreturn this._keyControlDown;\n}", "keyDown(e) {\n this._modifiers(e);\n const _keyCode = this.translateKeyCodes(e.keyCode);\n const _wantsToStopTheEvent = [];\n if (!this.status.cmdKeyDown && this._detectCmdKey(_keyCode)) {\n this.status.setCmdKey(true);\n _wantsToStopTheEvent.push(true);\n }\n const enabled = this._listeners.enabled;\n const _keyDowners = this._listeners.byEvent.keyDown;\n const _keyRepeaters = this._listeners.byEvent.keyRepeat;\n const _repeating = this._lastKeyDown === _keyCode && this.status.hasKeyDown(_keyCode);\n this.status.addKeyDown(_keyCode);\n const _filterMethod = _repeating ? _viewId => {\n return _keyRepeaters.includes(_viewId) && _keyDowners.includes(_viewId);\n } : _viewId => {\n return _keyDowners.includes(_viewId);\n };\n this._filterViewIdToValidView(enabled, _filterMethod).filter(_ctrl => {\n return this.isFunction(_ctrl.keyDown);\n }).some(_ctrl => {\n if (_ctrl.keyDown(_keyCode)) {\n _wantsToStopTheEvent.push(_ctrl.viewId);\n // no other keyDown events delegated after first responder returns true\n return true;\n }\n else {\n return false;\n }\n });\n // Some keys are special (esc and return) and they have their own\n // special events: defaultKey and escKey, which aren't limited\n // to instances of HControl, but any parent object will work.\n if (_wantsToStopTheEvent.length === 0 && !_repeating && this._defaultKeyActions[_keyCode.toString()]) {\n const _defaultKeyMethod = this._defaultKeyActions[_keyCode.toString()];\n if (this.defaultKey(_defaultKeyMethod, null, [])) {\n _wantsToStopTheEvent.push(true);\n }\n }\n this._lastKeyDown = _keyCode;\n if (_wantsToStopTheEvent.length !== 0) {\n Event.stop(e);\n }\n }", "keyDown(e) {\n this._modifiers(e);\n const _keyCode = this.translateKeyCodes(e.keyCode);\n const _wantsToStopTheEvent = [];\n if (!this.status.cmdKeyDown && this._detectCmdKey(_keyCode)) {\n this.status.setCmdKey(true);\n _wantsToStopTheEvent.push(true);\n }\n const enabled = this._listeners.enabled;\n const _keyDowners = this._listeners.byEvent.keyDown;\n const _keyRepeaters = this._listeners.byEvent.keyRepeat;\n const _repeating = this._lastKeyDown === _keyCode && this.status.hasKeyDown(_keyCode);\n this.status.addKeyDown(_keyCode);\n const _filterMethod = _repeating ? _viewId => {\n return _keyRepeaters.includes(_viewId) && _keyDowners.includes(_viewId);\n } : _viewId => {\n return _keyDowners.includes(_viewId);\n };\n this._filterViewIdToValidView(enabled, _filterMethod).filter(_ctrl => {\n return this.isFunction(_ctrl.keyDown);\n }).some(_ctrl => {\n if (_ctrl.keyDown(_keyCode)) {\n _wantsToStopTheEvent.push(_ctrl.viewId);\n // no other keyDown events delegated after first responder returns true\n return true;\n }\n else {\n return false;\n }\n });\n // Some keys are special (esc and return) and they have their own\n // special events: defaultKey and escKey, which aren't limited\n // to instances of HControl, but any parent object will work.\n if (_wantsToStopTheEvent.length === 0 && !_repeating && this._defaultKeyActions[_keyCode.toString()]) {\n const _defaultKeyMethod = this._defaultKeyActions[_keyCode.toString()];\n if (this.defaultKey(_defaultKeyMethod, null, [])) {\n _wantsToStopTheEvent.push(true);\n }\n }\n this._lastKeyDown = _keyCode;\n if (_wantsToStopTheEvent.length !== 0) {\n Event.stop(e);\n }\n }", "_keydown(event) {\n if (this._originatesFromChip(event)) {\n this._keyManager.onKeydown(event);\n }\n }", "_keydown(event) {\n if (this._originatesFromChip(event)) {\n this._keyManager.onKeydown(event);\n }\n }", "onDownKey() {\n this.onArrowKey('down');\n }", "onDownKey() {\n this.onArrowKey('down');\n }", "_handleKeydown(event) {\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n switch (keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__[\"ESCAPE\"]:\n if (!Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__[\"hasModifierKey\"])(event)) {\n event.preventDefault();\n this.closed.emit('keydown');\n }\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__[\"LEFT_ARROW\"]:\n if (this.parentMenu && this.direction === 'ltr') {\n this.closed.emit('keydown');\n }\n break;\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__[\"RIGHT_ARROW\"]:\n if (this.parentMenu && this.direction === 'rtl') {\n this.closed.emit('keydown');\n }\n break;\n default:\n if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__[\"UP_ARROW\"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_2__[\"DOWN_ARROW\"]) {\n manager.setFocusOrigin('keyboard');\n }\n manager.onKeydown(event);\n }\n }", "initializeKeyboardEvents() {\n document.addEventListener(\"keydown\", (event) => {\n if (this.keyboardEvents.get(event.key)) {\n this.keyboardEvents.get(event.key)(event)\n }\n })\n }", "listen() {\n window.addEventListener(\"keydown\", this.callbackFunc.bind());\n }", "onKeyDown(e) {\n e = e || window.event;\n //console.log(e.shiftKey);\n }", "keyEventInDown(keyEvent){\n if(this.state.popupActive === 0) {\n if (!this.keysDown.has(keyEvent.key)) {\n if (this.runningInstance) {\n this.runningInstance.keyEventIn(keyEvent);\n } else {\n console.log(\"Main menu keyEvent when not running: \" + keyEvent + \", key: \" + keyEvent.key);\n }\n\n // pause/unpause on space\n if (keyEvent.key === \" \" || keyEvent.key === \"p\" || keyEvent.key === \"P\") {\n this.pausePlayButtonRef.current.clicked();\n }\n this.keysDown.add(keyEvent.key);\n }\n }\n }", "_keydown(event) {\n switch (event.keyCode) {\n // Toggle for space and enter keys.\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_7__[\"SPACE\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_7__[\"ENTER\"]:\n if (!Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_7__[\"hasModifierKey\"])(event)) {\n event.preventDefault();\n this._toggle();\n }\n break;\n default:\n if (this.panel.accordion) {\n this.panel.accordion._handleHeaderKeydown(event);\n }\n return;\n }\n }", "_handleKeydown(event) {\n // We don't handle any key bindings with a modifier key.\n if (Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_14__[\"hasModifierKey\"])(event)) {\n return;\n }\n switch (event.keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_14__[\"ENTER\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_14__[\"SPACE\"]:\n if (this.focusIndex !== this.selectedIndex) {\n this.selectFocusedIndex.emit(this.focusIndex);\n this._itemSelected(event);\n }\n break;\n default:\n this._keyManager.onKeydown(event);\n }\n }", "function __bindKeyEvents() {\n var KEY_PRESS_EVENT = 'keydown.pong3D',\n KEY_RELEASE_EVENT = 'keyup.pong3D',\n __window = $(window);\n\n __window\n .on(KEY_PRESS_EVENT, function(event) {\n if (event.which === 82 || event.which === 91) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n __keyPressed[event.which] = true;\n //console.log('key down' + event.which);\n });\n\n __window\n .on(KEY_RELEASE_EVENT, function(event) {\n\n if (event.which === 82 || event.which === 91) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n __keyReleased[event.which] = true;\n //console.log(event.which);\n });\n\n }", "[symbols.keydown](event) {\n\n let handled;\n /** @type {any} */\n const list = this.$.list;\n\n switch (event.key) {\n\n case 'ArrowDown':\n if (this.opened) {\n handled = event.altKey ? this[symbols.goEnd]() : this[symbols.goDown]();\n }\n break;\n\n case 'ArrowUp':\n if (this.opened) {\n handled = event.altKey ? this[symbols.goStart]() : this[symbols.goUp]();\n }\n break;\n\n case 'PageDown':\n handled = list.pageDown && list.pageDown();\n break;\n \n case 'PageUp':\n handled = list.pageUp && list.pageUp();\n break;\n }\n\n // Prefer mixin result if it's defined, otherwise use base result.\n return handled || (super[symbols.keydown] && super[symbols.keydown](event));\n }", "keypressInput(e) {\n // console.log(e);\n let keycode = event.key; // also for cross-browser compatible\n (this.acceptMoves) && this.ea.publish('keyPressed', keycode);\n }", "function KeyEventsPlugin(doc){return _super.call(this,doc)||this;}", "bind() {\n\t\tdocument.addEventListener('keydown', this.handleKeyPress);\n\t}", "function onKeyDown(event) {\n}", "_keyDown(event) {\n this._keyDownHandled = false;\n if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {\n return false;\n }\n if (!this._compositionHelper.keydown(event)) {\n if (this.buffer.ybase !== this.buffer.ydisp) {\n this.scrollToBottom();\n }\n return false;\n }\n const result = evaluateKeyboardEvent(event, this._coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);\n this.updateCursorStyle(event);\n if (result.type === 3 /* PAGE_DOWN */ || result.type === 2 /* PAGE_UP */) {\n const scrollCount = this.rows - 1;\n this.scrollLines(result.type === 2 /* PAGE_UP */ ? -scrollCount : scrollCount);\n return this.cancel(event, true);\n }\n if (result.type === 1 /* SELECT_ALL */) {\n this.selectAll();\n }\n if (this._isThirdLevelShift(this.browser, event)) {\n return true;\n }\n if (result.cancel) {\n // The event is canceled at the end already, is this necessary?\n this.cancel(event, true);\n }\n if (!result.key) {\n return true;\n }\n // If ctrl+c or enter is being sent, clear out the textarea. This is done so that screen readers\n // will announce deleted characters. This will not work 100% of the time but it should cover\n // most scenarios.\n if (result.key === C0.ETX || result.key === C0.CR) {\n this.textarea.value = '';\n }\n this._onKey.fire({ key: result.key, domEvent: event });\n this._showCursor();\n this._coreService.triggerDataEvent(result.key, true);\n // Cancel events when not in screen reader mode so events don't get bubbled up and handled by\n // other listeners. When screen reader mode is enabled, this could cause issues if the event\n // is handled at a higher level, this is a compromise in order to echo keys to the screen\n // reader.\n if (!this.optionsService.options.screenReaderMode) {\n return this.cancel(event, true);\n }\n this._keyDownHandled = true;\n }", "componentDidMount() {\n document.onkeydown = this.onKeydown;\n }", "onElementKeyDown(event) {\n super.onElementKeyDown(event);\n\n const me = this;\n\n if (me.selectedEvents.length) {\n me.trigger(me.scheduledEventName + 'KeyDown', { eventRecord: me.selectedEvents });\n }\n }", "bindKeys() {\n document.addEventListener('keydown', this.handleKeys);\n }", "function keyDownHandler(e) {\n\twasdKeys.onKeyDown(e);\n}", "HandleKeyDown(event) {}", "getKeyMetaDown() {\nreturn this._keyMetaDown;\n}", "componentWillMount() {\n window.addEventListener('keydown', this.handleOnKeyDown);\n }", "_evtKeydown(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n if (!this._editor.host.contains(event.target)) {\n this.reset();\n return;\n }\n switch (event.keyCode) {\n case 9: // Tab key\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n let model = this._model;\n if (!model) {\n return;\n }\n model.subsetMatch = true;\n let populated = this._populateSubset();\n model.subsetMatch = false;\n if (populated) {\n return;\n }\n this.selectActive();\n return;\n case 27: // Esc key\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n this.reset();\n return;\n case 38: // Up arrow key\n case 40: // Down arrow key\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n this._cycle(event.keyCode === 38 ? 'up' : 'down');\n return;\n default:\n return;\n }\n }", "function keydownHandler () {\n if ($.fn.dropdown) {\n // wait to define until function is called in case Bootstrap isn't loaded yet\n var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown;\n return bootstrapKeydown.apply(this, arguments);\n }\n }", "function onKeyDown(ev) {\n var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE);\n return isEscape ? close(ev) : $q.when(true);\n }", "function onKeyDown(ev) {\n var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE);\n return isEscape ? close(ev) : $q.when(true);\n }", "function onKeyDown(ev) {\n var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE);\n return isEscape ? close(ev) : $q.when(true);\n }", "function KeyEventsPlugin(doc) {\n return _super.call(this, doc) || this;\n }", "function KeyEventsPlugin(doc) {\n return _super.call(this, doc) || this;\n }", "function KeyEventsPlugin(doc) {\n return _super.call(this, doc) || this;\n }", "function KeyEventsPlugin(doc) {\n return _super.call(this, doc) || this;\n }", "componentDidMount() {\n document.addEventListener('keydown', this.handleKeyDown);\n }", "function keydownEventListener(event) {\n\tvar elementXPath = getXPath(event.target);\n\tvar keyIdentifier;\n\tif (isCharacterKeyPress(event)) {\n\t\t// For charcter keys return printable character instead of code\n\t\tkeyIdentifier = String.fromCharCode(event.which);\n\t} else {\n\t\tkeyIdentifier = event.which;\n\t};\n\n\tif (isCharacterKeyPress(event) && ((!event.altKey && !event.metaKey && !event.shiftKey && !event.ctrlKey) || (!event.altKey && !event.metaKey && event.shiftKey && !event.ctrlKey))) {\n\t\t// Ignore as it's just normal key press and will be sent via \"keypress event\" or someone did Shift+key to make it capital – again will be sent via keypress event\n\t} else {\n\t\tconsole.log('Pressed down: ' + keyIdentifier + ' on ' + elementXPath + ' alt: ' + event.altKey + ' meta: ' + event.metaKey + ' shift: ' + event.shiftKey + ' ctrl: ' + event.ctrlKey);\n\t\tsendEvent(\"{\\\"path\\\":\\\"\" + elementXPath + \"\\\", \\\"action\\\":\\\"keydown\\\", \\\"keyIdentifier\\\":\\\"\" + keyIdentifier + \"\\\", \\\"metaKey\\\":\\\"\" + event.metaKey + \"\\\", \\\"ctrlKey\\\":\\\"\" + event.ctrlKey + \"\\\", \\\"altKey\\\":\\\"\" + event.altKey + \"\\\", \\\"shiftKey\\\":\\\"\" + event.shiftKey + \"\\\"}\");\n\t};\n}", "componentDidMount() {\n document.addEventListener(\"keydown\", this._handleKeyDown)\n }", "function onKeyDown(ev){var isEscape=ev.keyCode===$mdConstant.KEY_CODE.ESCAPE;return isEscape?close(ev):$q.when(true);}", "_handleKeyboard(e) {\n Foundation.Keyboard.handleKey(e, 'OffCanvas', {\n close: () => {\n this.close();\n this.$lastTrigger.focus();\n return true;\n },\n handled: () => {\n e.stopPropagation();\n e.preventDefault();\n }\n });\n }", "keyDown(event){\n\t\tconsole.log(`======] Key Down [======`, event);\n\t\tevent.preventDefault();\n\n\t\tlet keycode = event.which;\n\t\tif(keycode === 16){\n\t\t\tthis.setState({shiftDown: true});\n\t\t}\n\t\t\n\t\t//TODO: figure out how to use SHIFT and CAPS lock\n\t\tif(this.state.focused){\n\t\t\tlet androidKeycode = keycodes.map[keycode];\n\t\t\tconsole.log(`======] KeyCode ${keycode} -> ${androidKeycode} [======`);\n\t\t\tif(androidKeycode){\n\t\t\t\tlet commands = [];\n\t\t\t\tif(this.state.shiftDown){\n\t\t\t\t\tcommands.push(keycodes.map[16]);\n\t\t\t\t}\n\t\t\t\tcommands.push(androidKeycode);\n\t\t\t\tthis.serializer.to({type: 'KEYEVENT', commands: commands})\n\t\t\t\t\t.then(message => {\n\t\t\t\t\t\tthis.websocket.send(message);\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => console.error(error));\n\t\t\t}\n\t\t}\n\t}", "onKeyDown(e) {\n\t\tif (e.key === 'Escape') {\n\t\t\tconst { onClose } = this.props;\n\t\t\tonClose();\n\t\t}\n\t}", "componentDidMount() {\n // console.log('component did mount, handleKeyPress added');\n window.addEventListener(\"keydown\", this.handleKeyPress);\n }", "function keyDownHandler(event) {\n keyHandler(true, event);\n}", "keyupHandler(event) {\n window.addEventListener('keydown', this.keydown);\n }", "function getStdInKeyPresses() {\n // A Subject is something that you can push values at, and\n // it can be subscribed to as an Observable of those values\n const s = new Subject()\n\n // set up handler and return the stream as Observable\n process.stdin.on(\"keypress\", (ch, key = {}) => {\n if (key.name == \"x\" || (key && key.ctrl && key.name == \"c\")) {\n process.stdin.pause()\n console.log(\"Bye!\")\n return\n }\n if (ch === \"0\" || Number(ch)) {\n s.next(ch)\n } else {\n console.error(\"Not a number!\")\n }\n })\n return s\n}", "keyDown(_keycode) {}", "_keydown(event) {\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n const previousFocusIndex = manager.activeItemIndex;\n const hasModifier = Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"hasModifierKey\"])(event);\n switch (keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"SPACE\"]:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"ENTER\"]:\n if (!hasModifier && !manager.isTyping()) {\n this._toggleFocusedOption();\n // Always prevent space from scrolling the page since the list has focus\n event.preventDefault();\n }\n break;\n default:\n // The \"A\" key gets special treatment, because it's used for the \"select all\" functionality.\n if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"A\"] && this.multiple && Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"hasModifierKey\"])(event, 'ctrlKey') &&\n !manager.isTyping()) {\n const shouldSelect = this.options.some(option => !option.disabled && !option.selected);\n this._setAllOptionsSelected(shouldSelect, true, true);\n event.preventDefault();\n }\n else {\n manager.onKeydown(event);\n }\n }\n if (this.multiple && (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"UP_ARROW\"] || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_8__[\"DOWN_ARROW\"]) && event.shiftKey &&\n manager.activeItemIndex !== previousFocusIndex) {\n this._toggleFocusedOption();\n }\n }", "onInputKeyDown(event) {\n const keyCode = event.which;\n const { onEnter, onEscape, onDown, onUp } = this.props;\n\n if (keyCode === 27) { // Escape\n return onEscape(event);\n } else if (keyCode === 13) { // Enter\n return onEnter(event);\n } else if (keyCode === 38) { // Up\n return onUp(event);\n } else if (keyCode === 40) { // Down\n return onDown(event);\n }\n }", "componentDidMount() {\n window.addEventListener('keydown', this.handleKeyPress);\n }", "_keydown(event) {\n const target = event.target;\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n if (keyCode === TAB && target.id !== this._chipInput.id) {\n this._allowFocusEscape();\n }\n else if (this._originatesFromEditingChip(event)) {\n // No-op, let the editing chip handle all keyboard events except for Tab.\n }\n else if (this._originatesFromChip(event)) {\n manager.onKeydown(event);\n }\n this.stateChanges.next();\n }", "function keydownHandlerLib(event) {\r\n\r\n if (event.keyCode == 49) {\r\n keyIsDown[event.keyCode] = true;\r\n modal.style.display = \"block\";\r\n }\r\n\r\n if (event.keyCode == 50) {\r\n keyIsDown[event.keyCode] = true;\r\n modal2.style.display = \"block\";\r\n }\r\n\r\n}", "onElementKeyDown(event) {\n super.onElementKeyDown(event);\n const me = this;\n\n if (me.selectedEvents.length) {\n me.trigger(me.scheduledEventName + 'KeyDown', {\n eventRecord: me.selectedEvents,\n assignmentRecord: me.selectedAssignments\n });\n }\n }", "handleKeyDown (event) {\n }", "componentDidMount() {\n document.addEventListener(\"keydown\", this.handleKeyPress);\n \n }", "_keydown(event) {\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n const previousFocusIndex = manager.activeItemIndex;\n const hasModifier = (0,_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.hasModifierKey)(event);\n switch (keyCode) {\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.SPACE:\n case _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.ENTER:\n if (!hasModifier && !manager.isTyping()) {\n this._toggleFocusedOption();\n // Always prevent space from scrolling the page since the list has focus\n event.preventDefault();\n }\n break;\n default:\n // The \"A\" key gets special treatment, because it's used for the \"select all\" functionality.\n if (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.A && this.multiple && (0,_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.hasModifierKey)(event, 'ctrlKey') &&\n !manager.isTyping()) {\n const shouldSelect = this.options.some(option => !option.disabled && !option.selected);\n this._setAllOptionsSelected(shouldSelect, true, true);\n event.preventDefault();\n }\n else {\n manager.onKeydown(event);\n }\n }\n if (this.multiple && (keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.UP_ARROW || keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__.DOWN_ARROW) && event.shiftKey &&\n manager.activeItemIndex !== previousFocusIndex) {\n this._toggleFocusedOption();\n }\n }", "componentDidMount() {\n document.addEventListener(\"keydown\", this.escFunction);\n }", "componentDidMount() {\n $(\"body\").keydown(this.handlePress);\n }", "componentDidMount() {\n document.addEventListener('keydown', this.handleKeyPress)\n }", "get Keyboard() {}", "componentDidMount() {\n document.addEventListener('keydown', this.handleKeyPress, false);\n }", "onKeyDown(event) {\n const { escape } = this.props;\n\n if (event.keyCode === 27 && escape) {\n this.onClose();\n }\n\n if (SCROLLING_KEYS[event.keyCode]) {\n event.preventDefault();\n return false;\n }\n }", "setKeyDown(_state) {\n this.events.keyDown = _state;\n this.setEvents();\n return this;\n }", "onElementKeyDown(event) {\n super.onElementKeyDown(event);\n }", "onElementKeyDown(event) {\n super.onElementKeyDown(event);\n }", "bindKeys() {\n var self = this;\n\n document.addEventListener('keydown', function(e) {\n var which = e.which,\n code = e.code;\n if (e.target.id === self.MAIN_SHADERTOY_DEMO_ID) {\n console.log(e);\n // Alt (or Cmd) + ...\n if (e.altKey || e.metaKey) {\n // 1...9 Keys\n if (which === Math.max(49, Math.min(57, which))) {\n self.decreaseRes(which - 48);\n }\n if (e.key === 'ArrowUp') {\n gShaderToy.pauseTime();\n }\n if (e.key === 'ArrowDown') {\n gShaderToy.resetTime();\n }\n if (e.key === 'ArrowRight') {\n self.increaseTimePosition();\n }\n if (e.key === 'ArrowLeft') {\n self.decreaseTimePosition();\n }\n }\n\n // shift + ctrl + s\n if (e.ctrlKey && e.shiftKey && e.which === 83) {\n self.takeScreenShot();\n }\n\n // shift + ctrl + r\n if (e.ctrlKey && e.shiftKey && code === 'KeyR') {\n self.switchRecording();\n }\n }\n // shift + ctrl + enter\n if (e.which === 13 && e.shiftKey && e.ctrlKey) {\n self.toggleFullScreenEdit();\n }\n });\n }", "renderedKeyDown(e) {\n const shift = e.shiftKey;\n const ctrl = e.ctrlKey;\n if ((shift || ctrl) && e.key === 'Enter') {\n this.setState({ view: true });\n return false;\n }\n\n switch (e.key) {\n case 'ArrowUp':\n this.props.focusAbove();\n break;\n case 'ArrowDown':\n this.props.focusBelow();\n break;\n case 'Enter':\n this.openEditor();\n e.preventDefault();\n return false;\n default:\n }\n return true;\n }", "handleKeyDown(kCode) {\n console.log(\"handleKeyDown \" + this.id + \" \" + kCode)\n }", "function $getEventKey(e) {\r\n\t\treturn e.which || e.keyCode;\r\n\t}", "componentDidMount() {\n document.addEventListener('keydown', this.handleKey);\n }", "function keyDownEvent(event) {\n /* Left keydown event */\n if (event.key === 'ArrowLeft') {\n backButtonTrigger()\n window.currentMouseDownEvent = setTimeout(() => backButtonTrigger(), 100)\n /* Right keydown event */\n } else if (event.key === 'ArrowRight') {\n forwardButtonTrigger()\n window.currentMouseDownEvent = setTimeout(() => forwardButtonTrigger(), 100)\n }\n}", "[keydown](/** @type {KeyboardEvent} */ event) {\n let handled;\n\n switch (event.key) {\n case \" \":\n this.click();\n handled = true;\n break;\n }\n\n // Prefer mixin result if it's defined, otherwise use base result.\n return handled || (super[keydown] && super[keydown](event));\n }", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "function canvasHandleKeyDown(e){\r\n\tvar key = e.keyCode;\r\n\t//println(key);\r\n\tif(useStates){\r\n\t\tStates.current().input.handleKeyDown(e);\r\n\t}\r\n\tgInput.handleKeyDown(e);\r\n}", "onElementKeyPress(event) {}", "onElementKeyPress(event) {}", "_handleKeydown(event) {\n if (!this.disabled) {\n this.panelOpen ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);\n }\n }", "_handleKeydown(event) {\n if ((event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_11__.ENTER || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_11__.SPACE) && !(0,_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_11__.hasModifierKey)(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "constructor() {\r\n super();\r\n let eventHandler = event => {\r\n if(event.keyCode === 68) {\r\n this.wasRightPushed_ = true;\r\n }\r\n else if(event.keyCode === 65) {\r\n this.wasLeftPushed_ = true;\r\n }\r\n }\r\n window.addEventListener(\"keydown\", eventHandler); \r\n }", "function keyhandlerBindingFactory(keyCode) {\n return {\n init: function (element, valueAccessor, allBindingsAccessor, data, bindingContext) {\n var wrappedHandler, newValueAccessor;\n\n // wrap the handler with a check for the enter key\n wrappedHandler = function (data, event) {\n if (event.keyCode === keyCode) {\n valueAccessor().call(this, data, event);\n }\n };\n\n // create a valueAccessor with the options that we would want to pass to the event binding\n newValueAccessor = function () {\n return {\n keyup: wrappedHandler\n };\n };\n\n // call the real event binding's init function\n ko.bindingHandlers.event.init(element, newValueAccessor, allBindingsAccessor, data, bindingContext);\n }\n };\n }", "function bind() {\n document.addEventListener('keydown', handleEvent);\n}", "function keyEvent(name, el, key, fixture) {\n var kbdEvent;\n if (BROWSER_SUPPORTS_EVENT_CONSTRUCTORS) {\n kbdEvent = new KeyboardEvent(name);\n }\n else {\n kbdEvent = document.createEvent('Event');\n kbdEvent.initEvent(name, true, true);\n }\n // Hack DOM Level 3 Events \"key\" prop into keyboard event.\n Object.defineProperty(kbdEvent, 'key', {\n value: key,\n enumerable: false,\n writable: false,\n configurable: true\n });\n spyOn(kbdEvent, 'preventDefault').and.callThrough();\n spyOn(kbdEvent, 'stopPropagation').and.callThrough();\n el.nativeElement.dispatchEvent(kbdEvent);\n fixture.detectChanges();\n return kbdEvent;\n}", "keydown(e){\n let cursorPosition = {row:this.paper.cursor.row, col:this.paper.cursor.col}\n switch( e.key ) {\n case 'ArrowUp':\n this.cursorMove({row: cursorPosition.row - 1, col: cursorPosition.col})\n break;\n case 'ArrowDown':\n this.cursorMove({row: cursorPosition.row + 1, col: cursorPosition.col})\n break;\n case 'ArrowRight':\n this.cursorMove({row: cursorPosition.row, col: cursorPosition.col + 1})\n break;\n case 'ArrowLeft':\n this.cursorMove({row: cursorPosition.row, col: cursorPosition.col - 1})\n break;\n case 'Escape':\n this.cancel()\n break;\n case ' ':\n case 'Enter':\n e.row = cursorPosition.row\n e.col = cursorPosition.col\n if( !this.drawing ) {\n this.cursorDown(e)\n } else {\n this.cursorUp(e)\n }\n this.cursorClick(e)\n break;\n default:\n if( e.altKey && e.key.length == 1) {\n this.paper.toolbox.selectTool(e.key)\n }\n }\n }", "static _addKeyboardEventListeners() {\n window.addEventListener(\"keydown\", (keyboard) => {\n Input._setKeyDown(keyboard.code);\n });\n window.addEventListener(\"keyup\", (keyboard) => {\n Input._setKeyUp(keyboard.code);\n Input._executeOnReleaseFunction(keyboard.code);\n });\n }", "function keyDown(el, keyCode) {\n var eventObj = document.createEventObject ?\n document.createEventObject() : document.createEvent(\"Events\");\n\n if(eventObj.initEvent){\n eventObj.initEvent(\"keydown\", true, true);\n }\n\n eventObj.keyCode = keyCode;\n eventObj.which = keyCode;\n if (eventObj.keyCode != keyCode) {\n console.error('created keyCode incorrect. Actual: %i; Expected: %i', eventObj.keyCode, keyCode);\n }\n\n // _dbg = eventObj; // debug\n\n var res;\n if (el.dispatchEvent) {\n res = el.dispatchEvent(eventObj);\n }\n else {\n res = el.fireEvent(\"onkeydown\", eventObj);\n }\n return res;\n }", "_evtKeydown(event) {\n // Check for escape key\n switch (event.keyCode) {\n case 27: // Escape.\n event.stopPropagation();\n event.preventDefault();\n this.hideAndReset();\n break;\n default:\n break;\n }\n }", "onInternalKeyDown(event) {\n const sourceWidget = IdHelper.fromElement(event),\n isFromWidget = sourceWidget && sourceWidget !== this && !(sourceWidget instanceof MenuItem);\n\n if (event.key === 'Escape') {\n // Only close this menu if the ESC was in a child input Widget\n (isFromWidget ? this : this.rootMenu).close();\n return;\n }\n\n super.onInternalKeyDown(event);\n\n // Do not process keys from certain elemens\n if (isFromWidget) {\n return;\n }\n\n if (validKeys[event.key]) {\n event.preventDefault();\n }\n\n const active = document.activeElement,\n el = this.element;\n\n this.navigateFrom(active !== el && el.contains(active) ? active : null, event.key, event);\n }", "_handleHeaderKeydown(event) {\n this._keyManager.onKeydown(event);\n }", "_inputKeydownHandler(event) {\n const that = this,\n keyCode = !event.charCode ? event.which : event.charCode;\n\n if (keyCode === 40 && that._isIncrementOrDecrementAllowed()) {\n // decrement when Down Arrow is pressed\n that._incrementOrDecrement('subtract');\n }\n else if (keyCode === 38 && that._isIncrementOrDecrementAllowed()) {\n // increment when Up Arrow is pressed\n that._incrementOrDecrement('add');\n }\n\n that._keydownInfo = { value: that.$.input.value, specialKey: event.altKey || event.ctrlKey || event.shiftKey };\n }", "function keyPressDown(event){\n\n let key = (96 <= event.keyCode && event.keyCode <= 105)? event.keyCode - 48 : event.keyCode;\n if(key >= 16 && key <= 18){\n\n if(pressedModifiers.indexOf(key) === -1){\n\n pressedModifiers.push(key);\n }\n if(event.data && event.data.modifierFunc){\n\n event.data.modifierFunc(event);\n }\n\n } else {\n\n if(event.data && event.data.keyFunc){\n\n event.data.keyFunc(event);\n }\n }\n if(event.data && event.data.func){\n\n event.data.func(event);\n }\n for (var handler in waitingForInput) {\n if (waitingForInput.hasOwnProperty(handler)) {\n waitingForInput[handler](event);\n }\n }\n\n}", "_handleKeydown(event) {\n if ((event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"] || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]) && !Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"hasModifierKey\"])(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "_handleKeydown(event) {\n if ((event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"ENTER\"] || event.keyCode === _angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"SPACE\"]) && !Object(_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_10__[\"hasModifierKey\"])(event)) {\n this._selectViaInteraction();\n // Prevent the page from scrolling down and form submits.\n event.preventDefault();\n }\n }", "function keydown(event){switch(event.keyCode){case $mdConstant.KEY_CODE.LEFT_ARROW:event.preventDefault();incrementIndex(-1,true);break;case $mdConstant.KEY_CODE.RIGHT_ARROW:event.preventDefault();incrementIndex(1,true);break;case $mdConstant.KEY_CODE.SPACE:case $mdConstant.KEY_CODE.ENTER:event.preventDefault();if(!locked)select(ctrl.focusIndex);break;}ctrl.lastClick=false;}", "_triggerKeyDownChange (e) {\n if (this.options.onKeyDownChange) {\n this.options.onKeyDownChange(this.getFormElement(), this.getUIElement(), e);\n }\n }", "function keydown() {\n switch (d3.event.keyCode) {\n case 8: // backspace\n {\n break;\n }\n case 46: { // delete\n delete_node = true;\n break;\n }\n case 16: { //shift\n should_modify = true;\n break;\n }\n case 17: { //control\n drawing_line = true;\n }\n\n }\n}" ]
[ "0.7377901", "0.66555864", "0.5811591", "0.57188696", "0.57188696", "0.5625074", "0.5625074", "0.55653155", "0.55653155", "0.5547744", "0.55371225", "0.54708576", "0.541459", "0.5395512", "0.5394707", "0.5372348", "0.5368321", "0.5313045", "0.52713305", "0.52500796", "0.5230929", "0.52180773", "0.51974", "0.51861686", "0.5167894", "0.51631165", "0.5161543", "0.5148138", "0.5145806", "0.5144145", "0.5136419", "0.51056767", "0.5104918", "0.5104918", "0.5104918", "0.5101774", "0.5101774", "0.5101774", "0.5101774", "0.50954044", "0.5093645", "0.50867707", "0.50833255", "0.5075247", "0.5072211", "0.5069259", "0.5061834", "0.50541127", "0.5049016", "0.5043784", "0.5041229", "0.502937", "0.5026167", "0.50251114", "0.5018034", "0.5009434", "0.49985057", "0.49964562", "0.49870795", "0.49602947", "0.49531406", "0.4950845", "0.49472013", "0.49449685", "0.49423802", "0.49408153", "0.49381265", "0.4936686", "0.4936686", "0.49286294", "0.49206126", "0.4908359", "0.4907266", "0.4904942", "0.48907825", "0.4888506", "0.48866588", "0.48813346", "0.4879734", "0.4879734", "0.48755082", "0.48711568", "0.4869621", "0.48625782", "0.4860532", "0.4854549", "0.48457113", "0.4843095", "0.48365322", "0.4836467", "0.48278937", "0.48277223", "0.48268032", "0.48257402", "0.48234326", "0.48234326", "0.4819887", "0.48159626", "0.4812352" ]
0.6385792
3
Updates the dialog's position.
updatePosition(position) { let strategy = this._ref.config.positionStrategy; if (position && (position.left || position.right)) { position.left ? strategy.left(position.left) : strategy.right(position.right); } else { strategy.centerHorizontally(); } if (position && (position.top || position.bottom)) { position.top ? strategy.top(position.top) : strategy.bottom(position.bottom); } else { strategy.centerVertically(); } this._ref.updatePosition(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_position() {\n var dlgLeft = ($(document).width()/2) - ($('#dlg-box-content-container').width()/2) - 20;\n $('#dlg-box-content-container').css('left', dlgLeft);\n $('#dlg-box-content-container').css('top', '8%');\n }", "updatePosition() {\n this.position = getPositionForPopup(this.mapFeature);\n this.draw();\n }", "setDialogPosition() {\n if (this.$customPosition.left && this.$customPosition.top) {\n this.$dialog.style.left = this.$customPosition.left;\n this.$dialog.style.top = this.$customPosition.top;\n this.$dialog.style.right = 'auto';\n } else {\n // Dialog dimensions\n var dialogWidth = this.$dialog.offsetWidth;\n var dialogHeight = this.$dialog.offsetHeight;\n\n // Screen dimensions\n /*\n These variables check to make sure mobile is supported and scroll bar is accounted for across browsers \n */\n var cssWidth = window.innerWidth && document.documentElement.clientWidth \n ? Math.min(window.innerWidth, document.documentElement.clientWidth) : window.innerWidth || \n document.documentElement.clientWidth || \n document.getElementsByTagName('body')[0].clientWidth;\n var cssHeight = window.innerHeight && document.documentElement.clientHeight \n ? Math.min(window.innerHeight, document.documentElement.clientHeight) : window.innerHeight || \n document.documentElement.clientHeight || \n document.getElementsByTagName('body')[0].clientHeight;\n\n // Dialog position\n var topPosition = ((cssHeight - dialogHeight) / 3);\n var leftPosition = ((cssWidth - dialogWidth) / 2);;\n\n // Set positioning\n this.$dialog.style.left = leftPosition + 'px';\n this.$dialog.style.top = topPosition + 'px';\n this.$dialog.style.right = 'auto';\n }\n }", "function updatePositionDialog(x,y, name)\n{\n\tfor(i=0;i<dialogList.length;i++)\n\t{\n\t\tif(dialogList[i][2] == name)\n\t\t{\n\t\t\tdialogList[i][0] = x;\n\t\t\tdialogList[i][1] = y;\n\t\t}\n\t}\n\n}", "@action\n changePositionAction() {\n this.showPositionDialog = true;\n this.newPositionId = this.args.onDutyEntry.position_id;\n this.changePositionError = null;\n }", "resetDialogPosition() {\n this.$dialog.style.top = 0;\n this.$dialog.style.left = 'auto';\n this.$dialog.style.right = '-1000px';\n }", "setPosition() {\n this._setWrapperPosition();\n this._setContentPosition();\n }", "updatePosition() {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }", "updatePos(){\n if(this.track.hidden){\n this.delete();\n }\n this.pos.x = this.track.pos.x-this.barWidth/2;\n this.pos.y = -this.track.pos.y-this.yOffSet;\n if(this.text){\n this.text.x = this.pos.x;\n this.text.y = this.pos.y-this.text.height;\n }\n }", "function onUpdatePosition() {\n gridDotUpper.position = position;\n gridDot.position = position;\n gridDotMiddle.position = position;\n\n if (guitarString) {\n guitarString.updateDotPosition(self);\n }\n }", "function reposition() {\n\t\tvar modal = $(this),\n\t\t\tdialog = modal.find('.modal-dialog');\n\t\t\tmodal.css('display', 'block');\n\t\t\tdialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n\t\t\t$(\".modal .actions\").css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n\t}", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "updatePosition() {\n // set the new plane sizes and positions relative to document by triggering getBoundingClientRect()\n this._setDocumentSizes();\n\n // apply them\n this._applyWorldPositions();\n }", "updatePosition(position) \n {\n this.position = position;\n }", "setPosition() {\r\n if (!this.object) return;\r\n this.updatePosition();\r\n }", "requestUpdatePosition () {\n this.positionUpdateNeeded = true;\n }", "updatePosition() {\n const position = this.overlayRef.getConfig().positionStrategy;\n position.withPositions([\n POSITION_MAP[this.placement].position,\n ...DEFAULT_POPOVER_POSITIONS,\n ]);\n }", "_updatePosition() {\n var width = this.$element.outerWidth();\n var outerWidth = $(window).width();\n var height = this.$element.outerHeight();\n var outerHeight = $(window).height();\n var left, top;\n if (this.options.hOffset === 'auto') {\n left = parseInt((outerWidth - width) / 2, 10);\n } else {\n left = parseInt(this.options.hOffset, 10);\n }\n if (this.options.vOffset === 'auto') {\n if (height > outerHeight) {\n top = parseInt(Math.min(100, outerHeight / 10), 10);\n } else {\n top = parseInt((outerHeight - height) / 4, 10);\n }\n } else {\n top = parseInt(this.options.vOffset, 10);\n }\n this.$element.css({top: top + 'px'});\n // only worry about left if we don't have an overlay or we havea horizontal offset,\n // otherwise we're perfectly in the middle\n if(!this.$overlay || (this.options.hOffset !== 'auto')) {\n this.$element.css({left: left + 'px'});\n this.$element.css({margin: '0px'});\n }\n\n }", "function resetPosition (event) {\n var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position'];\n var windowHeight = $(window).height();\n var adjustedOptions = {};\n var option, optionValue, adjustedValue;\n for (var n = 0; n < positionOptions.length; n++) {\n option = positionOptions[n];\n optionValue = event.data[option];\n if (optionValue) {\n // jQuery UI does not support percentages on heights, convert to pixels.\n if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) {\n adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10);\n // Don't force the dialog to be bigger vertically than needed.\n if (option === 'height' && $element.parent().outerHeight() < adjustedValue) {\n adjustedValue = 'auto';\n }\n adjustedOptions[option] = adjustedValue;\n }\n else {\n adjustedOptions[option] = optionValue;\n }\n }\n }\n $element.dialog('option', adjustedOptions);\n }", "set_position(newval) {\n this.liveFunc.set_position(newval);\n return this._yapi.SUCCESS;\n }", "_updatePosFromTop() {\n this._bottomRight = this._topLeft.$add(this._size);\n this._updateCenter();\n }", "set position (newPosition) {\n this.emit('position', newPosition)\n this._position = newPosition * this.ticksPerSongPosition\n }", "_updatePosition() {\n const position = this._overlayRef.getConfig().positionStrategy;\n const origin = this._getOrigin();\n const overlay = this._getOverlayPosition();\n position.withPositions([\n Object.assign(Object.assign({}, origin.main), overlay.main),\n Object.assign(Object.assign({}, origin.fallback), overlay.fallback)\n ]);\n }", "function _moveToPosition(val) {\n\t\t\t\tvar timetable = this._timetable,\n\t\t\t\t\tvocab = getVocab.call(timetable);\n\n\t\t\t\t// update any interface element that need changing\n\t\t\t\tthis._dragAreaElm.css( vocab.pos, -(_valToPos.call(this, val)) );\n\t\t\t\t// TODO add slider position updates here\n\t\t\t\tif (this._scrollbar1) {\n\t\t\t\t\tthis._scrollbar1.moveToPosition(val);\n\t\t\t\t}\n\t\t\t\tif (this._scrollbar2) {\n\t\t\t\t\tthis._scrollbar2.moveToPosition(val);\n\t\t\t\t}\n\n\t\t\t}", "function processCurrentposition (data) {\n controls.setPosition(parseInt(data))\n}", "_positionCell() {\n if (this.props.inline) {\n return;\n }\n\n let position;\n if (!this.state.absolute) {\n position = this._getDialogPosition(this._dialog, this._table);\n }\n\n this.setState({ absolute: true, ...position });\n }", "set pos(newPos) {\n this._pos = newPos;\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function update_position() {\r\n if (!error_state) {\r\n if (prev_time + 50 < Date.now()) {\r\n prev_time = Date.now();\r\n //50 ms + 5ms to account for drift, measured to be around 5ms per update cycle.\r\n local_track.position += 55;\r\n update_controls_UI();\r\n }\r\n }\r\n }", "function moveDialog(event) {\n if (container.el) {\n container.el.style.left = Math.min(\n Math.max(container.elStartX + event.clientX - container.mouseStartX, offWindow ? (border - container.el.getBoundingClientRect().width) : 0),\n window.innerWidth - (offWindow ? border : container.el.getBoundingClientRect().width)\n ) + 'px';\n \n container.el.style.top = Math.min(\n Math.max(container.elStartY + event.clientY - container.mouseStartY, 0),\n window.innerHeight - (offWindow ? border : container.el.getBoundingClientRect().height)\n ) + 'px';\n }\n}", "function reposition() {\r\n\tvar modal = jQuery(this),\r\n\tdialog = modal.find('.modal-dialog');\r\n\tmodal.css('display', 'block');\r\n\t\r\n\t/* Dividing by two centers the modal exactly, but dividing by three \r\n\t or four works better for larger screens. */\r\n\tdialog.css(\"margin-top\", Math.max(0, (jQuery(window).height() - dialog.height()) / 2));\r\n}", "_updatePosFromCenter() {\n let half = this._size.$multiply(0.5);\n this._topLeft = this._center.$subtract(half);\n this._bottomRight = this._center.$add(half);\n }", "updatePosition() {\n this.handleWrapping();\n this.x += this.vx;\n }", "function reposition() {\n var modal = $(this),\n dialog = modal.find('.modal-dialog');\n modal.css('display', 'block');\n \n // Dividing by two centers the modal exactly, but dividing by three \n // or four works better for larger screens.\n dialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 2));\n}", "reposition_dialogs() {\n // Get info about image wrapper\n var imwrap = jquery_default()(\"#\" + this.config[\"imwrap_id\"]);\n const new_dimx = imwrap.width();\n const new_dimy = imwrap.height();\n\n // Get current subtask for convenience\n let crst = this.state[\"current_subtask\"];\n\n // Iterate over all visible dialogs and apply new positions\n for (var id in this.subtasks[crst][\"state\"][\"visible_dialogs\"]) {\n let el = this.subtasks[crst][\"state\"][\"visible_dialogs\"][id];\n let jqel = jquery_default()(\"#\" + id);\n let new_left = el[\"left\"]*new_dimx;\n let new_top = el[\"top\"]*new_dimy;\n switch(el[\"pin\"]) {\n case \"center\":\n new_left -= jqel.width()/2;\n new_top -= jqel.height()/2;\n break;\n case \"top-left\":\n // No need to adjust for a top left pin\n break;\n default:\n // TODO top-right, bottom-left, bottom-right\n // top/bottom-center? center-left/right?\n break;\n }\n \n // Enforce that position be on the underlying image\n // TODO\n \n // Apply new position\n jqel.css(\"left\", new_left + \"px\");\n jqel.css(\"top\", new_top + \"px\"); \n }\n }", "function setPosition() {\n\n var bottom = window.innerHeight-startBottom-y;\n bottom = (bottom>0)? bottom : 0;\n bottom = ((bottom+elem[0].getBoundingClientRect().height)<window.innerHeight)?bottom:(window.innerHeight-elem[0].getBoundingClientRect().height-40);\n\n var right = window.innerWidth-startRight-x;\n right = (right>0)? right : 0;\n right = ((right+elem[0].getBoundingClientRect().width)<window.innerWidth)?right:(window.innerWidth-elem[0].getBoundingClientRect().width);\n\n elem.css({\n bottom: bottom + 'px',\n right: right + 'px'\n });\n }", "setPosition(position) {\n this.position = position;\n }", "function setPosition() {\n if (container) {\n if (x < container.left) {\n x = container.left;\n } else if (x > container.right - width) {\n x = container.right - width;\n }\n if (y < container.top) {\n y = container.top;\n } else if (y > container.bottom - height) {\n y = container.bottom - height;\n }\n }\n\n elem.css({\n top: y + 'px',\n left: x + 'px'\n });\n }", "function sync(dom, pos) {\r\n dom.style.left = `${pos.x}px`;\r\n dom.style.top = `${pos.y}px`;\r\n}", "refresh() {\n this.viewDiv.node().style.top = this._position.y + \"px\";\n this.viewDiv.node().style.left = this._position.x + \"px\";\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "setPosition(newX=this.x, newY=this.y) {\n this.x = newX;\n this.y = newY;\n this.updateEdges() // Update Edge positions\n this.setAnchorPostion(this, newX, newY); // Update DOM element\n }", "function setPosition (x, y, width, height) {\n if (x == 'fullscreen') {\n svl.ui.popUpMessage.box.css({\n left: 0,\n top: 0,\n width: '960px',\n height: '680px',\n zIndex: 1000\n });\n } else if (x == 'canvas-top-left') {\n svl.ui.popUpMessage.box.css({\n left: 365,\n top: 122,\n width: '360px',\n height: '',\n zIndex: 1000\n });\n } else {\n svl.ui.popUpMessage.box.css({\n left: x,\n top: y,\n width: width,\n height: height,\n zIndex: 1000\n });\n }\n\n return this;\n }", "@action\n cancelUpdatePosition() {\n this.showPositionDialog = false;\n this.earlySlot = null;\n }", "validatePositioning() {\n if (!this.positioningValid) {\n this.calculateAndSetPopupPosition();\n }\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function setPos()\n {\n vm.moverStyle.left = vm.themeStyle.left;\n vm.moverStyle.top = vm.themeStyle.top;\n vm.moverStyle.display = vm.themeStyle.display;\n }", "function updatePos(drop_m, drop_v, dx, dy){\n drop_m.x += dx;\n drop_m.y += dy;\n \n drop_v.css({\n 'left': drop_m.x + 'px',\n 'top': drop_m.y + 'px'\n });\n}", "updatePositions() {\n this.simcirWorkspace.updatePositions();\n }", "updatePosition() {\n\t\tif ( this.numberOfPanels ) {\n\t\t\tconst { top, left } = this._balloonPanelView;\n\t\t\tconst { width, height } = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__[\"default\"]( this._balloonPanelView.element );\n\n\t\t\tObject.assign( this, { top, left, width, height } );\n\t\t}\n\t}", "_updatePosFromBottom() {\n this._topLeft = this._bottomRight.$subtract(this._size);\n this._updateCenter();\n }", "calculateAndSetPopupPosition() {\n this.measureDOMNodes();\n\n const { selfWidth, selfHeight, targetWidth, targetHeight, targetLeft, targetTop, viewportWidth, viewportHeight } = this;\n\n const newPositions = this.props.positionFunction(\n selfWidth,\n selfHeight,\n targetWidth,\n targetHeight,\n targetLeft,\n targetTop,\n viewportWidth,\n viewportHeight\n );\n\n const { newLeft, newTop } = newPositions;\n\n this.movePopover(newLeft, newTop);\n this.positioningValid = true;\n }", "setPosition(position)\n {\n this.position = position;\n }", "setAbsolutePosition(posX, posY) {\n this.position = { x: posX, y: posY };\n }", "function updatePositions(canvasTop) {\n // set positions using parameter\n $(\"#numInput\").css({\n top: canvasTop + 180\n });\n $(\"#convertBtn\").css({\n top: canvasTop + 210\n });\n }", "updatePosition() {\n console.log('update position');\n const xValue = this.IMAGE_WIDTH_ * this.currentIndex_;\n this.imageContainer_.style.left = -xValue;\n }", "newPosition(position) {\n this.position = position;\n }", "function setPosition() {\n if (newsletter) {\n if (x < newsletter.left) {\n x = newsletter.left;\n } else if (x > newsletter.right - width) {\n x = newsletter.right - width;\n }\n if (y < newsletter.top) {\n y = newsletter.top;\n } else if (y > newsletter.bottom - height) {\n y = newsletter.bottom - height;\n }\n }\n\n elem.css({\n top: y + 'px',\n left: x + 'px'\n });\n }", "function updateTimelinePosition() {\r\n\tupdatePosition('updateTimelinePosition', '#timeline > .video-container');\r\n}", "updatePos(token, tObj) {\n tObj.xPos = token.get('left');\n tObj.yPos = token.get('top');\n }", "function setProgressOverlayPosition() {\n\n var overlayWidth = $(\"#progressWrapper\").width();\n var overlayHeight = $(\"#progressWrapper\").height();\n\n var windowWidth = verge.viewportW();\n var windowHeight = verge.viewportH();\n \n var sideDistance = (windowWidth - overlayWidth) / 2;\n var topDistance = (windowHeight - overlayHeight) / 2;\n\n $(\"#progressOverlay\").css(\"left\", sideDistance + \"px\");\n $(\"#progressOverlay\").css(\"top\", topDistance + \"px\");\n}", "function setPosition(e) {\n var rect = canvas.getBoundingClientRect();\n pos.x = e.clientX - rect.left;\n pos.y = e.clientY - rect.top;\n }", "function setPosition() {\n let container = keysIndicator.container;\n container.show();\n let parent = container.get_parent();\n if (parent)\n parent.remove_actor(container);\n\n let side = setting.get_string('position-side');\n let index = setting.get_int('position-index');\n\n switch (side) {\n case 'left':\n Main.panel._leftBox.insert_child_at_index(container, index);\n break;\n case 'right':\n Main.panel._rightBox.insert_child_at_index(container, index);\n break;\n default:\n Main.panel._rightBox.insert_child_at_index(container, index);\n }\n\n let destroyId = keysIndicator.connect('destroy', Lang.bind(this, function(emitter) {\n emitter.disconnect(destroyId);\n container.destroy();\n }));\n}", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.position.x = newPosition.x;\n this.position.y = newPosition.y;\n }\n}", "update () {\n this.position = [this.x, this.y];\n }", "update() {\n if (this.showSelection && this.position) {\n // var screenPosition = this.computeScreenSpacePosition(this.position, screenPosition);\n var screenPosition = SceneTransforms.wgs84ToWindowCoordinates(this.scene, this.position);\n if (!screenPosition) {\n this._screenPositionX = offScreen;\n this._screenPositionY = offScreen;\n } else {\n var container = this._container;\n var containerWidth = container.clientWidth;\n var containerHeight = container.clientHeight;\n var indicatorSize = this._selectionIndicatorElement.clientWidth;\n var halfSize = indicatorSize * 0.5;\n screenPosition.x =\n Math.min(\n Math.max(screenPosition.x, -indicatorSize),\n containerWidth + indicatorSize\n ) - halfSize;\n screenPosition.y =\n Math.min(\n Math.max(screenPosition.y, -indicatorSize),\n containerHeight + indicatorSize\n ) - halfSize;\n this._screenPositionX = Math.floor(screenPosition.x + 0.25) + \"px\";\n this._screenPositionY = Math.floor(screenPosition.y + 0.25) + \"px\";\n }\n }\n }", "updatePositions(){\n this.api.get_positions(this.apiPositionListener)\n }", "function setPosition() {\n if (container) {\n if (x < 0) {\n //out of left scope\n x = 0;\n } else if (x > container.width - width) {\n //out of right scope\n x = container.width - width;\n }\n if (y < 0) {\n //out of top scope\n y = 0;\n } else if (y > container.height - height) {\n //out of bottom scope\n y = container.height - height;\n }\n }\n elem.css({\n top: y + 'px',\n left: x + 'px'\n });\n }", "set_drawing_position() {\n push()\n translate(this.module_x, this.module_y)\n }", "update() {\n super.update();\n this.move();\n }", "function setAbsolutePosition() {\n var top = $(this).position().top + $boundary.scrollTop();\n var width = $(this).innerWidth();\n\n // store current yPos\n positions.unshift(top);\n // move to absolute positioning\n $(this)\n .css({\n position: 'absolute',\n top: top,\n width: width\n });\n }", "function update() {\n updatePosition();\n checkBounds();\n }", "function setpostion(newPostion) {\n setPosition(newPostion);\n }", "function updatePosition(x, y) {\n queen.position.xcor = x;\n queen.position.ycor = y;\n}", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x;\n this.y = newPosition.y;\n }\n}", "resetPos(){\n this.addX(this.getX());\n this.addY(this.getY());\n }", "set position(position) {\n // update the unit's position\n if(this._unit !== null) {\n this._unit.position = {\n x: position.x + 5,\n y: position.y + 5\n }\n }\n this._position = position\n\n // update the svg positions\n this._svg.clickArea\n .attr(\"x\", this._position.x)\n .attr(\"y\", this._position.y)\n\n this._svg.background\n .attr(\"x\", this._position.x)\n .attr(\"y\", this._position.y)\n }", "function updatePosition(ev) {\n\tev = ev || window.event;\n\tev.preventDefault();\n\tpos1 = pos3 - ev.clientX;\n\tpos2 = pos4 - ev.clientY;\n\tpos3 = ev.clientX;\n\tpos4 = ev.clientY;\n\n\tt.style.top = (t.offsetTop - pos2) + 'px';\n\tt.style.left = (t.offsetLeft - pos1) + 'px';\n\n}", "setPos(x,y){\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}", "setPositioning() {\n const currentBox = this.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const availableBottom = viewportHeight - currentBox.bottom;\n this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below;\n this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position;\n this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;\n }", "function repositionTooltip() {\n\t\t\ttipController.resetPosition(element);\n\t\t}", "_setPosition() {\n var position = this._getPositionClass(this.template),\n $tipDims = Foundation.Box.GetDimensions(this.template),\n $anchorDims = Foundation.Box.GetDimensions(this.$element),\n direction = (position === 'left' ? 'left' : ((position === 'right') ? 'left' : 'top')),\n param = (direction === 'top') ? 'height' : 'width',\n offset = (param === 'height') ? this.options.vOffset : this.options.hOffset,\n _this = this;\n\n if (($tipDims.width >= $tipDims.windowDims.width) || (!this.counter && !Foundation.Box.ImNotTouchingYou(this.template))) {\n this.template.offset(Foundation.Box.GetOffsets(this.template, this.$element, 'center bottom', this.options.vOffset, this.options.hOffset, true)).css({\n // this.$element.offset(Foundation.GetOffsets(this.template, this.$element, 'center bottom', this.options.vOffset, this.options.hOffset, true)).css({\n 'width': $anchorDims.windowDims.width - (this.options.hOffset * 2),\n 'height': 'auto'\n });\n return false;\n }\n\n this.template.offset(Foundation.Box.GetOffsets(this.template, this.$element,'center ' + (position || 'bottom'), this.options.vOffset, this.options.hOffset));\n\n while(!Foundation.Box.ImNotTouchingYou(this.template) && this.counter) {\n this._reposition(position);\n this._setPosition();\n }\n }", "set position(value) {\n this.position$.next(value);\n }" ]
[ "0.757042", "0.7461063", "0.7111469", "0.70222586", "0.68252146", "0.6813239", "0.67854536", "0.6779687", "0.66002077", "0.6576248", "0.65392804", "0.65336835", "0.651607", "0.6513099", "0.6494823", "0.6448593", "0.6428878", "0.64042133", "0.6372772", "0.63476413", "0.62613887", "0.6218669", "0.6202136", "0.6174724", "0.6126299", "0.6113116", "0.6086181", "0.6068949", "0.60607594", "0.6059079", "0.60581493", "0.60579157", "0.6051592", "0.603519", "0.60187644", "0.6003225", "0.6001175", "0.59935194", "0.5991085", "0.5989117", "0.5988519", "0.5988519", "0.5988519", "0.59774816", "0.5973395", "0.59580505", "0.59527564", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5950084", "0.5939458", "0.5933581", "0.5924398", "0.59164417", "0.59054416", "0.5903292", "0.59014267", "0.589841", "0.58809274", "0.58586484", "0.5854744", "0.583982", "0.5821151", "0.5813899", "0.58073497", "0.58067393", "0.58048373", "0.58016044", "0.5785798", "0.5780298", "0.5759515", "0.57542", "0.5740486", "0.57371944", "0.5715793", "0.57157093", "0.5713517", "0.57115215", "0.5701821", "0.5699198", "0.5688322", "0.5687884", "0.5683253", "0.56715643", "0.56711185", "0.56699264", "0.5663313" ]
0.0
-1
Updates the dialog's width and height.
updateSize(width = '', height = '') { this._ref.updateSize(width, height); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateSize() {\n this.w = this.ent.width + this.wo;\n this.h = this.ent.height + this.ho;\n }", "updateSize() {\n windowWidth = Math.min(\n this.handler.getMaxGameWidth(),\n window.innerWidth\n )\n windowHeight = Math.min(\n this.handler.getMaxGameHeight(),\n window.innerHeight\n )\n this.handler.getGame().setWidth(windowWidth)\n this.handler.getGame().setHeight(windowHeight)\n }", "function originalSize() {\n svg.setAttribute(\"width\", w);\n svg.setAttribute(\"height\", h);\n resizeDiv(w, h);\n\n propObj.wProp = w;\n propObj.hProp = h;\n updateProperties();\n}", "_setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }", "updateSize(width = '', height = '') {\n this._getPositionStrategy().width(width).height(height);\n this._overlayRef.updatePosition();\n return this;\n }", "triggerRedraw() {\n this.dialog.style.display = 'none';\n this.dialog.offsetHeight;\n this.dialog.style.display = 'block';\n }", "updateSize(newCanvasWidth, newCanvasHeight) {\n canvasWidth = newCanvasWidth;\n canvasHeight = newCanvasHeight;\n isCanvasDirty = true;\n }", "adjustSize () {\n this._resize();\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}", "_updateSize() {\n this._size = this._bottomRight.$subtract(this._topLeft).abs();\n this._updateCenter();\n }", "updateDimensions() {\n this.props.w = this.getWidth();\n this.props.h = this.getHeight();\n }", "_updateSize() {\n if (qx.ui.mobile.core.Blocker.ROOT == this.getLayoutParent()) {\n this.getContainerElement().style.top =\n qx.bom.Viewport.getScrollTop() + \"px\";\n this.getContainerElement().style.left =\n qx.bom.Viewport.getScrollLeft() + \"px\";\n this.getContainerElement().style.width =\n qx.bom.Viewport.getWidth() + \"px\";\n this.getContainerElement().style.height =\n qx.bom.Viewport.getHeight() + \"px\";\n } else if (this.getLayoutParent() != null) {\n var dimension = qx.bom.element.Dimension.getSize(\n this.getLayoutParent().getContainerElement()\n );\n\n this.getContainerElement().style.width = dimension.width + \"px\";\n this.getContainerElement().style.height = dimension.height + \"px\";\n }\n }", "function update() {\n resize();\n controls.update();\n }", "function updateSliderWidthAndHeight() {\n slider._width = $slider.width();\n slider._height = $slider.height();\n }", "_changeSliderSize() {\n\t\t\t\tlet width = this.model.get('width'),\n\t\t\t\t\theight = this.model.get('height');\n\n\t\t\t\tthis.$el.css({width, height});\n\t\t\t}", "function updateDimensions() {\n\n\t\twindowHeight \t\t= main.innerHeight()-350;\n\t\t\n\t\twindowWidth \t\t= virtualhand.innerWidth();\n\n\t\t/*\n\t\t * The three.js area and renderer are resized to fit the page\n\t\t */\n\t\tvar renderHeight \t= windowHeight - 5;\n\n\t\trenderArea.css({width: windowWidth, height: renderHeight});\n\n\t\trenderer.setSize(windowWidth, renderHeight);\n\n\t}", "function updateSize() {\n $svg.remove();\n var width = $element.width(),\n height = $element.height(),\n elmRatio = width/height;\n if (!height || elmRatio < ratio) {\n height = width / ratio;\n } else {\n width = height * ratio;\n }\n $svg.appendTo($element);\n $svg.css({width: width, height: height});\n }", "resize(width, height) {\n if (this.element) {\n if (!isNullOrUndefined(width) && width > 200) {\n this.element.style.width = width + 'px';\n }\n if (!isNullOrUndefined(height) && height > 200) {\n this.element.style.height = height + 'px';\n }\n if (this.viewer) {\n this.viewer.updateViewerSize();\n }\n }\n }", "updateSize(width, xPos, yPos){\n this.cardWidth = width;\n this.cardHeight = width*1.5;\n this.originX = xPos;\n this.originY = yPos;\n }", "function setSize()\n\t\t{\n\t\t\t//console.log(width, height, height/width);\n\t\t\n\t\t\t/*\n\t\t\tthat.css({\n\t\t\t\twidth : w + '%',\n\t\t\t\tpaddingTop : height/width * w + '%',\n\t\t\t\tposition : 'relative'\n\t\t\t});\n\t\t\t*/\n\t\t\t\n\t\t\t/*\n\t\t\tthat.css({\n\t\t\t\twidth : width,\n\t\t\t\theight : height\n\t\t\t});\n\t\t\t\n\t\t\tdiv_wrapper.css({\n\t\t\t\twidth :width ,\n\t\t\t\theight : height\n\t\t\t});\n\t\t\t*/\n\t\t\t\n\t\t\tdiv_ratio.css({\n\t\t\t\twidth : '100%',\n\t\t\t\tpaddingTop : height/width * 100 + '%'\n\t\t\t});\n\t\t}", "_setPickerSize() {\n const that = this,\n parentWidth = that.$.svgContainer.offsetWidth,\n parentHeight = that.$.svgContainer.offsetHeight;\n let size = Math.min(parentWidth, parentHeight) * 0.9;\n\n if (that._pickerSize !== undefined && that._pickerSize !== size) {\n that._sizeChanged = true;\n }\n else {\n that._sizeChanged = false;\n }\n\n that._pickerSize = size;\n that._measurements.radius = size / 2;\n that._measurements.innerRadius = that._measurements.radius - 10;\n\n size += 'px';\n that.$.picker.style.width = size;\n that.$.picker.style.height = size;\n }", "setSize(w, h) {\n this.width = w;\n this.height = h;\n this.DOM.el.style.width = `${this.width}px`;\n this.DOM.el.style.height = `${this.height}px`;\n }", "function updateSize() {\n innerRadius = innerRadiusArg * canvas.width / 2;\n outerRadius = outerRadiusArg * canvas.width / 2;\n \n centerX = centerXArg * canvas.width;\n centerY = centerYArg * canvas.height;\n }", "function openHelp() {\n document.getElementById(\"helpbox1\").style.width = \"100%\"; // help dialogue opens with a width of 100%\n document.getElementById(\"helpbox1\").style.height = \"100%\"; // help dialogue opens with a height of 100%\n}", "function updateWidthHeight() {\n\tvar width = (document.getElementById(\"clientText\").clientWidth - PADDING_PX) * PX_TO_INCH\n\tvar height = (document.getElementById(\"clientText\").clientHeight - PADDING_PX) * PX_TO_INCH;\n\n\tdocument.getElementById(\"width\").innerHTML = Math.round(width)\n\tdocument.getElementById(\"height\").innerHTML = Math.round(height);\n}", "function ResizeControl() {\n\t\t\t\ttry {\n\t\t\t\t\tiLog(\"ResizeControl\", \"Called\");\n\n\t\t\t\t\t// Do not update elements which have no or wrong size! (hidden)\n\t\t\t\t\tvar w = self.GetWidth();\n\t\t\t\t\tvar h = self.GetHeight();\n\t\t\t\t\tif (w < 1 || h < 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tinput.width(w).height(h);\n\t\t\t\t\tspan.width(w).height(h);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"ResizeControl\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function updateCanvasSize() {\n canvasContainer.style.width = \"100vw\";\n var size = getCanvasSize();\n if (fullscreenCheckbox.checked) {\n canvasContainer.style.height = \"100%\";\n canvasContainer.style.maxWidth = \"\";\n canvasContainer.style.maxHeight = \"\";\n }\n else {\n size[1] = size[0] * maxHeight / maxWidth;\n canvasContainer.style.height = inPx(size[1]);\n canvasContainer.style.maxWidth = inPx(maxWidth);\n canvasContainer.style.maxHeight = inPx(maxHeight);\n }\n if (size[0] !== lastCanvasSize[0] || size[1] !== lastCanvasSize[1]) {\n lastCanvasSize = getCanvasSize();\n for (var _i = 0, canvasResizeObservers_1 = canvasResizeObservers; _i < canvasResizeObservers_1.length; _i++) {\n var observer = canvasResizeObservers_1[_i];\n observer(lastCanvasSize[0], lastCanvasSize[1]);\n }\n }\n }", "function adjustSize() {\n var\n prevW = canvasW,\n prevH = canvasH;\n canvasW = $(svgContainer).innerWidth();\n canvasH = $(svgContainer).innerHeight();\n canvasR = canvasW / canvasH;\n boxW *= canvasW / prevW ;\n boxH *= canvasH / prevH ;\n svgRoot.setAttribute( 'width', canvasW );\n svgRoot.setAttribute( 'height', canvasH );\n //console.log('called adjustSize: '+canvasW+' '+canvasH);\n }", "function ResizeDialog(width,height)\r\n{\r\n\tvar vOpener=window.opener;\r\n\tif(vOpener==\"undefined\" || vOpener==null)//modal dialog\r\n\t{\r\n\t\twindow.dialogWidth=width+\"px\";\t\r\n\t\twindow.dialogHeight=height+\"px\";\r\n\t\twindow.dialogTop=(screen.height-height)/2 + \"px\";\r\n\t\twindow.dialogLeft=(screen.width-width)/2 + \"px\";\r\n\t}\r\n\telse //normal window\r\n\t{\r\n\t\twindow.moveTo((screen.width-width)/2,(screen.height-height-76)/2)\t\t\r\n\t\twindow.resizeTo(width,height+76)\r\n\t}\r\n}", "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\t\tvar W = myCanvas.width;\n\t\tvar H = myCanvas.height;\n\n\t\tif((dataBase.length + 1) * (spacing + fontSize) + 3*marg > H) {\n\t\t\t$scope.set(\"DrawingArea:height\", Math.ceil((dataBase.length + 1) * (spacing + fontSize) + 3*marg));\n\t\t\tH = Math.ceil((dataBase.length + 1) * (spacing + fontSize) + 3*marg);\n\t\t}\n\n\t\tdrawW = W;\n\t\tdrawH = H;\n\n\t\tdrawBackground(W,H);\n\n\t\tvar iv = $scope.gimme(\"InputVector\");\n\t\tvar t = \"\";\n\t\tif(iv.length <= 0 && dataBase.length <= 0) {\n\t\t\tt = \"No data\";\n\t\t}\n\t\telse {\n\t\t\tt = dataBase.length.toString() + \" vectors. \" + iv.length.toString() + \" data items in selected vector.\";\n\t\t}\n\n\t\tvar maxTW = 0;\n\t\tctx.font = fontSize + \"px Arial\";\n\t\tctx.fillStyle = \"black\";\n\t\tvar tw = legacyDDSupLib.getTextWidthCurrentFont(ctx, t);\n\t\tif(tw > maxTW) {\n\t\t\tmaxTW = tw;\n\t\t}\n\n\t\tvar x = 0;\n\t\tif(tw < drawW) {\n\t\t\tMath.floor(x = (drawW - tw) / 2);\n\t\t}\n\t\tvar y = marg;\n\t\tctx.fillText(t, x, y + fontSize);\n\n\t\tfor(var i = 0; i < dataBase.length; i++) {\n\t\t\tt = dataBase[i][0];\n\n\t\t\tif(i == selectedIdx) {\n\t\t\t\tctx.font = \"bold \" + fontSize + \"px Arial\";\n\t\t\t\tctx.fillStyle = \"red\";\n\t\t\t}\n\n\t\t\tvar tw = legacyDDSupLib.getTextWidthCurrentFont(ctx, t);\n\t\t\tif(tw > maxTW) {\n\t\t\t\tmaxTW = tw;\n\t\t\t}\n\n\t\t\tvar x = marg;\n\t\t\tvar y = marg*2 + (i + 1) * (spacing + fontSize);\n\n\t\t\tctx.fillText(t, x, y + fontSize);\n\n\t\t\tif(i == selectedIdx) {\n\t\t\t\tctx.font = fontSize + \"px Arial\";\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t}\n\t\t}\n\n\t\tif(maxTW + 2*marg > W) {\n\t\t\t$scope.set(\"DrawingArea:width\", Math.ceil(maxTW + 2*marg));\n\t\t}\n\t}", "changeSizeRond(val) {\r\n this.cercle.style.width = val + \"px\";\r\n this.cercle.style.height = val + \"px\";\r\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 updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar plotDirty = false;\n\t\tif(plotCanvas === null) {\n\t\t\tplotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#thePlotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tplotCanvas = myCanvasElement[0];\n\t\t\t} else {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(plotCanvas.width != rw) {\n\t\t\tplotDirty = true;\n\t\t\tplotCanvas.width = rw;\n\t\t}\n\t\tif(plotCanvas.height != rh) {\n\t\t\tplotDirty = true;\n\t\t\tplotCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t// $log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\t// $log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "_resize() {\n this.width = this._context.canvas.width;\n this.height = this._context.canvas.height;\n this.dirty = true;\n }", "function showDialog() {\n var dialog = app.dialogs.add({ name: \"Set Width of Figures\" });\n\n with (dialog.dialogColumns.add()) {\n with (dialogRows.add()) {\n staticTexts.add({\n staticLabel:\n \"Set the widths of each figure type based on percentage of the width of the text frame.\"\n });\n }\n with (dialogRows.add()) {\n with (dialogColumns.add()) {\n staticTexts.add({ staticLabel: \"Inline Figures: \" });\n }\n\n with (dialogColumns.add()) {\n var largeImageWidthPercentageField = percentEditboxes.add({\n editValue: COLUMN_SIZE_DEFAULT_LARGE\n });\n }\n }\n with (dialogRows.add()) {\n with (dialogColumns.add()) {\n staticTexts.add({ staticLabel: \"Figure Thumbnails: \" });\n }\n\n with (dialogColumns.add()) {\n var smallImageWidthPercentageField = percentEditboxes.add({\n editValue: COLUMN_SIZE_DEFAULT_SMALL\n });\n }\n }\n }\n\n if (!dialog.show()) return; // TODO why 0?\n\n return {\n largeImageWidthPercentage: largeImageWidthPercentageField.editValue,\n smallImageWidthPercentage: smallImageWidthPercentageField.editValue\n };\n}", "_updateElementSize() {\n if (!this._pane) {\n return;\n }\n const style = this._pane.style;\n style.width = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.width);\n style.height = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.height);\n style.minWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.minWidth);\n style.minHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.minHeight);\n style.maxWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.maxWidth);\n style.maxHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.maxHeight);\n }", "function setWidth() {\n\tvar infoWindowData = viewModel.infoWindowData;\n\tvar $fsInfo = $('.foursquare-info');\n\tvar currentWidth = ($fsInfo.width() + img.photoSize() + 5) + 'px';\n\tinfoWindowData.width(currentWidth);\n}", "adjustIframe(size) {\n if (this.state.fullScreen) {\n return\n }\n\n this.iFrameWindow.setAttribute('width', size.width + '')\n this.iFrameWindow.setAttribute('height', size.height + '')\n // const bounds = this.wrapper.getBoundingClientRect()\n const w = Math.min(window.innerWidth * SpecialGlobals.editCode.popup.maxWidth, size.width)\n const h = Math.min(window.innerHeight * SpecialGlobals.editCode.popup.maxHeight, size.height)\n if (this.props.isPopup && this.props.isPlaying) {\n this.wrapper.style.width = w + 'px'\n this.wrapper.style.height = h + 'px'\n } else this.wrapper.style.width = '100%'\n // height will break minimize\n // this.wrapper.style.height = size.height + \"px\"\n // this.wrapper.style.height = \"initial\"\n\n const dx = w - this.iFrameWindow.innerWidth\n const dy = h - this.iFrameWindow.innerHeight\n this.clientX += dx\n this.clientY += dy\n this.forceUpdate()\n }", "_updateRendering() {\n this._domElement.style.width = this._width + 'px'\n this._domElement.style.height = this._height + 'px'\n this._adjustAll()\n }", "function imageEditorApplySize (w, h) {\r\n //min dimensions\r\n if (w < 300 || typeof(w) == \"undefined\")\r\n w = 300;\r\n if (h < 300 || typeof(h) == \"undefined\")\r\n h = 300;\r\n $('#fancybox-outer', top.document).width(Number(w) + 120);\r\n $('#fancybox-outer', top.document).height(Number(h) + 75);\r\n $('#fancybox-wrap', top.document).width(Number(w) + 120);\r\n $('#fancybox-wrap', top.document).height(Number(h) + 75);\r\n $('#fancybox-inner', top.document).width(Number(w) + 120);\r\n $('#fancybox-inner', top.document).height(Number(h) + 75);\r\n parent.jQuery.fancybox.center();\r\n }", "function InitGraphSize(w, h) {\n document.getElementById(w).value = GetViewportWidth();\n document.getElementById(h).value = GetViewportHeight();\n}", "updateDimensions() {\r\n\t\tthis.setState({ width: window.innerWidth, height: window.innerHeight });\r\n\t}", "_resizeHandler() {\n const that = this;\n\n that.$.container.style.width = that.$.container.style.height = Math.min(that.offsetWidth, that.offsetHeight) + 'px';\n }", "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n}", "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n}", "set width(width) {\n this._width = width;\n this.updateSize();\n }", "setSize() {\n this.size = this.fixHeight;\n }", "function updateSize()\n{\n\ttry\n {\n $(svgParent).width($(\"#view\").width());\n viewWidth=$('#svg').width();\n viewHeight=$('#svg').height();\n updateViewBox();\n }\n catch(e)\n {\n\n }\n}", "function _update_window_dimensions() {\n var uwidth;\n var uheight;\n if (main_outer_ref && main_outer_ref.current) {\n uheight = window.innerHeight - main_outer_ref.current.offsetTop;\n uwidth = window.innerWidth - main_outer_ref.current.offsetLeft;\n } else {\n uheight = window.innerHeight - USUAL_TOOLBAR_HEIGHT;\n uwidth = window.innerWidth - 2 * MARGIN_SIZE;\n }\n mDispatch({\n type: \"change_multiple_fields\",\n newPartialState: {\n usable_height: uheight,\n usable_width: uwidth\n }\n });\n }", "function resize(width, height) {\n JFCustomWidget.requestFrameResize({\n width: width,\n height: height,\n })\n}", "updateInputWidth() {\n let me = this,\n inputWidth = me.getInputWidth(),\n vdom = me.vdom;\n\n if (inputWidth !== null && inputWidth !== me.width) {\n vdom.cn[1].width = inputWidth;\n } else {\n delete vdom.cn[1].width;\n }\n\n me.vdom = vdom;\n }", "setSize(width, height) {\n if (this._editor) {\n this._editor.setSize(width, height);\n }\n }", "function calculateSize(resizing) {\n debug('calculateSize');\n\n modal.wrapper = modal.contentWrapper.children('div:first');\n\n resized.width = false;\n resized.height = false;\n if (false && !currentSettings.windowResizing) {\n initSettingsSize.width = currentSettings.width;\n initSettingsSize.height = currentSettings.height;\n }\n \n if (currentSettings.autoSizable && (!currentSettings.width || !currentSettings.height)) {\n modal.contentWrapper\n .css({\n opacity: 0,\n width: 'auto',\n height: 'auto'\n })\n .show();\n var tmp = {\n width: 'auto',\n height: 'auto'\n };\n if (currentSettings.width) {\n tmp.width = currentSettings.width;\n } else if (currentSettings.type == 'iframe') {\n tmp.width = currentSettings.minWidth;\n }\n \n if (currentSettings.height) {\n tmp.height = currentSettings.height\n } else if (currentSettings.type == 'iframe') {\n tmp.height = currentSettings.minHeight;\n }\n \n modal.content.css(tmp);\n if (!currentSettings.width) {\n currentSettings.width = modal.content.outerWidth(true);\n resized.width = true;\n }\n if (!currentSettings.height) {\n currentSettings.height = modal.content.outerHeight(true);\n resized.height = true;\n }\n modal.contentWrapper.css({opacity: 1});\n if (!resizing)\n modal.contentWrapper.hide();\n }\n\n if (currentSettings.type != 'image' && currentSettings.type != 'swf') {\n currentSettings.width = Math.max(currentSettings.width, currentSettings.minWidth);\n currentSettings.height = Math.max(currentSettings.height, currentSettings.minHeight);\n }\n\n var outerWrapper = getOuter(modal.contentWrapper);\n var outerWrapper2 = getOuter(modal.wrapper);\n var outerContent = getOuter(modal.content);\n\n var tmp = {\n content: {\n width: currentSettings.width,\n height: currentSettings.height\n },\n wrapper2: {\n width: currentSettings.width + outerContent.w.total,\n height: currentSettings.height + outerContent.h.total\n },\n wrapper: {\n width: currentSettings.width + outerContent.w.total + outerWrapper2.w.total,\n height: currentSettings.height + outerContent.h.total + outerWrapper2.h.total\n }\n };\n\n if (currentSettings.resizable) {\n var maxHeight = modal.blockerVars? modal.blockerVars.height : $(window).height()\n - outerWrapper.h.border\n - (tmp.wrapper.height - currentSettings.height);\n var maxWidth = modal.blockerVars? modal.blockerVars.width : $(window).width()\n - outerWrapper.w.border\n - (tmp.wrapper.width - currentSettings.width);\n maxHeight-= currentSettings.padding*2;\n maxWidth-= currentSettings.padding*2;\n\n if (tmp.content.height > maxHeight || tmp.content.width > maxWidth) {\n // We're gonna resize the modal as it will goes outside the view port\n if (currentSettings.type == 'image' || currentSettings.type == 'swf') {\n // An image is resized proportionnaly\n var useW = currentSettings.imgWidth?currentSettings.imgWidth : currentSettings.width;\n var useH = currentSettings.imgHeight?currentSettings.imgHeight : currentSettings.height;\n var diffW = tmp.content.width - useW;\n var diffH = tmp.content.height - useH;\n if (diffH < 0) diffH = 0;\n if (diffW < 0) diffW = 0;\n var calcH = maxHeight - diffH;\n var calcW = maxWidth - diffW;\n var ratio = Math.min(calcH/useH, calcW/useW);\n calcW = Math.floor(useW*ratio);\n calcH = Math.floor(useH*ratio);\n tmp.content.height = calcH + diffH;\n tmp.content.width = calcW + diffW;\n } else {\n // For an HTML content, we simply decrease the size\n tmp.content.height = Math.min(tmp.content.height, maxHeight);\n tmp.content.width = Math.min(tmp.content.width, maxWidth);\n }\n tmp.wrapper2 = {\n width: tmp.content.width + outerContent.w.total,\n height: tmp.content.height + outerContent.h.total\n };\n tmp.wrapper = {\n width: tmp.content.width + outerContent.w.total + outerWrapper2.w.total,\n height: tmp.content.height + outerContent.h.total + outerWrapper2.h.total\n };\n }\n }\n \n if (currentSettings.type == 'swf') {\n $('object, embed', modal.content)\n .attr('width', tmp.content.width)\n .attr('height', tmp.content.height);\n } else if (currentSettings.type == 'image') {\n $('img', modal.content).css({\n width: tmp.content.width,\n height: tmp.content.height\n });\n }\n\n modal.content.css($.extend({}, tmp.content, currentSettings.css.content));\n modal.wrapper.css($.extend({}, tmp.wrapper2, currentSettings.css.wrapper2));\n\n if (!resizing)\n modal.contentWrapper.css($.extend({}, tmp.wrapper, currentSettings.css.wrapper));\n \n var scrollPos = document.body.scrollTop;\n\n if (scrollPos == 0) {\n if (window.pageYOffset)\n scrollPos = window.pageYOffset;\n else\n scrollPos = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;\n }\n \n scrollPos = scrollPos + 25;\n \n modal.contentWrapper.css('top',scrollPos + 'px')\n if (currentSettings.type == 'image' && currentSettings.addImageDivTitle) {\n // Adding the title for the image\n $('img', modal.content).removeAttr('alt');\n var divTitle = $('div', modal.content);\n if (currentSettings.title != currentSettings.defaultImgAlt && currentSettings.title) {\n if (divTitle.length == 0) {\n divTitle = $('<div>'+currentSettings.title+'</div>');\n modal.content.append(divTitle);\n }\n if (currentSettings.setWidthImgTitle) {\n var outerDivTitle = getOuter(divTitle);\n divTitle.css({width: (tmp.content.width + outerContent.w.padding - outerDivTitle.w.total)+'px'});\n }\n } else if (divTitle.length = 0) {\n divTitle.remove();\n }\n }\n\n if (currentSettings.title)\n setTitle();\n\n tmp.wrapper.borderW = outerWrapper.w.border;\n tmp.wrapper.borderH = outerWrapper.h.border;\n\n setCurrentSettings(tmp.wrapper);\n setMargin();\n }", "function getSize$2(value) {\n if (value === \"full\") {\n return {\n dialog: {\n maxW: \"100vw\",\n h: \"100vh\"\n }\n };\n }\n\n return {\n dialog: {\n maxW: value\n }\n };\n}", "canvasResize()\n {\n View.canvas.setAttribute(\"width\", this.floatToInt(window.innerWidth*0.95));\n View.canvas.setAttribute(\"height\",this.floatToInt(window.innerHeight*0.95));\n\n //update objects with the new size\n this.updateCharacterDim();\n this.updateVirusDim();\n this.updateSyringesDim();\n this.background.resize();\n\n }", "function showDialog()\r\n{\r\n\t// Create a new dialog box with a single panel\r\n\tvar dialog = new Window(\"dialog\", \"Sprite Sheet Splitter\");\r\n\tvar sizePanel = dialog.add(\"panel\", [0,0,215,180], \"Sprite Sheet Size\");\r\n\r\n\t// Number of columns\r\n\tvar numColsLabel = sizePanel.add(\"statictext\", [25,25,150,35], \"Number of columns:\");\r\n\tvar numColsText = sizePanel.add(\"edittext\", [145,24,185,43], 4);\r\n\r\n\t// Number of rows\r\n\tvar numRowsLabel = sizePanel.add(\"statictext\", [25,55,150,65], \"Number of rows:\");\r\n\tvar numRowsText = sizePanel.add(\"edittext\", [145,54,185,73], 4);\r\n\tnumRowsLabel.enabled = false;\r\n\tnumRowsText.enabled = false;\r\n\r\n\t// Checkbox for making the number of cols/rows the same\r\n\tvar equalRowsLabel = sizePanel.add(\"statictext\", [25,85,150,95], \"Equal cols/rows:\");\r\n\tvar equalRowsBox = sizePanel.add(\"checkbox\", [145,85,175,105]);\r\n\tequalRowsBox.value = true;\r\n\r\n\t// When the checkbox is clicked, enable/disable the second input box\r\n\tequalRowsBox.onClick = function()\r\n\t{\r\n\t\tnumRowsLabel.enabled = !numRowsLabel.enabled; \r\n\t\tnumRowsText.enabled = !numRowsText.enabled; \r\n\t\t\r\n\t\tif(equalRowsBox.value == true)\r\n\t\t\tnumRowsText.text = numColsText.text;\r\n\t}\r\n\r\n\t// Make the number of rows match the number of columns if necessary\r\n\tnumColsText.onChanging = function()\r\n\t{\r\n\t\tif(equalRowsBox.value == true)\r\n\t\t\tnumRowsText.text = numColsText.text; \r\n\t}\r\n\r\n\t// Buttons for OK/Cancel\r\n\tvar okButton = sizePanel.add(\"button\", [25,125,100,150], \"OK\", {name:'ok'});\r\n\tvar cancelButton = sizePanel.add(\"button\", [110,125,185,150], \"Cancel\", {name:'cancel'});\r\n\r\n\t// Event handler for OK button\r\n\tokButton.onClick = function()\r\n\t{\r\n\t\tnumCols = parseInt(numColsText.text);\r\n\t\tnumRows = parseInt(numRowsText.text);\r\n\t\tdialog.close(0);\r\n\t}\r\n\r\n\t// Event handler for Cancel button\r\n\tcancelButton.onClick = function()\r\n\t{\r\n\t\tdialog.close();\r\n\t\tuserCancelled = true;\r\n\t}\r\n\r\n\tdialog.center();\r\n\tdialog.show();\r\n}", "function changeSettings() {\n originalWidth = width;\n originalHeight = height;\n xCentreCoord = 0;\n yCentreCoord = 0;\n }", "updateDimensions() {\n\t\t// if (window.innerWidth < 500) {\n\t\t// \tthis.setState({ width: 450, height: 102 })\n\t\t// } else {\n\t\t// \tlet update_width = window.innerWidth - 100\n\t\t// \tlet update_height = Math.round(update_width / 4.4)\n\t\t// \tthis.setState({ width: update_width, height: update_height })\n\t\t// }\n\t}", "update(width, height) {\n this.width = width;\n this.height = height;\n this.rl = 0.05 * width;\n this.tb = 0.05 * height;\n }", "_updateWidth() {\n this.setState(this._getDOMDimensions());\n }", "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "resize(width, height) {\n this.canvas.width = width;\n this.canvas.height = height;\n }", "updateBox () {\n // if the user haven't enabled advanced dimens' input, return.\n if (!this.enableAdvanced.checked) {\n return\n }\n\n // else, set css properties according to the data entered into the application\n let styleHeight = this.state.height == '' ? '' : this.state.height + 'px'\n let styleWidth = this.state.width == '' ? '' : this.state.width + 'px'\n this.boxContainer.style.height = styleHeight\n this.boxContainer.style.width = styleWidth\n this.heightInput.value = this.state.height\n this.widthInput.value = this.state.width\n }", "function updateSvgSize() {\n let g = document.getElementById('graph');\n width = g.clientWidth;\n height = g.clientHeight;\n}", "resize(w, h) {\n\n let c = this.canvas;\n let x, y;\n let width, height;\n\n // Find the best multiplier for\n // square pixels\n let mul = Math.min(\n (w / c.width) | 0, \n (h / c.height) | 0);\n \n // Compute properties\n width = c.width * mul;\n height = c.height * mul;\n x = w/2 - width/2;\n y = h/2 - height/2;\n \n // Set style properties\n let top = String(y | 0) + \"px\";\n let left = String(x | 0) + \"px\";\n\n c.style.height = String(height | 0) + \"px\";\n c.style.width = String(width | 0) + \"px\";\n c.style.top = top;\n c.style.left = left;\n }", "function calculateSize(resizing) {\r\n\t\tdebug('calculateSize');\r\n\r\n\t\tif (!modal.wrapper)\r\n\t\t\tmodal.wrapper = modal.contentWrapper.children(':first');\r\n\r\n\t\tresized.width = false;\r\n\t\tresized.height = false;\r\n\t\tif (currentSettings.autoSizable && (!currentSettings.width || !currentSettings.height)) {\r\n\t\t\tmodal.contentWrapper\r\n\t\t\t\t.css({\r\n\t\t\t\t\topacity: 0,\r\n\t\t\t\t\twidth: 'auto',\r\n\t\t\t\t\theight: 'auto'\r\n\t\t\t\t})\r\n\t\t\t\t.show();\r\n\t\t\tvar tmp = {\r\n\t\t\t\twidth: 'auto',\r\n\t\t\t\theight: 'auto'\r\n\t\t\t};\r\n\t\t\tif (currentSettings.width) {\r\n\t\t\t\ttmp.width = currentSettings.width;\r\n\t\t\t} else if (currentSettings.type == 'iframe') {\r\n\t\t\t\ttmp.width = currentSettings.minWidth;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif (currentSettings.height) {\r\n\t\t\t\ttmp.height = currentSettings.height\r\n\t\t\t} else if (currentSettings.type == 'iframe') {\r\n\t\t\t\ttmp.height = currentSettings.minHeight;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodal.content.css(tmp);\r\n\t\t\tif (!currentSettings.width) {\r\n\t\t\t\tcurrentSettings.width = modal.content.outerWidth(true);\r\n\t\t\t\tresized.width = true;\r\n\t\t\t}\r\n\t\t\tif (!currentSettings.height) {\r\n\t\t\t\tcurrentSettings.height = modal.content.outerHeight(true);\r\n\t\t\t\tresized.height = true;\r\n\t\t\t}\r\n\t\t\tmodal.contentWrapper.hide().css({opacity: 1});\r\n\t\t}\r\n\r\n\t\tcurrentSettings.width = Math.max(currentSettings.width, currentSettings.minWidth);\r\n\t\tcurrentSettings.height = Math.max(currentSettings.height, currentSettings.minHeight);\r\n\r\n\t\tvar outerWrapper = getOuter(modal.contentWrapper);\r\n\t\tvar outerWrapper2 = getOuter(modal.wrapper);\r\n\t\tvar outerContent = getOuter(modal.content);\r\n\r\n\t\tvar tmp = {\r\n\t\t\tcontent: {\r\n\t\t\t\twidth: currentSettings.width,\r\n\t\t\t\theight: currentSettings.height\r\n\t\t\t},\r\n\t\t\twrapper2: {\r\n\t\t\t\twidth: currentSettings.width + outerContent.w.total,\r\n\t\t\t\theight: currentSettings.height + outerContent.h.total\r\n\t\t\t},\r\n\t\t\twrapper: {\r\n\t\t\t\twidth: currentSettings.width + outerContent.w.total + outerWrapper2.w.total,\r\n\t\t\t\theight: currentSettings.height + outerContent.h.total + outerWrapper2.h.total\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (currentSettings.resizable) {\r\n\t\t\tvar maxHeight = modal.blockerVars? modal.blockerVars.height : $(window).height()\r\n\t\t\t\t\t\t\t\t- outerWrapper.h.border\r\n\t\t\t\t\t\t\t\t- (tmp.wrapper.height - currentSettings.height);\r\n\t\t\tvar maxWidth = modal.blockerVars? modal.blockerVars.width : $(window).width()\r\n\t\t\t\t\t\t\t\t- outerWrapper.w.border\r\n\t\t\t\t\t\t\t\t- (tmp.wrapper.width - currentSettings.width);\r\n\t\t\tmaxHeight-= currentSettings.padding*2;\r\n\t\t\tmaxWidth-= currentSettings.padding*2;\r\n\r\n\t\t\tif (tmp.content.height > maxHeight || tmp.content.width > maxWidth) {\r\n\t\t\t\t// We're gonna resize the modal as it will goes outside the view port\r\n\t\t\t\tif (currentSettings.type == 'image') {\r\n\t\t\t\t\t// An image is resized proportionnaly\r\n\t\t\t\t\tvar diffW = tmp.content.width - currentSettings.imgWidth;\r\n\t\t\t\t\tvar diffH = tmp.content.height - currentSettings.imgHeight;\r\n\t\t\t\t\t\tif (diffH < 0) diffH = 0;\r\n\t\t\t\t\t\tif (diffW < 0) diffW = 0;\r\n\t\t\t\t\tvar calcH = maxHeight - diffH;\r\n\t\t\t\t\tvar calcW = maxWidth - diffW;\r\n\t\t\t\t\tvar ratio = Math.min(calcH/currentSettings.imgHeight, calcW/currentSettings.imgWidth);\r\n\r\n\t\t\t\t\tcalcH = Math.floor(currentSettings.imgHeight*ratio);\r\n\t\t\t\t\tcalcW = Math.floor(currentSettings.imgWidth*ratio);\r\n\t\t\t\t\t$('img#nyroModalImg', modal.content).css({\r\n\t\t\t\t\t\theight: calcH+'px',\r\n\t\t\t\t\t\twidth: calcW+'px'\r\n\t\t\t\t\t});\r\n\t\t\t\t\ttmp.content.height = calcH + diffH;\r\n\t\t\t\t\ttmp.content.width = calcW + diffW;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// For an HTML content, we simply decrease the size\r\n\t\t\t\t\ttmp.content.height = Math.min(tmp.content.height, maxHeight);\r\n\t\t\t\t\ttmp.content.width = Math.min(tmp.content.width, maxWidth);\r\n\t\t\t\t}\r\n\t\t\t\ttmp.wrapper2 = {\r\n\t\t\t\t\t\twidth: tmp.content.width + outerContent.w.total,\r\n\t\t\t\t\t\theight: tmp.content.height + outerContent.h.total\r\n\t\t\t\t\t};\r\n\t\t\t\ttmp.wrapper = {\r\n\t\t\t\t\t\twidth: tmp.content.width + outerContent.w.total + outerWrapper2.w.total,\r\n\t\t\t\t\t\theight: tmp.content.height + outerContent.h.total + outerWrapper2.h.total\r\n\t\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tmodal.content.css($.extend({}, tmp.content, currentSettings.css.content));\r\n\t\tmodal.wrapper.css($.extend({}, tmp.wrapper2, currentSettings.css.wrapper2));\r\n\r\n\t\tif (!resizing) {\r\n\t\t\tmodal.contentWrapper.css($.extend({}, tmp.wrapper, currentSettings.css.wrapper));\r\n\t\t\tif (currentSettings.type == 'image') {\r\n\t\t\t\t// Adding the title for the image\r\n\t\t\t\tvar title = $('img', modal.content).attr('alt');\r\n\t\t\t\t$('img', modal.content).removeAttr('alt');\r\n\t\t\t\tif (title != currentSettings.defaultImgAlt) {\r\n\t\t\t\t\tvar divTitle = $('<div>'+title+'</div>');\r\n\t\t\t\t\tmodal.content.append(divTitle);\r\n\t\t\t\t\tif (currentSettings.setWidthImgTitle) {\r\n\t\t\t\t\t\tvar outerDivTitle = getOuter(divTitle);\r\n\t\t\t\t\t\tdivTitle.css({width: (tmp.content.width + outerContent.w.padding - outerDivTitle.w.total)+'px'});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!currentSettings.modal)\r\n\t\t\t\tmodal.contentWrapper.prepend(currentSettings.closeButton);\r\n\t\t}\r\n\r\n\t\tif (currentSettings.title)\r\n\t\t\tsetTitle();\r\n\r\n\t\ttmp.wrapper.borderW = outerWrapper.w.border;\r\n\t\ttmp.wrapper.borderH = outerWrapper.h.border;\r\n\r\n\t\tsetCurrentSettings(tmp.wrapper);\r\n\t\tsetMargin();\r\n\t}", "function updateWidth() {\n\t\tsetMaxWidth(window.innerWidth * 0.7);\n\t}", "function _updateEditorSize() {\n // The editor itself will call refresh() when it gets the window resize event.\n if (_currentEditor) {\n $(_currentEditor.getScrollerElement()).height(_editorHolder.height());\n }\n }", "function pChangeSize(bean,aimWidth,aimHeight) {\n bean.style.width = aimWidth +_PX;\n bean.style.height = aimHeight + _PX; \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 setDivSize() {\n\t\tvar wsize = getWindowSize();\n\t\tvar winh = wsize[0] - headerH - 80;\n\t\tvar winw = wsize[1] - 110;\n\t\t$('#controls').css('height','80').css('width',winw);\n\t\tfor (var i=1; i<=maxGraphs; i++ ) {\n\t\t\t$('#graphdiv'+i).css('height','240px').css('width',winw);\n\t\t\t$('#chart'+i).css('height','240px').css('width',winw);\n\t\t}\n\t}", "function askForDimensions(){\n\n\t// Create new dialog window\n\tvar w = new Window (\"dialog\", \"Export PNG Scale\");\n\n\t// Group all inputs together\n\tvar scaleInputGroup = w.add(\"group\");\n\n\t// Put all inputs into a column\n\tscaleInputGroup.orientation = \"column\";\n\n\t// Group all width portions\n\tvar widthGroup = scaleInputGroup.add(\"group\");\n\n\t// Puts all width into a row\n\twidthGroup.orientation = \"row\"\n\n\t// Label for width\n\tvar widthLabel = widthGroup.add(\"statictext\", undefined, \"width in px\");\n\n\t// Editable text field for width\n\tvar widthField = widthGroup.add(\"edittext\", undefined, \"200\");\n\n\t// Sets number of characters allowed\n\twidthField.characters = 20;\n\n\t// Allows field to be editable\n\twidthField.active = true;\n\n\t// Group all height portions\n\tvar heightGroup = scaleInputGroup.add(\"group\");\n\n\t// Puts all height into a row\n\theightGroup.orientation = \"row\";\n\n\t// Label for height\n\tvar heightLabel = heightGroup.add(\"statictext\", undefined, \"height in px\");\n\n\t// Editable text field for width\n\tvar heightField = heightGroup.add(\"edittext\", undefined, \"200\");\n\n\t// Sets number of characters allowed\n\theightField.characters = 20;\n\n\t// Allows field to be editable\n\theightField.active = true;\n\t\n\n\t// Puts all buttons into a group\n\tvar buttonGroup = w.add(\"group\");\n\n\t// Sets all buttons into a row\n\tbuttonGroup.orientation = \"row\";\n\n\t// Aligns buttons to the left side\n\tbuttonGroup.alignment = \"left\";\n\n\t// Set confirm button\n\tvar confirmButton = buttonGroup.add(\"button\", undefined, \"OK\");\n\n\t// Create cancel button\n\tbuttonGroup.add(\"button\", undefined, \"Cancel\")\n\t\n\t// Callback to after the button has been clicked\n\tconfirmButton.onClick = function(){\n\n\t\t// Creates the scale for the height export\n\t\tvscale = parseInt(heightField.text)\n\n\t\t// Creates the scale for the width export\n\t\thscale = parseInt(widthField.text)\n\n\t\t// Closes the window\n\t\tw.close()\n\t}\n\t// Shows the window\n\tw.show ();\n}", "updateCanvasSize() {\n var w = window,\n d = document,\n documentElement = d.documentElement,\n body = d.getElementsByTagName('body')[0],\n width = w.innerWidth || documentElement.clientWidth || body.clientWidth,\n height = w.innerHeight|| documentElement.clientHeight|| body.clientHeight;\n\n this.setState({width: width, height: height});\n // if you are using ES2015 I'm pretty sure you can do this: this.setState({width, height});\n }", "setDragSize(width, height) {\n if (this.element.style.display !== 'none') {\n // Do not update size of hidden components to prevent unwanted reflows\n utils_1.setElementWidth(this.element, width);\n utils_1.setElementHeight(this.element, height);\n this._container.setDragSize(width, height);\n }\n }", "update() {\n if (!this.valid) {\n if (this.width > 0 && this.height > 0) {\n this.valid = true;\n this.dispatchEvent(Event_1.Event.getEvent(\"loaded\"));\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('loaded', this);\n // this.emit('update', this);\n }\n }\n else {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('update', this);\n }\n }", "function refreshView() {\nrefreshFlex()\n//two.width = flexWidth+200\n//two.height = flexLength+100\n\n//two.update()\n\n}", "function help_resize() {\n\t\tvar h_height = inner_size()[1];\n\t\tdocument.getElementById('general').style.height = h_height-45;\n\t\tdocument.getElementById('chat').style.height = h_height-45;\n\t\tdocument.getElementById('calendar').style.height = h_height-45;\n\t\tdocument.getElementById('inbox').style.height = h_height-45;\n\t\tdocument.getElementById('compose').style.height = h_height-45;\n\t\tdocument.getElementById('address').style.height = h_height-45;\n\t\tdocument.getElementById('folders').style.height = h_height-45;\n\t\tdocument.getElementById('search').style.height = h_height-45;\n\t\tdocument.getElementById('preferences').style.height = h_height-45;\n\t\tdocument.getElementById('credits').style.height = h_height-45;\n\t}", "function openEntry () {\n document.getElementById(\"entrybox\").style.width = \"100%\";\n document.getElementById(\"entrybox\").style.height = \"100%\";\n}", "function updateCurtainSize() {\n\t\t$(\"#main #curtain\").css(\"width\", $(\"#video-player\").width());\n\t\t$(\"#main #curtain\").css(\"height\", $(\"#video-player\").height());\n\t}", "function update_position() {\n var dlgLeft = ($(document).width()/2) - ($('#dlg-box-content-container').width()/2) - 20;\n $('#dlg-box-content-container').css('left', dlgLeft);\n $('#dlg-box-content-container').css('top', '8%');\n }", "updateDimensions() {\n const network = this._network;\n if( network ) {\n network.setSize(window.innerWidth, window.innerHeight);\n network.redraw();\n }\n const { dispatch } = this.props;\n // if(window.innerWidth<=1000)\n // dispatch(drawerStatusChange(false));\n }", "setDialogPosition() {\n if (this.$customPosition.left && this.$customPosition.top) {\n this.$dialog.style.left = this.$customPosition.left;\n this.$dialog.style.top = this.$customPosition.top;\n this.$dialog.style.right = 'auto';\n } else {\n // Dialog dimensions\n var dialogWidth = this.$dialog.offsetWidth;\n var dialogHeight = this.$dialog.offsetHeight;\n\n // Screen dimensions\n /*\n These variables check to make sure mobile is supported and scroll bar is accounted for across browsers \n */\n var cssWidth = window.innerWidth && document.documentElement.clientWidth \n ? Math.min(window.innerWidth, document.documentElement.clientWidth) : window.innerWidth || \n document.documentElement.clientWidth || \n document.getElementsByTagName('body')[0].clientWidth;\n var cssHeight = window.innerHeight && document.documentElement.clientHeight \n ? Math.min(window.innerHeight, document.documentElement.clientHeight) : window.innerHeight || \n document.documentElement.clientHeight || \n document.getElementsByTagName('body')[0].clientHeight;\n\n // Dialog position\n var topPosition = ((cssHeight - dialogHeight) / 3);\n var leftPosition = ((cssWidth - dialogWidth) / 2);;\n\n // Set positioning\n this.$dialog.style.left = leftPosition + 'px';\n this.$dialog.style.top = topPosition + 'px';\n this.$dialog.style.right = 'auto';\n }\n }", "_onExitFullscreen() {\n this.setSize(this._initWidth, this._initHeight)\n }", "scale(size) {\n document.getElementById(\"guiArea\").style.width = size + \"px\";\n }", "updateSize() {\n const _style = window.getComputedStyle(this.track);\n const inheritedFontSize = _style['font-size'];\n\n this.track.style.setProperty('--simple-switch_size', inheritedFontSize);\n }", "function resize(){\n let style_height = +getComputedStyle(canvas).getPropertyValue(\"height\").slice(0, -2); \n let style_width = +getComputedStyle(canvas).getPropertyValue(\"width\").slice(0, -2); \n\n canvas.setAttribute('height', style_height * dpi); \n canvas.setAttribute('width', style_width * dpi); \n}", "function updateWidth(w) {\r\n\tif (anySelected) {\r\n\t\tvar shape = previousSelectedShape;\r\n\t\tshape.outlineWidth = w;\r\n\t\tdrawShapes();\r\n\t}\r\n}", "setSize(_width, _height) {\n const _argLen = arguments.length;\n // Using width and height:\n if (_argLen === 2) {\n }\n // Using a point:\n else if (_argLen === 1 && _width.hasAncestor && _width.hasAncestor(HPoint)) {\n const _point = _width;\n _width = _point.x;\n _height = _point.y;\n }\n // From a rect:\n else if (_argLen === 1 && _width.hasAncestor && _width.hasAncestor(HRect)) {\n const _rect = _width;\n _width = _rect.width;\n _height = _rect.height;\n }\n this.right = this.left + _width;\n this.bottom = this.top + _height;\n this.updateSecondaryValues();\n return this;\n }", "function change_width() {\n\tvar w = document.getElementById(\"input_width\").value;\n\tvar h = document.getElementById(\"input_height\").value;\n\tvar dw = document.getElementById(\"input_dest_width\").value;\n\tvar dh = document.getElementById(\"input_dest_height\");\n\n\tdh.value = (h*dw/w)\n}", "update() {\n if (window.innerWidth != this._windowWidth) {\n this.elements.select.style.left = \"0px\";\n this.elements.select.style.width = \"0px\";\n }\n this.drawer.update();\n this.previewer.update();\n this.controller.update();\n this._windowWidth = window.innerWidth;\n }", "function updateFrame() {\r\n var iframe = parent.document.getElementById(\"iframeHelp\");\r\n var helpModule = iframe.contentWindow.document.getElementById(\"help-module\");\r\n // console.log(\"running updateframeHeight\");\r\n\r\n var newHeight = helpModule.offsetHeight + \"px\";\r\n var newWidth = helpModule.offsetWidth + \"px\";\r\n iframe.style.height = newHeight;\r\n iframe.style.width = newWidth;\r\n}", "function editPremium () {\n document.getElementById(\"editpremium\").style.width = \"100%\";\n document.getElementById(\"editpremium\").style.height = \"100%\";\n}", "function updateResize()\r\n{\r\n if (_startWidthResizing - (_mouseStartPos - _mouse_x) > 10)\r\n {\r\n newWidth = _startWidthResizing - (_mouseStartPos - _mouse_x);\r\n newTableWidth = _startTableWidthResizing - (_mouseStartPos - _mouse_x);\r\n }\r\n _objectResizing.style.width = newWidth + 'px';\r\n _objectResizingDiv.style.width = newWidth + 'px';\r\n _objectTableResizing.style.width = newTableWidth + 'px';\r\n}", "function resize() {\n\t var box = c.getBoundingClientRect();\n\t c.width = box.width;\n\t\tc.height = (typeof canvasHeight !== 'undefined') ? canvasHeight : document.body.scrollHeight;\n\t}", "function updateSize() {\n let gameArea = document.getElementById(\"game\");\n let tileProportion = 10;\n h = Math.floor(gameArea.clientHeight * 0.9);\n w = Math.floor(gameArea.clientWidth * 0.9);\n size = Math.min(h, w);\n style = gameArea.style;\n style.setProperty(\"--proportion\", `${tileProportion}`);\n style.setProperty(\"--size\", `${size}px`);\n}", "resizeTo(_width, _height) {\n if (this.rect) {\n if (this.isNumber(_width)) {\n this.rect.right = this.rect.left + _width;\n }\n if (this.isNumber(_height)) {\n this.rect.bottom = this.rect.top + _height;\n }\n this.rect.updateSecondaryValues();\n this.drawRect();\n }\n else {\n if (this.isNumber(_width)) {\n ELEM.setStyle(this.elemId, 'width', `${_width}px`);\n }\n if (this.isNumber(_height)) {\n ELEM.setStyle(this.elemId, 'height', `${_height}px`);\n }\n }\n return this;\n }", "_updateViewportSize() {\n const window = this._getWindow();\n\n this._viewportSize = this._platform.isBrowser ? {\n width: window.innerWidth,\n height: window.innerHeight\n } : {\n width: 0,\n height: 0\n };\n }" ]
[ "0.688389", "0.68189067", "0.650368", "0.64399314", "0.6436595", "0.6431291", "0.6418697", "0.6384462", "0.63689333", "0.63553935", "0.6355038", "0.6301114", "0.62491226", "0.6232512", "0.6214462", "0.6174061", "0.61720806", "0.6158587", "0.61061627", "0.6073626", "0.6051642", "0.60405827", "0.6027973", "0.6010548", "0.59868276", "0.5963039", "0.595054", "0.594969", "0.59489447", "0.5936529", "0.59308785", "0.59249836", "0.5914498", "0.59143317", "0.5910119", "0.5898788", "0.5875342", "0.58749247", "0.587273", "0.58222085", "0.58116496", "0.58052576", "0.5798766", "0.57974756", "0.57974756", "0.57943535", "0.57816863", "0.57633156", "0.5762174", "0.57542163", "0.5748313", "0.5732357", "0.5730797", "0.5730533", "0.5718952", "0.5708211", "0.56994927", "0.56962717", "0.566729", "0.5659444", "0.5657256", "0.5657256", "0.56561947", "0.56537443", "0.5652126", "0.5650585", "0.5649888", "0.5648718", "0.56435156", "0.56435007", "0.5637204", "0.5637204", "0.5629557", "0.56294304", "0.56256974", "0.561743", "0.56099826", "0.5603569", "0.56027687", "0.560177", "0.55925375", "0.55918324", "0.55845946", "0.5577322", "0.5575003", "0.55711013", "0.5567058", "0.55584323", "0.5555749", "0.55471224", "0.55425656", "0.55406994", "0.55268145", "0.5518461", "0.55167323", "0.5515078", "0.5506313", "0.55009836", "0.5500216" ]
0.60143965
23
Add a CSS class or an array of classes to the overlay pane.
addPanelClass(classes) { this._ref.addPanelClass(classes); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addPanelClasses(cssClasses) {\n if (this._pane) {\n Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceArray\"])(cssClasses).forEach(cssClass => {\n if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) {\n this._appliedPanelClasses.push(cssClass);\n this._pane.classList.add(cssClass);\n }\n });\n }\n }", "addPanelClass(classes) {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, true);\n }\n }", "addPanelClass(classes) {\n this._overlayRef.addPanelClass(classes);\n return this;\n }", "addObject(pos, classes) {\n this.grid[pos].classList.add(...classes);\n }", "function addClass(el){\r\n\tel.classList.add(\"opaque\");\r\n\r\n}", "function _addClassesOption(options, classes) {classes.forEach(function(cls){_addClassOption(options, cls)})}", "addClasses(){\n\t\tif(!this.visible) return;\n\t\t\n\t\tif(this.classes){\n\t\t\tthis.appliedClasses = this.classes;\n\t\t\tthis.element.classList.add(...this.appliedClasses);\n\t\t}\n\t}", "addClass(...classes) {\n this._props.className = classNames(this._props.className, classes);\n }", "_addClass(className) {\n this.container.className = this.container.className.split(' ')\n .concat(className)\n .join(' ');\n }", "function elementAddClass(className, selector) {\n$(selector).addClass(className);\n}", "function addC(item, className) { item.classList.add(className) }", "function addC(item, className) { item.classList.add(className) }", "function add(className, callback) {\n var a = document.getElementsByClassName(className);\n for (var i = 0; i < a.length; i++) {\n addListener(a[i], 'click', callback);\n }\n}", "function addClass(element, cls) {\n element.classList.add(cls);\n}", "function addClass(el, className) { \n el.className += className;\n }", "setClass(el, classname) {\n el.className += ' ' + classname;\n }", "function showOverlay() {\n addClass(overlay, showClass);\n reflow(overlay);\n}", "function addClass(obj, className) {\n obj.classList.add(className);\n}", "function _add (className) {\n //add class name to class names array\n this._classNames.push(className);\n\n //apply class name\n this._targetElement.className += ' ' + className;\n\n //exec\n _exec.call(this);\n }", "function add (domNode, classes) {\n classes.split(' ').forEach(function (c) {\n if (!has(domNode, c)) {\n domNode.setAttribute('class', domNode.getAttribute('class') + ' ' + c);\n }\n });\n}", "showClasses(classElements) {\n const props = this.props\n classElements.forEach(item => {\n props.classListElement.appendChild(item)\n })\n }", "function addClass(element, newClass) {\n element.classList.add(newClass);\n}", "function changeCss(className, classValue) {\n\t\tvar cssMainContainer = $('#css-modifier-container');\n\n\t\tif (cssMainContainer.length == 0) {\n\t\t\tvar cssMainContainer = $('<style id=\"css-modifier-container\"></style>');\n\t\t\tcssMainContainer.appendTo($('head'));\n\t\t}\n\t\tcssMainContainer.append(className + \" {\" + classValue + \"}\\n\");\n\t}", "appendCssClass(className, classRules) {\n\t\tconst style = document.createElement('style');\n\t\tlet classRulesString = '';\n\t\tfor(let key in classRules){\n\t\t\tclassRulesString += `${key}: ${classRules[key]}; `;\n\t\t}\n\t\tstyle.type = 'text/css';\n\t\tstyle.innerHTML = `.${className} { ${classRulesString} }`;\n\t\tdocument.getElementsByTagName('head')[0].appendChild(style);\n\t\tthis.element.classList.add(className);\n\t}", "_applyClassModifiers() {\n if (this.options.feedbackOnHover) {\n this.wrapperEl.addClass(this.options.classes.feedbackOnHover);\n }\n else {\n this.wrapperEl.removeClass(this.options.classes.feedbackOnHover);\n }\n if (this.options.backgroundInSlots) {\n this.wrapperEl.addClass(this.options.classes.backgroundInSlots);\n }\n else {\n this.wrapperEl.removeClass(this.options.classes.backgroundInSlots);\n }\n }", "function AddClass(el, cl) {\n if (HasClass(el, cl)) return;\n el.className += \" \" + cl;\n}", "function addClass(element, cls) {\n element.className +=cls+' ';\n}", "add_class(e, c)\n\t{\n\t\te && c && e.classList.add(c);\n\t}", "function clickMe (e) {\n overlay.classList.add(\"hidden\");\n}", "function addClass(elem, className) {\r\n elem.addClass(className);\r\n }", "function addClass(id, clazz) {\n $(id).classList.add(clazz);\n}", "function addingClass(element, addedClass) {\n element.classList.add(addedClass);\n }", "function addClass(e,clazz) {\n\t if(e.className!=null)\n\t e.className += ' '+clazz;\n\t else\n\t e.className = clazz;\n\t }", "function addClass(el, className) {\n if (el.classList)\n el.classList.add(className);\n else\n el.className += ' ' + className;\n}", "function addCSSClass(selector, className) {\n if (!selector.hasClass(className)) {\n selector.addClass(className);\n }\n}", "function nbAddCssClass(element, cssClass) {\n var className = element.className;\n if (className.indexOf(cssClass) !== -1) {\n // already has this class\n return;\n }\n element.className = (element.className.trim() + ' ' + cssClass);\n}", "layerize() {\n this.el.classList.add('layerize');\n this.container.classList.add('layerize');\n }", "function addClass(element, clas)\n{\n if (! hasClass(element, clas))\n element.className += ' ' + clas;\n}", "function setClass(_native8,className,add,renderer,store,playerBuilder){if(store||playerBuilder){if(store){store.setValue(className,add);}if(playerBuilder){playerBuilder.setValue(className,add);}}else if(add){ngDevMode&&ngDevMode.rendererAddClass++;isProceduralRenderer(renderer)?renderer.addClass(_native8,className):_native8['classList'].add(className);}else{ngDevMode&&ngDevMode.rendererRemoveClass++;isProceduralRenderer(renderer)?renderer.removeClass(_native8,className):_native8['classList'].remove(className);}}", "function addClass(el, cls) {\n var classes = el.className.split(' ');\n classes.push(cls);\n el.className = classes.join(' ');\n}", "function addActiveClass(sec) {\r\n sec.classList.add('your-active-class');\r\n }", "function addCssO(c,objetos){\n\tvar i=1;\n\twhile (i<arguments.length){\n\t\tdocument.querySelector(arguments[i]).classList.add(c);\n\t\ti++;\n\t}\n}", "function classAdd(me, strin) {\n me.className += \" \" + strin;\n }", "function xAddClass(e, c) {\r\n e = xGetElementById(e);\r\n if (!e)\r\n return false;\r\n if (!xHasClass(e, c))\r\n e.className += ' '+c;\r\n return true;\r\n}", "function addClass(el, clName) { if (!el) return; el.classList.add(clName); }", "function setClassOver() {\r\n\tthis.className+=\" over\";\r\n}", "addClass() {\n document.body.classList.add('learn-to-code');\n }", "function addClass(element, classToAdd) {\n var currentClassValue = element.className;\n \n if (currentClassValue.indexOf(classToAdd) == -1) {\n if ((currentClassValue === null) || (currentClassValue === \"\")) {\n element.className = classToAdd;\n } else {\n element.className += \" \" + classToAdd;\n }\n }\n}", "function addMyClass(param, classToAdd) {\r\n //if it has the class\r\n if (param.classList.contains(classToAdd)) {\r\n param.classList.remove(classToAdd);\r\n } else {\r\n //if it doesnt have the class add it\r\n var classString = param.className; // returns the string of all the classes for element\r\n var newClass = classString.concat(\" \" + classToAdd);\r\n param.className = newClass;\r\n }\r\n}", "function addClasses(el) {\n eachDom(el.querySelectorAll(\"[data-add-class]\"), function (el) {\n var cls = el.getAttribute(\"data-add-class\");\n if (cls) el.classList.add(cls);\n });\n }", "function addClasses(el) {\n eachDom(el.querySelectorAll(\"[data-add-class]\"), function (el) {\n var cls = el.getAttribute(\"data-add-class\");\n if (cls) el.classList.add(cls);\n });\n }", "function addClasses(elems, className) {\n var ln = elems.length, i;\n\n for (i = 0; i < ln; i++) {\n var elem = elems[i];\n if (elem.nodeType === 1) addClass(elem, className);\n };\n }", "function addClass(element, classToAdd) {\n var currentClassValue = element.className;\n\n if (currentClassValue.indexOf(classToAdd) == -1) {\n if (currentClassValue == null || currentClassValue === \"\") {\n element.className = classToAdd;\n } else {\n element.className += \" \" + classToAdd;\n }\n }\n}", "function addClass() {\n\tvar tiles = $$(\"#puzzlearea div\");\n\tfor(var i = 0; i < tiles.length; i++) {\n\n\t\t// adding/removing classNames based on whether they are movable\n\t\tif(canMove(tiles[i])) {\n\t\t tiles[i].addClassName(\"movablepiece\");\n\t\t} else {\n\t\t\ttiles[i].removeClassName(\"movablepiece\");\n\t\t}\n\t}\n}", "function addClass(elements, myClass) {\n \n // get all elements that match our selector\n elements = document.querySelectorAll('.'+elements);\n \n // add class to all chosen elements\n for (var i=0; i<elements.length; i++) {\n elements[i].classList.add(myClass);\n }\n }", "function openModal() {\n modal.classList.add(\"active\");\n overlay.classList.add(\"active\");\n}", "function addClass(elements, myClass) {\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 // add class to all chosen elements\n for (var i = 0; i < elements.length; i++) {\n // if class is not already found\n if ((' ' + elements[i].className + ' ').indexOf(' ' + myClass + ' ') < 0) {\n // add class\n elements[i].className += ' ' + myClass;\n }\n }\n }", "function addClass(element, classToAdd) {\n \tvar currentClassValue = element.className;\n\n \tif(currentClassValue.indexOf(classToAdd) == -1) {\n \t\tif((currentClassValue == null) || (currentClassValue === \"\")) {\n \t\t\telement.className = classToAdd;\n \t\t} else {\n \t\t\telement.className += \" \" + classToAdd;\n \t\t}\n \t}\n }", "function addAnimation(elem, animClass) {\n elem.classList.add(animClass);\n}", "function xAddClass(e, c)\n{\n if ((e=xGetElementById(e))!=null) {\n var s = '';\n if (e.className.length && e.className.charAt(e.className.length - 1) != ' ') {\n s = ' ';\n }\n if (!xHasClass(e, c)) {\n e.className += s + c;\n return true;\n }\n }\n return false;\n}", "function add(className, displayState){\r\n var elements = document.getElementsByClassName(className)\r\n\r\n for (var i = 0; i < elements.length; i++){\r\n elements[i].style.display = displayState;\r\n }\r\n}", "function trocarBG(){\n document.querySelector('.bg').classList.add('bg1')\n \n}", "function addClass(element, newClass)\n {\n \telement.className = element.className + \" \" + newClass;\n }", "function addClass(element, classesToAdd) {\t\t\n\t\tvar newClasses = classesToAdd.replace(/\\s+/g,'').split(\",\");\t\t\n\t\tvar newClassName = element.className.trim().replace(/\\s+/g,' ') + ' ';\n var len = newClasses.length;\n var ind = 0;\n\t\twhile(ind < len) { \n\t\t\tvar testTerm = new RegExp(newClasses[ind] + ' ');\n if (!testTerm.test(newClassName)) {\n\t\t\t\t//current className doesn't contain class - add it\n\t\t\t\tnewClassName += newClasses[ind] + ' ';\t\t\t\n \t\t\t}\n ind++;\n \t\t}\n\n\t\telement.className = newClassName.trim();\n \t}", "addControl(control, cssClasses ){\r\n \r\n if (!this.divExtraControls) {\r\n this.divExtraControls = document.createElement(\"div\");\r\n this.HTMLElement.appendChild(this.divExtraControls);\r\n }\r\n \r\n this.divExtraControls.appendChild(control.HTMLElement);\r\n if (cssClasses) {\r\n if (Array.isArray(cssClasses)) {\r\n cssClasses.forEach( cssClass => control.HTMLElement.classList.add(cssClass));\r\n }else {\r\n control.HTMLElement.className = cssClasses;\r\n }\r\n \r\n }\r\n \r\n }", "function addClassName(el, sClassName) {\n\tvar s = el.className;\n\tvar p = s.split(\" \");\n\tif (p.length == 1 && p[0] == \"\")\n\t\tp = [];\n\n\tvar l = p.length;\n\tfor (var i = 0; i < l; i++) {\n\t\tif (p[i] == sClassName)\n\t\t\treturn;\n\t}\n\tp[p.length] = sClassName;\n\tel.className = p.join(\" \");\n}", "function AddClass(obj,cName){ KillClass(obj,cName); return obj && (obj.className+=(obj.className.length>0?' ':'')+cName); }", "function add_css_class(dom_ob, cl) {\n var classes=dom_ob.className.split(\" \");\n\n if(!in_array(cl, classes)) {\n classes.push(cl);\n }\n\n dom_ob.className=classes.join(\" \");\n\n return classes;\n}", "function uuklassadd(node, // @param Node:\r\n classNames) { // @param String: \"class1 class2 ...\"\r\n // @return Node:\r\n node.className += \" \" + classNames; // [OPTIMIZED] // uutriminner()\r\n return node;\r\n}", "function addClass(el, className){\n removeClass(el, className);\n el.className += ' '+className;\n }", "addClass(cssClass, condition) {\n let conditionStatement = condition !== undefined ? condition : true;\n if (cssClass !== undefined && conditionStatement) {\n this.classes.push(cssClass);\n }\n }", "function initAddClasses() {\n jQuery('.tabset-holder .opener').clickClass({\n classAdd: 'active',\n addToParent: 'tabset-holder'\n });\n jQuery('.rating-opener').clickClass({\n classAdd: 'active',\n addToParent: 'user-rating'\n });\n}", "function initAddClasses() {\n jQuery('.tabset-holder .opener').clickClass({\n classAdd: 'active',\n addToParent: 'tabset-holder'\n });\n jQuery('.rating-opener').clickClass({\n classAdd: 'active',\n addToParent: 'user-rating'\n });\n}", "function putActiveClass(e) {\n removeActiveClass()\n e.classList.add(\"active\")\n}", "addClass(...classes) {\n return this.forEach((el => el.classList.add(...classes))), this;\n }", "function addElementClasses() {\n\n $(layout_classes.layout__wrapper).each(function(index, element) {\n var $wrapper = $(this),\n $header = $wrapper.children(layout_classes.layout__header),\n $drawer = $wrapper.children(layout_classes.layout__drawer);\n\n // Scroll header\n if ($header.hasClass(layout_classes.header_scroll)) {\n $wrapper.addClass(layout_classes.wrapper_has_scrolling_header);\n }\n\n // Drawer\n if ($drawer.length > 0) {\n $wrapper.addClass(layout_classes.wrapper_has_drawer);\n }\n\n // Upgraded\n if ($wrapper.length > 0) {\n $wrapper.addClass(layout_classes.wrapper_is_upgraded);\n }\n });\n }", "_setClassNames() {\n const classNames = ['osjs-window', ...this.attributes.classNames];\n if (this.id) {\n classNames.push(`Window_${this.id}`);\n }\n\n classNames.filter(val => !!val)\n .forEach((val) => this.$element.classList.add(val));\n }", "function addClass(element, className) {\n var classes = element.className.split(' ');\n if (classes.indexOf(className) == -1) {\n classes.push(className);\n }\n element.className = classes.join(' ');\n }", "function addClassToElement(element, className) {\n element.classList.add(className);\n}", "_setContainerClass(isAdd) {\n const classList = this._element.nativeElement.classList;\n const className = 'mat-drawer-container-has-open';\n if (isAdd) {\n classList.add(className);\n }\n else {\n classList.remove(className);\n }\n }", "_setContainerClass(isAdd) {\n const classList = this._element.nativeElement.classList;\n const className = 'mat-drawer-container-has-open';\n if (isAdd) {\n classList.add(className);\n }\n else {\n classList.remove(className);\n }\n }", "function interviewShow() {\n document.querySelector(\".interviews-container\").classList.add(\"show\");\n}", "function interviewShow() {\n document.querySelector(\".interviews-container\").classList.add(\"show\");\n}", "function addClassToAccountLink() {\n var element = document.getElementById(\"cas4_ileinner\");\n element.classList.add(\"ta-hover-load\");\n}", "function assignClasses(array) {\n for(let i = 0; i <= squares.length-1; i++) {\n squares[i].classList.add(array[i])\n }\n}", "function addPositionClass(position, feedback, obj){\n\tremovePositionClass(obj);\n\tobj.css( position );\n\tobj\n\t\t.addClass( feedback.vertical )\n\t\t.addClass( feedback.horizontal );\n}", "function addClass (element, classname) {\n if (element.classList) {\n element.classList.add(classname);\n } else {\n element.className += ' ' + classname;\n }\n }", "function addClassBoard(element, addedClass) {\n element.classList.remove(\"add-card\", \"save-card\", \"save-column\");\n element.classList.add(addedClass);\n}", "function addClass(element,newClassName)\n{\n var oldClassName = element.className;\n element.className = oldClassName === \"\" ? newClassName:oldClassName + \" \" + newClassName;\n}", "function changeOpacity3() {\n document.getElementById(\"cactus2\").classList.add(\"bottom\");\n}", "function classAdd(element, name) {\n var className;\n if (classContains(element, name)) {\n return;\n }\n className = element.className;\n if (className === '' || className === null || className === undefined) {\n element.className = name;\n } else {\n element.className = className + ' ' + name;\n }\n }", "function Overlay_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-vv1x9t-style\";\n\tstyle.textContent = \".overlay{position:absolute;top:0;left:0;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-index:999}.overlay--content--container.svelte-vv1x9t{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;pointer-events:none}.overlay--content--box.svelte-vv1x9t{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;max-width:100%;max-height:100%;pointer-events:auto;overflow-y:auto;background:#fff;min-width:400px}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function addClass(id,c) {\n var x = document.getElementById(id);\n if (!x.classList.contains(c))\n x.classList.add(c);\n}", "function addClass(clist,ncls) {\n\tif (clist == '')\n\t\treturn clist + ncls;\n\telse\n\t\treturn clist + ' ' + ncls;\n}", "function addClass(a, b) {\n a.addClass(b);\n }", "function addClass(object,clazz){\n if(!classExists(object,clazz)) {\n object.className += object.className ? ' ' + clazz : clazz;\n }\n}", "function addClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "function addClass(el,cls){/* istanbul ignore if */if(!cls||!(cls=cls.trim())){return;}/* istanbul ignore else */if(el.classList){if(cls.indexOf(' ')>-1){cls.split(/\\s+/).forEach(function(c){return el.classList.add(c);});}else{el.classList.add(cls);}}else{var cur=\" \"+(el.getAttribute('class')||'')+\" \";if(cur.indexOf(' '+cls+' ')<0){el.setAttribute('class',(cur+cls).trim());}}}", "addOverlay(overlay) {\n this.overlay = overlay;\n }" ]
[ "0.6802812", "0.6662932", "0.66179687", "0.65104145", "0.6420611", "0.6319864", "0.6266014", "0.6134859", "0.6133349", "0.604855", "0.6003801", "0.6003801", "0.5996183", "0.5954547", "0.5875076", "0.5859327", "0.5858932", "0.5856695", "0.5855528", "0.5831775", "0.57766855", "0.5749543", "0.5745388", "0.57437605", "0.57417655", "0.5741679", "0.57359135", "0.5728629", "0.57270473", "0.57178694", "0.5710333", "0.57076687", "0.5705679", "0.56971055", "0.56827086", "0.5678578", "0.56782323", "0.5677945", "0.5661795", "0.5655835", "0.5650612", "0.5647135", "0.564025", "0.5610965", "0.5587891", "0.5578223", "0.55736977", "0.5567242", "0.5562805", "0.5560192", "0.5560192", "0.55542547", "0.55255127", "0.55141115", "0.55132496", "0.5512132", "0.5504842", "0.54981035", "0.5490115", "0.5481978", "0.54651433", "0.54587334", "0.54561937", "0.54475075", "0.5437712", "0.5426062", "0.5425831", "0.5419701", "0.5410403", "0.5410248", "0.54093903", "0.54045004", "0.54045004", "0.54034734", "0.53938496", "0.53886133", "0.5387822", "0.53872365", "0.53773165", "0.53676176", "0.53676176", "0.53669393", "0.53669393", "0.53666097", "0.5362965", "0.5359918", "0.5358946", "0.53547853", "0.53532976", "0.5346197", "0.5345783", "0.5339734", "0.5333567", "0.53327584", "0.5331708", "0.53144586", "0.53107655", "0.53107655", "0.53064245" ]
0.55825406
45
Remove a CSS class or an array of classes from the overlay pane.
removePanelClass(classes) { this._ref.removePanelClass(classes); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }", "removePanelClass(classes) {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, false);\n }\n }", "function hideOverlay() {\n removeClass(overlay, showClass);\n}", "removeObject(pos, classes) {\n this.grid[pos].classList.remove(...classes);\n }", "function removeTurnOverlay () {\n swapTurnsOverlay.classList.remove('show');\n}", "function removeClasses(){\n body.classList.remove(\"act1\", \"act2\", \"act3\", \"act4\", \"act5\");\n}", "_removeClass(className) {\n this.container.className = this.container.className.split(' ')\n .filter(c => c !== className)\n .join(' ');\n }", "removePanelClass(classes) {\n this._overlayRef.removePanelClass(classes);\n return this;\n }", "function removeClass(el){\r\n\tel.classList.remove(\"pats-silver\");\r\n}", "function disappearALL(array){\n for (var i = 0; i < array.length; i++) {\n array[i].classList.remove(\"open\",\"show\",\"clicked\",\"match\");\n\n}}", "function removeClasses() {\n for (let i=0; i<openCards.length; i++ ) {\n openCards[i][0].classList.remove(\"open\",\"show\");\n }\n openCards = [];\n }", "function removeClass(element) {\n var elementClasses = element.className.split(\" \");\n while (elementClasses.indexOf(\"show\") > -1) {\n elementClasses.splice(elementClasses.indexOf(\"show\"), 1);\n }\n element.className = elementClasses.join(\" \");\n}", "function ClickRemoverClasse() {\n if (gEntradas.classes.length == 1) {\n Mensagem('Impossível remover classe');\n return;\n }\n gEntradas.classes.pop();\n AtualizaGeralSemLerEntradas();\n}", "unsetClass(el, classname) {\n el.className = el.className.replace(' ' + classname, '');\n }", "function RemoveColorFromClass (className){\n\n if (selectedClasses.includes(className)){\n // console.log(\"word is still locked, won't remove the color\", className);\n }\n else {\n // remove color from bars\n $(\".\" + className + '_bar')\n .css(\"fill\", colorForUnselected)\n .css(\"background\", 'transparent');\n\n // remove color from lines\n $(\".\" + className + '_line')\n .css(\"stroke\", colorForUnselected)\n .css(\"stroke-width\", \"0.2px\")\n .css(\"background\", 'transparent');\n\n // remove color from circles\n $(\".\" + className + '_circle')\n .css(\"fill\", colorForUnselected)\n .css(\"background\", 'transparent');\n\n\n // and transition back\n reduceSelectedCircle(className);\n }\n}", "function removeClasses() {\n $(\".card\").removeClass(\"show open wobble wrong\");\n removeOpenCards();\n}", "function removeClass(at, cls) {\n at.classList.remove(cls);\n}", "function removeClass(at, cls) {\n at.classList.remove(cls);\n}", "function _removeClasses($el, arr){\n for (var ix = 0; ix < arr.length; ix++)\n $el.removeClass(arr[ix])\n }", "function classRemover(){\r\n $(\"#snackNav\").removeClass();\r\n $(\"#drinkNav\").removeClass();\r\n $(\"#lunchNav\").removeClass();\r\n }", "function removeScale() {\n document.body.classList.remove(\"scale-cv\");\n}", "rem_class(e, c)\n\t{\n\t\te && c && e.classList.remove(c);\n\t}", "function remove (domNode, classes) {\n classes.split(' ').forEach(function (c) {\n var removedClass = domNode.getAttribute('class').replace(new RegExp('(\\\\s|^)' + c + '(\\\\s|$)', 'g'), '$2');\n if (has(domNode, c)) {\n domNode.setAttribute('class', removedClass);\n }\n });\n}", "function delClass(element, clas)\n{\n element.className = element.className.replace(clas, '').replace(' ', ' ');\n}", "function removeClassJS (cssClass) {\n\n\tlet el = document.querySelectorAll (\"div\");\n\tel.forEach (function (element) {\n\t\telement.addEventListener (\"click\", function () {\n\t\t\tif (this.classList.contains (cssClass)) {\n\t\t\t\tthis.classList.remove (cssClass);\n\t\t\t\tconsole.log (\"Class name '\" + cssClass + \"' removed.\")\n\t\t\t}\n\t\t\telse console.log (\"Element doesn't have that class name\");\n\t\t});\n\t});\t\n}", "function removeClasses() {\n $(\".card\").removeClass(\"show open flipInY bounceIn shake noMatch\");\n removeOpenCards();\n}", "function remove() {\n\n component.classList.add(style.fadeOut);\n setTimeout(function () { component.remove() }, 200);\n }", "function removeActiveClasses() {\n panels.forEach(panel => {\n panel.classList.remove('active')\n })\n}", "function remove() {\n 'use strict';\n ulelement.forEach(function (ulelement) {\n ulelement.classList.remove('activ');\n });\n}", "function rmvClass(el, cl) {\r\n el.classList.remove(cl)\r\n}", "function removeActiveClasses(){\n panels.forEach(panel =>{\n panel.classList.remove('active')\n })\n}", "function removeClass(element, cls) {\n element.classList.remove(cls);\n}", "function removeActiveClasses() {\n panels.forEach(panel => {\n panel.classList.remove('active');\n })\n}", "function removeClass(elemento1, elemento2, elemento3) {\n elemento1.classList.remove(\"active-choose\");\n elemento2.classList.remove(\"active-choose\");\n elemento3.classList.remove(\"active-choose\");\n}", "function removeClass(elements, myClass) {\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 // create pattern to find class name\n var reg = new RegExp('(^| )' + myClass + '($| )', 'g');\n // remove class from all chosen elements\n for (var i = 0; i < elements.length; i++) {\n elements[i].className = elements[i].className.replace(reg, ' ');\n }\n }", "function removeSelected() {\r\n arrayClass = [\r\n 'open', 'save', 'eraser', 'brush', 'line', 'curve', \r\n 'letterL', 'letterW', 'car', 'house', 'rectangle', \r\n 'circle', 'ellipse', 'hexagon', 'arrow', 'triangle', \r\n 'pentagon', 'diamond', 'fourStar', 'fiveStar'\r\n ]\r\n\r\n arrayClass.forEach(element => {\r\n let toolClass = document.getElementById(element)\r\n try {\r\n toolClass.classList.remove(\"selected\");\r\n } catch {\r\n }\r\n });\r\n}", "function removeActiveClasses(){\n panels.forEach((panel)=> {\n panel.classList.remove('active')\n })\n}", "function deleteAnimation() {\n CHOICES.forEach(el => {\n const CLASSES = document.getElementById(el).classList;\n \n if (CLASSES.length > 1) {\n CLASSES.remove(CLASSES[1])\n }\n })\n}", "function removeActiveSelectorClass() {\n var pieceSelectorButtons = document.getElementsByClassName(pieceSelectorClassName);\n for (var i = 0; i < pieceSelectorButtons.length; i++) {\n var pieceSelector = pieceSelectorButtons[i];\n pieceSelector.classList.remove(\"active\");\n }\n }", "function removeClass(element, deleteClass)\n {\n \tvar reg = new RegExp(\" \" + deleteClass,\"g\");\n \telement.className = element.className.replace(reg, '');\n }", "function removeShowElement(){var elms=document.querySelectorAll(\".introjs-showElement\");forEach(elms,function(elm){removeClass(elm,/introjs-[a-zA-Z]+/g);});}", "function xRemoveClass(e, c) {\r\n e = xGetElementById(e);\r\n if (!e)\r\n return false;\r\n if (xHasClass(e, c))\r\n e.className = e.className.replace(new RegExp('(^| )'+c+'($| )','g'), '');\r\n return true;\r\n}", "function removeActiveclasses() {\n\n // Loop through each panel\n // Remove the active class for each\n panels.forEach((panel) => {\n\n // Remove the active class on each panel.\n panel.classList.remove('active');\n })\n}", "function addPics () {\r\n\te.classList.remove(\"hidebox\")\r\n\tf.classList.remove(\"hidebox\")\r\n\ta.classList.remove(\"pulse1\")\r\n\ta.classList.remove(\"cursor\")\r\n\ta.classList.remove(\"grey\")\r\n\ta.classList.remove(\"shadow\")\r\n}", "function removeElementsByClass(className){\n var elements = document.getElementsByClassName(className);\n while(elements.length > 0){\n elements[0].parentNode.removeChild(elements[0]);\n }\n}", "function removeSelectedClass() {\n document.querySelectorAll(\".colorSelector\").forEach((element) => element.classList.remove(\"colorSelected\"));\n }", "function removeElementsByClass(className){\n var elements = document.getElementsByClassName(className);\n while(elements.length > 0){\n elements[0].parentNode.removeChild(elements[0]);\n }\n }", "function removeGreen (className) {\n if(className === 'why-android-wrapper') {\n document.getElementsByClassName(className)[0].children[0].style.cssText = '';\n document.getElementsByClassName(className)[0].children[1].style.cssText = '';\n } else {\n document.getElementsByClassName(className)[0].children[0].children[0].style.cssText = '';\n document.getElementsByClassName(className)[0].children[1].style.cssText = '';\n }\n}", "function removeClass (element, class_name) {\n\tvar class_names = element.className.split ( ' ' ), //class_name splits $html class names at spaces\n\t\tlen = class_names.length, //len = Number of class names in array\n\t\tkept_classes = []; //kept_classes = Empty array\n\twhile (len--) {\n\t\tif (class_names[len] != class_name){\n\t\t\tkept_classes.push (class_name[len]);\n\t\t}\n\t}\n\telement.className = kept_classes.join ( ' ' );\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1); \n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function _remove (className) {\n if (typeof (className) != 'undefined') {\n _removeClass.call(this, className);\n } else {\n var lastClassName = this._classNames[this._classNames.length - 1];\n\n if (typeof (lastClassName) != 'undefined') {\n _removeClass.call(this, lastClassName);\n }\n }\n\n //exec\n _exec.call(this);\n }", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\n var i, arr1, arr2;\n arr1 = element.className.split(\" \");\n arr2 = name.split(\" \");\n for (i = 0; i < arr2.length; i++) {\n while (arr1.indexOf(arr2[i]) > -1) {\n arr1.splice(arr1.indexOf(arr2[i]), 1);\n }\n }\n element.className = arr1.join(\" \");\n}", "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "removeClass(clazz) {\n this.eachElem(item => item.classList.remove(clazz));\n return this;\n }", "removeClass(clazz) {\n this.eachElem(item => item.classList.remove(clazz));\n return this;\n }", "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1); \r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "function w3RemoveClass(element, name) {\r\n var i, arr1, arr2;\r\n arr1 = element.className.split(\" \");\r\n arr2 = name.split(\" \");\r\n for (i = 0; i < arr2.length; i++) {\r\n while (arr1.indexOf(arr2[i]) > -1) {\r\n arr1.splice(arr1.indexOf(arr2[i]), 1);\r\n }\r\n }\r\n element.className = arr1.join(\" \");\r\n}", "function removeClass(selector, className) {\n const target = document.querySelectorAll(selector)\n for (let i = 0, j = target.length; i < j; i++) {\n target[i].classList.remove(className);\n }\n}", "function removeClass(elem, classN){\n\tvar myClassName=classN;\n\telem.className=elem.className.replace(myClassName,'');\n}", "function removeClass(element, classesToRemove) { \n\t\tvar classes = classesToRemove.replace(/\\s+/g,'').split(\",\");\n\t\tvar ind = classes.length;\n\t\tvar newClass = element.className.trim().replace(/\\s+/g,' ') + ' ';\n\t\twhile(ind--) { \n //remove class\n\t\t\tnewClass = newClass.replace(classes[ind] + ' ','');\n\t\t}\n\t\telement.className = newClass.trim();\n \t}", "function remove(){\n\t\tthis.classList.remove(\"red\");\n\t}", "function removeElementsByClass(className) {\n var elements = document.getElementsByClassName(className);\n while (elements.length > 0) {\n elements[0].parentNode.removeChild(elements[0]);\n }\n}", "function w3RemoveClass(element, name) {\n element.classList.remove(name);\n}", "function w3RemoveClass(element, name) {\n element.classList.remove(name);\n}", "function removeClass(elem, className) {\r\n elem.removeClass(className);\r\n }", "function test(){\ndocument.getElementById('monImage').classList.remove('hidden');\n }", "function removeClasses() {\n //loop over the array of open cards\n openCards.forEach(function(card) {\n //remove the open and show class from open cards only\n card.removeClass('open show');\n })\n openCards = []; //open crds is empty\n}", "function hideWin() {\n winContainer.classList.remove('win-screen');\n}", "function removeClass(object,clazz){\n var rep=object.className.match(' ' + clazz) ? ' ' + clazz : clazz;\n object.className=object.className.replace(rep,'');\n}", "function closeModal() {\n document.getElementById('overlay').classList.remove('show');\n}", "function removeElementsByClass(className){\n var elements = document.getElementsByClassName(className);\n while(elements.length > 0){\n elements[0].parentNode.removeChild(elements[0]);\n }\n }", "function removeClass(e,clazz) {\n\t if(e.className==null)\n\t return false;\n\t \n\t var list = e.className.split(/\\s+/);\n\t var r = [];\n\t for( var i=0; i<list.length; i++ ) {\n\t if(list[i]!=clazz) r.push(list[i]);\n\t }\n\t e.className = r.join(' ');\n\t }", "function removeAnimation(elem, animClass) {\n elem.classList.remove(animClass);\n}", "function removeOverlay() {\n if (!getCurrentOpen()) {\n removeClass(overlay, fadeClass);\n overlay.remove();\n resetScrollbar();\n }\n}", "function removeCSSClass(selector, className) {\n if (selector.hasClass(className)) {\n selector.removeClass(className);\n }\n}", "function removeClass(el, className) { \n el.className = el.className.replace(className, '');\n }", "function removeStyle (inputVar) {\n\tvar allSuchClass = document.getElementsByClassName(inputVar); // Declare a Variable Which Becomes an Array\n\tfor (i = 0; i < allSuchClass.length; i++) { // For Each Array Member Style Opacity Value\n\t\tallSuchClass[i].removeAttribute(\"style\");\n\t};\n}", "function removeSelectedClass() {\n const colorPalette = document.querySelectorAll('.color');\n\n for (let index = 0; index < colorPalette.length; index += 1) {\n colorPalette[index].classList.remove('selected');\n }\n}", "function removeClass(element, className) {\n var classes = element.className.split(' ');\n var index = classes.indexOf(className);\n if (index != -1) {\n classes.splice(index, 1);\n }\n element.className = classes.join(' ');\n }", "function unselectImages() {\r\n let chosen = document.querySelector('.chosen');\r\n chosen.classList.remove('chosen');\r\n}", "function removeClass(css_class, element) {\r\n checkParams(css_class, element, 'removeClass');\r\n var regexp = new RegExp('(\\\\s' + css_class + ')|(' + css_class + '\\\\s)|' + css_class, 'i');\r\n element.className = trim(element.className.replace(regexp, ''));\r\n }", "function xRemoveClass(e, c)\n{\n if(!(e=xGetElementById(e))) return false;\n e.className = e.className.replace(new RegExp(\"(^|\\\\s)\"+c+\"(\\\\s|$)\",'g'),\n function(str, p1, p2) { return (p1 == ' ' && p2 == ' ') ? ' ' : ''; }\n );\n return true;\n}", "function del_css_class(dom_ob, cl) {\n var classes=dom_ob.className.split(\" \");\n var p;\n\n if((p=array_search(cl, classes))!==false) {\n classes=array_remove(classes, p);\n }\n\n dom_ob.className=classes.join(\" \");\n\n return classes;\n}", "removeClass(...classes) {\n return this.forEach((el => el.classList.remove(...classes))), this;\n }", "function remCssO(c,objetos){\n\tvar i=1;\n\twhile (i<arguments.length){\n\t\tdocument.querySelector(arguments[i]).classList.remove(c);\n\t\ti++;\n\t}\n}", "function removeUnusedClasses(element) {\n\n element.classList.contains('old-out') ? element.classList.remove('old-out') : null;\n element.classList.contains('old-in') ? element.classList.remove('old-in') : null;\n element.classList.contains('new-out') ? element.classList.remove('new-out') : null;\n element.classList.contains('new-in') ? element.classList.remove('new-in') : null;\n}" ]
[ "0.702097", "0.67840517", "0.67471254", "0.67445874", "0.6681233", "0.6679959", "0.66741395", "0.6567679", "0.6562862", "0.6525584", "0.64825255", "0.64626575", "0.6422464", "0.6418374", "0.63363826", "0.6328601", "0.63218987", "0.63218987", "0.63180834", "0.6314455", "0.6313436", "0.62986326", "0.6256845", "0.6243799", "0.62417823", "0.6234915", "0.6225111", "0.6224949", "0.6221876", "0.62117153", "0.62085533", "0.6192943", "0.61856836", "0.6176838", "0.616115", "0.6160545", "0.61559516", "0.6154447", "0.6145519", "0.61308223", "0.6129249", "0.6115725", "0.6115637", "0.6100976", "0.6091985", "0.60917765", "0.60872626", "0.60776806", "0.60673875", "0.6047009", "0.6047009", "0.6047009", "0.6047009", "0.6047009", "0.6047009", "0.6043568", "0.6043568", "0.6043568", "0.6043568", "0.6043568", "0.6043568", "0.6043568", "0.60434175", "0.60351837", "0.60351837", "0.6033031", "0.6033031", "0.6033031", "0.60309154", "0.60309154", "0.6029047", "0.6027809", "0.6026763", "0.60255176", "0.60252047", "0.6025106", "0.60230684", "0.60203636", "0.60203636", "0.60196257", "0.60173595", "0.6006318", "0.6005283", "0.6000608", "0.60003334", "0.59994996", "0.5997135", "0.5987913", "0.59829974", "0.5982193", "0.5981935", "0.5976563", "0.5976506", "0.59701097", "0.5969118", "0.5956306", "0.59548104", "0.5952106", "0.5947465", "0.59413177", "0.593865" ]
0.0
-1
Gets the current state of the dialog's lifecycle.
getState() { return this._state; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "state() {\n return this.eventContext.state();\n }", "function getState() {\n return state;\n }", "get state() {\n return this._current().state;\n }", "state() {\n\t\treturn this._state;\n\t}", "function getState() {\n\t\t\tvar data = this.data('timeline');\n\t\t\tif (typeof data === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttriggers = data.triggers;\n\t\t\toptions = data.options;\n\t\t\tlastScrollY = data.lastScrollY;\n\t\t}", "get() {\n return this._state\n }", "get state() {\n return this._clock.getStateAtTime(this.now());\n }", "getState() {\n return this._state;\n }", "get state() {\r\n return this._state;\r\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "get state() {\n return this._state;\n }", "function getState() {\n return currentState\n }", "get state() {\n return this._obj.state;\n }", "getState() {\n return this.state;\n }", "function getState() {\n return currentState\n }", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "function getState () {\n\t\treturn currentState;\n\t}", "get state() { return this._state; }", "get state() {\r\n\t\treturn this[propertyNames.state]\r\n\t}", "function getCurrentState() {\n\t\treturn {};\n\t}", "state() {\n return (this._state);\n }", "getInternalState ()\n {\n return this.viewerState;\n }", "function getState() {\n return currentState\n }", "get state() {\n if (!this._state)\n this.startState.applyTransaction(this);\n return this._state;\n }", "function getState() {\r\n return playerState_;\r\n }", "getState() {\n return state;\n }", "get state() { return this.viewState.state; }", "function getCurrentState() {\n return currentState;\n }", "get_state() {\n return this.state;\n }", "get State() {\r\n return _state;\r\n }", "get State() {\r\n return _state;\r\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "get state() { return this._publicState; }", "function getCurrentState() {\n return {\n thrust: state.thrust,\n rotation: state.rotation\n };\n }", "get state() {\n return this.view.state;\n }", "get state() {return this._p.state;}", "getState() {\n if (this.state) {\n return this.state;\n }\n\n if (this.options.getState instanceof Function) {\n return this.options.getState();\n }\n\n return {};\n }", "state() {\n return this.context.state;\n }", "getGameState() {\n\t\treturn this.gameState;\n\t}", "function getState() {\n return window.stokr.model.getState();\n }", "function getState() {\n return toggle.data(\"toggle\");\n }", "get state() {\n return this._initialState;\n }", "get readyState() {\n return internalSlots.get(this).readyState;\n }", "get state () {\n return this._mem.state === undefined ? C.ROOM_STATE_NORMAL : this._mem.state;\n }", "getState() {\n return this._platformLocation.getState();\n }", "function getState(){\n\t\tconsole.log('getting state');\n\t\treturn JSON.stringify(JSProblemState);\n\t}", "function getState(){\n\t\tconsole.log('getting state');\n\t\treturn JSON.stringify(JSProblemState);\n\t}", "get State() {\n return _state;\n }", "get State() {\n return _state;\n }", "get State() {\n return _state;\n }", "get State() {\n return _state;\n }", "get State() {\n return _state;\n }", "get state(){return this._state;}", "get state(){return this._state;}", "get state(){return this._state;}", "get state() {\n return this._state$ || (this.state = this.defaultState);\n }", "get gameState() {\n return this._gameState;\n }", "getGameState() {\n return this.gameState;\n }", "getGameState() {\n return this.gameState;\n }", "getState() {\n return JSON.parse(JSON.stringify(this._state));\n }", "function getStoreState() {\n return {\n results: VotingResultsStore.getResults(),\n showReturnToWorkspace: false,\n };\n}", "getActiveInputStates() {\n return controller.getAllInputStates();\n }", "getInitialState() {\n\t\treturn this.stage.getInitialStageState();\n\t}", "getState(){ return this.program.getState(); }", "function RunState() {\n // The time at which this run was performed.\n var time;\n\n // All alerts from any child workflows.\n var alerts = {};\n\n // An array of root workflows/documents for this state.\n var rootWorkflows = [];\n}", "function WorkflowState() {\n // The filename of the workflow executed.\n var filename;\n\n // Timestamp indicating when this result is valid until.\n var valid_until;\n\n // Any alerts generated during this execution.\n var alerts = [];\n\n // A tree containing the name of all of the child workflows and files used\n // to generate the output of this workflow.\n var children = {};\n\n // Structured output from this execution.\n var structuredOutput = {};\n\n // Rendered output from this execution.\n var renderedOutput = \"\";\n}", "get hasStableDialog() {\n return this.dlg && this.dlg.connected;\n }", "get appliedState() {\n return this._currentState.clone();\n }", "get state() {\n return this._wantedState;\n }", "get stateInput() {\n return this._state;\n }", "get stateInput() {\n return this._state;\n }", "getIsShown() {\n return this.currentlyShown;\n }", "getStateName() {\n return this.currentStateName;\n }", "function getEditorState() {\n\n var editorState = {};\n \n //add the data members\n editorState.pathToIdMap = pathToIdMap;\n editorState.allInsertEventsByFile = allInsertEventsByFile;\n editorState.autoGeneratedEventId = autoGeneratedEventId;\n editorState.autoGeneratedFileId = autoGeneratedFileId;\n editorState.autoGeneratedDirId = autoGeneratedDirId;\n editorState.autoGeneratedDeveloperId = autoGeneratedDeveloperId;\n editorState.autoGeneratedDeveloperGroupId = autoGeneratedDeveloperGroupId;\n \n return editorState;\n}", "status() {\n if (this.statusListeners) {\n this.statusListeners.depend();\n }\n\n return this.currentStatus;\n }", "get state() \n{ return this._state; \n}", "function getMessageState() {\n return {\n messages: MessageStore.getMessages(),\n };\n}", "function getTimerState() {\n return {\n allTimers: TimerStore.getAll()\n };\n}", "function getGameState() {\n\t\treturn gameOngoing;\n\t}", "function getUserState() {}", "get state() {\n return this.getStringAttribute('state');\n }", "get state() {\n return this.getStringAttribute('state');\n }", "get state() {\n return this.getStringAttribute('state');\n }", "get state() {\n return this.getStringAttribute('state');\n }", "_stateChanged(state) {\n console.log(state);\n }", "get wasStarted() {\n return this._started;\n }", "getCurrentScrollPosition() {\n return this._state;\n }", "function getTodoState() {\r\n return {\r\n //allTodos: TodoStore.getAll(),\r\n //areAllComplete: TodoStore.areAllComplete()\r\n tracks : PlayerStore.getAll(),\r\n currentTrack : PlayerStore.getCurrentTrack()\r\n };\r\n}", "state(){\n return this.getGuaranteedLocality('state')\n }", "function getState() {\n return JSON.parse(device.localStorage.getItem(stateKey));\n}", "function getState() {\n generalServices.addLogEvent('stateServices', 'getState', 'Start');\n return $q(function (resolve, reject) {\n var params = { sessionId: window.localStorage.sessionId, id: window.localStorage.id, loggingLevel: window.localStorage.loggingLevel };\n\n generalServices.callRestApi('/getState', params)\n .then(function (data) { // Data \n if (data.error != \"\") {\n userServices.userDataNotFoundHandler();\n reject();\n } else {\n resolve(data.state);\n }\n },\n function () { reject(); });\n });\n }" ]
[ "0.6653352", "0.6611362", "0.65158635", "0.6486249", "0.6465978", "0.64471936", "0.63721544", "0.62975746", "0.6291692", "0.6286584", "0.6286584", "0.6286584", "0.6256539", "0.616064", "0.61257744", "0.61009055", "0.60936815", "0.60936815", "0.60678", "0.6064159", "0.6029409", "0.60226756", "0.6002893", "0.59901494", "0.5975819", "0.595179", "0.5930889", "0.58686185", "0.58419466", "0.58354145", "0.5825701", "0.5783619", "0.5783619", "0.57808363", "0.57808363", "0.57808363", "0.57808363", "0.57808363", "0.5770019", "0.576764", "0.5682909", "0.56611204", "0.56566495", "0.5652929", "0.56359243", "0.56356436", "0.5629105", "0.56036234", "0.55893815", "0.5577324", "0.5561125", "0.5558174", "0.5558174", "0.55373156", "0.55373156", "0.55373156", "0.55373156", "0.55373156", "0.54934746", "0.54934746", "0.54934746", "0.5485635", "0.5426782", "0.5414729", "0.5414729", "0.5401556", "0.5401397", "0.5379367", "0.5378399", "0.5341265", "0.5340507", "0.53248423", "0.5317992", "0.53083634", "0.5307965", "0.5303975", "0.5303975", "0.53008723", "0.5299103", "0.5275476", "0.5274825", "0.52739096", "0.52728224", "0.52599037", "0.52474356", "0.5241198", "0.5239893", "0.5239893", "0.5239893", "0.5239893", "0.5238435", "0.5228647", "0.5219973", "0.5218765", "0.5214334", "0.52067137", "0.5202611" ]
0.65686625
3
Finishes the dialog close by updating the state of the dialog and disposing the overlay.
_finishDialogClose() { this._state = 2 /* MatDialogState.CLOSED */; this._ref.close(this._result, { focusOrigin: this._closeInteractionType }); this.componentInstance = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "_finishDismiss() {\n this._overlayRef.dispose();\n if (!this._onAction.closed) {\n this._onAction.complete();\n }\n this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });\n this._afterDismissed.complete();\n this._dismissedByAction = false;\n }", "close() {\n\n this.overlay.remove();\n this.overlay = null;\n\n }", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "function _close() {\n\t\tif (dialogBox) {\n\t\t\t$dialogInput.off(\"blur\");\n\t\t\tdialogBox.parentNode.removeChild(dialogBox);\n\t\t\tdialogBox = null;\n\t\t}\n\t\tEditorManager.focusEditor();\n\t\t_removeHighlights();\n\t\t$(currentEditor).off(\"scroll\");\n\t}", "function closeDialog()\n\t\t{\n\t\t\t$(\"#dialog\").fadeOut(\"slow\", function()\n\t\t\t\t{\n\t\t\t\t\t$(\"#dialog\").empty();\n\t\t\t\t});\n\t\t}", "function handleClose() {\n props.handleDialog(false);\n }", "function closeDialog() {\n setDialogOpen(false)\n }", "close() {\n\n if (this.onClose) {\n setTimeout(() => {\n this.onClose();\n this.onClose = null;\n }, 150);\n }\n\n this.client.$.removeClass('dialog-active');\n this.base.attr('open', false);\n this.base.find('.rdp-dialog__body').empty();\n this.activeModel = null;\n this.interaction = null;\n this.selector = null;\n this.isOpen = false;\n\n // re-enable other interface components again when closing\n this.client.toolbar.enable();\n this.client.snapshots.lock(false);\n\n }", "function closeDialog()\n{\n\tdocument.getElementById(dialogID + \"_popup\").style.display = \"none\";\n\n\t/* soporte para lightbox */\n\tvar overlay = document.getElementById('_overlay');\n\tif (overlay!=null)\n\t\toverlay.style.display='none';\n}", "function closeDialog() {\n jQuery('#oexchange-dialog').hide();\n jQuery('#oexchange-remember-dialog').hide();\n refreshShareLinks();\n }", "function handleClose() {\n // Start close animation\n document.getElementById(\"securesend_dialog\").className += \" securesend_dialog_closed\";\n\n // Close dialog in 100ms\n setTimeout(() => {\n document.getElementById(\"securesend_dialog_container\").remove();\n }, 100);\n\n }", "function handleGameEndDialogClose() {\n setGameEndDialogOpen(false);\n setCurrentRound(1);\n setScore(0);\n }", "function closeContentEditor(){\n $.PercBlockUI();\n cancelCallback(assetid);\n dialog.remove();\n $.unblockUI();\n $.PercDirtyController.setDirty(false);\n }", "function onClosed()\n\t{\n\t\t//cancel dialog with no data\n\t\tModalDialog.close();\n\t}", "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "function onClose() {\n\t\t\t$mdDialog.hide()\n\t\t}", "_close(dispose = true) {\n this._animateOut();\n if (dispose) {\n this.modalObj.close();\n this._dispose();\n }\n }", "closeCleanup() {\n this.hide();\n this.addPopUpListener();\n }", "closePostOverlay() {\n this.set('postOverlayData', null);\n }", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "didClose(uri) {\n this.overlay.delete(uri);\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "closeDialog() {\n this.dialog = false;\n this.errors = \"\";\n this.valid = true;\n }", "function close_dialog() {\r\n\t dialog.hide();\r\n\t return_focus.focus();\r\n\t return false;\r\n\t }", "function _finish() {\n\t\t\t$('#jquery-lightbox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "function _finish() {\r\n\t\t\t$('#jquery-lightbox').remove();\r\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\r\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\r\n\t\t}", "close(returnValue) {\n this.returnValue = returnValue || this.returnValue;\n this.style.pointerEvents = 'auto';\n this.open = false;\n this.dispatchEvent(new CustomEvent('close')); // MDN: \"Fired when the dialog is closed.\"\n }", "function close_ok_dialog() {\r\n\t \tdialog.hide();\r\n\t \treturn_focus.focus();\r\n\t }", "function closeRemoteModal(){\n\t$remoteModal.data(\"overlay\").close();\n\t$remoteModalContent.html('').html($remoteModalLoading);\n}", "function shutdown() {\n\t\t// If popup timer was pending, cancel it.\n\t\tif (popup_delay_started && !popup_delay_expired) clearTimeout(popup_timer);\n\t\tpopup_delay_started = false;\n\t\tpopup_delay_expired = false;\n\n\t\t// If progress dialog is open, close it.\n\t\tif (dialog_visible) dialog.dialog('close');\n\t\tuser_closed = false;\n\t\tprogress_bars = {};\n\t}", "function closedialog(){\n\tif($('#maindialog').css(\"visibility\")==\"visible\"){\n\t\t$(\"#maindialog\").css(\"visibility\",\"hidden\");\n\t\t$(\"#drop\").css(\"visibility\",\"hidden\").css(\"top\",\"69\").css(\"left\",\"77\");\n \tvar $this = $(\"#maindialog\");\n \t\t\t $this\n .effect(\"transfer\", {\n to: \"#home\",\n className: \"close-transfer-effect\"\n\n },340, function(){});}\n\t}", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function close() {\n\t\ttry{ $dialog.close(); }catch(e){};\n\t\twindow.clearTimeout(timer);\n\t\tif (opts.easyClose) {\n\t\t\t$document.unbind(\"mouseup\", close);\n\t\t}\n\t}", "function closePopup() {\n\t\t$('.overlay-bg, .overlay-content').hide(); // hide the overlay\n\t}", "function closeOpDialog(e) {\n e.stopPropagation();\n $(\"#dlgairops\").css(\"display\", \"none\");\n $(\"#dlgoverlay\").css(\"display\", \"none\");\n}", "onDialogClose() {\n var nextDialogState = this.state.dialog;\n nextDialogState.open = false;\n this.setState({ dialog: nextDialogState })\n }", "function closeAlert() {\n $mdDialog.hide( alert, \"finished\" );\n alert = undefined;\n }", "close () {\n // don't do anything when we have an error\n if (this.state === 'error') { return; }\n\n if (!this.leaveOpen && this.active) {\n this.closed = true;\n this.rsWidget.classList.add('rs-closed');\n let selected = document.querySelector('.rs-box.rs-selected');\n if (selected) {\n selected.setAttribute('aria-hidden', 'true');\n }\n } else if (this.active) {\n this.setState('connected');\n } else {\n this.setInitialState();\n }\n\n if (this.rsWidget.classList.contains('rs-modal')) {\n this.rsBackdrop.classList.remove('visible');\n setTimeout(() => {\n this.rsBackdrop.style.display = 'none';\n }, 300);\n }\n }", "function closeDialog() {\n $mdDialog.hide();\n }", "function _finish() {\n\t\t\t$('#jquery-largephotobox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "function map_close() {\n\n $('#' + map_dialog_id).css('display', 'none');\n\n hideFog();\n}", "function closePopup(){\n $('.overlay-bg, .overlay-content, #loader').hide();\n }", "function closeDialog() {\n\tdialog.close();\n\tbuttonOpen.removeAttribute(\"class\", \"close\");\n\tbuttonOpen2.removeAttribute(\"class\", \"close\");\n}", "function dialogAjaxDone(json){\n\tNUI.ajaxDone(json);\n\tif (json.statusCode == NUI.statusCode.ok){\n\n\t\t\n\t\tif (\"true\" == json.closeDialog) {\n\t\t\t$.pdialog.close();\n\t\t}\n\t}\n}", "function close() {\r\n\t\ttry{ $dialog.close(); }catch(e){};\r\n\t\twindow.clearTimeout(timer);\r\n\t\tif (opts.easyClose) {\r\n\t\t\t$document.unbind(\"mouseup\", close);\r\n\t\t}\r\n\t}", "function close()\n\t{\n\t\tthat.fadeOut(200, 0, fadeComplete);\n\t}", "function closeDialog(dialog) {\n\tif (dialog && dialog.closed != true) dialog.close();\n}", "close() {\n\t\tthis.$modal.removeClass(this.options.classes.open);\n\t\tthis.isOpen = false;\n\n // remove accessibility attr\n this.$body.attr('aria-hidden', false);\n\n\t\t// After starting fade-out transition, wait for it's end before setting hidden class\n\t\tthis.$modal.on(transitionEndEvent(), (e) => {\n\t\t\tif (e.originalEvent.propertyName === 'opacity') {\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tthis.$body.removeClass(this.options.classes.visible);\n\t\t\t\tthis.$modal\n\t\t\t\t\t.addClass(this.options.classes.hidden)\n\t\t\t\t\t.detach().insertAfter(this.$el)\n\t\t\t\t\t.off(transitionEndEvent());\n\t\t\t}\n\t\t});\n\n this.$closeBtn.off('click');\n this.$backdrop.off('click');\n this.$modal.off('keydown');\n this.$el.focus();\n\t}", "function onDialogCancel()\n{\n\tdialogClosed();\n\treturn true;\n}", "function closeModalDialog () {\n mainView.send('close-modal-dialog');\n}", "close(result) {\n if (this._windowCmptRef) {\n this._resolve(result);\n this._removeModalElements();\n }\n }", "function closeDialog() {\n document.querySelector(\"#remove_aorb\").classList.add(\"hide\");\n document.querySelector(\"#remove_aorb .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_aorb #removea\").removeEventListener(\"click\", removeA);\n document.querySelector(\"#remove_aorb #removeb\").removeEventListener(\"click\", removeB);\n }", "closeDialog() {\n // Trigger the popup to close\n tableau.extensions.ui.closeDialog();\n }", "function closeLightbox() {\n var s = $self[0].style;\n if (opts.destroyOnClose) {\n $self.add($overlay).remove();\n } else {\n $self.add($overlay).hide();\n }\n\n //show the hidden parent lightbox\n if (opts.parentLightbox) {\n opts.parentLightbox.fadeIn(200);\n }\n if (opts.preventScroll) {\n $('body').css('overflow', '');\n }\n $iframe.remove();\n\n\t\t\t\t // clean up events.\n $self.undelegate(opts.closeSelector, \"click\");\n $self.unbind('close', closeLightbox);\n $self.unbind('repositon', setSelfPosition);\n \n $(window).unbind('resize', setOverlayHeight);\n $(window).unbind('resize', setSelfPosition);\n $(window).unbind('scroll', setSelfPosition);\n $(window).unbind('keyup.lightbox_me');\n opts.onClose();\n }", "close() {\n this.opened = false;\n if (window.ShadyCSS && !window.ShadyCSS.nativeShadow) {\n this.shadowRoot\n .querySelector(\"web-dialog\")\n .shadowRoot.querySelector(\"#backdrop\").style.position = \"relative\";\n }\n }", "_closeModal( e ) {\n if ( document.body.contains( this._overlay ) ) {\n this._overlay.classList.remove( 'visible' );\n setTimeout( () => { document.body.removeChild( this._overlay ); }, 1000 );\n }\n }", "function closeDialog(obj) {\n if (typeof obj == 'undefined' || obj == 'all' ) {\n $('dialog').removeClass('isVisible');\n $('#dialog_mask').removeClass('isVisible');\n $('main,nav').removeClass('dialogIsOpen');\n // e.preventDefault();\n }\n}", "function closeDialog() {\n document.querySelector(\"#expel_student\").classList.add(\"hide\");\n document.querySelector(\"#expel_student .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#expel_student #expel_button_modal\").removeEventListener(\"click\", expelStudent);\n }", "function closeOverlay(){\n $(\"#changeCPLayer\").fadeOut(\"fast\",function(){\n $(\"#commonOverlay\").fadeOut(\"fast\"); \n });\n}", "function closeSpinnerDialog() {\r\n spinnerWindow.close();\r\n }", "function endloading(){\n\t//$(\"#ajaxloading\").fadeOut(1000);\n\t$('.sl-popup:visible .overlay').fadeOut(1000);\n}", "function closeIframeDialog() {\r\n window.parent.postMessage(kradVariables.MODAL.MODAL_CLOSE_DIALOG, \"*\");\r\n // Fix for lingering loading message in IE\r\n hideLoading();\r\n}", "function modalClose() {\t\t\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif($('mb_Error')) $('mb_Error').remove();\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\n\t\t$('mb_center').style.display = 'none';\n\t\t\n\t\t$('mb_contents').getChildren()[0].remove();\n\t\t$('mb_overlay').setStyle('opacity',0);\n\t\t$('mb_frame').setStyle('opacity',0);\n\t\twindow.location.reload(true); \n}", "function dialogOff() {\n\n if (dialog !== null) {\n if (typeof uiVersion !== 'undefined' && uiVersion === 'Minuet') {\n hideSection('percDialogTarget', 'fadeOut', true);\n }\n else {\n dialog.remove();\n }\n dialog = null;\n }\n isDialogOn = false;\n\n }", "function _closeDialogVia(ref, interactionType, result) {\n ref._closeInteractionType = interactionType;\n return ref.close(result);\n}", "onCloseDialog(isTrue) {\n\t\tthis.setState({ open: false });\n\t\tthis.props.onConfirm(isTrue)\n\t}", "onClose() {\n\t\t}", "closeDialog_(event) {\n this.userActed('close');\n }", "function close() {\n // Unbind the events\n $(window).unbind('resize', modalContentResize);\n $('body').unbind( 'focus', modalEventHandler);\n $('body').unbind( 'keypress', modalEventHandler );\n $('body').unbind( 'keydown', modalTabTrapHandler );\n $('.close').unbind('click', modalContentClose);\n $('body').unbind('keypress', modalEventEscapeCloseHandler);\n $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));\n\n // Set our animation parameters and use them\n if ( animation == 'fadeIn' ) animation = 'fadeOut';\n if ( animation == 'slideDown' ) animation = 'slideUp';\n if ( animation == 'show' ) animation = 'hide';\n\n // Close the content\n modalContent.hide()[animation](speed);\n\n // Remove the content\n $('#modalContent').remove();\n $('#modalBackdrop').remove();\n\n // Restore focus to where it was before opening the dialog\n $(oldFocus).focus();\n }", "function close() {\n $mdDialog.hide();\n }", "function endOverlay() {\n if (isDefined(parseInt(overlayOptions.end)) && player.currentTime() >= overlayOptions.end) {\n player.off('timeupdate', endOverlay);\n document.getElementsByClassName('vjs-overlay')[0].className += ' bcls-hide-overlay';\n }\n }", "function closeDialog() {\n $.fancybox.close();\n }", "function close() {\n if (title == null ||\n instructions == null ||\n selectDiv == null ||\n selectLabel == null ||\n selectList == null ||\n optionsDiv == null) {\n return;\n }\n\n clearOptions();\n\n userInput.removeChild(optionsDiv);\n optionsDiv = null;\n\n selectDiv.removeChild(selectList);\n selectList = null;\n\n selectDiv.removeChild(selectLabel);\n selectLabel = null;\n\n userInput.removeChild(selectDiv);\n selectDiv = null;\n\n userInput.removeChild(instructions);\n instructions = null;\n\n userInput.removeChild(title);\n title = null;\n\n chart.close();\n}", "function _finish() {\r\n // stop all fading and animations\n $.each(['#lightbox-image-details', '#jquery-lightbox', '#jquery-overlay'], function (i, id) {\n $(id).stop(true, true);\n });\n\n window._activeLightBox = null;\r\n _disable_keyboard_navigation();\r\n $('.hover-icon').remove();\r\n $('#lightbox-loading').remove();\r\n $('#jquery-lightbox').remove();\r\n $('#jquery-overlay').remove();\r\n // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r\n $('embed, object, select').css({ 'visibility' : 'visible' });\r\n }", "function bookingConfirmationClose(){\n\n\t\t$bookingOverlay.velocity('fadeOut', 100);\n\t\t$bookConfirm.velocity('fadeOut', 200);\n\n\t}", "function close() {\n\n let $loadingScreenContainer = $('.loadingScreenContainer');\n\n $loadingScreenContainer.trigger('close');\n\n }", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "function closeModal() {\n // Change the modal overlay's opacity from 1 to 0, with a 200ms fade\n modalOverlay.style.opacity = \"0\";\n\n // Use a timeout to change the 'visibility' after the 200ms. Also: delete its contents.\n setTimeout(function() {\n modalOverlay.parentNode.style.visibility = \"hidden\";\n removeModalContent();\n }, 200);\n}", "function _close() {\n var selectedTxt = selectItems[selected].text;\n selectedTxt != $label.text() && $original.change();\n $label.text(selectedTxt);\n\n $outerWrapper.removeClass(classOpen);\n isOpen = false;\n\n options.onClose.call(this);\n }", "function closeDialog() {\n document.querySelector(\"#removeOther\").classList.add(\"hidden\");\n document.querySelector(\"#removeOther .closeButton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#removeOtherButton\").removeEventListener(\"click\", clickRemoveOther);\n }", "function onPopupClose(evt) {\r\n /*\r\n // 'this' is the popup.\r\n var feature = this.feature;\r\n if (feature.layer) { // The feature is not destroyed\r\n selectControl.unselect(feature);\r\n } else { // After \"moveend\" or \"refresh\" events on POIs layer all \r\n // features have been destroyed by the Strategy.BBOX\r\n this.destroy();\r\n }\r\n */\r\n }", "handleWindowClose() {\n\t\tthis.runFinalReport()\n\t}", "_close() {\n const that = this,\n closingEvent = that.$.fireEvent('closing');\n\n if (!closingEvent.defaultPrevented) {\n that.$.calendarDropDown.disabled = true;\n\n that.$calendarButton.removeClass('jqx-calendar-button-pressed');\n that.$.calendarButton.removeAttribute('active');\n that.$dropDownContainer.addClass('jqx-visibility-hidden');\n that.opened = false;\n that._positionDetection.removeOverlay(true);\n\n that.$.fireEvent('close');\n\n if (that._edgeMacFF && !that.hasAnimation) {\n that.$.dropDownContainer.style.top = null;\n that.$.dropDownContainer.style.left = null;\n that.$dropDownContainer.addClass('not-in-view');\n }\n }\n else {\n that.opened = true;\n }\n }", "function closeDialog() {\n document.querySelector(\"#remove_other\").classList.add(\"hide\");\n document.querySelector(\"#remove_other .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_other #removeother\").removeEventListener(\"click\", clickRemoveOther);\n }", "dismiss() {\n if (!this._afterDismissed.closed) {\n this.containerInstance.exit();\n }\n clearTimeout(this._durationTimeoutId);\n }", "function closeModalBox() {\r\n\t\t$['mapsettings'].modal = false;\r\n\t\t$('#modal').slideUp(\"slow\", function(){\r\n\t\t\t$('#modal').remove();\r\n\t\t});\r\n\t\t$(\"#overlay\").fadeTo(\"slow\", 0, function() {\r\n\t\t\t$(\"#overlay\").remove();\r\n\t\t\tif($['mapsettings'].afterModal.length > 0) ($['mapsettings'].afterModal.shift())();\r\n\t\t});\r\n\t}", "function gMapClose(sender) {\n\n //if (newRect) {\n // newRect.setMap(null);\n //}\n\n\n $('#gMapModal, #pac-input').fadeOut(150, function () {\n // Re-load page to refresh POI list.\n $('#panelOverlay').fadeOut(200);\n //window.location.reload();\n });\n}", "handleCloseClick()\n {\n invokeCloseModal() \n this.close()\n }", "function closeHandler() {\n $('#sf_close').click(() => {\n closeOverlay();\n });\n}", "closeModal() {\n this.close();\n }", "accept() {\n this._dialog_ref.close('done');\n this.event.emit({ reason: 'done' });\n }" ]
[ "0.8550732", "0.7405404", "0.7260153", "0.7104279", "0.7083736", "0.7083736", "0.6985526", "0.6908111", "0.6902874", "0.6829207", "0.6791973", "0.67579216", "0.67488986", "0.66696763", "0.6605422", "0.66041255", "0.66039455", "0.6574522", "0.65394133", "0.65226835", "0.65044993", "0.64641625", "0.6440305", "0.6425094", "0.6425094", "0.6420338", "0.6420338", "0.64103985", "0.6393695", "0.6383686", "0.63528115", "0.63287", "0.63198143", "0.63197345", "0.63052267", "0.62886655", "0.62867045", "0.6271768", "0.6270285", "0.6270285", "0.62677324", "0.6253916", "0.62461674", "0.6229434", "0.62203884", "0.62143105", "0.6211541", "0.6203628", "0.6199689", "0.61923575", "0.6176137", "0.616471", "0.6164137", "0.6159825", "0.6142504", "0.6136748", "0.6136707", "0.6132263", "0.61292315", "0.61180073", "0.61142343", "0.6111377", "0.61102", "0.61099803", "0.60931844", "0.60912687", "0.6090166", "0.60844505", "0.6073941", "0.6071545", "0.6065192", "0.6046777", "0.6039567", "0.6028766", "0.6019443", "0.601208", "0.6006373", "0.59992504", "0.5992548", "0.59923166", "0.59847397", "0.59815705", "0.59800833", "0.5977876", "0.5976995", "0.59763634", "0.59763604", "0.59743726", "0.5962878", "0.59589005", "0.59509766", "0.5938751", "0.5924563", "0.588972", "0.5883818", "0.5883082", "0.5872797", "0.58668625", "0.586585" ]
0.7378775
3
Closes the dialog with the specified interaction type. This is currently not part of `MatDialogRef` as that would conflict with custom dialog ref mocks provided in tests. More details. See: TODO: Move this back into `MatDialogRef` when we provide an official mock dialog ref.
function _closeDialogVia(ref, interactionType, result) { ref._closeInteractionType = interactionType; return ref.close(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _closeDialogVia(ref, interactionType, result) {\n // Some mock dialog ref instances in tests do not have the `_containerInstance` property.\n // For those, we keep the behavior as is and do not deal with the interaction type.\n if (ref._containerInstance !== undefined) {\n ref._containerInstance._closeInteractionType = interactionType;\n }\n\n return ref.close(result);\n}", "function _closeDialogVia(ref, interactionType, result) {\n // Some mock dialog ref instances in tests do not have the `_containerInstance` property.\n // For those, we keep the behavior as is and do not deal with the interaction type.\n if (ref._containerInstance !== undefined) {\n ref._containerInstance._closeInteractionType = interactionType;\n }\n return ref.close(result);\n}", "function _closeDialogVia(ref, interactionType, result) {\n // Some mock dialog ref instances in tests do not have the `_containerInstance` property.\n // For those, we keep the behavior as is and do not deal with the interaction type.\n if (ref._containerInstance !== undefined) {\n ref._containerInstance._closeInteractionType = interactionType;\n }\n\n return ref.close(result);\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "_finishDialogClose() {\n this._state = 2 /* MatDialogState.CLOSED */;\n this._ref.close(this._result, { focusOrigin: this._closeInteractionType });\n this.componentInstance = null;\n }", "function close(type) {\n if (type == 'save') {\n $uibModalInstance.close(oneThreePackingEditModalCtrl.ePage.Masters.Package.FormView);\n } else {\n $uibModalInstance.close(oneThreePackingEditModalCtrl.ePage.Masters.Package.FormViewCopy);\n }\n }", "function dismissDialog(dialogId, $action) {\r\n var $dialog = jQuery('#' + dialogId);\r\n\r\n if (!$dialog) {\r\n return;\r\n }\r\n\r\n // trigger the dialog response event if necessary\r\n if ($action && $action.is(\"[\" + kradVariables.ATTRIBUTES.DATA_RESPONSE + \"]\")) {\r\n var dialogResponseEvent = jQuery.Event(kradVariables.EVENTS.DIALOG_RESPONSE);\r\n\r\n dialogResponseEvent.response = $action.attr(kradVariables.ATTRIBUTES.DATA_RESPONSE);\r\n dialogResponseEvent.action = $action;\r\n dialogResponseEvent.dialogId = dialogId;\r\n\r\n $dialog.trigger(dialogResponseEvent);\r\n }\r\n\r\n $dialog.modal('hide');\r\n\r\n // Make sure the background is removed for modals that may have been replaced\r\n ensureDialogBackdropRemoved();\r\n}", "function closeDialog() {\n setDialogOpen(false)\n }", "close() {\n\n if (this.onClose) {\n setTimeout(() => {\n this.onClose();\n this.onClose = null;\n }, 150);\n }\n\n this.client.$.removeClass('dialog-active');\n this.base.attr('open', false);\n this.base.find('.rdp-dialog__body').empty();\n this.activeModel = null;\n this.interaction = null;\n this.selector = null;\n this.isOpen = false;\n\n // re-enable other interface components again when closing\n this.client.toolbar.enable();\n this.client.snapshots.lock(false);\n\n }", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "closeDialog() {\n // Trigger the popup to close\n tableau.extensions.ui.closeDialog();\n }", "_finishDialogClose() {\n this._state = 2 /* CLOSED */;\n this._overlayRef.dispose();\n }", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "function closeModalDialog () {\n mainView.send('close-modal-dialog');\n}", "close(returnValue) {\n this.returnValue = returnValue || this.returnValue;\n this.style.pointerEvents = 'auto';\n this.open = false;\n this.dispatchEvent(new CustomEvent('close')); // MDN: \"Fired when the dialog is closed.\"\n }", "function closeModel(type) {\n\t\t if (type == \"save_page_text\") {\n\t\t $('#myModal').modal('toggle');\n\t\t } else if (type == \"save_page_video\") {\n\t\t $('#videoModal').modal('toggle');\n\t\t } else if (type == \"countdown\") {\n\t\t $('#CountdownModal').modal('toggle');\n\t\t }\n\t\t else if (type == \"save_seo_text\") {\n\t\t $('#mySeoPopup').modal('toggle');\n\t\t }\n\t\t else if (type == \"save_tracking_text\") {\n\t\t $('#myTrackingCode').modal('toggle');\n\t\t }\n\t\t else if (type == \"save_exit_popup_text\") {\n\t\t $('#myExitPopup').modal('toggle');\n\t\t }\n\t\t else if (type == \"save_linking\") {\n\t\t $('#linkingModal').modal('toggle');\n\t\t }\n\t\t else if (type == \"save_window_tab\") {\n\t\t $('#windowModal').modal('toggle');\n\t\t }\n\t\t}", "closeDialog_(event) {\n this.userActed('close');\n }", "async _closeReviewRequests(closeType) {\n try {\n const confirmed = await this._confirmClose();\n\n if (confirmed) {\n const results = await this.model.closeReviewRequests({\n closeType: closeType,\n });\n this._showCloseResults(results.successes, results.failures);\n }\n } catch (err) {\n alert(_`An error occurred when attempting to close review requests: ${err}`);\n }\n }", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "closeWithAction() {\n this.dismissWithAction();\n }", "closeInteliUiModal() {\n $(this.target.boxContainer).parents().find('.modal-content').find('#btnClose').click();\n }", "function _close() {\n\t\tif (dialogBox) {\n\t\t\t$dialogInput.off(\"blur\");\n\t\t\tdialogBox.parentNode.removeChild(dialogBox);\n\t\t\tdialogBox = null;\n\t\t}\n\t\tEditorManager.focusEditor();\n\t\t_removeHighlights();\n\t\t$(currentEditor).off(\"scroll\");\n\t}", "function closeDialog(customDialog) {\r\n\t$(customDialog).dialog('close');\r\n}", "closeModal() {\n this.modalRef.current.closeModal();\n }", "close() {\n this.modal.dismiss();\n }", "function closeDialog() {\n $mdDialog.hide();\n }", "function closeTag(btn_close, element, type) {\n btn_close.parentNode.style.display = 'none';\n\n if (type == \"ingr\") {\n moveElementFromTabToTab(tabSelectIngr, tabIngredients, element);\n tabIngredients.sort(Intl.Collator().compare);\n loadFilteredIngr();\n } else if (type == \"app\") {\n moveElementFromTabToTab(tabSelectApp, tabAppareils, element);\n tabAppareils.sort(Intl.Collator().compare);\n loadFilteredApp();\n } else {\n moveElementFromTabToTab(tabSelectUst, tabUstensiles, element);\n tabUstensiles.sort(Intl.Collator().compare);\n loadFilteredUst();\n }\n showRecipes(selectAllFilteredRecipes(tabSelectIngr, tabSelectApp, tabSelectUst));\n}", "closeRemoveEfficacyStudyModalDialog(linkText) {\n //Hide dialog\n this.setState({modalIsOpen: false});\n\n //Send analytics event that the modal was closed\n if (linkText !== undefined) {\n Analytics.sendEvent(Analytics.getDataLayerOptions(\"efficacy modal\", linkText));\n }\n }", "cancel() {\n this.mdDialog_.cancel();\n }", "handleCloseClick()\n {\n invokeCloseModal() \n this.close()\n }", "close() {\n this.opened = false;\n if (window.ShadyCSS && !window.ShadyCSS.nativeShadow) {\n this.shadowRoot\n .querySelector(\"web-dialog\")\n .shadowRoot.querySelector(\"#backdrop\").style.position = \"relative\";\n }\n }", "function closeDialog(obj) {\n if (typeof obj == 'undefined' || obj == 'all' ) {\n $('dialog').removeClass('isVisible');\n $('#dialog_mask').removeClass('isVisible');\n $('main,nav').removeClass('dialogIsOpen');\n // e.preventDefault();\n }\n}", "function handleClose() {\n props.handleDialog(false);\n }", "closemodal() {\n this.modalCtr.dismiss();\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "cancel() {\r\n this.mdDialog_.cancel();\r\n }", "cancel() {\r\n this.mdDialog_.cancel();\r\n }", "close() {\n \n // The close function will hide the modal...\n this.visible = false;\n\n // ...and dispatch an event on the modal that the view model can listen for.\n this.el.dispatchEvent(\n new CustomEvent('closed', { bubbles: true })\n );\n }", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function onClose() {\n\t\t\t$mdDialog.hide()\n\t\t}", "function closeDialog() {\n document.querySelector(\"#expel_student\").classList.add(\"hide\");\n document.querySelector(\"#expel_student .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#expel_student #expel_button_modal\").removeEventListener(\"click\", expelStudent);\n }", "closeModal() {\n this.close();\n }", "internalCloseDialog(selector) {\n var $sel = $(selector);\n if ($sel.modal) {\n // Bootstrap\n $sel.modal('hide');\n\n } else if ($sel.foundation){\n // Foundation\n var popup = new Foundation.Reveal($sel);\n popup.close();\n $('.reveal-overlay').hide();\n\n } else {\n console.error('You must load Bootstrap or Foundation in order to open modal dialogs');\n return;\n }\n }", "function closeChatModal() {\n if ($('#chatBodyModal').length) {\n $('#chatBodyModal').hide();\n }\n $('.kore-chat-window').removeClass('modelOpen');\n try {\n if (koreAriaUtilis) {\n koreAriaUtilis.closeDialog(document.getElementById('closeChatBodyModal'));\n }\n } catch (e) {\n }\n }", "closeTypeWarningModal() {\n this.setState({ openTypeWarning: false });\n }", "function dialogOff() {\n\n if (dialog !== null) {\n if (typeof uiVersion !== 'undefined' && uiVersion === 'Minuet') {\n hideSection('percDialogTarget', 'fadeOut', true);\n }\n else {\n dialog.remove();\n }\n dialog = null;\n }\n isDialogOn = false;\n\n }", "function close() {\n // Unbind the events\n $(window).unbind('resize', modalContentResize);\n $('body').unbind( 'focus', modalEventHandler);\n $('body').unbind( 'keypress', modalEventHandler );\n $('body').unbind( 'keydown', modalTabTrapHandler );\n $('.close').unbind('click', modalContentClose);\n $('body').unbind('keypress', modalEventEscapeCloseHandler);\n $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));\n\n // Set our animation parameters and use them\n if ( animation == 'fadeIn' ) animation = 'fadeOut';\n if ( animation == 'slideDown' ) animation = 'slideUp';\n if ( animation == 'show' ) animation = 'hide';\n\n // Close the content\n modalContent.hide()[animation](speed);\n\n // Remove the content\n $('#modalContent').remove();\n $('#modalBackdrop').remove();\n\n // Restore focus to where it was before opening the dialog\n $(oldFocus).focus();\n }", "function CloseModal(type_alrt) {\n document.getElementById(\"myModal\").style.display = \"none\";\n document.getElementById(\"errorMesg\").classList.remove(\"modal-content1\");\n document.getElementById(\"errorMesg\").style.fontSize = '20px';\n\n\n //-------- notify modal\n if (type_alrt == \"notify_modal\") {\n document.getElementById(\"alert_modal\").style.display = \"none\";\n document.getElementById(\"errorMesg\").classList.remove(\"modal-content1\");\n\n }\n}", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function close() {\n $mdDialog.hide();\n }", "function closeDialog(msg) {\n\t\t_$.alert({\n\t\t\ttitle: 'Error',\n\t\t\tcontent: msg,\n\t\t\tbackgroundDismiss: true\n\t\t});\n\n\t\treturn setTimeout(_ => {\n\t\t\t_$('.modal#runner').modal('hide');\n\t\t}, 1);\n\t}", "function closeDialog()\n{\n\tdocument.getElementById(dialogID + \"_popup\").style.display = \"none\";\n\n\t/* soporte para lightbox */\n\tvar overlay = document.getElementById('_overlay');\n\tif (overlay!=null)\n\t\toverlay.style.display='none';\n}", "endDialog(turnContext, instance, reason) {\n const _super = Object.create(null, {\n endDialog: { get: () => super.endDialog }\n });\n return __awaiter(this, void 0, void 0, function* () {\n const properties = {\n DialogId: this.id,\n Kind: 'Microsoft.AdaptiveDialog',\n };\n if (reason === botbuilder_dialogs_1.DialogReason.cancelCalled) {\n this.telemetryClient.trackEvent({\n name: 'AdaptiveDialogCancel',\n properties: properties,\n });\n }\n else if (reason === botbuilder_dialogs_1.DialogReason.endCalled) {\n this.telemetryClient.trackEvent({\n name: 'AdaptiveDialogComplete',\n properties: properties,\n });\n }\n yield _super.endDialog.call(this, turnContext, instance, reason);\n });\n }", "function closeModals() {\n if ($scope.warning) {\n $scope.warning.close();\n $scope.warning = null;\n }\n if ($scope.timedout) {\n $scope.timedout.close();\n $scope.timedout = null;\n }\n }", "close() {\n // Remove events listeners\n this.rl.removeListener('SIGINT', this.onForceClose);\n process.removeListener('exit', this.onForceClose);\n\n this.rl.output.unmute();\n\n if (this.activePrompt && typeof this.activePrompt.close === 'function') {\n this.activePrompt.close();\n }\n\n // Close the readline\n this.rl.output.end();\n this.rl.pause();\n this.rl.close();\n }", "close() {\n // Remove events listeners\n this.rl.removeListener('SIGINT', this.onForceClose);\n process.removeListener('exit', this.onForceClose);\n\n this.rl.output.unmute();\n\n if (this.activePrompt && typeof this.activePrompt.close === 'function') {\n this.activePrompt.close();\n }\n\n // Close the readline\n this.rl.output.end();\n this.rl.pause();\n this.rl.close();\n }", "function stopInteraction() {\n if (GC.interactor !== null) {\n GC.interactor.kill();\n }\n}", "close() {\n this.closeButton.on('click', null);\n this.modal(false);\n this.window.remove();\n }", "function closeModals($scope) {\n if ($scope.warning) {\n $scope.warning.close();\n $scope.warning = null;\n }\n\n if ($scope.timedout) {\n $scope.timedout.close();\n $scope.timedout = null;\n }\n}", "function dismissReminder(remindertype) {\n if (selectedReminders.length == 0) {\n notificationService.error(\"Please select a reminder to dismiss.\");\n return;\n }\n\n var reminderids = {};\n\n var selectedTasks = _.filter(selectedReminders, function (reminder) {\n return reminder.type == 'task';\n });\n\n var selectedEvents = _.filter(selectedReminders, function (reminder) {\n return reminder.type == 'event';\n });\n\n reminderids.taskids = _.pluck(selectedTasks, 'reminderid');\n reminderids.eventids = _.pluck(selectedEvents, 'reminderid');\n\n eventsDataService.dismissReminder(reminderids)\n .then(function (res) {\n spliceSelectedReminders();\n notificationService.success(\"Dismissed successfully.\");\n var remEvents = _.filter(vm.reminders, function (rem) { return rem.type == \"event\"; });\n var remTasks = _.filter(vm.reminders, function (rem) { return rem.type == \"task\"; });\n if ($rootScope.onIntake) {\n $rootScope.$broadcast('updateReminderCountForIntake', { event_count: remEvents.length, task_count: remTasks.length });\n } else {\n $rootScope.$broadcast('updateReminderCount', { event_count: remEvents.length, task_count: remTasks.length });\n }\n }, function (res) { notificationService.error(\"Unable to dismiss.\") });\n }", "closeModal() {\n this.closeModal();\n }", "function closeModal() {\n clearForm();\n props.onChangeModalState();\n }", "_finishDismiss() {\n this._overlayRef.dispose();\n if (!this._onAction.closed) {\n this._onAction.complete();\n }\n this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });\n this._afterDismissed.complete();\n this._dismissedByAction = false;\n }", "function closeDialog(dialog) {\n\tif (dialog && dialog.closed != true) dialog.close();\n}", "function closeDialog() {\n let bubble = document.getElementById('gdx-bubble-host')\n if (bubble) {\n bubble.remove()\n }\n definition = \"&zwnj;\"; // Blank character so the box renders the same size\n}", "function closeAlert() {\n let alertDialogID = document.getElementById(\"alertCustomDialog\");\n alertDialogID.close();\n}", "'click .close' (event) {\n console.log(\"MODAL CLOSED VIA X\");\n modal.hide();\n }", "function closeDialog() {\n jQuery('#oexchange-dialog').hide();\n jQuery('#oexchange-remember-dialog').hide();\n refreshShareLinks();\n }", "function closeDialog() {\n\tdialog.close();\n\tbuttonOpen.removeAttribute(\"class\", \"close\");\n\tbuttonOpen2.removeAttribute(\"class\", \"close\");\n}", "function popupMsgClose(type) {\n var closeType = \"popup-container\";\n if (type == \"warning\") {\n var closeType = \"popup-container-warn\";\n }\n else if (type == \"error\") {\n var closeType = \"popup-container-error\";\n }\n else if (type == \"okay\") {\n var closeType = \"popup-container-okay\";\n }\n else if (type == \"alert\") {\n var closeType = \"popup-container\";\n }\n else {\n var closeType = \"popup-container\";\n }\n try {\n // Find the div \"popup-container\" and set it to not display anything\n document.getElementById(closeType).style.display = \"none\";\n } catch (err) {\n // Well you fucked it up, didn't you?!\n console.error(\"Popup close failed. Reason: \" + err);\n }\n console.log(\"Popup closed.\");\n}", "function closeDialog(sDialogId)\r\n{\r\n var div = document.getElementById(sDialogId);\r\n div.style.display = \"none\";\r\n var div = document.getElementById(\"modal\");\r\n div.style.display = \"none\";\r\n}", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "function closeDefaultModal() {\n default_modal.close();\n }", "cancel() {\n this.$mdDialog.cancel();\n }", "function closeModal() {\n if (modalController) {\n modalController.close();\n }\n }", "closeCommand() {\n this.close();\n this.translation.infobarClosed();\n }", "dismiss () {\n this.modalService.close()\n }", "function finishGame(type) {\n\tclearInterval(countdownTimer);\n\tisDone = true;\n\tif(type==\"win\")\n\t\tif(!isOnline) $('#modalText').text($('#'+currentTurn+'Name').text() + ' wins!');\n\t\telse {\n\t\t\tif(myTurn) $('#modalText').text('You win!');\n\t\t\telse $('#modalText').text('You lose.');\n\t\t}\n\t\n\tif(type==\"draw\") \n\t\t$('#modalText').text('It is a draw!');\n\t\n\t$('#finishedModal').show();\n}", "close() {\n\t\tthis.$modal.removeClass(this.options.classes.open);\n\t\tthis.isOpen = false;\n\n // remove accessibility attr\n this.$body.attr('aria-hidden', false);\n\n\t\t// After starting fade-out transition, wait for it's end before setting hidden class\n\t\tthis.$modal.on(transitionEndEvent(), (e) => {\n\t\t\tif (e.originalEvent.propertyName === 'opacity') {\n\t\t\t\te.stopPropagation();\n\n\t\t\t\tthis.$body.removeClass(this.options.classes.visible);\n\t\t\t\tthis.$modal\n\t\t\t\t\t.addClass(this.options.classes.hidden)\n\t\t\t\t\t.detach().insertAfter(this.$el)\n\t\t\t\t\t.off(transitionEndEvent());\n\t\t\t}\n\t\t});\n\n this.$closeBtn.off('click');\n this.$backdrop.off('click');\n this.$modal.off('keydown');\n this.$el.focus();\n\t}", "function closeDialog() {\n document.querySelector(\"#remove_other\").classList.add(\"hide\");\n document.querySelector(\"#remove_other .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_other #removeother\").removeEventListener(\"click\", clickRemoveOther);\n }", "_close(dispose = true) {\n this._animateOut();\n if (dispose) {\n this.modalObj.close();\n this._dispose();\n }\n }", "function closeContentEditor(){\n $.PercBlockUI();\n cancelCallback(assetid);\n dialog.remove();\n $.unblockUI();\n $.PercDirtyController.setDirty(false);\n }", "dismiss(data, role) {\n if (this.durationTimeout) {\n clearTimeout(this.durationTimeout);\n }\n return overlays.dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);\n }", "function closeModal() {\n $scope.oModal.hide();\n vm.directionsDisplay.setDirections({\n routes: []\n });\n }", "onCloseWindow () {\n this.mainWindowManager.window.close();\n }", "close(e) {\n var normalizedEvent = dom(e);\n var local = normalizedEvent.localTarget;\n if (\n typeof e === typeof undefined ||\n local === this.shadowRoot.querySelector(\"#dialog\") ||\n local === this.shadowRoot.querySelector(\"#closedialog\")\n ) {\n // reset the active element which will force this to reset the manager\n window.HaxStore.write(\"activeHaxElement\", {}, this);\n this.opened = false;\n this.resetManager();\n }\n }", "function close_history_dialog()\n {\n $('#notehistory, #notediff').each(function(i, elem) {\n var $dialog = $(elem);\n if ($dialog.is(':ui-dialog'))\n $dialog.dialog('close');\n });\n }", "function quitThisChat(jid, hash, type) {\n if(type == 'chat')\n chatStateSend('gone', jid, hash);\n \n else if(type == 'groupchat') {\n sendPresence(jid + '/' + getDB('muc', jid), 'unavailable');\n removeDB('muc', jid);\n }\n \n // Remove the chat\n deleteThisChat(hash);\n \n // We reset the switcher overflowing\n switcherScroll();\n \n // We reset the switcher\n switchChan('channel');\n}", "handleCloseDialog() {\n this.setState({ openDialog: false });\n }", "close() {\n this.googleInfoWindow_.close();\n this.googleInfoWindow_.setContent(null);\n }", "handle_closing() {\n if (!this.app || !this.element) {\n return;\n }\n /* The AttentionToaster will take care of that for AttentionWindows */\n /* InputWindow & InputWindowManager will take care of visibility of IM */\n if (!this.app.isAttentionWindow && !this.app.isCallscreenWindow &&\n !this.app.isInputMethod) {\n this.app.setVisible && this.app.setVisible(false);\n }\n this.switchTransitionState('closing');\n }", "close() {\n this.sendAction('close');\n }", "function closeResponse (code, type, msg) {\n station.logger.info ({\n domain: requestDomain,\n transport: 'http',\n method: request.method,\n path: path.path,\n action: action.name,\n status: status,\n latency: timeDifference (startTime, process.hrtime()),\n format: isJSON ? 'json' : 'html'\n }, 'action');\n\n headers['Content-Type'] = type;\n if (reply.redirectURL)\n headers.Location = reply.redirectURL;\n if (!streamClosed)\n headers.Connection = \"close\";\n\n if (msg) {\n headers[\"Content-Length\"] = Buffer.byteLength (msg);\n response.writeHead (code, headers);\n response.write (msg);\n } else\n response.writeHead (code, headers);\n response.end ();\n }", "hide(){\n\t\tif(atom && this.panel)\n\t\t\tthis.panel.hide();\n\t\telse (\"dialog\" === this.elementTagName)\n\t\t\t? this.element.close()\n\t\t\t: this.element.hidden = true;\n\t\tthis.autoFocus && this.restoreFocus();\n\t}", "function closeDialog() {\n document.querySelector(\"#removeOther\").classList.add(\"hidden\");\n document.querySelector(\"#removeOther .closeButton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#removeOtherButton\").removeEventListener(\"click\", clickRemoveOther);\n }", "_handleBodyInteraction() {\n if (this._closeOnInteraction) {\n this.hide(0);\n }\n }", "function closeDialog() {\n $.fancybox.close();\n }" ]
[ "0.77614063", "0.7740571", "0.7727459", "0.57818717", "0.57818717", "0.5589683", "0.53552485", "0.53342915", "0.5184275", "0.50898427", "0.508408", "0.5065508", "0.50612366", "0.49840567", "0.49190772", "0.4885232", "0.48799348", "0.48679402", "0.48160487", "0.48160487", "0.47871858", "0.47333384", "0.47162354", "0.47143152", "0.4708511", "0.46924648", "0.46616346", "0.46535176", "0.46428713", "0.46374494", "0.4608297", "0.46072075", "0.46020326", "0.45979613", "0.45900255", "0.4569788", "0.4569788", "0.4557046", "0.4557046", "0.4551435", "0.45406574", "0.45159048", "0.45123196", "0.45094287", "0.44884375", "0.44876385", "0.44739756", "0.4468135", "0.44522446", "0.444116", "0.4433773", "0.4433773", "0.44288048", "0.44280785", "0.44105995", "0.44024038", "0.44004905", "0.438707", "0.438707", "0.43854406", "0.43850124", "0.43683344", "0.43623635", "0.43464297", "0.43430063", "0.43403992", "0.43334842", "0.4326854", "0.43240362", "0.4307568", "0.43047467", "0.42952988", "0.42951497", "0.42907825", "0.42874894", "0.42857662", "0.42813748", "0.42763683", "0.42725155", "0.42687488", "0.42680046", "0.4257976", "0.42569673", "0.42541766", "0.4252837", "0.42501822", "0.42481294", "0.42434394", "0.42430827", "0.42357343", "0.4235664", "0.42308098", "0.4223301", "0.42163914", "0.42161041", "0.4214525", "0.4197295", "0.41896617", "0.41848308", "0.41798633" ]
0.77259135
3
Keeps track of the currentlyopen dialogs.
get openDialogs() { return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOpeningIds() {\n var ids = [];\n try {\n ids = JSON.parse(localStorage.openWhenComplete);\n } catch (e) {\n localStorage.openWhenComplete = JSON.stringify(ids);\n }\n return ids;\n}", "function resetOpen() {\n open = [];\n}", "function removeAllDialogs() {\n for (var i = 0; i < dialogs.length; i++) {\n var dialog = dialogs[i];\n removeDialog(dialog);\n dialogs.splice(i, 1);\n }\n }", "closeAll() {\n this._closeDialogs(this.openDialogs);\n }", "closeAll() {\n this._closeDialogs(this.openDialogs);\n }", "closeAll() {\n this._closeDialogs(this.openDialogs);\n }", "getOpen () {\n const openWindows = this.windowIdMap.toIndexedSeq()\n return openWindows\n }", "allocateDialogId() {\n let dialogId = DialogManager.MIN_DIALOG_ID;\n while (this.dialogs_.hasOwnProperty(dialogId)) {\n if (dialogId > DialogManager.MAX_DIALOG_ID)\n throw new Error('Pool of available dialog ids has run out.');\n\n ++dialogId;\n }\n\n return dialogId;\n }", "function checkIfCount() {\n if(focus == true){ // Is Chrome focused?\n chrome.tabs.query({'active': true, 'lastFocusedWindow': true},\n function(tabs){\n chrome.storage.local.get(['urlList'], function(result) {\n checkReset(1); // checks and resets variables at each new day\n checkUrlInList(tabs, result);\n });\n });\n }\n }", "function dialogOn() {\n\n if (typeof uiVersion != 'undefined' && uiVersion === 'Minuet' && dialog !== 'active') {\n openMinuetWarningDialog();\n }\n else {\n dialog = openWarningDialog();\n }\n isDialogOn = true;\n setCounter();\n\n\n }", "_closeDialogs(dialogs) {\n let i = dialogs.length;\n while (i--) {\n // The `_openDialogs` property isn't updated after close until the rxjs subscription\n // runs on the next microtask, in addition to modifying the array as we're going\n // through it. We loop through all of them and call close without assuming that\n // they'll be removed from the list instantaneously.\n dialogs[i].close();\n }\n }", "_closeDialogs(dialogs) {\n let i = dialogs.length;\n while (i--) {\n // The `_openDialogs` property isn't updated after close until the rxjs subscription\n // runs on the next microtask, in addition to modifying the array as we're going\n // through it. We loop through all of them and call close without assuming that\n // they'll be removed from the list instantaneously.\n dialogs[i].close();\n }\n }", "getOpenConnections() {\n\t\treturn this.connections.filter(c => this.active(c.peerId));\n\t}", "getAll () {\n const openWindows = this.getOpen().toArray()\n const closedSavedWindows = this.bookmarkIdMap.toIndexedSeq().filter((w) => !(w.open)).toArray()\n return openWindows.concat(closedSavedWindows)\n }", "_removeAllOpened() {\n\t\t// remove all\n\t\telement(this._CONST.OPEN_DROPDOWN_SEL).forEach(item => {\n\t\t\titem.classList.remove(this._CONST.OPEN_CLASS);\n\t\t});\n\t}", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "function createRecentlyOpendList() {\n var recentlyOpened = [];\n for (i = 0; i < $scope.fileList.length; i++) {\n if ($scope.fileList[i].lastOpened) {\n recentlyOpened.push($scope.fileList[i]);\n }\n }\n $scope.recentlyOpened = recentlyOpened;\n }", "function getTabIds() {\n Reporter_1.Reporter.debug('Get all ids of all open tabs');\n return tryBlock(() => browser.getWindowHandles(), 'Failed to get tab ids');\n }", "function buildDialogs() {\n\tDIALOGS = {\n\t 1: {id: 'help', html: buildHelpDialog, functions: null, height: '36', width: '50'}, //help\n\t 2: {id: 'YN', html: YNdialog, functions: null, height: '6', width: '30'}, //yes or no dialog\n\t 3: {id: 'chooseHead', html: chooseHead, functions: null, height: '30', width: '60'},\n\t 4: {id: 'setLinkType', html: setLinkTypeHtml, functions: null, height: '25', width: '30'},\n\t 5: {id: 'linkageMode', html: linkageDialogHtml, functions: null, height: '20', width: '80'},\n\t 6: {id: 'remarks', html: remarksHtml, functions: null, height: '25', width: '20'},\n\t 7: {id: 'docs'}, \n\t 8: {id: 'settings', html: settingsHtml, functions: null, height: '15', width: '15'},\n 9: {id: 'alert', html: alertHtml, functions: null, height: '6', width: '30'}\n\t};\n}", "function close_history_dialog()\n {\n $('#notehistory, #notediff').each(function(i, elem) {\n var $dialog = $(elem);\n if ($dialog.is(':ui-dialog'))\n $dialog.dialog('close');\n });\n }", "function updateCurrentlyOpenCounter(e, closing) {\n\tvar count = $('#contentWrapper .tiddler').length;\n\tif(closing) {\n\t\tcount -= 1;\n\t}\n\tif(count<0) {\n\t\tcount=0;\n\t}\n\t$('#sidebarIcons #current span').each(function() {\n\t\tif(!count) {\n\t\t\t$(this).hide().text('');\n\t\t} else {\n\t\t\t$(this).show().text(count);\n\t\t}\n\t});\n}", "function buildDialogs() {\n\t\tajaxHelper.getUsers(pageData.songId);//set initial user list as something to fall back on\n\n\t\t/* \n\t\tThis dialog is shared between the add and change instrument functions (they just update the title etc)\n\t\t*/\n\t\t$('.instrument-dialog').dialog({\n\t\t\tmodal : true,\n\t\t\ttitle : 'Add Instrument',\n\t\t\tautoOpen : false,\n\t\t\tbuttons : [{text : 'OK', click : function() {\n\t\t\t\t//need to work out the instrument to add/change\n\t\t\t\tvar familyIndex = parseInt($('select#instrument-class').val());//the family of instrument\n\t\t\t\tvar instrumentIndex = parseInt($('select#instrument-choice').val());\n\n\t\t\t\t//calls either add or change instrument (depending on dialog) with the selected instrument as an argument\n\t\t\t\tpageData.instrumentFunction(familyIndex * 8 + instrumentIndex);\n\t\t\t\t$('.instrument-dialog').dialog(\"close\");\n\t\t\t}},\n\t\t\t{text : 'Cancel', click : function() {\n\t\t\t\t$('.instrument-dialog').dialog(\"close\");\n\t\t\t}}]\n\t\t});\n\n\t\t$('select#instrument-class').change(function() {\n\t\t\tvar index = $(this).val();\n\t\t\t$('select#instrument-choice').empty();//remove any current entries\n\t\t\tfor(var i = 0; i < 8; i++) {//loop through family of instruments and append to lower select box\n\t\t\t\tvar instrumentNo = index * 8 + i;\n\t\t\t\t$('select#instrument-choice').append(\"<option value='\" + i + \"'>\" + midiHelper.getInstrumentName(instrumentNo) + \"</option>\");\n\t\t\t}\n\t\t});\n\t\t$('select#instrument-class').change();//call it once to set fill it in initially\n\n\t\t$('button.add-instrument').click(function() {//set up dialog to work for add instrument\n\t\t\tif($('.tab-content').children().length >= pageData.maxTabs) {\n\t\t\t\treturn;//we have reached maximum number of tabs\n\t\t\t}\n\t\t\t$('.ui-dialog-titlebar').html(\"Add Instrument\");\n\t\t\tpageData.instrumentFunction = addInstrument;\n\t\t\t$('.instrument-dialog').removeClass('no-display');\n\t\t\t$('.instrument-dialog').dialog('open');\n\t\t});\n\n\t\t$('button.change-instrument').click(function() {//set up dialof to work for change instrument\n\t\t\t$('.ui-dialog-titlebar').html(\"Change Instrument\");\n\t\t\tpageData.instrumentFunction = changeInstrument;\n\t\t\t$('.instrument-dialog').removeClass('no-display');\n\t\t\t$('.instrument-dialog').dialog('open');\n\t\t});\n\n\t\t/*\n\t\tCreate invite friends dialog\n\t\t*/\n\t\t$('div.invite-dialog').dialog({\n\t\t\tmodal : true,\n\t\t\ttitle : 'Invite friends to collaborate',\n\t\t\tautoOpen : false,\n\t\t\tbuttons : [{text : 'Cancel', click : function() {\n\t\t\t\t$('.invite-dialog').dialog(\"close\");\n\t\t\t}}],\n\t\t\topen : function() {\n\t\t\t\tajaxHelper.getUsers(pageData.songId);//update list of users\n\t\t\t\t$(this).removeClass(\"no-display\");\n\t\t\t}\n\t\t});\n\n\t\t$('.invite-button').click(function() {\n\t\t\t$('div.invite-dialog').dialog(\"open\");\n\t\t\t$('.ui-dialog-titlebar').html(\"Invite friends to collaborate\");\n\t\t});\n\n\n\t\t$('input.name-bar').keyup(function(){\n\t\t\t//compare name entered to list of users whenever user types something \n\t\t\t//and draw a list of matches below with invite buttons for each one\n\t\t\tvar name = $(this).val();\n\t\t\tvar matches = searchForPossibleUser(name);\n\n\t\t\tif(!matches || matches.length === 0) {\n\t\t\t\t$('table.results-table tbody').empty();\n\t\t\t\t$('span.invite-info').html(\"No results\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$('span.invite-info').html(\"Results\");\n\t\t\t$('table.results-table tbody').empty();//get rid of previous matches \n\t\t\tfor(var i = 0; i < matches.length; i++) {\n\t\t\t\tvar html = '<tr><td>' + matches[i].username + '</td><td><button class=\"btn btn-primary fresh\" id=\"match' +\n\t\t\t\tmatches[i].user_id + '\">Invite' + '</button></td></tr>';\n\n\t\t\t\t$('table.results-table tbody').append(html);\n\t\t\t\t$('button.fresh').click(function() {//fresh tag used to mark button out to register callback\n\t\t\t\t\tajaxHelper.sendInvite(pageData.songId,$(this).attr('id').substring(5), ajaxFailure);\n\t\t\t\t\t$(this).html(\"Added\").attr(\"disabled\",\"disabled\");\n\t\t\t\t});\n\t\t\t\t$('button.fresh').removeClass('fresh');//get rid of tag after used to register callback\n\t\t\t}\n\t\t});\n\t}", "dialog() {\n return this._getOrCreateSubset('dialog', dialog_1.default);\n }", "openAll() {\n this._openCloseAll(true);\n }", "function handleStateChanges(){\n\n /*\n * Handle events on dialog show.\n */\n $('#configSelectionModal').on('show.bs.modal', function(e){\n selections = [];\n $('table#filelist tr.config').each(function(idx, tr){\n var selection = getSelectionFromTR($(tr));\n selections.push(selection);\n });\n runSearch();\n });\n\n /*\n * Listen for remove events on the filelist and update\n * selections accordingly.\n */\n $('table#configurations').on('filelist:removed', function(e){\n $(selections).each(function(idx, selection){\n if (selection.uid === e.selection.uid) {\n selections.splice(idx, 1);\n }\n });\n runSearch();\n });\n\n /*\n * Listen for configurations being added to the filelist\n * and update state on this.\n */\n $('table#configurations').on('config:added', function(e){\n selections.push(e.selection);\n toggleCheckboxes(e.selection, true);\n });\n\n $('table#configurations').on('config:removed', function(e){\n toggleCheckboxes(e.selection, false);\n });\n }", "function currentCompletions(state) {\n var _a;\n let open = (_a = state.field(completionState, false)) === null || _a === void 0 ? void 0 : _a.open;\n if (!open || open.disabled)\n return [];\n let completions = completionArrayCache.get(open.options);\n if (!completions)\n completionArrayCache.set(open.options, completions = open.options.map(o => o.completion));\n return completions;\n}", "function keepCheckOnDesktopIcons() {\n allIcons.forEach((icon) => {\n icon.addEventListener(\"dblclick\", () => {\n let src = null;\n let split = null;\n let idg = null;\n for (let i = 0; i < allIcons.length; i++) {\n if (icon.src == allIcons[i].src) {\n src = allIcons[i].src;\n split = src.split(\"/\");\n let source = split.pop();\n idg = source.split(\".\");\n }\n }\n if (icon.src == src && iconArray[icon.src] >= 1) {\n let icon_name = idg[0];\n let icon_extension = idg[1];\n let tagType = \"img\";\n addIconToTaskbar(icon_name, icon_extension, tagType);\n panelcount++;\n iconArray[icon.src]--;\n CreateModal(idg, icon.src);\n hideWidget();\n return;\n }\n return;\n });\n });\n}", "overlayOpened() {\n for(var modal in state.openedModals) {\n if(state.openedModals[modal]) {\n return true\n }\n }\n return false\n }", "function updateDialogsList(dialogId, text){\n\n // update unread message count\n var badgeCount = $('#'+dialogId+' .badge').html();\n $('#'+dialogId+'.list-group-item.inactive .badge').text(parseInt(badgeCount)+1).fadeIn(500);\n\n // update last message\n $('#'+dialogId+' .list-group-item-text').text(text);\n}", "gainedActiveStatus(_lastActiveControl) {\n let _parentIdx = this.isArray(this.parents) ?\n this.parents.length - 1 : -1;\n if (HSystem.windowFocusMode === 1 && _parentIdx > 1) {\n for (; _parentIdx > 0; _parentIdx--) {\n // Send gainedActiveStatus to HWindow parent(s)\n if (this.isntNullOrUndefined(this.parents[_parentIdx].windowFocus)) {\n this.parents[_parentIdx].gainedActiveStatus();\n }\n }\n }\n }", "getDialogById(id) {\n return this.openDialogs.find(dialog => dialog.id === id);\n }", "getDialogById(id) {\n return this.openDialogs.find(dialog => dialog.id === id);\n }", "getDialogById(id) {\n return this.openDialogs.find(dialog => dialog.id === id);\n }", "function saveBeforeClose() {\n // We've already saved all other open editors when they go active->inactive\n saveLineFolds(EditorManager.getActiveEditor());\n }", "function initAllDialogs() {\r\n\r\n initGridLanguage(systemConfig.common.language);\r\n\r\n $dialogSystem.dialog({\r\n autoOpen: false,\r\n modal: true,\r\n width: 800,\r\n height: 480,\r\n buttons: [\r\n {\r\n text: _('Save'),\r\n click: function () {\r\n var common = systemConfig.common;\r\n var languageChanged = false;\r\n var activeRepoChanged = false;\r\n\r\n $('.system-settings.value').each(function () {\r\n var $this = $(this);\r\n var id = $this.attr('id').substring('system_'.length);\r\n\r\n if ($this.attr('type') == 'checkbox') {\r\n common[id] = $this.prop('checked');\r\n } else {\r\n if (id == 'language' && common.language != $this.val()) languageChanged = true;\r\n if (id == 'activeRepo' && common.activeRepo != $this.val()) activeRepoChanged = true;\r\n common[id] = $this.val();\r\n if (id == 'isFloatComma') common[id] = (common[id] === \"true\" || common[id] === true);\r\n }\r\n });\r\n\r\n // Fill the repositories list\r\n var links = {};\r\n for (var r in systemRepos.native.repositories) {\r\n if (typeof systemRepos.native.repositories[r] == 'object' && systemRepos.native.repositories[r].json) {\r\n links[systemRepos.native.repositories[r].link] = systemRepos.native.repositories[r].json;\r\n }\r\n }\r\n systemRepos.native.repositories = {};\r\n var data = $gridRepo.jqGrid('getRowData');\r\n var first = null;\r\n for (var i = 0; i < data.length; i++) {\r\n systemRepos.native.repositories[data[i].name] = {link: data[i].link, json: null};\r\n if (links[data[i].link]) systemRepos.native.repositories[data[i].name].json = links[data[i].link];\r\n if (!first) first = data[i].name;\r\n }\r\n // Check if the active repository still exist in the list\r\n if (!first) {\r\n if (common.activeRepo) {\r\n activeRepoChanged = true;\r\n common.activeRepo = '';\r\n }\r\n } else if (!systemRepos.native.repositories[common.activeRepo]) {\r\n activeRepoChanged = true;\r\n common.activeRepo = first;\r\n }\r\n common.diag = $('#diagMode').val();\r\n\r\n // Fill the certificates list\r\n systemCerts.native.certificates = {};\r\n data = $gridCerts.jqGrid('getRowData');\r\n for (var j = 0; j < data.length; j++) {\r\n systemCerts.native.certificates[data[j].name] = string2cert(data[j].name, data[j].certificate);\r\n }\r\n\r\n socket.emit('extendObject', 'system.config', {common: common}, function (err) {\r\n if (!err) {\r\n if (languageChanged) {\r\n window.location.reload();\r\n } else {\r\n if (activeRepoChanged) initAdapters(true);\r\n }\r\n }\r\n\r\n socket.emit('extendObject', 'system.repositories', systemRepos, function (err) {\r\n if (activeRepoChanged) initAdapters(true);\r\n\r\n socket.emit('extendObject', 'system.certificates', systemCerts, function (err) {\r\n $dialogSystem.dialog('close');\r\n });\r\n });\r\n });\r\n }\r\n },\r\n {\r\n text: _('Cancel'),\r\n click: function () {\r\n $dialogSystem.dialog('close');\r\n }\r\n }\r\n ],\r\n open: function (event, ui) {\r\n $gridRepo.setGridHeight($(this).height() - 150).setGridWidth($(this).width() - 40);\r\n $gridCerts.setGridHeight($(this).height() - 150).setGridWidth($(this).width() - 40);\r\n initRepoGrid();\r\n initCertsGrid();\r\n },\r\n resize: function () {\r\n $gridRepo.setGridHeight($(this).height() - 160).setGridWidth($(this).width() - 40);\r\n $gridCerts.setGridHeight($(this).height() - 160).setGridWidth($(this).width() - 40);\r\n }\r\n });\r\n\r\n $dialogEnum.dialog({\r\n autoOpen: false,\r\n modal: true,\r\n width: 500,\r\n height: 300,\r\n buttons: [\r\n {\r\n text: _('Save'),\r\n click: function () {\r\n $dialogEnum.dialog('close');\r\n\r\n var name = $('#enum-name').val().replace(/ /g, '_').toLowerCase();\r\n if (!name) {\r\n alert(_('Invalid name!'));\r\n return;\r\n }\r\n if (objects[(enumCurrentParent || 'enum') + '.' + name]) {\r\n alert(_('Name yet exists!'));\r\n return;\r\n }\r\n\r\n enumAddChild(enumCurrentParent, (enumCurrentParent || 'enum') + '.' + name, $('#enum-name').val());\r\n }\r\n },\r\n {\r\n text: _('Cancel'),\r\n click: function () {\r\n $dialogEnum.dialog('close');\r\n }\r\n }\r\n ]\r\n });\r\n\r\n $dialogCommand.dialog({\r\n autoOpen: false,\r\n modal: true,\r\n width: 920,\r\n height: 480,\r\n closeOnEscape: false,\r\n open: function (event, ui) {\r\n $(\".ui-dialog-titlebar-close\", ui.dialog || ui).hide();\r\n }\r\n });\r\n\r\n $dialogConfig.dialog({\r\n autoOpen: false,\r\n modal: true,\r\n width: 830, //$(window).width() > 920 ? 920: $(window).width(),\r\n height: 536, //$(window).height() - 100, // 480\r\n closeOnEscape: false,\r\n open: function (event, ui) {\r\n $('#dialog-config').css('padding', '2px 0px');\r\n },\r\n beforeClose: function () {\r\n if (window.frames['config-iframe'].changed) {\r\n return confirm(_('Are you sure? Changes are not saved.'));\r\n }\r\n return true;\r\n },\r\n close: function () {\r\n // Clear iframe\r\n $configFrame.attr('src', '');\r\n }\r\n });\r\n\r\n $dialogHistory.dialog({\r\n autoOpen: false,\r\n modal: true,\r\n width: 830,\r\n height: 575,\r\n closeOnEscape: false,\r\n buttons: [\r\n {\r\n text: _('Save'),\r\n click: function () {\r\n var id = $('#edit-history-id').val();\r\n var enabled = $('#edit-history-enabled').is(':checked');\r\n var changesOnly = $('#edit-history-changesOnly').is(':checked');\r\n var minLength = parseInt($('#edit-history-minLength').val(), 10) || 480;\r\n var retention = parseInt($('#edit-history-retention').val(), 10) || 0;\r\n\r\n objects[id].common.history = {\r\n enabled: enabled,\r\n changesOnly: changesOnly,\r\n minLength: minLength,\r\n maxLength: minLength * 2,\r\n retention: retention\r\n };\r\n\r\n currentHistory = null;\r\n\r\n socket.emit('setObject', id, objects[id], function () {\r\n $dialogHistory.dialog('close');\r\n });\r\n\r\n }\r\n },\r\n {\r\n text: _('Cancel'),\r\n click: function () {\r\n $dialogHistory.dialog('close');\r\n }\r\n }\r\n ],\r\n open: function (event, ui) {\r\n $gridHistory.setGridHeight($(this).height() - 180).setGridWidth($(this).width() - 30);\r\n $('#iframe-history-chart').css({height: $(this).height() - 115, width: $(this).width() - 30});\r\n },\r\n close: function () {\r\n $('#iframe-history-chart').attr('src', '');\r\n },\r\n resize: function () {\r\n $gridHistory.setGridHeight($(this).height() - 180).setGridWidth($(this).width() - 30);\r\n $('#iframe-history-chart').css({height: $(this).height() - 115, width: $(this).width() - 30});\r\n }\r\n });\r\n }", "function saveWindow(){\n var folder = document.getElementById(\"curr-folder-name\").innerHTML\n\n chrome.windows.getCurrent({populate:true},function(window){\n //collect all of the urls here\n window.tabs.forEach(function(tab){\n\n var myURL = {\n url: tab.url,\n title: tab.title\n };\n\n // make sure you're not adding repeats\n if (!myTabDict[folder].urlSet.includes(myURL.url)){\n addTabToFolder(myURL, folder)\n saveData();\n updateURLS(folder); // here so that I can see all the tabs without needing exit\n }\n });\n });\n // why can't i see the urls appear? seems more efficient to have it here, but...\n // updateURLS(folder);\n}", "function openUserHistoryList() {\r\n\tvar days = $('#activity-level').val();\r\n\tvar title = $('#activity-level option:selected').text();\r\n\t$('#userListTable').html('');\r\n\t$('#userListProgress').css('display','block');\t\t\t\t\t\r\n\t$('#userList').dialog('destroy');\r\n\tvar userListDialog = $('#userList').dialog({ title: title, bgiframe: true, modal: true, position: ['center',50], width: 850, buttons: { Close: function() { $(this).dialog('close'); } } });\r\n\t$.get(app_path_webroot+'ControlCenter/user_list_ajax.php?d='+days, {}, function(data) {\r\n\t\t// Inject table\r\n\t\t$('#userListProgress').css('display','none');\r\n\t\t$('#userListTable').html(data);\r\n\t\t// Reset dialog dimensions\r\n\t\tfitDialog(userListDialog);\r\n\t\t// Activate table search\r\n\t\t$('#user_list_search').quicksearch('table#table-userListTableInner tbody tr');\r\n\t\t// Re-activate table search when table is re-sorted\r\n\t\t$('.hDivBox').click(function() {\r\n\t\t\t$('#user_list_search').quicksearch('table#table-userListTableInner tbody tr');\r\n\t\t});\r\n\t});\r\n}", "function _getActive() { // store once last interaction\n if (DF.thisAction !== DF.lastAction) {\n DF.lastAction = DF.thisAction;\n API.update();\n }\n }", "function isAlreadyOpen(path) {\n var b = false;\n var pid = undefined;\n\n $('#theCollections > div[role=tabpanel]')\n .each(function (i, e) {\n var dp = $(e).attr('data-path');\n if ( dp === path ) {\n b = true;\n pid = $(e).attr('id');\n };\n });\n return [b, pid];\n}", "get hasStableDialog() {\n return this.dlg && this.dlg.connected;\n }", "function currentTabs(tabs) {\n var loc = tbr.localSession_;\n consoleDebugLog('Latest local tabs:\\n' + tabsToString(tabs));\n // Accept the new set of tabs\n loc.tabs = tabs;\n // Proceed with updated tabs in place.\n contFunc();\n }", "handleOpenDialog(id, persist) {\n this.setState({\n openDialog: true,\n idToDelete: id,\n persistToDelete: persist,\n });\n }", "closeAll() {\n let i = this.openModals.length;\n while (i--) {\n this.openModals[i].close();\n }\n }", "function tries() {\n\t\topenedPairs++\n\t\t$(\"#openedPairs span\").text(openedPairs);\n\t}", "dismissAllDialogs() {\n _.map(this.state.dialogs, (x) => {\n if (x.props.onDismiss) {\n x.props.onDismiss();\n }\n });\n this.setState({ dialogs: [], });\n }", "get activeInstances() { return this._modalStack.activeInstances; }", "get afterOpened() {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }", "get afterOpened() {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }", "get afterOpened() {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }", "_removeOpenDialog(dialogRef) {\n const index = this.openDialogs.indexOf(dialogRef);\n if (index > -1) {\n this.openDialogs.splice(index, 1);\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this._ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n }\n else {\n element.removeAttribute('aria-hidden');\n }\n });\n this._ariaHiddenElements.clear();\n this._getAfterAllClosed().next();\n }\n }\n }", "_removeOpenDialog(dialogRef) {\n const index = this.openDialogs.indexOf(dialogRef);\n if (index > -1) {\n this.openDialogs.splice(index, 1);\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this._ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n }\n else {\n element.removeAttribute('aria-hidden');\n }\n });\n this._ariaHiddenElements.clear();\n this._getAfterAllClosed().next();\n }\n }\n }", "function activate() {\n scope.$on('wizard_changes-have-been-made', onChanges);\n scope.$on('text-edit_changes-have-been-made', onChanges);\n\n // array of the IDs of opened ndDialogs\n // will change if some ngDialog have been opened or closed\n scope.ngDialogs = ngDialog.getOpenDialogs();\n\n scope.$watchCollection('ngDialogs', function (newVal, oldVal) {\n if (lodash.isEmpty(oldVal) && newVal.length === 1) {\n $document.on('keyup', onKeyUp);\n } else if (lodash.isEmpty(newVal)) {\n $document.off('keyup', onKeyUp);\n\n isChangesHaveBeenMade = false;\n }\n });\n }", "_capturePreviouslyFocusedElement() {\n if (this._document) {\n this._elementFocusedBeforeDialogWasOpened = this._document.activeElement;\n }\n }", "function getTabIds() {\n Reporter_1.Reporter.debug('Get all ids of all open tabs');\n return tryBlock(() => browser.getTabIds(), 'Failed to get tab ids');\n }", "function determineWindowState() {\n var self = this;\n var _previousState = _isMainWindow;\n _windowArray = localStorage.getItem(_LOCALSTORAGE_KEY);\n\n if (_windowArray === null || _windowArray === \"NaN\") {\n _windowArray = [];\n } else {\n _windowArray = JSON.parse(_windowArray);\n }\n\n if (_isFocusedPromotedToMain && document.hasFocus() && _initialized) {\n _windowArray.splice(_windowArray.indexOf(_windowId), 1);\n\n _windowArray.push(_windowId);\n\n _isMainWindow = true;\n localStorage.setItem(_LOCALSTORAGE_KEY, JSON.stringify(_windowArray));\n } else if (_initialized) {\n //Determine if this window should be promoted\n if (_windowArray.length <= 1 || (_isNewWindowPromotedToMain ? _windowArray[_windowArray.length - 1] : _windowArray[0]) === _windowId) {\n _isMainWindow = true;\n } else {\n _isMainWindow = false;\n }\n } else {\n if (_windowArray.length === 0) {\n _isMainWindow = true;\n _windowArray[0] = _windowId;\n localStorage.setItem(_LOCALSTORAGE_KEY, JSON.stringify(_windowArray));\n } else {\n _isMainWindow = false;\n\n _windowArray.push(_windowId);\n\n localStorage.setItem(_LOCALSTORAGE_KEY, JSON.stringify(_windowArray));\n }\n } //If the window state has been updated invoke callback\n\n\n if (_previousState !== _isMainWindow) {\n _onWindowUpdated.call(this, this);\n } //Perform a recheck of the window on a delay\n\n\n setTimeout(function () {\n determineWindowState.call(self);\n }, RECHECK_WINDOW_DELAY_MS);\n } //Remove the window from the global count", "onDialogClose() {\n var nextDialogState = this.state.dialog;\n nextDialogState.open = false;\n this.setState({ dialog: nextDialogState })\n }", "function updateItemDialogue(){\n if(currentItem === `acRemote`){\n generateDialogue(itemDialogue.acRemote_dialogues);\n currentdialogueNbr ++;\n currentItem = `acRemote`;\n }else if (currentItem === `ac`){\n generateDialogue(itemDialogue.Air_Conditioner_dialogues);\n currentdialogueNbr ++;\n currentItem = `ac`;\n }else if (currentItem === `penpen`){\n generateDialogue(itemDialogue.penPen_dialogues);\n currentdialogueNbr ++;\n currentItem = `penpen`;\n }else if (currentItem === `pictureBoard`){\n generateDialogue(itemDialogue.Pictures_Board_dialogues);\n currentdialogueNbr ++;\n currentItem = `pictureBoard`;\n }\n checkIfNextScene();\n}", "function checkActivity() {\n\t//console.log(\"checkActivity initialized\");\n\t// Check for changing tab\n\tchrome.tabs.onActivated.addListener(\n\tfunction(tabs) {\n\t\tcurTabId = tabs.tabId;\n\t\tconsole.log(\"Tab changed - \" + tabs.tabId);\n\t\tupdateInfo();\n\t\t\n\t});\n\t\n\t// Check for tabs updating\n\tchrome.tabs.onUpdated.addListener(\n\tfunction(tabId, changeInfo, tab) {\n\t\tif (tabId == curTabId) {\n\t\t\tconsole.log(\"Tabs updated - \" + tabId);\n\t\t\tupdateInfo();\n\t\t}\n\t});\n\t\n\t// Query info for tabs.query\n\tvar queryInfo = {\n\t\tactive: true,\n\t\tcurrentWindow: true\n\t};\n\t\n\t// check for window focus changing (different window or closing)\n\tchrome.windows.onFocusChanged.addListener(\n\tfunction(windowId) {\n console.log(\"Detected window focus changed\");\n chrome.tabs.query(queryInfo,\n function(tabs) {\n\t\tconsole.log(\"Window or Tab changed\");\n\t\t// Make sure tabs is defined\n\t\tif (typeof tabs[0] != 'undefined') {\n\t\t\tvar tab = tabs[0]; // only one active tab at a time\n\t\t\tcurTabId = tab.id;\n\t\t\tupdateInfo();\n\t\t}\n\t });\n\t});\t\n}", "getAllPopups() {\n return document.getElementsByClassName(A11yClassNames.POPUP);\n }", "function clearOpenCards() {\n openedCards = [];\n}", "function getOpenPaths(){\n console.log('Init getOpenPaths()')\n var gettingItem = browser.storage.local.get('idOpenPaths');\n // Object result: empty object if the searched value is not stored.\n gettingItem.then((result) => {\n // Undefined -> open paths option has never been used.\n if ( (typeof result.idOpenPaths != 'undefined') && (result.idOpenPaths == 1) ){\n // On/off openPaths switch.\n document.getElementById('boxPaths').checked = true;\n } else {\n document.getElementById('boxPaths').checked = false;\n }\n }, reportError);\n }", "function trackNotebookOpenClose(){\n /* track notebook open and close events */\n trackAction(Notebook, Date.now(), 'notebook-opened', 0, [0]);\n window.onbeforeunload = function(event) {\n trackAction(Notebook, Date.now(), 'notebook-closed', 0, [0]);\n }\n }", "function scanSidebars () {\r\n let a_winId = Object.keys(privateSidebarsList);\r\n let len = a_winId.length;\r\n for (let i=0 ; i<len ; i++) {\r\n\tlet winId = a_winId[i]; // A String\r\n\tlet windowId = privateSidebarsList[winId]; // An integer\r\n//console.log(\"Scanning \"+windowId);\r\n\tbrowser.sidebarAction.isOpen(\r\n\t {windowId: windowId}\r\n\t).then(\r\n\t function (open) {\r\n//console.log(windowId+\" is \"+open);\r\n\t\tif (!open) { // Remove from lists of open sidebars\r\n//console.log(\"Deleting \"+windowId);\r\n\t\t delete privateSidebarsList[windowId];\r\n\t\t delete isSidebarOpen[windowId];\r\n\t\t // Do not delete entry in sidebarCurId to keep it across sidebar sessions\r\n\t\t if (--len <= 0) {\r\n\t\t\tclearInterval(sidebarScanIntervalId);\r\n\t\t\tsidebarScanIntervalId = undefined;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t).catch( // Asynchronous also, like .then\r\n\t function (err) {\r\n\t\t// window doesn't exist anymore\r\n//console.log(\"Error name: \"+err.name+\" Error message: \"+err.message);\r\n\t\tif (err.message.includes(\"Invalid window ID\")) {\r\n//console.log(\"Window doesn't exist anymore, deleting it: \"+windowId);\r\n\t\t delete privateSidebarsList[windowId];\r\n\t\t delete isSidebarOpen[windowId];\r\n\t\t // Do not delete entry in sidebarCurId to keep it across sidebar sessions\r\n\t\t let len = Object.keys(privateSidebarsList).length;\r\n\t\t if (len == 0) {\r\n\t\t\tclearInterval(sidebarScanIntervalId);\r\n\t\t\tsidebarScanIntervalId = undefined;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t);\r\n }\r\n}", "function syncSelectionIndicator() {\n _.forEach(_views, function (view) {\n view.$openFilesContainer.triggerHandler(\"scroll\");\n });\n }", "function getWindowHandles() {\r\n var windowHandles = [];\r\n for (var tab in ChromeDriver.tabs) {\r\n windowHandles.push(ChromeDriver.tabs[tab].windowName);\r\n }\n return JSON.stringify({statusCode: 0, value: windowHandles});\r\n}", "get undockedItems() {\n const that = this;\n\n if (!that.isReady) {\n return;\n }\n\n const tabsWindows = document.getElementsByTagName('jqx-tabs-window');\n let undockedWindows = [];\n\n for (let i = 0; i < tabsWindows.length; i++) {\n if (!tabsWindows[i].closest('jqx-docking-layout') && tabsWindows[i].layout === that) {\n tabsWindows[i].undocked = true;\n undockedWindows.push(tabsWindows[i]);\n }\n }\n\n return undockedWindows;\n }", "function dialogContent() {\n\n let timeCount=document.getElementById(\"timer\");\n let time= timeCount.textContent;\n timeCount.innerText=\"00min:00sec\";\n\n let star=document.getElementsByTagName(\"li\");\n for(let i=2;i>=0;i--)\n {\n star[i].style.color=\"black\";\n }\n\n let dial=document.getElementById(\"favDialog\");\n\n let str=\"<h1>Congratulatios!!!<h1><hr><h1>You Won with \"+moves+\" moves you took <br>\"+time+\" to complete the game.<br>You earned \"+starCount+\" STARS.</h1><hr><button class='dialogBtn' onclick='ok()'>Ok</button><button class='daBtn' onclick='playAgain()'>Play Again</button>\";\n\n let child=document.createElement('div');\n child.innerHTML=str;\n\n dial.appendChild(child);\n document.querySelector(\".deck\").remove();\n\n let scorePanel=document.getElementsByClassName(\"score-panel\")[0];\n scorePanel.style.display=\"none\";\n matches=0;\n moves=0;\n\n let m=document.getElementsByClassName(\"moves\")[0];\n m.textContent =\"\";\n document.getElementById(\"favDialog\").setAttribute(\"open\",\"open\");\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 }", "get openModals() {\n return this.parentService ? this.parentService.openModals : this.rootOpenModals;\n }", "_saveWindowStates () {\n \n this.settingsStore.set(\"MainWindow\", this.mainWinName)\n \n this.settingsStore.set('managed', this.windowStates)\n \n this.settingsStore.set(\"LastOpen\", this.lastOpen)\n \n }", "openAll(){\n\t\t\n\t\tif(this.options.allOpen || this.options.keepOpen){\n\t\t\tfor(let i = 0; i < this.accordions.length; i++){\n\t\t\t\tlet accordion = this.accordions[i];\n\t\t\t\tlet accordionInput = accordion.input;\n\t\t\t\taccordionInput.checked = true;\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.error(\"Only one accordion can be opened at a time\");\n\t\t}\n\t}", "function clear_last_opened_list()\r\n{\r\n\tTitanium.App.Properties.setString('last_opened_list', '1');\r\n}", "function putNewMsgCount (count, dialog_id, text, add_time) {\n if (parseInt(dialog_id)>0) {\n if ($('#dialog_'+dialog_id).length) {\n if (count>0) {\n //alert($('#dialog_'+dialog_id+' .dialogue-count').length)\n if ($('#dialog_'+dialog_id+' .dialogue-count').length) {\n $('#dialog_'+dialog_id+' .dialogue-count').html(''+count+'');\n } else {\n if ($('#dialog_'+dialog_id+' .datetime').length)\n $('#dialog_'+dialog_id+' .datetime').after('<div class=\"dialogue-count\">'+count+'</div>');\n else if ($('#dialog_'+dialog_id+' .contact-actions').length)\n $('#dialog_'+dialog_id+' .contact-actions').after('<div class=\"dialogue-count\">'+count+'</div>');\n else if ($('#dialog_'+dialog_id+' .dialogue-info').length)\n $('#dialog_'+dialog_id+' .dialogue-info').after('<div class=\"dialogue-count\">'+count+'</div>');\n }\n } else {\n $('#dialog_'+dialog_id+' .dialogue-count').remove();\n }\n /*if (author)\n $('#dialog_'+dialog_id+' .dialogue-name').html(author);*/\n if (text)\n $('#dialog_'+dialog_id+' .dialoque-text').html(text);\n if (add_time)\n $('#dialog_'+dialog_id+' .datetime').html(add_time);\n }\n var html = $('#dialog_'+dialog_id).html();\n $('#dialog_'+dialog_id).remove();\n if (html) {\n $('.dialogues-all-list').prepend('<li id=\"dialog_'+dialog_id+'\">'+html+'</li>')\n } else {\n $.get( '/dialogs/getOneDialog/?dialog_id='+dialog_id+'&ajax=1', function( data ) {\n if (!$('#dialog_'+dialog_id).length) {\n $('.dialogues-all-list').prepend(data)\n }\n }); \n }\n }\n}", "function monitorCurrentPage() {\n $('#monitor_page').addClass('inprogress');\n chrome.tabs.getSelected(null, function(tab) {\n initializePageModePickerPopup(tab);\n _gaq.push(['_trackEvent', tab.url, 'add']);\n\n chrome.tabs.getAllInWindow(null, function(tabs){\n var found = false;\n for (var i = 0; i < tabs.length; i++) {\n if(tabs[i].url == chrome.extension.getURL(\"options.htm\")) \n {\n found = true;\n break;\n }\n }\n \n if (found == false)\n {\n chrome.tabs.create({url: \"options.htm\", active: false});\n }\n addPage({url: tab.url, name: tab.title}, function() {\n BG.takeSnapshot(tab.url);\n });\n});\n \n });\n}", "get isOpened() {\n return this._isOpened;\n }", "function loadOpenTabs() {\n var open_tabs = [];\n\n chrome.tabs.query({currentWindow: true}, function(tabs){\n for(var i=0; i<tabs.length; i++)\n {\n open_tabs.push({\n active: tabs[i].active,\n url: tabs[i].url,\n title: tabs[i].title\n });\n }\n\n // set the default name in name textfield\n // format is first tab name + # open tabs\n var currentTitle = open_tabs[0].title;\n if(currentTitle.length > 20)\n currentTitle = currentTitle.substring(0,20)+\"... + \"+(open_tabs.length-1)+\" others\";\n else\n currentTitle = currentTitle+\" + \"+(open_tabs.length-1)+\" others\";\n document.getElementById(\"input_name\").value = currentTitle;\n\n fillActiveInfo(open_tabs);\n });\n}", "setOpenDialogState() {\n let newState = Object.assign({}, this.state);\n newState['open'] = true;\n this.setState(newState);\n }", "function initDialogs() {\n\n\t// initalise all of the dialogs\n\t$('#search_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 450,\n\t\twidth: 700,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\n\t\t\t{\n\t\t\t\ttext: 'Reset Map',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$('#btn_map_reset').click();\n\t\t\t\t\t$('#search_message_box').hide();\n\t\t\t\t\t$('#search_result_count').empty();\n\t\t\t\t\t$('#search_result_hidden').empty();\n\t\t\t\t\t$('#search_results_box').empty();\n\t\t\t\t\tinitSearchForms();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: 'Add All',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$('.fw-add-to-map').filter(':visible').each(function(index, element) {\n\t\t\t\t\t\t$(this).click();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\ttext: 'Help',\n\t\t\t\tclick: function() {\n\t\t\t\t\tshowHelp('search');\n\t\t\t\t}\n\t\t\t},\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t$('#search_message_box').hide();\n\t\t\t$('#search_result_count').empty();\n\t\t\t$('#search_result_hidden').empty();\n\t\t\tinitSearchForms();\n\t\t\tmap.panBy(-350, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t//tidy up the dialog when we close\n\t\t\tvar form = $('#search_form').validate();\n\t\t\tform.resetForm();\n\t\t\tmap.panBy(350, 0);\n\t\t}\n\t});\n\t\n\t$('#adv_search_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 500,\n\t\twidth: 800,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\n\t\t\t{\n\t\t\t\ttext: 'Reset Map',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$('#btn_map_reset').click();\n\t\t\t\t\t$('#adv_search_message_box').hide();\n\t\t\t\t\t$('#adv_result_count').empty();\n\t\t\t\t\t$('#adv_result_hidden').empty();\n\t\t\t\t\tresetAdvFilters();\n\t\t\t\t\tinitSearchForms();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: 'Add All',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$('.fw-add-to-map').filter(':visible').each(function(index, element) {\n\t\t\t\t\t\t$(this).click();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\ttext: 'Help',\n\t\t\t\tclick: function() {\n\t\t\t\t\tshowHelp('adv_search');\n\t\t\t\t}\n\t\t\t},\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t$(\"#adv_search_message_box\").hide();\n\t\t\t$('#adv_result_count').empty();\n\t\t\t$('#adv_result_hidden').empty();\n\t\t\tresetAdvFilters();\n\t\t\tinitSearchForms();\n\t\t\tmap.panBy(-400, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t//tidy up the dialog when we close\n\t\t\tvar form = $('#adv_search_form').validate();\n\t\t\tform.resetForm();\n\t\t\tmap.panBy(400, 0);\n\t\t}\n\t});\n\t\n\t$('#browse_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 500,\n\t\twidth: 800,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\n\t\t\t{\n\t\t\t\ttext: 'Reset Map',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$('#btn_map_reset').click();\n\t\t\t\t\t$('#browse_dialog').dialog('close');\n\t\t\t\t\t$('#browse_dialog').dialog('open');\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: 'Add All',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$('.fw-add-to-map').filter(':visible').each(function(index, element) {\n\t\t\t\t\t\t$(this).click();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\ttext: 'Help',\n\t\t\t\tclick: function() {\n\t\t\t\t\tshowHelp('browse');\n\t\t\t\t}\n\t\t\t},\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\t$('#browse_result_count').empty();\n\t\t\t$('#browse_result_hidden').empty();\n\t\t\t\n\t\t\t$('.browse-select').each(function(){\n\t\t\t\n\t\t\t\tvar select = $(this);\n\t\t\t\t\n\t\t\t\t$('#' + select.context.id + ' option:selected').attr('selected', false);\n\t\t\t\t$('#' + select.context.id + ' option:first').attr('selected', 'selected');\n\n\t\t\t});\n\t\t\t\n\t\t\t$('#browse_search_results').empty();\n\t\t\t$('#browse_search_results_2').empty();\n\t\t\t$('#browse_search_results_3').empty();\n\t\t\t\n\t\t\t$('#browse_tabs').tabs('select', 0);\n\t\t\t\n\t\t\t\n\t\t\tmap.panBy(-400, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\tmap.panBy(400, 0);\n\t\t}\n\t});\n\t\n\t$('#controls_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 500,\n\t\twidth: 850,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\n\t\t\t{\ttext: 'Help',\n\t\t\t\tclick: function() {\n\t\t\t\t\tshowHelp('controls');\n\t\t\t\t}\n\t\t\t},\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\tmap.panBy(-425, 0);\n\t\t\tprepareMapControls();\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\tmap.panBy(425, 0);\n\t\t}\n\t});\n\t\n\t$('#ajax_error_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 150,\n\t\twidth: 600,\n\t\tmodal: true,\n\t\tposition: 'middle',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t\n\t\t},\n\t\tclose: function() {\n\t\t\t\n\t\t}\n\t});\n\t\n\t$('#welcome_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 600,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\tmap.panBy(-300, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\tmap.panBy(300, 0);\n\t\t}\n\t});\n\t\n\t$('#time_slider_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 250,\n\t\twidth: 700,\n\t\tmodal: false,\n\t\tposition: 'bottom',\n\t\tbuttons: [\n\t\t\t{\n\t\t\t\ttext: 'Animate',\n\t\t\t\tclick: function() {\n\t\t\t\t\tstartTimeAnimation();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\ttext: 'Help',\n\t\t\t\tclick: function() {\n\t\t\t\t\tshowHelp('time_slider');\n\t\t\t\t}\n\t\t\t},\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t$('#time_slider').slider({\n\t\t\t\tmin: 0,\n\t\t\t\tmax: filmWeeklyCategories.length -1,\n\t\t\t\tchange: function(event, ui) {\n\t\t\t\t\t$('#slider_label_top_right').empty().append(filmWeeklyCategories[ui.value].description);\n\t\t\t\t\tupdateMapTimePeriod(ui.value);\n\t\t\t\t},\n\t\t\t\tslide: function(event, ui) {\n\t\t\t\t\t$('#slider_label_top_right').empty().append(filmWeeklyCategories[ui.value].description);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t// reset the time slider and map if it has been updated\n\t\t\t// by having markers added or removed\n\t\t\t\n\t\t\tif(mapUpdated == true) {\n\t\t\t\n\t\t\t\t// reset the time slider\n\t\t\t\t$('#time_slider').slider('value', 0);\n\t\t\t\t\n\t\t\t\t// reset the labels\n\t\t\t\t$('#slider_label_top_right').empty().append(filmWeeklyCategories[0].description);\n\t\t\t\t$('#slider_label_left').empty().append(filmWeeklyCategories[0].description);\n\t\t\t\t$('#slider_label_right').empty().append(filmWeeklyCategories[filmWeeklyCategories.length -1 ].description);\n\t\t\t\t\n\t\t\t\t// update the map\n\t\t\t\tupdateMapTimePeriod(0);\n\t\t\t}\n\t\t},\n\t\tclose: function() {\n\t\t\n\t\t\tstopTimeAnimation();\n\t\t\t\n\t\t}\n\t});\n\t\n\t$('#film_weekly_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 600,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\tmap.panBy(-300, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\tmap.panBy(300, 0);\n\t\t}\n\t});\n\t\n\t$('#about_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 600,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\tmap.panBy(-300, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\tmap.panBy(300, 0);\n\t\t}\n\t});\n\t\n\t$('#help_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 920,\n\t\tmodal: false,\n\t\tposition: 'right',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\t//map.panBy(-300, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\t//map.panBy(300, 0);\n\t\t}\n\t});\n\t\n\t$('#legend_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 600,\n\t\tmodal: false,\n\t\tposition: 'right',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\t//map.panBy(-300, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\t//map.panBy(300, 0);\n\t\t}\n\t});\n\t\n\t$('#contribute_dialog').dialog({\n\t\tautoOpen: false,\n\t\theight: 400,\n\t\twidth: 600,\n\t\tmodal: true,\n\t\tposition: 'left',\n\t\tbuttons: [\t\t\t\n\t\t\t{\n\t\t\t\ttext: 'Close',\n\t\t\t\tclick: function() {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\topen: function() {\n\t\t\t// do this when the dialog opens\n\t\t\tmap.panBy(-300, 0);\n\t\t},\n\t\tclose: function() {\n\t\t\t// do this when the dialog closes\n\t\t\tmap.panBy(300, 0);\n\t\t}\n\t});\n\n}", "static get keepHistory() {\n return this[KEEP_HISTORY];\n }", "openLastActions() {\n this.showActions = true;\n this.$nextTick(() => this.$refs.actionDelete.focus());\n }", "openLastActions() {\n this.showActions = true;\n this.$nextTick(() => this.$refs.actionDelete.focus());\n }", "openLastActions() {\n this.showActions = true;\n this.$nextTick(() => this.$refs.actionDelete.focus());\n }", "openLastActions() {\n this.showActions = true;\n this.$nextTick(() => this.$refs.actionDelete.focus());\n }", "function saveState() {\n if (currentView) {\n currentView.checkpoint();\n }\n ConferenceApp.State.local.navigationState = WinJS.Navigation.history;\n }", "storeCurrentlyViewedReport() {\n const reportID = this.getReportID();\n updateCurrentlyViewedReportID(reportID);\n }", "function _openOnAllDisplays() {\n\t\tchrome.system.display.getInfo(function(displayInfo) {\n\t\t\tif (displayInfo.length === 1) {\n\t\t\t\t_open(null);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < displayInfo.length; i++) {\n\t\t\t\t\t_open(displayInfo[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function resetOpenedCards() {\n openedCards = []\n}", "afterOpened() {\n return this._afterOpened;\n }", "afterOpened() {\n return this._afterOpened;\n }", "afterOpened() {\n return this._afterOpened;\n }", "function addOpened(clickedCard) {\n openCards.push(clickedCard);\n }", "getActiveSymbolCounts() {\n return this.activeSymbolCounts;\n }", "function update_dialog() {\n\t\tif (!externals_requested) {\n\t\t\texternals_requested = true;\n\t\t\tload_externals()\n\t\t\t.then(function() {\n\t\t\t\texternals_loaded = true;\n\t\t\t\tupdate_progress();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!externals_loaded) return;\n\t\tif (user_closed) return;\n\n\t\tif (!dialog_visible) {\n\t\t\tdialog_visible = true;\n\t\t\tif (!document.querySelector('#wkof_ds')) {\n\t\t\t\tlet ds = document.createElement('div');\n\t\t\t\tds.setAttribute('id', 'wkof_ds');\n\t\t\t\tdocument.body.prepend(ds);\n\t\t\t}\n\n\t\t\tdialog = $('<div id=\"wkof_progbar_dlg\" class=\"wkofs_progress_dlg\" style=\"display:none;\"></div>');\n\n\t\t\tdialog.dialog({\n\t\t\t\ttitle: 'Loading Data...',\n\t\t\t\tminHeight: 20,\n\t\t\t\tmaxHeight: window.innerHeight,\n\t\t\t\theight: 'auto',\n\t\t\t\tdialogClass: 'wkof_progbar_dlg',\n\t\t\t\tmodal: false,\n\t\t\t\tresizable: false,\n\t\t\t\tautoOpen: false,\n\t\t\t\tappendTo: '#wkof_ds',\n\t\t\t\tclose: dialog_close\n\t\t\t});\n\t\t\tdialog.dialog('open');\n\t\t}\n\n\t\tvar all_done = true;\n\t\tfor (name in progress_bars) {\n\t\t\tvar progress_bar = progress_bars[name];\n\t\t\tif (progress_bar.value < progress_bar.max) all_done = false;\n\t\t\tvar bar = $('#wkof_progbar_dlg .wkof_progbar_wrap[name=\"'+name+'\"]');\n\t\t\tif (bar.length === 0) {\n\t\t\t\tbar = $('<div class=\"wkof_progbar_wrap\" name=\"'+name+'\"><label>'+progress_bar.label+'</label><div class=\"wkof_progbar\"></div></div>');\n\t\t\t\tvar bars = $('#wkof_progbar_dlg .wkof_progbar_wrap');\n\t\t\t\tbars.push(bar[0]);\n\t\t\t\t$('#wkof_progbar_dlg').append(bars.sort(bar_label_compare));\n\t\t\t}\n\t\t\tif (progress_bar.is_updated) {\n\t\t\t\tprogress_bar.is_updated = false;\n\t\t\t\tbar.find('.wkof_progbar').progressbar({value: progress_bar.value, max: progress_bar.max});\n\t\t\t}\n\t\t}\n\n\t\tif (all_done) shutdown();\n\t}", "attachToAllVisible() {\n for (const editor of vscode.window.visibleTextEditors) {\n this.ensure(editor.document.uri.toString(), editor.document);\n }\n }", "function resetOpenCardsList() {\n openCardsList = [];\n}", "function getPageInfos(){\n browser.tabs.query({active: true, currentWindow: true}, function(tabs) {\n browser.tabs.sendMessage(tabs[0].id, {infoCode: \"pageInfo\"}, function(response) {\n writeToPopup(response);\n });\n });\n}" ]
[ "0.5882049", "0.5790425", "0.56959325", "0.5524715", "0.5524715", "0.5524715", "0.5510946", "0.535889", "0.53493553", "0.5322622", "0.5261911", "0.5261911", "0.5191203", "0.5185792", "0.5171016", "0.51417994", "0.51417994", "0.51417994", "0.51164967", "0.51149267", "0.5112687", "0.5097572", "0.50767106", "0.5044462", "0.5040817", "0.5027328", "0.49645287", "0.49618718", "0.49486002", "0.49427328", "0.49423", "0.49281257", "0.49205467", "0.49205467", "0.49205467", "0.49135464", "0.49127203", "0.487726", "0.4876282", "0.48647863", "0.48575768", "0.48472768", "0.48404998", "0.48342055", "0.48265177", "0.4807168", "0.480611", "0.48041943", "0.48000646", "0.48000646", "0.48000646", "0.47987044", "0.47987044", "0.479496", "0.47887036", "0.47823846", "0.4777738", "0.4773215", "0.47732112", "0.47666556", "0.47645137", "0.47583932", "0.4756438", "0.4754382", "0.47480455", "0.47472343", "0.47435552", "0.4740601", "0.47395313", "0.47355095", "0.47318915", "0.4723517", "0.47110394", "0.47031716", "0.47026005", "0.46973932", "0.4697289", "0.46941257", "0.4693608", "0.4687455", "0.46839318", "0.46826208", "0.46826208", "0.46826208", "0.46826208", "0.468039", "0.46736944", "0.46728662", "0.46660748", "0.4665436", "0.4665436", "0.4665436", "0.46632838", "0.4644622", "0.46431863", "0.4638455", "0.46322256", "0.46264315" ]
0.6404366
2
Stream that emits when a dialog has been opened.
get afterOpened() { return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openDialog() {\n var message = this.getQuestion() + chalk.dim(this.messageCTA + ' Waiting...');\n this.screen.render(message, '');\n\n // Pause Readline to prevent stdin and stdout from being modified while the editor is showing\n this.rl.pause();\n this.dialog.open(this.endDialog.bind(this));\n }", "open() {\n this.$.sourceDialog.opened = true;\n }", "accept() {\n this._dialog_ref.close('done');\n this.event.emit({ reason: 'done' });\n }", "onDialog(handler) {\n return this.on('Dialog', handler);\n }", "function open(dialog) {\n\t\n}", "_onClosed() {\n this.emit(\"closed\");\n }", "onOpen () {\n this.callback()\n }", "showEventDialog() {\n this.refs.dialog.show();\n }", "openSettings () {\n this.emit('opensettings', {})\n }", "_emitClosedEvent() {\n this.closed.next();\n this.closed.complete();\n }", "onOpen() { }", "openDialog() {\n\t\tthis.setState({ open: true });\n\t}", "get onOpening() {\n this.document.documentElement.classList.add(DIALOG_OPEN_HTML_CLASS);\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "get isOpened() {\n return this._isOpened;\n }", "function userOpensHandler() {\n\tdialog.showOpenDialog({\n\t\tproperties: ['openFile']\n\t}, function (filepath) {\n\t\tnewWindowWithContent(filepath.toString());\n\t});\n}", "open() {\n this.visible = true;\n console.log(\"Modal opened\");\n }", "function onOpen() {\n file.pipe(res);\n\n onFinished(res, onResFinished);\n }", "onOpen() {\n\t\t}", "open() {\n this.opened = true;\n }", "function dialogOpened(result) {\n self.onReady && self.onReady(result);\n args.onServiceActivated && args.onServiceActivated(self);\n\n }", "open () {\n this.opened = true;\n }", "show() {\n if(this.hidden) {\n this._stream = this._hiddenStream;\n this._hiddenStream = null;\n }\n }", "setOpenDialogState() {\n let newState = Object.assign({}, this.state);\n newState['open'] = true;\n this.setState(newState);\n }", "openDialog(e) {\n if (this._haxstate) {\n // do not do default\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n return false;\n }\n let c = document.createElement(\"div\");\n for (var id in this.children) {\n if (this.children[id].cloneNode) {\n c.appendChild(this.children[id].cloneNode(true));\n }\n }\n const evt = new CustomEvent(\"simple-modal-show\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n title: this.term,\n elements: {\n content: c,\n },\n styles: {\n \"--simple-modal-width\": \"50vw\",\n \"--simple-modal-max-width\": \"50vw\",\n \"--simple-modal-z-index\": \"100000000\",\n \"--simple-modal-min-height\": \"50vh\",\n },\n invokedBy: this,\n },\n });\n this.dispatchEvent(evt);\n }", "clicked() {\n this.get('onOpen')();\n }", "function handleOpen() {\n setOpen(true);\n }", "_open() {\n if (!this._afterOpened.closed) {\n this._afterOpened.next();\n this._afterOpened.complete();\n }\n }", "function handleOpen() {\n setOpen(true)\n }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "function open() {\n $rootScope.$emit('progress.open', 'open')\n }", "function open(type, params, pipeResponse) {\n var previousDeferred = modal.deferred;\n // Setup the new modal instance properties.\n modal.deferred = $q.defer();\n modal.params = params;\n // window's deferred value.\n if (previousDeferred && pipeResponse) {\n modal.deferred.promise.then(previousDeferred.resolve, previousDeferred.reject);\n // We're not going to pipe, so immediately reject the current window.\n } else if (previousDeferred) {\n previousDeferred.reject();\n }\n $rootScope.$emit(\"AlertServices.open\", type);\n\n return (modal.deferred.promise);\n }", "function show(name) {\r\n var dialogEl = $('#' + name),\r\n dialog = dialogs[name].dialog;\r\n\r\n // Show the dialog.\r\n dialogEl.show().addClass(\"in\");\r\n\r\n // Run onOpen function\r\n dialog.onOpen(dialogEl);\r\n\r\n // Check for auto close of dialog.\r\n dialog.autoClose();\r\n\r\n // Close on Esc key.\r\n checkEsc(name);\r\n\r\n // Close on Cancel button.\r\n dialogEl.find(\".cancel, .ok, .\" + settings.confirm.option_btn_class).on(\"click.dialog\", function () {\r\n close(name);\r\n });\r\n }", "function showOpenDialog () {\n // `showOpenDialogue` takes properties (of the fie selection dialogue)\n // and a callback that gets executed when a file is selected\n dialog.showOpenDialog({ properties: [ 'openDirectory' ] }, loadUserScripts)\n}", "open() {\n // Attach dialog to the body to ensure it's on top of all existing overlays\n // XXX - Known issue: this generates addEventListener errors from a11y\n document.body.appendChild(this);\n\n // Wait until dialog is added to the DOM (required for Safari)\n setTimeout(\n function () {\n this.shadowRoot.querySelector(\"#dialog\").open();\n\n // Clone selected filters, so it can be changed without touching the external property\n this._selectedFilters = Object.assign({}, this.selectedFilters);\n }.bind(this),\n 1\n );\n }", "openDialog(e) {\n let children = FlattenedNodesObserver.getFlattenedNodes(this).filter(\n n => n.nodeType === Node.ELEMENT_NODE\n );\n let c = document.createElement(\"div\");\n for (var child in children) {\n c.appendChild(children[child].cloneNode(true));\n }\n const evt = new CustomEvent(\"simple-modal-show\", {\n bubbles: true,\n cancelable: true,\n detail: {\n title: this.term,\n elements: {\n content: c\n },\n invokedBy: this.shadowRoot.querySelector(\"#button\")\n }\n });\n window.dispatchEvent(evt);\n }", "openNewUserModal() {\n const ref = this._dialog.open(_users_src_lib_new_user_modal_new_user_modal_component__WEBPACK_IMPORTED_MODULE_8__[\"NewUserModalComponent\"], {\n width: 'auto',\n height: 'auto',\n data: {}\n });\n ref.componentInstance.event\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"first\"])((_) => _.reason === 'done'))\n .subscribe((event) => {\n this.addUser(event.metadata);\n ref.close();\n });\n }", "function delegateToAlexa() {\n //console.log(\"in delegateToAlexa\");\n //console.log(\"current dialogState: \"+ this.event.request.dialogState);\n\n if (this.event.request.dialogState === 'STARTED') {\n //console.log(\"in dialog state STARTED\");\n var updatedIntent = this.event.request.intent;\n //optionally pre-fill slots: update the intent object with slot values for which\n //you have defaults, then return Dialog.Delegate with this updated intent\n // in the updatedIntent property\n this.emit(':delegate', updatedIntent);\n } else if (this.event.request.dialogState !== 'COMPLETED') {\n //console.log(\"in dialog state COMPLETED\");\n // Return a Dialog.Delegate directive with no updatedIntent property\n this.emit(':delegate');\n } else {\n //console.log(\"dialog finished\");\n //console.log(\"returning: \"+ JSON.stringify(this.event.request.intent));\n // Dialog is now complete and all required slots should be filled,\n // so call your normal intent handler.\n return this.event.request.intent;\n }\n}", "onDialogBegin(session, args, next) {\n return __awaiter(this, void 0, void 0, function* () {\n session.dialogData.isFirstTurn = true;\n this.showUserProfile(session);\n next();\n });\n }", "function onOpen(){\n console.log('Open connections!');\n}", "showModal() {\n this.open = true;\n }", "async open() {\n\t\tif (this.lock_status_id === 4) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(2);\n\t\tawait this.await_event('status:OPENED');\n\t}", "function dialogOn() {\n\n if (typeof uiVersion != 'undefined' && uiVersion === 'Minuet' && dialog !== 'active') {\n openMinuetWarningDialog();\n }\n else {\n dialog = openWarningDialog();\n }\n isDialogOn = true;\n setCounter();\n\n\n }", "_onOpen() {\n this.state.connected = true;\n console.log(\"Connected...\");\n this.notify(\"open\");\n }", "function delegateSlotCollection(){\n console.log(\"in delegateSlotCollection\");\n console.log(\"current dialogState: \"+this.event.request.dialogState);\n if (this.event.request.dialogState === \"STARTED\") {\n console.log(\"in Beginning\");\n var updatedIntent=this.event.request.intent;\n this.emit(\":delegate\", updatedIntent);\n } else if (this.event.request.dialogState !== \"COMPLETED\") {\n console.log(\"in not completed\");\n // return a Dialog.Delegate directive with no updatedIntent property.\n this.emit(\":delegate\");\n } else {\n console.log(\"in completed\");\n console.log(\"returning: \"+ JSON.stringify(this.event.request.intent));\n // Dialog is now complete and all required slots should be filled,\n // so call your normal intent handler.\n return this.event.request.intent;\n }\n}", "onResultsOpen() {\n state = 'opened';\n\n run(() => {\n debug(`Flexberry Lookup::autocomplete state = ${state}`);\n });\n }", "subscribeToFileOpen() {\n return atom.workspace.onDidOpen(event => {\n this.activeEditor = event.item;\n });\n }", "onClosed() {\r\n // Stub\r\n }", "function Stream() {\n EventEmitter.call(this);\n }", "openDialog() {\n // assemble everything in the slot\n let nodes = dom(this).getEffectiveChildNodes();\n let h = document.createElement(\"span\");\n let c = document.createElement(\"span\");\n let node = {};\n for (var i in nodes) {\n if (typeof nodes[i].tagName !== typeof undefined) {\n switch (nodes[i].getAttribute(\"slot\")) {\n case \"toolbar-primary\":\n case \"toolbar-secondary\":\n case \"toolbar\":\n case \"header\":\n node = nodes[i].cloneNode(true);\n node.removeAttribute(\"slot\");\n h.appendChild(node);\n break;\n case \"button\":\n // do nothing\n break;\n default:\n node = nodes[i].cloneNode(true);\n node.removeAttribute(\"slot\");\n if (this.dynamicImages && node.tagName === \"IRON-IMAGE\") {\n node.preventLoad = false;\n node.removeAttribute(\"prevent-load\");\n }\n c.appendChild(node);\n break;\n }\n }\n }\n const evt = new CustomEvent(\"simple-modal-show\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n title: this.header,\n elements: {\n header: h,\n content: c\n },\n invokedBy: this.$.dialogtrigger,\n clone: true\n }\n });\n this.dispatchEvent(evt);\n }", "playDialogOpenSound() {\n this.dialogOpenSound.play();\n }", "open() {\n const that = this;\n\n if (that.opened) {\n return;\n }\n\n that._open();\n }", "function Stream() {\n EventEmitter.call(this);\n }", "isOpen() { return this._open; }", "async open() {\n if (super.open) {\n await super.open();\n }\n await this.toggle(true);\n }", "function streamCreatedHandler(event) {\n\t\tfor (var i = 0; i < event.streams.length; i++) {\n\t\t\t// Enable the identify button as soon as the publisher hits 'Allow'\n\t\t\tif (event.streams[i].connection.connectionId == session.connection.connectionId) {\n\t\t\t\t//$(\"#identifyButton\").css(\"display\", \"block\");\n\t\t\t}\n\t\t}\n\t}", "get hasStableDialog() {\n return this.dlg && this.dlg.connected;\n }", "focus() {\n this.openDialog();\n }", "focus() {\n this.openDialog();\n }", "changeDialog() {\n this.setState({\n openDialog: !this.state.openDialog\n });\n }", "function StartStreamMode() {\n\n // Set flag\n streaming_mode = true;\n\n // Notify other widgets\n}", "function openUpdateStream() {\n var source = new EventSource(updates_url);\n source.onmessage = function (response) {\n processResponseData(response.data)\n };\n console.log(\"Stream Opened:\", updates_url);\n }", "function onOpen(evt) {\n console.log(\"Connected to server\");\n}", "show() {\n this.style.pointerEvents = 'none'; // To \"allow interaction outside dialog\"\n this.open = true;\n }", "isOpen() {\n return this._opened;\n }", "showDialog() {\n\n if (!this.state.err) {\n return (\n <DialogNewCompetition\n open={this.state.open}\n handleClose={() => this.handleClose()}\n />\n );\n } else {\n return (\n <DialogErrorCompetition\n open={this.state.open}\n handleClose={() => this.handleClose()}\n />\n );\n }\n }", "openDialog(message) {\n this.dialogRef = this.dialog.open(_dialog_dialog_component__WEBPACK_IMPORTED_MODULE_4__[\"DialogComponent\"], {\n data: { message: message },\n });\n }", "showDialog(state, edit) {\n state.dialog = edit;\n }", "showModal() {\n this.isModalOpen = true;\n }", "function Stream() {\n\t EventEmitter.call(this);\n\t}", "function Stream() {\n\t EventEmitter.call(this);\n\t}", "function Stream() {\n\t EventEmitter.call(this);\n\t}", "function Stream() {\n\t EventEmitter.call(this);\n\t}", "function Stream() {\n\t EventEmitter.call(this);\n\t}", "open () {\n const askFilepath = () => {\n const filepath = dialog.showOpenDialog(this.win, {\n title: translate(\"dialog-open\"),\n properties: ['openFile'],\n defaultPath: this.defaultPath\n });\n return filepath[0];\n };\n const filepath = askFilepath();\n if (!filepath) {\n return Promise.resolve(false);\n }\n return this.load(filepath);\n }", "start() {\n\t\t// Is OBS Studio connected?\n\t\tif (!this.obs.connected()) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treject(new Error(\"OBS Studio is not connected.\".lox()));\n\t\t\t});\n\t\t}\n\n\t\t// Is it already active?\n\t\tif (this.active) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tresolve(true);\n\t\t\t});\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.obs.call(\"obs.frontend.streaming.start\", (result, error) => {\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\tthis._active = result;\n\t\t\t\t\tthis._event_status();\n\t\t\t\t\tresolve(result);\n\t\t\t\t} else {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "open () {\n return super.open();\n }", "open () {\n return super.open();\n }", "static create() {\n return __awaiter(this, void 0, void 0, function* () {\n const dialog = new Dialog();\n yield dialog.render();\n return dialog;\n });\n }", "_openedChanged(newValue) {\n if (typeof newValue !== typeof undefined && !newValue) {\n // wipe the slot of our modal\n this.title = \"\";\n while (this.firstChild !== null) {\n this.removeChild(this.firstChild);\n }\n if (this.invokedBy) {\n setTimeout(() => {\n this.invokedBy.focus();\n }, 500);\n }\n const evt = new CustomEvent(\"simple-modal-closed\", {\n bubbles: true,\n cancelable: true,\n detail: {\n opened: false,\n invokedBy: this.invokedBy,\n },\n });\n this.dispatchEvent(evt);\n } else if (newValue) {\n // p dialog backport; a nice, simple solution for close buttons\n let dismiss = this.querySelectorAll(\"[dialog-dismiss]\");\n dismiss.forEach((el) => {\n el.addEventListener(\"click\", (e) => {\n const evt = new CustomEvent(\"simple-modal-dismissed\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n opened: false,\n invokedBy: this.invokedBy,\n },\n });\n this.dispatchEvent(evt);\n this.close();\n });\n });\n let confirm = this.querySelectorAll(\"[dialog-confirm]\");\n confirm.forEach((el) => {\n el.addEventListener(\"click\", (e) => {\n const evt = new CustomEvent(\"simple-modal-confirmed\", {\n composed: true,\n bubbles: true,\n cancelable: true,\n detail: {\n opened: false,\n invokedBy: this.invokedBy,\n },\n });\n this.dispatchEvent(evt);\n this.close();\n });\n });\n const evt = new CustomEvent(\"simple-modal-opened\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n opened: true,\n invokedBy: this.invokedBy,\n },\n });\n this.dispatchEvent(evt);\n }\n }", "function ConvFinished({openConvFinishedDialog, setOpenConvFinishedDialog}) {\n function handleClose() {setOpenConvFinishedDialog(false)}\n // Render\n return (\n <div>\n <Dialog\n open={openConvFinishedDialog}\n onClose={handleClose}\n aria-labelledby=\"InitCompDialog-title\"\n aria-describedby=\"InitCompDialog-description\"\n >\n <DialogTitle id=\"InitCompDialog-title\">{\"Conversion complete!\"}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n The converted epub file can be found in the directory of your pdf file.\n </DialogContentText>\n <Alert severity=\"warning\">\n Some converted epub files may not be viewable as text but images. \n Reed recommends you to buy/get the epub book directly without converting.\n In the next update there will be another option to convert pdf file to epub ensuring text, but will be a bit dirty and contain no images.\n </Alert>\n </DialogContent>\n <DialogActions>\n <Button color=\"primary\" variant=\"contained\" style={{fontWeight: 'bold'}} onClick={()=>{handleClose()}}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n}", "function onStream(request, response) {\n Game\n .findAll()\n .then(games => {\n const json = JSON.stringify(games)\n stream.updateInit(json)\n stream.init(request, response)\n console.log('ONSTREAM', stream)\n })\n .catch(error => next(error))\n}", "function open()\n{\n GC.initial_video_path = dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] });\n}", "function openDialog({ $content, $container = document.body, center = false, initialize = (() => new WebDialog()) } = {}) {\n // Construct the dialog.\n const $dialog = initialize();\n // Set the relevant properties of the dialog.\n if (center != null) {\n $dialog.center = center;\n }\n // Attach the content to the dialog.\n if ($content != null) {\n if (typeof $content === \"function\") {\n $content($dialog);\n }\n else {\n $dialog.appendChild($content);\n }\n }\n // Create a resolver that resolves when the dialog closes.\n const resolver = new Promise(res => {\n $dialog.addEventListener(\"close\", (e) => {\n $dialog.remove();\n res(e.detail);\n }, { once: true });\n });\n // Append the dialog to the container and open it.\n $container.appendChild($dialog);\n $dialog.show();\n return { $dialog, resolver };\n}", "open() {\n this._open();\n }", "function open() {\n let ts = new Date(Date.now()).toISOString();\n main.innerHTML = `<p><b><code>${ts} - opened</code></b></p>`;\n let payload = {\n action: 'connected'\n };\n ws.send(JSON.stringify(payload));\n}", "onResultsOpen() {\n state = 'opened';\n Ember.Logger.debug(`Flexberry Lookup::autocomplete state = ${state}`);\n }", "function onopen() {\n this._logger.info('Connection created.');\n\n this._debuggerObj.setEngineMode(this._debuggerObj.ENGINE_MODE.RUN);\n\n if (this._surface.getPanelProperty('chart.active')) {\n this._surface.toggleButton(true, 'chart-record-button');\n }\n\n if (this._surface.getPanelProperty('run.active')) {\n this._surface.updateRunPanel(this._surface.RUN_UPDATE_TYPE.ALL, this._debuggerObj, this._session);\n }\n\n if (this._surface.getPanelProperty('watch.active')) {\n this._surface.updateWatchPanelButtons(this._debuggerObj);\n }\n\n this._surface.disableActionButtons(false);\n this._surface.toggleButton(false, 'connect-to-button');\n}", "function openModal() {\n setOpen(true);\n }", "handleModalOpen(type) {}", "function doopenchannel() {\n ModalService.showModal({\n templateUrl: \"modals/openchannel.html\",\n controller: \"OpenChannelController\",\n }).then(function(modal) {\n modal.element.modal();\n $scope.$emit(\"child:showalert\",\n \"To open a new channel, enter or scan the remote node id and amount to fund.\");\n modal.close.then(function(result) {\n });\n });\n }", "function start() { \n \t//[3.1] UI & Events\n \tgw_job_process.UI(); \n \tgw_job_process.procedure();\n //[3.2] Notice Opened Event to Master Page\n var args = { ID: gw_com_api.v_Stream.msg_openedDialogue };\n gw_com_module.streamInterface(args);\n }", "get onDidOpen() {\r\n return this._onDidOpen.event;\r\n }", "get onDidOpen() {\r\n return this._onDidOpen.event;\r\n }", "onOpen() {\n const {dataStore, activeUserId, activeTeamId} = this.slack.rtmClient;\n const user = dataStore.getUserById(activeUserId);\n const team = dataStore.getTeamById(activeTeamId);\n this.log(this.formatOnOpen({user, team}));\n }", "function peerjsOpenHandler(){\n if (_this.debug)\n console.log(\"Server started\", _this._serverPeer.id);\n\n // Reset peers\n _this._connections = {};\n \n // Trigger\n _this._triggerSystemEvent(\"$open\", {serverId: _this._serverPeer.id});\n }", "accept() {\n this.dialog = false;\n this.snackbarOk = true;\n this.runRoutine();\n }", "newStream() {\n return this.channel.newStream();\n }" ]
[ "0.5878268", "0.5762913", "0.56209415", "0.5611367", "0.5559547", "0.55561626", "0.55001247", "0.5469724", "0.54484016", "0.5429138", "0.53921634", "0.5391304", "0.53793484", "0.5360101", "0.5360101", "0.5349593", "0.53403217", "0.5258222", "0.5255514", "0.5255279", "0.5243989", "0.52309024", "0.5220265", "0.5216279", "0.514228", "0.5130966", "0.5103598", "0.509797", "0.5095589", "0.5073523", "0.505809", "0.505809", "0.505809", "0.5056997", "0.5054558", "0.5053795", "0.5050471", "0.50497705", "0.5046285", "0.5038291", "0.50349367", "0.49870712", "0.49769863", "0.49500114", "0.493283", "0.49324068", "0.4928944", "0.48946542", "0.48779443", "0.48602298", "0.48599905", "0.48572305", "0.48552117", "0.48498115", "0.48127815", "0.48010543", "0.4800979", "0.4799467", "0.47945637", "0.4792917", "0.47911397", "0.47911397", "0.47882566", "0.4782578", "0.4782462", "0.47769323", "0.477469", "0.47494122", "0.4747761", "0.47454053", "0.4740516", "0.47363308", "0.4735972", "0.4735972", "0.4735972", "0.4735972", "0.4735972", "0.47346604", "0.47234917", "0.47187462", "0.47187462", "0.4717729", "0.47127023", "0.47087008", "0.4706795", "0.4704896", "0.4701124", "0.4691521", "0.46712077", "0.46588755", "0.46573618", "0.46561167", "0.4649728", "0.46474257", "0.46453756", "0.46398684", "0.46398684", "0.4623618", "0.46075025", "0.46022835", "0.4598172" ]
0.0
-1
Closes all of the currentlyopen dialogs.
closeAll() { this._closeDialogs(this.openDialogs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeAll() {\n let i = this.openModals.length;\n while (i--) {\n this.openModals[i].close();\n }\n }", "function closeAll() {\n\t\t\t$.each( menuItems, function( index ) {\n\t\t\t\tmenuItems[index].close();\n\t\t\t});\n\t\t}", "function closeAllInfoWindows() {\n\tfor (var i=0;i<infoWindows.length;i++) {\n\t\tinfoWindows[i].close();\n\t}\n}", "closeAll() {\n this._openCloseAll(false);\n }", "function _close() {\n\t\tif (dialogBox) {\n\t\t\t$dialogInput.off(\"blur\");\n\t\t\tdialogBox.parentNode.removeChild(dialogBox);\n\t\t\tdialogBox = null;\n\t\t}\n\t\tEditorManager.focusEditor();\n\t\t_removeHighlights();\n\t\t$(currentEditor).off(\"scroll\");\n\t}", "closeAll() {\n this.modalControl.closeAll();\n }", "function closeDialog() {\n setDialogOpen(false)\n }", "_closeDialogs(dialogs) {\n let i = dialogs.length;\n while (i--) {\n // The `_openDialogs` property isn't updated after close until the rxjs subscription\n // runs on the next microtask, in addition to modifying the array as we're going\n // through it. We loop through all of them and call close without assuming that\n // they'll be removed from the list instantaneously.\n dialogs[i].close();\n }\n }", "_closeDialogs(dialogs) {\n let i = dialogs.length;\n while (i--) {\n // The `_openDialogs` property isn't updated after close until the rxjs subscription\n // runs on the next microtask, in addition to modifying the array as we're going\n // through it. We loop through all of them and call close without assuming that\n // they'll be removed from the list instantaneously.\n dialogs[i].close();\n }\n }", "function closeAllPopups() {\n setEditAvatarPopupOpen(false);\n setEditProfilePopupOpen(false);\n setAddPlacePopupOpen(false);\n setDeleteCardPopupOpen(false);\n setImagePopupOpen(false);\n setInfoToolTipOpen(false);\n setSelectedCard({});\n }", "function closeAllInfoWindows() {\n for (var i=0;i<infowins.length;i++) {\n infowins[i].close();\n infowins.splice(i, 1);\n }\n}", "closeAll() {\n return Promise.all(this._contexts.map(context => this._widgetManager.closeWidgets(context))).then(() => undefined);\n }", "closeAll() {\n // Make a copy of all the widget in the dock panel (using `toArray()`)\n // before removing them because removing them while iterating through them\n // modifies the underlying data of the iterator.\n toArray(this._dockPanel.widgets()).forEach(widget => widget.close());\n this._downPanel.stackedPanel.widgets.forEach(widget => widget.close());\n }", "function closeAllInfoWindows() {\n if(originInfoWindowList != undefined){\n for (var i=0;i<originInfoWindowList.length;i++) {\n originInfoWindowList[i].close();\n }\n }\n if(currentInfoWindowList != undefined){\n for (var i=0;i<currentInfoWindowList.length;i++) {\n currentInfoWindowList[i].close();\n }\n }\n if(destinationInfoWindowList != undefined){\n for (var i=0;i<destinationInfoWindowList.length;i++) {\n destinationInfoWindowList[i].close();\n }\n }\n }", "function closeDialog() {\n jQuery('#oexchange-dialog').hide();\n jQuery('#oexchange-remember-dialog').hide();\n refreshShareLinks();\n }", "function closeModals() {\n if ($scope.warning) {\n $scope.warning.close();\n $scope.warning = null;\n }\n if ($scope.timedout) {\n $scope.timedout.close();\n $scope.timedout = null;\n }\n }", "function close_history_dialog()\n {\n $('#notehistory, #notediff').each(function(i, elem) {\n var $dialog = $(elem);\n if ($dialog.is(':ui-dialog'))\n $dialog.dialog('close');\n });\n }", "function closeIWindows() {\n for (let i = 0; i < iwindows.length; i++) {\n iwindows[i].close();\n }\n iwindows = [];\n }", "close() {\n\n if (this.onClose) {\n setTimeout(() => {\n this.onClose();\n this.onClose = null;\n }, 150);\n }\n\n this.client.$.removeClass('dialog-active');\n this.base.attr('open', false);\n this.base.find('.rdp-dialog__body').empty();\n this.activeModel = null;\n this.interaction = null;\n this.selector = null;\n this.isOpen = false;\n\n // re-enable other interface components again when closing\n this.client.toolbar.enable();\n this.client.snapshots.lock(false);\n\n }", "function closeAllPopups()\n {\n if(infoPopupVisible)\n {\n $('#' + configuration.CSS.ids.infoPopupId).fadeOut();\n infoPopupVisible = false; \n }\n \n if(otherPopupVisible)\n {\n $('#' + configuration.CSS.ids.otherPopupId).fadeOut();\n otherPopupVisible = false;\n }\n \n if(economicalPopupVisible)\n {\n $('#' + configuration.CSS.ids.economicalPopupId).fadeOut();\n economicalPopupVisible = false; \n }\n \n if(politicalPopupVisible)\n {\n $('#' + configuration.CSS.ids.politicalPopupId).fadeOut();\n politicalPopupVisible = false; \n } \n }", "function closeAllMarkersWindows() {\n\tvar keys = Object.keys(infoWindows);\n\t\n\tfor (infoKeyIndex in keys ) {\n\t\tvar infoWindowIndex = keys[infoKeyIndex]; \n\t\tvar markerInfoWindow = infoWindows[infoWindowIndex];\n\t\t\n\t\tmarkerInfoWindow.close();\n\t}\n}", "function closeDialog(dialog) {\n\tif (dialog && dialog.closed != true) dialog.close();\n}", "function closeAllMenus(){\n closeMenu(\"divMenuHelp\");\n closeMenu(\"divMenuOpt\");\n closeMenu(\"divMenuGame\"); }", "closeAll() {\n const that = this;\n\n for (var i = that._instances.length - 1; i > -1; i--) {\n that._close(that._instances[i]);\n }\n }", "closeAllViews() {\n // Raise ViewHiding events for open views in reverse order.\n while (this.openViews.length) {\n this._closeLatestView();\n }\n }", "function Popups_CloseAll(bForced)\n{\n\t//interactions blocked? unless this is forced\n\tif (__SIMULATOR.UserInteractionBlocked() && !bForced)\n\t{\n\t\t//ignore it\n\t}\n\telse\n\t{\n\t\t//while we have popups\n\t\twhile (this.PopupData.length > 0)\n\t\t{\n\t\t\t//close the last popup\n\t\t\tthis.CloseLast(bForced);\n\t\t}\n\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_POPUP_DESTROY);\n\t}\n}", "function removeAllDialogs() {\n for (var i = 0; i < dialogs.length; i++) {\n var dialog = dialogs[i];\n removeDialog(dialog);\n dialogs.splice(i, 1);\n }\n }", "function closeAll() {\n $scope.closeMenu();\n document.activeElement.blur();\n $scope.ib.close();\n var listBox = document.getElementById(\"floating-panel\");\n while (listBox.firstChild) {\n listBox.removeChild(listBox.firstChild);\n }\n listBox.className = \"hidden\";\n $scope.closeWndr();\n }", "closeAll() {\n for (const theModal of this.modals) {\n $(`#${theModal}`).modal('hide'); $(`#${theModal}`).unbind('hide.bs.modal').unbind('shown.bs.modal').unbind('hidden.bs.modal');\n delete this.tempObject[theModal]; // Delete the temporary cloned copy of object to be saved.\n }\n }", "closeAllEntries() {\n for(var entryIndex in entries) {\n var entry = entries[entryIndex];\n\n if(entry.isCloseable()) {\n entry.close();\n }\n }\n\n this.updateWindowHeight();\n }", "function hideAllDialogs() {\n $(\"#dialogContainer\").hide();\n $(\".dialog\").hide();\n\n // Reset units_dialog dispatch units delete buttons\n $(\".delete_dispatched_unit_btn\").hide();\n $(\"#dispatched_delete_start_btn\").removeClass(\"glowlightblue\");\n $(\"#dispatched_delete_start_btn\").html(\"DELETE\");\n}", "function closeDialog() {\n\tdialog.close();\n\tbuttonOpen.removeAttribute(\"class\", \"close\");\n\tbuttonOpen2.removeAttribute(\"class\", \"close\");\n}", "function closeDialog() {\n document.querySelector(\"#removeOther\").classList.add(\"hidden\");\n document.querySelector(\"#removeOther .closeButton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#removeOtherButton\").removeEventListener(\"click\", clickRemoveOther);\n }", "function bs_close_all_modals() {\n $('.modal, [role=\"dialog\"]').modal('hide');\n $('.modal-backdrop').remove();\n $('body').removeClass('modal-open');\n}", "function closeAllMenus() {\r\n hideOverlay();\r\n closeMobileCart();\r\n closeMobileCustomerMenu();\r\n closeMobileMainMenu();\r\n closeFilterMenu();\r\n}", "close() {\r\n if (this.widget_wizard != null) this.widget_wizard.close()\r\n // close all the widget of the page\r\n for (var id in this.widget_objects) {\r\n var widget_object = this.widget_objects[id]\r\n if(typeof widget_object.close === 'function')\r\n widget_object.close()\r\n }\r\n }", "_closeAll() {\n this._closeItems();\n this._toggleShowMore(false);\n }", "function closeAllPopups() {\n gees.tools.setElementDisplay(DISPLAY_ELEMENTS_KML, 'none');\n gees.dom.setDisplay('BuildResponseDiv', 'none');\n}", "function onClose() {\n\t\t\t$mdDialog.hide()\n\t\t}", "function closeContextMenus() {\n for (let i = 0; i < 100; i++) {\n const popperOverlay = getLastClass(document, 'popper__overlay');\n if (popperOverlay) {\n popperOverlay.click();\n } else {\n break;\n }\n if (i == 99) {\n warn('Tried a lot to close poppers.');\n }\n }\n click(document.body);\n withClass(document, 'manager', (manager) => {\n const cancelBtn = getUniqueClass(manager, 'cancel');\n if (cancelBtn) {\n click(cancelBtn);\n }\n });\n // Close windows with close buttons, particularly move-to-project\n //\n // (probably old)\n withClass(document, 'GB_window', (gbw) => {\n withClass(gbw, 'close', (close) => {\n withTag(close, 'div', click);\n });\n });\n // Close windows with close buttons\n withQuery(document, '[aria-label=\"Close modal\"]', click);\n // Close todoist-shortcuts' modals\n withClass(document, 'ts-modal-close', click);\n }", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function closeDialog() {\n $mdDialog.hide();\n }", "function close_dialog() {\n\tif (win) {\n\t\twin.close();\n\t\tif (feed_summary.selected_users_in_list == null || feed_summary.selected_users_in_list.length == 0 ) {\n\t\t\t//users_selection.use_all_users\n\t\t\tif ( last_selected_user_filter==\"all\" ) {\n\t\t\t\t\t//alert(\"have to selecte teh all\");\n\t\t\t\t\tusers_selection.use_all_users();\n\t\t\t\t\tswap_users($('show_users_all'));\r\n\t\t\t}\n\t\t\tif ( last_selected_user_filter==\"network\" ) {\n\t\t\t\t\t//alert(\"have to selecte teh all\");\n\t\t\t\t\tusers_selection.use_my_network_users();\n\t\t\t\t\tswap_users($('show_users_network'));\n\t\t\t}\n\n\t\t\t\r\n\t\t}\n\t\t//let'see what in the box\n\t\t\r\n\t}\r\n}", "function closeApp(){\n\tfor(var i=windows.length-1;i>=0;i--){\n\t\twindows[i].close();\n\t}\n\twindows = [];\n}", "function Popups_TriggerCloseAll()\n{\n\t//call close all\n\t__POPUPS.CloseAll();\n}", "function closeDialog() {\n document.querySelector(\"#remove_other\").classList.add(\"hide\");\n document.querySelector(\"#remove_other .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_other #removeother\").removeEventListener(\"click\", clickRemoveOther);\n }", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function close() {\n\t\ttry{ $dialog.close(); }catch(e){};\n\t\twindow.clearTimeout(timer);\n\t\tif (opts.easyClose) {\n\t\t\t$document.unbind(\"mouseup\", close);\n\t\t}\n\t}", "function closeDialog()\n\t\t{\n\t\t\t$(\"#dialog\").fadeOut(\"slow\", function()\n\t\t\t\t{\n\t\t\t\t\t$(\"#dialog\").empty();\n\t\t\t\t});\n\t\t}", "function closeAllMenus() {\n hideCategoryNav();\n hideMobileMenuDropdown();\n }", "closeDialog() {\n this.dialog = false;\n this.errors = \"\";\n this.valid = true;\n }", "function closeModals($scope) {\n if ($scope.warning) {\n $scope.warning.close();\n $scope.warning = null;\n }\n\n if ($scope.timedout) {\n $scope.timedout.close();\n $scope.timedout = null;\n }\n}", "function closeAllVisibleControllers( ){\n try{\n for( var i in m_present_controllers ){\n if( m_content_container.contains( m_present_controllers[ i ].getDisplayNode() ) ){\n m_present_controllers[ i ].close();\n }\n }\n }catch( e ){\n Logger.logObj( e );\n Logger.log( '!!! EXCEPTION ON closeAllVisibleControllers()' );\n }\n }", "function closeToolModals(){\n Quas.each(\".post-tool-modal\", function(el){\n el.visible(false);\n });\n\n Quas.each(\".toolbar-modal-btn\", function(el){\n el.active(false);\n });\n\n Quas.scrollable(true);\n}", "function closePopups() {\n locations.forEach(location => {\n location.marker.getPopup().remove()\n })\n}", "function closeAll() {\n $(\".tap-target\").tapTarget(\"close\");\n $(\".tap-target\").tapTarget(\"destroy\");\n}", "function closeDialog() {\n document.querySelector(\"#remove_aorb\").classList.add(\"hide\");\n document.querySelector(\"#remove_aorb .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#remove_aorb #removea\").removeEventListener(\"click\", removeA);\n document.querySelector(\"#remove_aorb #removeb\").removeEventListener(\"click\", removeB);\n }", "function closeAll() {\n document.getElementById(\"About\").style.display = \"none\";\n document.getElementById(\"Information\").style.display = \"none\";\n document.getElementById(\"header\").style.display = \"none\";\n document.getElementById(\"player\").style.display = \"none\";\n document.getElementById(\"Account\").style.display = \"none\";\n document.getElementById(\"Stats\").style.display = \"none\";\n document.getElementById(\"permission\").style.display = \"none\";\n}", "function close_modals(){\n\t\t$('.close').on('click', function(){\n\t\t\t$('.popup_msg').hide();\n\t\t});\n\t}", "function closeParentDialog() {\n\tif (top.opener && isWindowPopup(top.opener)) {\n\t\troot = top.opener.top.opener;\n\t\ttop.opener.close();\n\t\ttop.opener = root;\n\t}\n}", "setCloseListeners()\n {\n let alert = document.getElementById(this.id + '-alert');\n [...document.getElementById(this.id).getElementsByClassName('close-dialog')].forEach(function(item) {\n item.addEventListener('click', function() {\n alert.style.display = 'none';\n });\n });\n }", "function close() {\r\n\t\ttry{ $dialog.close(); }catch(e){};\r\n\t\twindow.clearTimeout(timer);\r\n\t\tif (opts.easyClose) {\r\n\t\t\t$document.unbind(\"mouseup\", close);\r\n\t\t}\r\n\t}", "closeDialog() {\n // Trigger the popup to close\n tableau.extensions.ui.closeDialog();\n }", "function closeAllLightboxes() {\n\t// get every .lightbox div, getElementsByClassName gives us an array \n\tvar lightboxElements = document.getElementsByClassName('lightbox');\n\n\t// sneak preview of Javascript loops, which will go through every element in an array of elements\n\tfor (var i = 0; i < lightboxElements.length; i++) {\n\t\t// get id of this particular .lightbox div\n\t\tvar id = lightboxElements[i].id;\n\t\t// call closeLightbox for this id\n\t\tcloseLightbox(id);\n\t}\n}", "closeCleanup() {\n this.hide();\n this.addPopUpListener();\n }", "function closeAll() {\n\tdocument.getElementsByClassName(\"fst_container\")[0].remove();\n\twindow.location.reload();\n}", "function closeAll() {\n\tdocument.getElementsByClassName(\"fst_container\")[0].remove();\n\twindow.location.reload();\n}", "function closeAll() {\n\tdocument.getElementsByClassName(\"fst_container\")[0].remove();\n\twindow.location.reload();\n}", "function closeAll() {\n\tdocument.getElementsByClassName(\"fst_container\")[0].remove();\n\twindow.location.reload();\n}", "function close() {\n $mdDialog.hide();\n }", "function closeAllCommentForms(){\n $(\".hasReplyForm\").each(function () {\n $(this).find(\".btn-cancelReply\").trigger(\"click\");\n });\n $(\".hasEditForm\").each(function () {\n $(this).find(\".btn-cancelEdit\").trigger(\"click\");\n });\n}", "closeAllTabs() {\n for (let i = this.boxes.webviews.length; i > 0; i--) {\n this.closeTab(i);\n }\n }", "function closeDialog() {\n document.querySelector(\"#expel_student\").classList.add(\"hide\");\n document.querySelector(\"#expel_student .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#expel_student #expel_button_modal\").removeEventListener(\"click\", expelStudent);\n }", "function close() {\n // Unbind the events\n $(window).unbind('resize', modalContentResize);\n $('body').unbind( 'focus', modalEventHandler);\n $('body').unbind( 'keypress', modalEventHandler );\n $('body').unbind( 'keydown', modalTabTrapHandler );\n $('.close').unbind('click', modalContentClose);\n $('body').unbind('keypress', modalEventEscapeCloseHandler);\n $(document).trigger('CToolsDetachBehaviors', $('#modalContent'));\n\n // Set our animation parameters and use them\n if ( animation == 'fadeIn' ) animation = 'fadeOut';\n if ( animation == 'slideDown' ) animation = 'slideUp';\n if ( animation == 'show' ) animation = 'hide';\n\n // Close the content\n modalContent.hide()[animation](speed);\n\n // Remove the content\n $('#modalContent').remove();\n $('#modalBackdrop').remove();\n\n // Restore focus to where it was before opening the dialog\n $(oldFocus).focus();\n }", "function closeOpenedModals() {\n\tvar openModals = document.getElementsByClassName('modal');\n\tfor (var i = 0; i < openModals.length; i++) {\n\t\tvar openModal = openModals[i];\n\t\tif (openModal.style.display == \"block\") {\n\t\t\topenModal.style.display = \"none\";\n\t\t}\n\t}\n}", "function close() {\n var self = this;\n\n self._close.apply(self, arguments);\n}", "function handleClose() {\n props.handleDialog(false);\n }", "close() {\n const that = this;\n\n if (!that.opened) {\n return;\n }\n\n that._close();\n }", "closeAllOpenDrawers() {\n let closetDrawers=this.closet.getProducts(ProductTypeEnum.DRAWER);\n for(let closetDrawer of closetDrawers)\n ThreeDrawerAnimations.close(closetDrawer);\n }", "function onClose() {\r\n window.close();\r\n}", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "openAll() {\n this._openCloseAll(true);\n }", "close() {\n this._drawers.forEach((drawer) => drawer.close());\n }", "function closeDialog(obj) {\n if (typeof obj == 'undefined' || obj == 'all' ) {\n $('dialog').removeClass('isVisible');\n $('#dialog_mask').removeClass('isVisible');\n $('main,nav').removeClass('dialogIsOpen');\n // e.preventDefault();\n }\n}", "function closePopups() {\n timeBox = $(\"#time-box\");\n $(\".backdrop\").css(\"display\", \"none\");\n $(\"#info-box\").css(\"display\", \"none\");\n $(\"#host-box\").css(\"display\", \"none\");\n $(\"#round-end-box\").css(\"display\", \"none\");\n }", "function closeDialog() {\n document.querySelector(\"#inq_student\").classList.add(\"hide\");\n document.querySelector(\"#inq_student .closebutton\").removeEventListener(\"click\", closeDialog);\n }", "close() {\n this._drawers.forEach(drawer => drawer.close());\n }", "onCloseWindow () {\n this.mainWindowManager.window.close();\n }", "get onClosing() {\n this.document.documentElement.classList.remove(DIALOG_OPEN_HTML_CLASS);\n }", "close() {\n this.closeButton.on('click', null);\n this.modal(false);\n this.window.remove();\n }", "dispose() {\n this.editMenu.dispose();\n this.fileMenu.dispose();\n this.helpMenu.dispose();\n this.kernelMenu.dispose();\n this.runMenu.dispose();\n this.settingsMenu.dispose();\n this.viewMenu.dispose();\n this.tabsMenu.dispose();\n super.dispose();\n }", "closeAll(event) {\n this._openPanels.forEach((panel) => {\n panel.dispatchNodeEvent(new NodeEvent('close-requested', this, false));\n });\n }", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "closeAllClients() {\n this._clients.forEach((client) => {\n client.terminate();\n // clients are being removed from the set in the closing callback\n });\n }" ]
[ "0.7218156", "0.7095193", "0.7060914", "0.70241266", "0.69022053", "0.68948585", "0.68916386", "0.68800557", "0.68800557", "0.685714", "0.6801596", "0.67541283", "0.6698916", "0.66701514", "0.6663062", "0.66136086", "0.65285623", "0.6444135", "0.6401621", "0.63858783", "0.6350261", "0.6342342", "0.6307876", "0.6242118", "0.6234579", "0.62151057", "0.62150306", "0.6207903", "0.6203524", "0.61895704", "0.6187793", "0.61822563", "0.6163998", "0.61608046", "0.61395574", "0.6138103", "0.6134204", "0.6123243", "0.6112179", "0.6103267", "0.6090787", "0.6090787", "0.60888004", "0.6086739", "0.60798395", "0.60740227", "0.6039103", "0.603734", "0.603734", "0.60369164", "0.60369164", "0.60156894", "0.60009414", "0.5991845", "0.59651434", "0.5960955", "0.5959726", "0.5940225", "0.592852", "0.5920724", "0.59057856", "0.5887496", "0.5886962", "0.5857311", "0.585196", "0.58504575", "0.58393115", "0.58347565", "0.58308", "0.5828298", "0.5828298", "0.5828298", "0.5828298", "0.57833004", "0.5777785", "0.5775457", "0.5755554", "0.5750553", "0.5738826", "0.5730563", "0.57163936", "0.5712632", "0.57091576", "0.57057583", "0.5704134", "0.5699877", "0.56641483", "0.56620735", "0.5629935", "0.56284976", "0.5624746", "0.56216085", "0.5621537", "0.5595231", "0.5588953", "0.5586019", "0.5582688", "0.55768067" ]
0.8642801
2
Finds an open dialog by its id.
getDialogById(id) { return this.openDialogs.find(dialog => dialog.id === id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findDialog(dialogId) {\n return this.dialogs.find(dialogId);\n }", "function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find(function (dialog) {\n return dialog.id === parent.id;\n }) : null;\n }", "function getClosestDialog(element, openDialogs) {\n let parent = element.nativeElement.parentElement;\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n return parent ? openDialogs.find(dialog => dialog.id === parent.id) : null;\n}", "function getClosestDialog(element, openDialogs) {\n let parent = element.nativeElement.parentElement;\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n return parent ? openDialogs.find(dialog => dialog.id === parent.id) : null;\n}", "function getClosestDialog(element, openDialogs) {\n let parent = element.nativeElement.parentElement;\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n return parent ? openDialogs.find(dialog => dialog.id === parent.id) : null;\n}", "function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find(function (dialog) {\n return dialog.id === parent.id;\n }) : null;\n}", "findCursorByID(id) {\n\t\tfor (let i = 0; i < this.menuData.length; i++) {\n\t\t\tif (this.menuData[i].id === id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "find(id) {\n return this.frames.get(id);\n }", "function find(id) {\n return document.getElementById(id);\n}", "function openDialog(id) {\n\t/* set the dialog in center of the screen */\n\tvar dialog = $(document.getElementById(id));\n\tdialog.css(\"left\", Math.max(0, Math.round(($(window).width() - $(dialog)\n\t\t\t.outerWidth()) / 2)\n\t\t\t+ $(window).scrollLeft())\n\t\t\t+ \"px\");\n\t/* open the dialog */\n\tdialog.show();\n\t$(\".imj_modalDialogBackground\").show();\n}", "static find(id) {\n\t\tlet promiseFind = new Parse.Promise();\n\n\t\tlet query = new Parse.Query(Mentor);\n\t\tquery.get(id).then(function(mentor) {\n\t\t\tpromiseFind.resolve(mentor);\n\t\t}, function(err) {\n\t\t\tpromiseFind.reject(err);\n\t\t});\n\n\t\treturn promiseFind;\n\t}", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "async findById(id) {\n const selectorId = await $(id);\n await selectorId.waitForExist();\n await selectorId.waitForDisplayed();\n return selectorId;\n }", "getElementById(id) {\n if (!this._ids[id]) {\n return null;\n }\n\n // Let's find the first element with where it's root is the document.\n const matchElement = this._ids[id].find(candidate => {\n let root = candidate;\n while (domSymbolTree.parent(root)) {\n root = domSymbolTree.parent(root);\n }\n\n return root === this;\n });\n\n return matchElement || null;\n }", "function find(id){\n var elem = document.getElementById(id);\n return elem;\n}", "showAncestorDialog(viewName) {\n let dialogId;\n $('app-root [dialogtype]')\n .each(function () {\n const dialog = $(this);\n if ($(dialog.html()).find('[name=\"' + viewName + '\"]').length) {\n dialogId = dialog.attr('name');\n return false;\n }\n });\n return dialogId;\n }", "dialog() {\n return this._getOrCreateSubset('dialog', dialog_1.default);\n }", "function closestDialog(event) {\n // check for left click\n if (event.button !== 0) {\n return;\n }\n\n let dialog;\n // target must contain one of provided classes\n ['v-card__title', 'v-toolbar__content', 'v-toolbar__title'].forEach((className) => {\n if (event.target.classList.contains(className)) {\n dialog = event.target.closest(`${dialogSelector}`);\n }\n });\n\n return dialog;\n}", "function findById(id) {\n var deferred = q.defer();\n\n FormModel.findById(id, function(err, form) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(form);\n }\n });\n\n return deferred.promise;\n }", "function find_tab(id)\n{\n\n found = false;\n tab = null;\n\n done:\n for(outer_tab_key in menu_structure.OuterTabs)\n {\n if (menu_structure.OuterTabs.hasOwnProperty(outer_tab_key))\n {\n outer_tab = menu_structure.OuterTabs[outer_tab_key];\n for(inner_tab_key in outer_tab.Tabs)\n {\n if (outer_tab.Tabs.hasOwnProperty(inner_tab_key))\n {\n if(inner_tab_key === id)\n {\n \n tab = outer_tab.Tabs[id];\n found = true;\n break done;\n }\n }\n }\n }\n }\n \n if(found)\n return tab;\n else\n return null;\n}", "_findWidgetByID(id) {\n const item = find(this._items, value => value.widget.id === id);\n return item ? item.widget : null;\n }", "find(id){\n\t\tvar $views = this.$views\n\t\tif(id.constructor === RegExp){\n\t\t\tfor(let key in $views)\t{\n\t\t\t\tif(key.match(id)) return $views[key]\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor(let key in $views)\t{\n\t\t\t\tif(key === id) return $views[key]\n\t\t\t}\n\t\t}\n\t\tfor(let key in $views)\t{\n\t\t\tlet res = $views[key].find(id)\n\t\t\tif(res) return res\n\t\t}\n\t}", "function findMessage(id) {\n let chatWindow = document.querySelector(\"#chat_window\");\n for (let msg of chatWindow.children) {\n\n if (msg.getElementsByClassName(\"message-id\")[0].innerHTML == id) {\n console.log(\"Message found\");\n return msg;\n }\n }\n}", "function makeInfoDialog(id){\n\n\t$(\"#info_\"+id).dialog({\n\t\tautoOpen:false\n\t});\n\n\t$(\"#infoButton_\"+id).click(function(){\n\t\t$(\"#info_\"+id).dialog(\"open\");\n\t});\n}", "function openMassEditSiteDialog(id, name) {\n\t$('#dialog').dialog({\n\t\twidth: '30%',\n\t\tmodal: true,\n\t\tshow: 'fade',\n\t\thide: 'fade',\n\t\tresizable: false,\n\t\tposition: {\n\t\t\tmy: \"center\",\n\t\t\tat: \"top\",\n\t\t\tof: $('body')\n\t\t},\n\t\topen: function () {\n\t\t\tvar dialog = $(this),\n\t\t\taccessOptions = buildAccessOptions(),\n\t\t\thtml = '';\n\t\t\thtml += '<p>You are about to apply the same access for the selected users for the <strong>' + name + '</strong> site.</p>';\n\t\t\thtml += accessOptions;\n\t\t\thtml += '<p>Are you sure you wish to continue?</p>';\n\t\t\thtml += '<div id=\"dialogMessage\"></div>';\n\t\t\thtml += '<p id=\"dialogButtons\"><button data-id=\"' + id + '\" data-name=\"' + name + '\" id=\"editUsersForSite\" class=\"confirm\">Yes, Edit</button> <button id=\"cancelDialog\" class=\"cancel\">No, Cancel</button></p>';\n\t\t\tdialog.dialog('option', 'title', 'Mass Edit User Access for Site');\n\t\t\tdialog.html(html);\n\t\t},\n\t\tclose: function () {\n\t\t\t$(this).html('').dialog('destroy');\n\t\t}\n\t});\n}", "function showModal(id) {\n if (id in modals) {\n modals[id].show();\n }\n }", "locate(id) {\n return this.show(id);\n }", "function findListInCtrl(id) {\n\t\tvar lists = that.data.lists;\n\t\tfor (var i = 0, len = lists.length; i < len; i++) {\n\t\t\tif (lists[i].id === id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}", "function createDialogFind(obj,titulo,ancho,alto,resize,bar){\n\tif($dhxWins==null)\n\t\t$dhxWins = new dhtmlXWindows();\n\tvar sid=(new Date()).valueOf();\n\tvar w = $dhxWins.createWindow({id:sid,text:titulo,width:ancho, height:alto, center:true,resize: resize,park:false,modal:false\t});\n\tw.button(\"close\").attachEvent(\"onClick\", function(){w.hide(); w.setModal(false); return false; });w.setIconCss(\"iconimr\"); \tw.centerOnScreen();\n\tif(bar)\n\t\tw.attachStatusBar({text: \"<div id='\" + obj + \"'></div>\",\tpaging: true\t});\n\treturn w;\n}", "function showModal(id){\n\t\n\t//dialogUser.dialog('option', 'position', { my: \"center\", at: \"center\", of: window });\n\t$(\"#idPeople\").removeData(\"pkPeopleId\");\n\t$(\"#idPeople\").removeData(\"pkEmployeeId\");\n\t//cleanUserFields();\n\t//$('.tab-modal').hide();\n\t//$('#tab-PGeneral').show();\n\t/*\n\t\tif (typeof unidadResDialog !== 'undefined') {\n\t\tif (unidadResDialog!=null) {\n\t\t\tunidadResDialog.dialog( \"destroy\" );\n\t\t}\n\t}\n\tif (typeof peopleDialog !== 'undefined') {\n\t\tif (peopleDialog != null) {\n\t\t\tpeopleDialog.dialog( \"destroy\" );\n\t\t}\n\t}\n\tif (typeof dialogUser !== 'undefined') {\n\t\tif (dialogUser!=null) {\n\t\tdialogUser.dialog( \"destroy\" );\n\t}\n\t}\n\t*/\n\tif (dialogUser!=null) {\n\t\tdialogUser.dialog( \"destroy\" );\n\t}\n\t\n\tdialogUser = createModalDialog(id);\n\tdialogUser.dialog('open');\n\tif(id == 0){\n\t\t//$('.dialogModalButtonSecondary').hide();\n\t\t//$(\"#tabsModalPeople\").hide();\n\t\t\n\t\tdialogUser.dialog( \"option\", \"title\", \"People > Create person\" );\n\t\t//$('#imgCloseModal').off();\n\t\t//$('.imgCloseModal').on('click', function() { hideModal(); });\n\t}else{\n\t\tdialogUser.dialog( \"option\", \"title\", \"People > Edit person\" );\n\t\t/*$('.dialogModalButtonSecondary').show();\n\t\t$(\"#tabsModalPeople\").show();\n\t\t$('#dialog-User .contentModal').css('height', \"90%\" );\n\t\tgetInfoPeople(id);*/\t\n\t}\n\t/**/\n}", "function findById(id) {\n\t\tvar element;\n\t\tif(document.getElementById)\n\t\t\tvar element = document.getElementById(id);\n\t\treturn (element)? element : document;\n\t}", "function find(doc, element, id) {\n if (!element) {\n element = doc.getElementById(id);\n if (!element) {\n throw new Error('Missing element, id=' + id);\n }\n }\n return element;\n}", "function open(dialog) {\n\t\n}", "function GetElement(win, id) {\n var el = win.document.getElementById(id);\n if (!el) {\n DumpError(\"Element \" + id + \" not found.\");\n }\n return el;\n}", "async function dddialogVisible(id) {\n setDdialogVisible(true);\n setidEp(id);\n }", "function openMassEditUserDialog(id, name) {\n\t$('#dialog').dialog({\n\t\twidth: '30%',\n\t\tmodal: true,\n\t\tshow: 'fade',\n\t\thide: 'fade',\n\t\tresizable: false,\n\t\tposition: {\n\t\t\tmy: \"center\",\n\t\t\tat: \"top\",\n\t\t\tof: $('body')\n\t\t},\n\t\topen: function () {\n\t\t\tvar dialog = $(this),\n\t\t\taccessOptions = buildAccessOptions(),\n\t\t\thtml = '';\n\t\t\thtml += '<p>You are about to apply the same access to the selected sites for <strong>' + name + '</strong>.</p>';\n\t\t\thtml += accessOptions;\n\t\t\thtml += '<p>Are you sure you wish to continue?</p>';\n\t\t\thtml += '<div id=\"dialogMessage\"></div>';\n\t\t\thtml += '<p id=\"dialogButtons\"><button data-id=\"' + id + '\" data-name=\"' + name + '\" id=\"editSitesForUser\" class=\"confirm\">Yes, Edit</button> <button id=\"cancelDialog\" class=\"cancel\">No, Cancel</button></p>';\n\t\t\tdialog.dialog('option', 'title', 'Mass Edit Site Access for User');\n\t\t\tdialog.html(html);\n\t\t},\n\t\tclose: function () {\n\t\t\t$(this).html('').dialog('destroy');\n\t\t}\n\t});\n}", "function showAncestorDialog(viewName) {\n var dialogId;\n WM.element('#wm-app-content [dialogtype]')\n .each(function () {\n var dialog = WM.element(this);\n if (WM.element(dialog.html()).find(\"[name='\" + viewName + \"']\").length) {\n dialogId = dialog.attr(\"name\");\n DialogService.closeAllDialogs();\n DialogService.showDialog(dialogId);\n return false;\n }\n });\n return dialogId;\n }", "function findPlayer(id) {\n var player;\n var result = $.grep(players, function(item) {\n return item._id == id;\n });\n if (result.length == 1) {\n player = result[0];\n }\n return player;\n }", "function findTreeItemById( tree, id ) {\n\tif( tree.id() == id ) return tree;\n\tfor( var c in tree.children() ) {\n\t\tvar found = findTreeItemById( tree.children()[c], id );\n\t\tif(found) return found;\n\t}\n\treturn null;\n}", "function showDialog(id, value) {\n // Attempt to get existing window with id.\n var win = Ext.getCmp(id + '-win');\n\n if(win==null){\n win = new Ext.Window({\n id: id + '-win',\n animateTarget: id,\n autoScroll: true,\n width: 550,\n height: 350,\n closeAction: 'hide',\n bodyBorder: false,\n plain: true,\n constrain: true,\n title: value.title,\n // contentEl: value.element\n autoLoad: {\n url: value.url,\n nocache: false,\n discardUrl: false,\n method: \"POST\"\n }\n });\n }\n\n win.show();\n win.toFront();\n var anchor = id + '_anchor';\n if (document.getElementById(anchor) != null) {\n win.alignTo(anchor, 'bl-tl?');\n }\n}", "findControlById(id) {\r\n return this.findControl((c) => c.id === id);\r\n }", "function OpenDeleteDialog(_id) \n{\n $(\"#loading\").hide();\n var cells = $(\"#zipRow\" + _id).children(\"td\");\n\n $dialog = $('<div></div>')\n\t\t .html('You are about to delete zip \"' + cells.eq(0).text() + '\". Do you want to continue? ')\n\t\t .dialog({\n\t\t autoOpen: false,\n width:400,\n\t\t modal: true,\n\t\t buttons: {\n\t\t \"Yes\": function () {\n\t\t DeleteZip(_id);\n\t\t },\n\t\t \"No\": function () {\n\t\t $(this).dialog(\"close\");\n\t\t }\n\t\t },\n\t\t title: 'Delete Zip'\n\t\t });\n $dialog.dialog('open');\n}", "function getPopupObject(myId) {\n if (document.getElementById(myId)) {\n return document.getElementById(myId);\n }\n else {\n return window.document[myId];\n }\n }", "function find(obj, id) {\n if (obj.id === id) return obj;\n for (var i = 0; i < obj._parents.length; i ++) {\n var result = find(obj._parents[i], id);\n if (result) return result;\n }\n return null;\n}", "function findElement(id){\r\n\t\tvar found = false;\r\n\t\tvar i = 0;\r\n\t\twhile(!found){\r\n\t\t\tif($scope.tasks[i].id == id){\r\n\t\t\t\tfound=true;\r\n\t\t\t}else{\r\n\t\t\t\ti++;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn i;\r\n\t}", "function getSavedMatchById() {\n var urlParams = new URLSearchParams(window.location.search);\n var idParam = urlParams.get(\"id\");\n\n getById(idParam).then(function (detail) {\n showSavedDetail(detail);\n });\n}", "function getExistingDocument(id) {\n return wsk.actions.invoke({\n actionName: packageName + \"/read-document\",\n params: { \"docid\": id },\n blocking: true,\n })\n .then(activation => {\n console.log(\"Found pull request in database with ID \" + id);\n return activation.response.result;\n })\n // it could be possible that the doc with this ID doesn't exist and\n // therefore return \"undefined\" instead of exiting with error\n .catch(function (err) {\n console.log(\"Error fetching pull request from database for: \" + id);\n console.log(err)\n return undefined;\n });\n}", "function openMassDeleteSiteDialog(id, name) {\n\t$('#dialog').dialog({\n\t\twidth: '30%',\n\t\tmodal: true,\n\t\tshow: 'fade',\n\t\thide: 'fade',\n\t\tresizable: false,\n\t\tposition: {\n\t\t\tmy: \"center\",\n\t\t\tat: \"top\",\n\t\t\tof: $('body')\n\t\t},\n\t\topen: function () {\n\t\t\tvar dialog = $(this),\n\t\t\thtml = '';\n\t\t\thtml += '<p>You are about to delete the selected users from the <strong>' + name + '</strong> site.</p>';\n\t\t\thtml += '<p>Are you sure you wish to continue?</p>';\n\t\t\thtml += '<div id=\"dialogMessage\"></div>';\n\t\t\thtml += '<p id=\"dialogButtons\"><button data-id=\"' + id + '\" id=\"deleteUsersFromSite\" class=\"confirm\">Yes, Delete</button> <button id=\"cancelDialog\" class=\"cancel\">No, Cancel</button></p>';\n\t\t\tdialog.dialog('option', 'title', 'Mass Delete User Access for Site');\n\t\t\tdialog.html(html);\n\t\t},\n\t\tclose: function () {\n\t\t\t$(this).html('').dialog('destroy');\n\t\t}\n\t});\n}", "function get_win_id(object_id)\n{\n if (!object_id) object_id = '';\n else if (typeof object_id.id != 'undefined') object_id = object_id.id;\n \n var match = /function (.*)\\(/i.exec(get_win_id.caller.toString());\n \n var win_id = match[1] + object_id;\n \n // check if not already open\n var win = Ext.WindowMgr.get(win_id);\n if (win)\n {\n Ext.fly(win.getEl()).frame(\"ff0000\");\n win.toFront();\n return false;\n }\n \n return win_id;\n}", "function findElement(id, tagName){\n\t\tvar elems = document.getElementsByTagName(tagName);\n\t\tfor (var i=0; i<elems.length; i++){\n\t\t\tvar elem = elems[i];\n\t\t\tif (elem.id.indexOf(id) != -1)\n\t\t\t\treturn elem;\n\t\t}\n}", "function addEventToDialog(id) {\n \n instantiateDialogBox(id);\n \n $(\"#dialog-\"+ id).dialog({\n autoOpen: false, \n modal: true,\n hide: \"puff\",\n show : \"slide\",\n width: 1200\n });\n \n $(\"#dialogOpener-\"+ id).on(\"click\", function() {\n $(\"#dialog-\"+id).dialog( \"open\" );\n \n });\n}", "function sale_listing(id){\n $('#'+id).dialog({\n title: \"Sale Listing\",\n modal: true,\n width: 600,\n height: 400,\n buttons: {\n \"Cancel\": function() {\n \n $(this).dialog(\"close\");\n \n }\n }\n });\n }", "function openEditCategoriesDialog(id)\n { \n showLoader();\n \n $( \"#edit_categories_dialog\" ).dialog( \"open\" );\n\n $('#site_id').val(id);\n \n $('.site_edit_category_caption').show();\n $('#set_mp').show();\n\n $('#categories').show(); \n getCategoriesBySiteId(id);\n \n hideLoader(); \n \n return false;\n }", "static find(id) {\n\t\tlet promiseFind = new Parse.Promise();\n\n\t\tlet query = new Parse.Query(User);\n\t\tquery.get(id).then(function(user) {\n\t\t\tpromiseFind.resolve(user);\n\t\t}, function(err) {\n\t\t\tpromiseFind.reject(err);\n\t\t});\n\n\t\treturn promiseFind;\n\t}", "function setupDialogBox(id){\r\n\tstartLoadingIndicator();\r\n\tif($('#dialog-'+id).html() == null){\r\n\t\t$.ajax({\r\n\t\t\turl: '/internships/' + id + '.json',\r\n\t\t \tdataType: 'json',\r\n\t\t \tsuccess: function(data){\r\n\t\t\t\t\tvar html = new EJS({ url: 'javascripts/templates/modal_view.ejs'}).render(data);\r\n\t\t\t\t\t$('#dialogs').append(html);\r\n\t\t\t\t\t$('#tabs-' + id).tabs({ selected: 0});\r\n\t\t\t\t\tinitDialog(id);\r\n\t\t\t\t\tstopLoadingIndicator();\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tinitDialog(id);\r\n\t\tstopLoadingIndicator();\r\n\t}\r\n\t\r\n}", "function findObjectById(id,arr)\n{\n\tfor(var i = 0; i < arr.length; i++)\n\t\tif(arr[i].id == id) return arr[i];\n\n\treturn false;\n}", "function openMassDeleteUserDialog(id, name) {\n\t$('#dialog').dialog({\n\t\twidth: '30%',\n\t\tmodal: true,\n\t\tshow: 'fade',\n\t\thide: 'fade',\n\t\tresizable: false,\n\t\tposition: {\n\t\t\tmy: \"center\",\n\t\t\tat: \"top\",\n\t\t\tof: $('body')\n\t\t},\n\t\topen: function () {\n\t\t\tvar dialog = $(this),\n\t\t\thtml = '';\n\t\t\thtml += '<p>You are about to delete the selected sites from <strong>' + name + '</strong>.</p>';\n\t\t\thtml += '<p>Are you sure you wish to continue?</p>';\n\t\t\thtml += '<div id=\"dialogMessage\"></div>';\n\t\t\thtml += '<p id=\"dialogButtons\"><button data-id=\"' + id + '\" id=\"deleteSitesFromUser\" class=\"confirm\">Yes, Delete</button> <button id=\"cancelDialog\" class=\"cancel\">No, Cancel</button></p>';\n\t\t\tdialog.dialog('option', 'title', 'Mass Delete Site Access for User');\n\t\t\tdialog.html(html);\n\t\t},\n\t\tclose: function () {\n\t\t\t$(this).html('').dialog('destroy');\n\t\t}\n\t});\n}", "function focusOnOpen(){if(options.focusOnOpen){var target=$mdUtil.findFocusTarget(element)||findCloseButton()||dialogElement;target.focus();}/**\n\t * If no element with class dialog-close, try to find the last\n\t * button child in md-actions and assume it is a close button.\n\t *\n\t * If we find no actions at all, log a warning to the console.\n\t */function findCloseButton(){var closeButton=element[0].querySelector('.dialog-close');if(!closeButton){var actionButtons=element[0].querySelectorAll('.md-actions button, md-dialog-actions button');closeButton=actionButtons[actionButtons.length-1];}return closeButton;}}", "function _openDialog( pDialog ) {\n var lWSDlg$, lTitle, lId,\n lButtons = [{\n text : MSG.BUTTON.CANCEL,\n click : function() {\n lWSDlg$.dialog( \"close\" );\n }\n }];\n\n function _displayButton(pAction, pLabel, pHot, pClose ) {\n var lLabel, lStyle;\n\n if ( pLabel ) {\n lLabel = pLabel;\n } else {\n lLabel = MSG.BUTTON.APPLY;\n }\n if ( pHot ) {\n lStyle = 'ui-button--hot';\n }\n lButtons.push({\n text : lLabel,\n class : lStyle,\n click : function() {\n that.actions( pAction );\n if ( pClose ) {\n lWSDlg$.dialog( \"close\" );\n }\n }\n });\n }\n\n if ( pDialog==='WEBSHEET' ) {\n lTitle = MSG.DIALOG_TITLE.PROPERTIES;\n _displayButton( 'websheet_properties_save', null, true, false );\n } else if ( pDialog==='ADD_COLUMN' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_COLUMN;\n _displayButton( 'column_add', null, true, false );\n } else if ( pDialog==='COLUMN_PROPERTIES' ) {\n lTitle = MSG.DIALOG_TITLE.COLUMN_PROPERTIES;\n _displayButton( 'column_properties_save', null, true, false );\n } else if ( pDialog==='LOV' ) {\n lTitle = MSG.DIALOG_TITLE.LOV;\n lId = apex.item( \"apexir_LOV_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'lov_delete', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'lov_save', null, true, false );\n } else if ( pDialog==='GROUP' || pDialog==='GROUP2' ) {\n lTitle = MSG.DIALOG_TITLE.COLUMN_GROUPS;\n lId = apex.item( \"apexir_GROUP_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'column_groups_delete', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'column_groups_save', null, true, false );\n } else if ( pDialog==='VALIDATION' ) {\n lTitle = MSG.DIALOG_TITLE.VALIDATION;\n lId = apex.item( \"apexir_VALIDATION_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'VALIDATION_DELETE', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'VALIDATION_SAVE', null, true, false );\n } else if ( pDialog==='REMOVE_COLUMN' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_COLUMNS;\n _displayButton( 'column_remove', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='SET_COLUMN_VALUE' ) {\n lTitle = MSG.DIALOG_TITLE.SET_COLUMN_VALUES;\n _displayButton( 'set_column_value', null, true, false );\n } else if ( pDialog==='REPLACE' ) {\n lTitle = MSG.DIALOG_TITLE.REPLACE;\n _displayButton( 'replace_column_value', null, true, false );\n } else if ( pDialog==='FILL' ) {\n lTitle = MSG.DIALOG_TITLE.FILL;\n _displayButton( 'fill_column_value', null, true, false );\n } else if ( pDialog==='DELETE_ROWS' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_ROWS;\n _displayButton( 'delete_rows', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='COPY' ) {\n lTitle = MSG.DIALOG_TITLE.COPY_DATA_GRID;\n _displayButton( 'copy', MSG.BUTTON.COPY, true, false );\n } else if ( pDialog==='DELETE' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_DATA_GRID;\n _displayButton( 'delete_websheet', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='ATTACHMENT' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_FILE;\n _displayButton( 'ATTACHMENT_SAVE', null, true, true );\n } else if ( pDialog==='NOTE' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_NOTE;\n _displayButton( 'NOTE_SAVE', null, true, false );\n } else if ( pDialog==='LINK' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_LINK;\n _displayButton( 'LINK_SAVE', null, true, false );\n } else if ( pDialog==='TAGS' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_TAGS;\n _displayButton( 'TAG_SAVE', null, true, false );\n }\n\n lWSDlg$ = $( \"#a-IRR-dialog-js\", apex.gPageContext$ ).dialog({\n modal : true,\n dialogClass: \"a-IRR-dialog\",\n width : \"auto\",\n height : \"auto\",\n minWidth : \"360\",\n title : lTitle,\n buttons : lButtons,\n close : function() {\n lWSDlg$.dialog( \"destroy\");\n }\n });\n }", "function findById(id) {\n return store.items.find(item => item.id === id);\n }", "function findIndexById(id) {\n return $scope.contacts.findIndex(contact => (contact._id === id));\n }", "function setDialogClick(e, id){\n e.preventDefault();\n setDialog(id);\n}", "function FindGameInAcctObjById(accountObj, id) {\n if (accountObj.savedGames != null) {\n for (var i = 0; i < accountObj.savedGames.length; i++) {\n if (accountObj.savedGames[i].id == id) {\n return { gameObj: accountObj.savedGames[i], position: i };\n }\n }\n }\n return null;\n}", "function returnObjectById(id){\n\n return selectableObjects.find(object=> object.id == id)\n}", "function openAddPromoModal(id) {\n\t$('#serviceId').val(id);\n\taddModal.style.display = \"block\";\n}", "function getDialog()/*:Window*/ {\n return this.dialog$QiCE;\n }", "function findCloseButton(){var closeButton=element[0].querySelector('.dialog-close');if(!closeButton){var actionButtons=element[0].querySelectorAll('.md-actions button, md-dialog-actions button');closeButton=actionButtons[actionButtons.length-1];}return closeButton;}", "function findById(a, id) {\n for (var i = 0; i < a.length; i++) {\n if (a[i].id == id) return a[i];\n }\n return null;\n }", "function _launchFind() {\n var editor = EditorManager.getFocusedEditor();\n if (editor) {\n var codeMirror = editor._codeMirror;\n\n // Bring up CodeMirror's existing search bar UI\n codeMirror.execCommand(\"find\");\n\n // Prepopulate the search field with the current selection, if any\n $(\".CodeMirror-dialog input[type='text']\")\n .attr(\"value\", codeMirror.getSelection())\n .get(0).select();\n }\n }", "function openPopupDialog() {\n\nvar type = $(this).attr('id');\n\nif(type.indexOf('logMediator') != -1){\n openLogMediatorPopup();\n}\n\nif(type.indexOf('propertyMediator') != -1){\n openLogMediatorPopup();\n}\n\n}", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }", "function _find( items, id ) {\n for ( var i=0; i < items.length; i++ ) {\n if ( items[i].id == id ) return i;\n }\n }", "function find(id) {\n // eslint-disable-next-line eqeqeq\n return data.find(q => q.id == id);\n}", "initOpen(id) {\n if (this.service.currentVisibleId && id !== this.service.currentVisibleId) {\n // trying to open a different panel so close current one if allowed.\n if (this.needConfirmation(this.service.currentVisibleId)) {\n // need to ask user\n const $modal = $(this.getPropertyValue(this.service.currentVisibleId, 'modal'));\n $modal.modal('setting', 'onApprove', (e) => {\n this.doClosePanel(id);\n });\n $modal.modal('show');\n } else {\n this.doClosePanel(this.service.currentVisibleId);\n this.doOpenPanel(id);\n this.initPanelReload(id);\n }\n } else if (this.service.currentVisibleId === id) {\n // current panel already open try to reload new content\n if (this.needConfirmation(id)) {\n const $modal = $(this.getPropertyValue(id, 'modal'));\n $modal.modal('setting', 'onApprove', (e) => {\n this.doOpenPanel(id);\n this.initPanelReload(id);\n });\n $modal.modal('show');\n } else {\n this.doOpenPanel(id);\n this.initPanelReload(id);\n }\n } else {\n this.doOpenPanel(id);\n this.initPanelReload(id);\n }\n }", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }", "findButton(id) {\n let button = this.buttons.filter(button => {\n return button.pathId === id;\n });\n return button[0];\n }", "function _closerPosition(id) {\n let modal = document.getElementById(id);\n let closer;\n \n if (\n adaptive.small &&\n modal.querySelector(\".modal-window\").scrollHeight >=\n window.innerHeight\n ) {\n closer = document.querySelector(\n \"#\" + id + \" .modal-window .modal-close\"\n );\n if (closer) modal.appendChild(closer);\n } else {\n closer = document.querySelector(\"#\" + id + \" > .modal-close\");\n if (closer)\n document\n .querySelector(\"#\" + id + \" .modal-window\")\n .appendChild(closer);\n }\n }", "getById(id) {\r\n return new Conversation(this, id);\r\n }", "function findId(object) {\n return object.id\n }", "allocateDialogId() {\n let dialogId = DialogManager.MIN_DIALOG_ID;\n while (this.dialogs_.hasOwnProperty(dialogId)) {\n if (dialogId > DialogManager.MAX_DIALOG_ID)\n throw new Error('Pool of available dialog ids has run out.');\n\n ++dialogId;\n }\n\n return dialogId;\n }", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }", "function MaybeGetElement(win, id) {\n return win.document.getElementById(id);\n}", "getById(id)\n {\n return this.getModel()\n .find(id)\n .first();\n }", "function findById(id) {\n return _.find(relations, { '_id': id });\n }", "function findMessage(messageid) {\n return messages.find(m => m.id == messageid);\n}", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n\n return closeButton;\n }", "static async findById (id) {\n const criteria = {\n where: {\n id\n }\n }\n const entity = await Document.findOne(criteria)\n if (!entity) {\n throw new errors.NotFoundError(`id: ${id} \"Document\" doesn't exists.`)\n }\n return entity\n }", "function findCard(id, cardsArray) {\n for (const card of cardsArray) {\n if (card.id == id) {\n return card;\n }\n }\n }", "function find_object_by_id_in_a_list(data, id) {\n var object;\n $.each(data, function(key, value) {\n if (value.id == id) {\n object = value;\n }\n });\n return object;\n }", "function openEditDialog(url, titleText, dialogID) {\r\n beginRequest();\r\n $.ajax({\r\n type: \"GET\",\r\n url: encodeURI(url),\r\n cache: false,\r\n dataType: 'html',\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n $(\"#modal-body-content\").html(XMLHttpRequest.responseText);\r\n },\r\n success: function (data, textStatus, XMLHttpRequest) {\r\n $(\"#modal-body-content\").html(data);\r\n },\r\n complete: function (XMLHttpRequest, textStatus) {\r\n // $(\"#modal-body-content\").html($(\"#\" + dialogID).html());\r\n $(\"#modal-body-title\").addClass(\"modelbox-title\").html(titleText);\r\n\r\n $('#light-box').modal('toggle');\r\n endRequest();\r\n\r\n // $(\"#\" + dialogID).dialog({\r\n // title: titleText,\r\n // width: '500px',\r\n // modal: true\r\n // });\r\n }\r\n });\r\n\r\n}", "function ScheduleClass_Open(scheduleId, departmentId, scheduleclassId) {\n\t//console.warn('ScheduleClass_Open(scheduleId='+scheduleId+', departmentId='+departmentId+', scheduleclassId='+scheduleclassId+')');\n\tvar e_dialogDiv = document.getElementById('dialogDiv');\n\tvar dialogDivContents = e_dialogDiv.innerHTML;\n\tif ( dialogDivContents.indexOf('Load OK') !== -1 ) {\n\t\tvar e_dialogContainer = document.getElementById('dialogContainer');\n\t\tvar docScroll = document.documentElement;\n\t\tvar docLeft = (window.pageXOffset || docScroll.scrollLeft) - (docScroll.clientLeft || 0);\n\t\tvar docTop = (window.pageYOffset || docScroll.scrollTop) - (docScroll.clientTop || 0);\n\t\tif ( dialogContainerLeft < docLeft ) {\n\t\t\tdialogContainerLeft = docLeft;\n\t\t\te_dialogContainer.style.left = dialogContainerLeft+'px';\n\t\t}\n\t\tif ( dialogContainerLeft < 0 ) {\n\t\t\tdialogContainerLeft = 0;\n\t\t\te_dialogContainer.style.left = dialogContainerLeft+'px';\n\t\t}\n\t\tif ( dialogContainerTop < docTop ) {\n\t\t\tdialogContainerTop = docTop;\n\t\t\te_dialogContainer.style.top = dialogContainerTop+'px';\n\t\t}\n\t\t// Make sure dialog is rendered in the viewport\n\t\tif ( dialogContainerTop > docTop ) {\n\t\t\t// Get the distance of the sidenav from the top\n\t\t\t// By getting this, it insures the dialogDiv will never render above the top of the sidenav\n\t\t\t// Without this the dialog could render on the top navbar \n\t\t\tvar e_sidenav = document.getElementById(\"sidenav\");\n\t\t\tvar sidenavDistanceFromTop = parseInt(e_sidenav.style.top);\n\n\t\t\t// Check to see if dialog will be rendered above the sidenav\n\t\t\tif ( dialogContainerTop >= sidenavDistanceFromTop ) {\n\t\t\t\tdialogContainerTop = sidenavDistanceFromTop;\n\t\t\t\te_dialogContainer.style.top = dialogContainerTop+'px';\n\t\t\t} else {\n\t\t\t\tdialogContainerTop = docTop;\n\t\t\t\te_dialogContainer.style.top = dialogContainerTop+'px';\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( dialogContainerTop < 0 ) {\n\t\t\tdialogContainerTop = 0;\n\t\t\te_dialogContainer.style.top = dialogContainerTop+'px';\n\t\t}\n\t\te_dialogDiv.style.display = 'block';\n\n\t\t// Get legend button and add drag event listener\n\t\tvar e_legends = e_dialogContainer.getElementsByTagName(\"legend\");\n\t\te_legends[0].onmousedown = ScheduleClassDialogDrag;\n\n\t} else {\n\t\tif ( ScheduleClassOpenCount < 5 ) {\n\t\t\tScheduleClassOpenCount++;\n\t\t\tURI = '/Schedule/ScheduleClass/ScheduleClassForm.php?scheduleId='+scheduleId+'&departmentId='+departmentId;\n\t\t\tif ( typeof scheduleclassId !== 'undefined' ) { URI += '&scheduleclassId='+scheduleclassId; }\n\t\t\teId = 'dialogDiv';\n\t\t\tpreloadText = 'Getting class';\n\t\t\t\n\t\t\tconsole.log(\"UpdateInclude['\"+window.location.protocol+'//'+window.location.hostname+URI+'&DEBUG=true'+\"', '\"+eId+\"', '\"+preloadText+\"'];\");\n\t\t\t\n\t\t\tUpdateInclude(URI, eId, preloadText);\n\t\t\t//console.warn('console.warn 949');\n\t\t\tsetTimeout(function(){ScheduleClass_Open(scheduleId, departmentId, scheduleclassId);},ScheduleClassOpenCount*1000);\n\t\t} else {\n\t\t\talert('Never got return from URI='+URI);\n\t\t}\n\t}\n} // END ScheduleClass_Open.", "function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = $mdUtil.findFocusTarget(element) || findCloseButton() || dialogElement;\n target.focus();\n }\n\n /**\n * If no element with class dialog-close, try to find the last\n * button child in md-actions and assume it is a close button.\n *\n * If we find no actions at all, log a warning to the console.\n */\n function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n\n return closeButton;\n }\n }", "function findObjectById(list, id){\r\n\tif(!list){\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tfor(var i = 0; i < list.size(); i++){\r\n\t\tif(list.get(i).id == id){\r\n\t\t\treturn list.get(i);\r\n\t\t}\r\n\t}\r\n\r\n\treturn null;\r\n}", "function getComponentByScopeId(id) {\n for (let component of componentList) {\n if (component.scopeId == id) {\n return component;\n }\n }\n}", "function findElementById(elementId) {\n return findElementRecursive(elementId, fsStorage[0], null).element;\n }", "function findObById(id, arr) {\n return lodash.find(arr, function(obj) { return obj.id == id });\n }", "function findById( items, id ) {\n for ( i = 0; i < items.length; i++ ) {\n if ( items[ i ].id === id ) {\n return items[ i ];\n }\n }\n }" ]
[ "0.7865522", "0.657214", "0.65183777", "0.65183777", "0.65183777", "0.6498772", "0.6016974", "0.59315944", "0.5923269", "0.58757794", "0.5782433", "0.57787436", "0.57787436", "0.57718843", "0.5771227", "0.57551366", "0.5711225", "0.5662793", "0.5639442", "0.5636406", "0.5621455", "0.5610551", "0.55821157", "0.5579037", "0.5572012", "0.55517423", "0.5546879", "0.5546437", "0.5546387", "0.5532843", "0.5516463", "0.55112725", "0.5480696", "0.54760605", "0.5451569", "0.54291713", "0.5425513", "0.5419994", "0.5398586", "0.53968", "0.53928876", "0.53773683", "0.53715175", "0.53712606", "0.53619665", "0.53564215", "0.53218615", "0.531909", "0.53155994", "0.53064567", "0.52996534", "0.52777994", "0.52746946", "0.5271306", "0.5270778", "0.5268251", "0.52505946", "0.5243534", "0.5243271", "0.5229673", "0.5227446", "0.52271444", "0.5212933", "0.52113295", "0.5210855", "0.52101815", "0.5208154", "0.5201343", "0.51943666", "0.5194199", "0.5194099", "0.51900035", "0.51888955", "0.51827806", "0.5178415", "0.51761115", "0.517017", "0.51639014", "0.5159666", "0.51574016", "0.5149527", "0.5142776", "0.51399285", "0.5133959", "0.5133726", "0.5121811", "0.5121637", "0.5117081", "0.5104899", "0.51047564", "0.5090653", "0.5069171", "0.506803", "0.5067201", "0.50667423", "0.50532967", "0.50435233", "0.5042206" ]
0.7984786
2
TODO(crisbeto): this utility shouldn't be necessary anymore, because the dialog ref is provided both to component and template dialogs through DI. We need to keep it around, because there are some internal wrappers around `MatDialog` that happened to work by accident, because we had this fallback logic in place. Finds the closest MatDialogRef to an element by looking at the DOM.
function getClosestDialog(element, openDialogs) { let parent = element.nativeElement.parentElement; while (parent && !parent.classList.contains('mat-dialog-container')) { parent = parent.parentElement; } return parent ? openDialogs.find(dialog => dialog.id === parent.id) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find(function (dialog) {\n return dialog.id === parent.id;\n }) : null;\n}", "function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find(function (dialog) {\n return dialog.id === parent.id;\n }) : null;\n }", "function closestDialog(event) {\n // check for left click\n if (event.button !== 0) {\n return;\n }\n\n let dialog;\n // target must contain one of provided classes\n ['v-card__title', 'v-toolbar__content', 'v-toolbar__title'].forEach((className) => {\n if (event.target.classList.contains(className)) {\n dialog = event.target.closest(`${dialogSelector}`);\n }\n });\n\n return dialog;\n}", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }", "getFocusDomRef() {\n const domRef = this.getDomRef();\n if (domRef) {\n const focusRef = domRef.querySelector(\"[data-sap-focus-ref]\");\n return focusRef || domRef;\n }\n }", "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n\n return closeButton;\n }", "findDialog(dialogId) {\n return this.dialogs.find(dialogId);\n }", "function findCloseButton(){var closeButton=element[0].querySelector('.dialog-close');if(!closeButton){var actionButtons=element[0].querySelectorAll('.md-actions button, md-dialog-actions button');closeButton=actionButtons[actionButtons.length-1];}return closeButton;}", "getDomRef() {\n // If a component set _getRealDomRef to its children, use the return value of this function\n if (typeof this._getRealDomRef === \"function\") {\n return this._getRealDomRef();\n }\n if (!this.shadowRoot || this.shadowRoot.children.length === 0) {\n return;\n }\n const children = [...this.shadowRoot.children].filter(child => ![\"link\", \"style\"].includes(child.localName));\n if (children.length !== 1) {\n console.warn(`The shadow DOM for ${this.constructor.getMetadata().getTag()} does not have a top level element, the getDomRef() method might not work as expected`); // eslint-disable-line\n }\n\n return children[0];\n }", "function closestPolyfill(el, s) {\n var ElementProto = win.Element.prototype,\n elementMatches = ElementProto.matches ||\n ElementProto.msMatchesSelector ||\n ElementProto.webkitMatchesSelector,\n ret = null;\n if (ElementProto.closest) {\n ret = ElementProto.closest.call(el, s);\n }\n else {\n do {\n if (elementMatches.call(el, s)) {\n return el;\n }\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n }\n return ret;\n }", "function getModal(paperReference) {\n return document.querySelector(\".\" + paperReference + \" div.modal\");\n}", "function findCloseButton() {\n return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child');\n }", "function polyfillClosest(element, selector) {\n let curr = element;\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n return (curr || null);\n}", "function polyfillClosest(element, selector) {\n let curr = element;\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n return (curr || null);\n}", "function polyfillClosest(element, selector) {\n let curr = element;\n while (curr != null && !(curr instanceof Element && matches(curr, selector))) {\n curr = curr.parentNode;\n }\n return (curr || null);\n}", "showAncestorDialog(viewName) {\n let dialogId;\n $('app-root [dialogtype]')\n .each(function () {\n const dialog = $(this);\n if ($(dialog.html()).find('[name=\"' + viewName + '\"]').length) {\n dialogId = dialog.attr('name');\n return false;\n }\n });\n return dialogId;\n }", "function getAncestorEl(elem, selector) {\n\tfor ( ; elem && elem !== document; elem = elem.parentNode ) {\n\t\tif ( elem.matches( selector ) ) return elem;\n\t}\n\treturn null;\n}", "_getClosest(elem, selector) {\n\n\t\t// Element.matches() polyfill\n\t\tif (!Element.prototype.matches) {\n\t\t Element.prototype.matches =\n\t\t Element.prototype.matchesSelector ||\n\t\t Element.prototype.mozMatchesSelector ||\n\t\t Element.prototype.msMatchesSelector ||\n\t\t Element.prototype.oMatchesSelector ||\n\t\t Element.prototype.webkitMatchesSelector ||\n\t\t function(s) {\n\t\t var matches = (this.document || this.ownerDocument).querySelectorAll(s),\n\t\t i = matches.length;\n\t\t while (--i >= 0 && matches.item(i) !== this) {}\n\t\t return i > -1;\n\t\t };\n\t\t}\n\n\t\t// Get the closest matching element\n\t\tfor ( ; elem && elem !== document; elem = elem.parentNode ) {\n\t\t\tif ( elem.matches( selector ) ) return elem;\n\t\t}\n\t\treturn null;\n\n\t}", "function getClosest(el) {\n if (valid(el)) { return el; }\n var parent = el.parentNode;\n while (parent && parent !== document.body) {\n if (valid(parent)) { return parent; }\n parent = parent.parentNode;\n }\n return null;\n\n function valid(el) {\n return el.nodeName === 'MD-BRANCH' || $$mdTree.isArrow(el) || $$mdTree.isCheckbox(el);\n }\n }", "$getElement(refName) {\n const ref = (refName ? this.refs[refName] : this);\n if (!ref) return $();\n return $(ReactDOM.findDOMNode(ref));\n }", "get dialog() {\n if (!this.dialogInternal) {\n this.initDialog(this.owner.enableRtl);\n }\n return this.dialogInternal;\n }", "function getClosestTargetElement(elem, tag) {\n do {\n if (elem.nodeName === tag) {\n return elem;\n }\n } while (elem = elem.parentNode);\n\n return null;\n }", "function getClosestMatchingAncestor(element, selector) {\n var currentElement = element.parentElement;\n\n while (currentElement) {\n // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n if (currentElement.matches ? currentElement.matches(selector) : currentElement.msMatchesSelector(selector)) {\n return currentElement;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return null;\n }", "function _getTopDialog(elems) {\n // Store the greates z-index that has been seen so far\n var maxZ = 0;\n // Stores a reference to the element that has the greatest z-index so\n // far\n var maxElem;\n // Check each element's z-index\n elems.each(function() {\n var dialog = $(this).parent();\n // If it's bigger than the currently biggest one, store the value\n // and reference\n if (dialog.css(\"z-index\") > maxZ) {\n maxElem = dialog;\n maxZ = dialog.css(\"z-index\");\n }\n });\n // Finally, return the reference to the element on top\n return maxElem;\n }", "function getDomElement(element, defaultElement) {\n if (angular.isString(element)) {\n element = $document[0].querySelector(element);\n }\n\n // If we have a reference to a raw dom element, always wrap it in jqLite\n return angular.element(element || defaultElement);\n }", "function getDomElement(element, defaultElement) {\n if (angular.isString(element)) {\n element = $document[0].querySelector(element);\n }\n\n // If we have a reference to a raw dom element, always wrap it in jqLite\n return angular.element(element || defaultElement);\n }", "function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = $mdUtil.findFocusTarget(element) || findCloseButton();\n target.focus();\n }\n\n /**\n * If no element with class dialog-close, try to find the last\n * button child in md-actions and assume it is a close button.\n *\n * If we find no actions at all, log a warning to the console.\n */\n function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }\n }", "function getPromptElement(options) {\n var result;\n\n if (options.iframe && options.iframeContainer) {\n throwError(\n 'Passing both `iframe` and `iframeContainer` arguments at the' +\n ' same time is not allowed.'\n );\n } else if (options.iframe) {\n // If we are getting an iframe, try to get it and raise if the\n // element we find is NOT an iframe.\n result = getUserDefinedElement(options.iframe);\n validateIframe(result);\n } else if (options.iframeContainer) {\n result = getUserDefinedElement(options.iframeContainer);\n validateIframeContainer(result);\n } else {\n result = document.getElementById('duo_iframe');\n }\n\n return result;\n }", "function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }", "function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }", "function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }", "function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }", "function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = $mdUtil.findFocusTarget(element) || findCloseButton();\n target.focus();\n }\n\n /**\n * If no element with class dialog-close, try to find the last\n * button child in md-actions and assume it is a close button\n */\n function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }\n }", "function getDomElement(element, defaultElement) {\n if (angular.isString(element)) {\n element = $document[0].querySelector(element);\n }\n\n // If we have a reference to a raw dom element, always wrap it in jqLite\n return angular.element(element || defaultElement);\n }", "function closest(element, selector) {\n const el = element.closest(selector);\n return el === element ? null : el;\n}", "function getDomElement(element,defaultElement){if(angular.isString(element)){element=$document[0].querySelector(element);}// If we have a reference to a raw dom element, always wrap it in jqLite\n\treturn angular.element(element||defaultElement);}", "getReference(id) {\n for (let ref of this.refs) {\n if (ref.id === id)\n return ref;\n }\n return undefined;\n }", "function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = $mdUtil.findFocusTarget(element) || findCloseButton() || dialogElement;\n target.focus();\n }\n\n /**\n * If no element with class dialog-close, try to find the last\n * button child in md-actions and assume it is a close button.\n *\n * If we find no actions at all, log a warning to the console.\n */\n function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n\n return closeButton;\n }\n }", "function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }", "get _focusedElement() {\n let commandDispatcher = this._commandDispatcher;\n if (commandDispatcher) {\n return commandDispatcher.focusedElement;\n }\n return null;\n }", "function getDialog()/*:Window*/ {\n return this.dialog$QiCE;\n }", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n if (node instanceof react__WEBPACK_IMPORTED_MODULE_0__.Component) {\n return react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode(node);\n }\n return null;\n}", "function getDomElement(element, defaultElement) {\n if (angular.isString(element)) {\n var simpleSelector = element,\n container = $document[0].querySelectorAll(simpleSelector);\n element = container.length ? container[0] : null;\n }\n\n // If we have a reference to a raw dom element, always wrap it in jqLite\n return angular.element(element || defaultElement);\n }", "function getDomElement(selector) {\n if (WINDOW$6.document && WINDOW$6.document.querySelector) {\n return WINDOW$6.document.querySelector(selector) ;\n }\n return null;\n }", "function focusOnOpen(){if(options.focusOnOpen){var target=$mdUtil.findFocusTarget(element)||findCloseButton()||dialogElement;target.focus();}/**\n\t * If no element with class dialog-close, try to find the last\n\t * button child in md-actions and assume it is a close button.\n\t *\n\t * If we find no actions at all, log a warning to the console.\n\t */function findCloseButton(){var closeButton=element[0].querySelector('.dialog-close');if(!closeButton){var actionButtons=element[0].querySelectorAll('.md-actions button, md-dialog-actions button');closeButton=actionButtons[actionButtons.length-1];}return closeButton;}}", "function findParent( element, parentTag ) {\n while ( element.parentNode ) {\n element = element.parentNode;\n if ( element.tagName == parentTag ) {\n return element;\n }\n }\n return null;\n }", "function closest(el, selector) {\n const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;\n while (el) {\n if (matchesSelector.call(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}", "function botMessageBoxElement() {\n var bot_input = botMessageElement();\n return bot_input.parents('.bot_form_box');\n}", "getElementById(id) {\n if (!this._ids[id]) {\n return null;\n }\n\n // Let's find the first element with where it's root is the document.\n const matchElement = this._ids[id].find(candidate => {\n let root = candidate;\n while (domSymbolTree.parent(root)) {\n root = domSymbolTree.parent(root);\n }\n\n return root === this;\n });\n\n return matchElement || null;\n }", "function findParent(element,options){var parent=options.parent;// Search for parent at insertion time, if not specified\n\tif(angular.isFunction(parent)){parent=parent(options.scope,element,options);}else if(angular.isString(parent)){parent=angular.element($document[0].querySelector(parent));}else{parent=angular.element(parent);}// If parent querySelector/getter function fails, or it's just null,\n\t// find a default.\n\tif(!(parent||{}).length){var el;if($rootElement[0]&&$rootElement[0].querySelector){el=$rootElement[0].querySelector(':not(svg) > body');}if(!el)el=$rootElement[0];if(el.nodeName=='#comment'){el=$document[0].body;}return angular.element(el);}return parent;}", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "openDialog() {\n return this.dialogElement.current.openDialog();\n }", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react_dom___default.a.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react_dom___default.a.findDOMNode(node);\n}", "function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = $mdUtil.findFocusTarget(element) || findCloseButton();\n target.focus();\n }\n\n /**\n * If no element with class dialog-close, try to find the last\n * button child in md-actions and assume it is a close button.\n *\n * If we find no actions at all, log a warning to the console.\n */\n function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }\n }", "_findViewId(_elem) {\n while (_elem && this.isntNullOrUndefined(_elem.view_id) && (_elem !== document.body)) {\n _elem = _elem.parentNode;\n }\n return _elem;\n }", "_findViewId(_elem) {\n while (_elem && this.isntNullOrUndefined(_elem.view_id) && (_elem !== document.body)) {\n _elem = _elem.parentNode;\n }\n return _elem;\n }", "function getDomElement(selector) {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) ;\n }\n return null;\n}", "function unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n }", "_getParentElement(element, selector) {\n\n\t\t\tlet match;\n\t\t\twhile(element.nodeName.toLowerCase() !== 'svg') {\n\t\t\t\tif (element.matches(selector)) {\n\t\t\t\t\tmatch = element;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telement = element.parentNode;\n\t\t\t}\n\n\t\t\treturn match;\n\n\t\t}", "function getClosestRElement(tView, tNode, lView) {\n var parentTNode = tNode; // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n\n while (parentTNode !== null && parentTNode.type & (8\n /* ElementContainer */\n | 32\n /* Icu */\n )) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n } // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n\n\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n } else {\n ngDevMode && assertTNodeType(parentTNode, 3\n /* AnyRNode */\n | 4\n /* Container */\n );\n\n if (parentTNode.flags & 2\n /* isComponentHost */\n ) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n var encapsulation = tView.data[parentTNode.directiveStart].encapsulation; // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n\n if (encapsulation === ViewEncapsulation.None || encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n\n return getNativeByTNode(parentTNode, lView);\n }\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default().findDOMNode(node);\n}", "function getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n if (parentTNode.flags & 2 /* isComponentHost */) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation$1.None ||\n encapsulation === ViewEncapsulation$1.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}", "function getScrollParent(el) {\n var position = el.css('position');\n var scrollParent = el.parents().filter(function () {\n var parent = $(this);\n return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x'));\n }).eq(0);\n return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;\n}", "function getScrollParent(el) {\n var position = el.css('position');\n var scrollParent = el.parents().filter(function () {\n var parent = $(this);\n return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x'));\n }).eq(0);\n return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;\n}", "function getScrollParent(el) {\n var position = el.css('position');\n var scrollParent = el.parents().filter(function () {\n var parent = $(this);\n return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x'));\n }).eq(0);\n return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;\n}", "function getScrollParent(el) {\n var position = el.css('position');\n var scrollParent = el.parents().filter(function () {\n var parent = $(this);\n return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x'));\n }).eq(0);\n return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;\n}", "findElement(selector) {\n return document.querySelector(selector);\n }", "function getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n if (parentTNode.flags & 2 /* isComponentHost */) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}", "function getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n if (parentTNode.flags & 2 /* isComponentHost */) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}", "function getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n if (parentTNode.flags & 2 /* isComponentHost */) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}", "function getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n if (parentTNode.flags & 2 /* isComponentHost */) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}", "function getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);\n if (parentTNode.flags & 2 /* isComponentHost */) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}", "_getRootNode() {\n const nativeElement = this._viewContainerRef.element.nativeElement;\n // The directive could be set on a template which will result in a comment\n // node being the root. Use the comment's parent node if that is the case.\n return (nativeElement.nodeType === nativeElement.ELEMENT_NODE ?\n nativeElement : nativeElement.parentNode);\n }", "get nativeElement() {\n var _a;\n return (_a = this.view) === null || _a === void 0 ? void 0 : _a.nativeElement;\n }", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "function getClosestRElement(tView, tNode, lView) {\n var parentTNode = tNode; // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n\n while (parentTNode !== null && parentTNode.type & (8\n /* ElementContainer */\n | 32\n /* Icu */\n )) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n } // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n\n\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n } else {\n ngDevMode && assertTNodeType(parentTNode, 3\n /* AnyRNode */\n | 4\n /* Container */\n );\n\n if (parentTNode.flags & 2\n /* isComponentHost */\n ) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n var encapsulation = tView.data[parentTNode.directiveStart].encapsulation; // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n\n if (encapsulation === ViewEncapsulation.None || encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n\n return getNativeByTNode(parentTNode, lView);\n }\n }", "function getHostElement(directive){return getLContext(directive)[\"native\"];}", "function getOffsetParent(element) {\n var window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && Object(_isTableElement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(offsetParent) && Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent) === 'html' || Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent) === 'body' && Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "function getOffsetParent(element) {\n var window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && Object(_isTableElement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(offsetParent) && Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent) === 'html' || Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent) === 'body' && Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "function getOffsetParent(element) {\n var window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && Object(_isTableElement_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(offsetParent) && Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent) === 'html' || Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent) === 'body' && Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "getFocusRevertTarget() {\n const me = this,\n {\n owner,\n focusInEvent\n } = me,\n searchDirection = focusInEvent ? focusInEvent.backwards ? 1 : -1 : -1;\n let target = focusInEvent && focusInEvent.relatedTarget;\n const toComponent = target && Widget.fromElement(target); // If the from element is now not focusable, for example an Editor which hid\n // itself on focus leave, then we have to find a sibling/parent/parent's sibling\n // to take focus. Anything is better than flipping to document.body.\n\n if (owner && !owner.isDestroyed && (!target || !DomHelper.isFocusable(target) || toComponent && !toComponent.isFocusable)) {\n target = null; // If this widget can have siblings, then find the closest\n // (in the direction focus arrived from) focusable sibling.\n\n if (owner.eachWidget) {\n const siblings = []; // Collect focusable siblings.\n // With this included so we can find ourselves.\n\n owner.eachWidget(w => {\n if (w === me || w.isFocusable) {\n siblings.push(w);\n }\n }, false);\n\n if (siblings.length > 1) {\n const myIndex = siblings.indexOf(me);\n target = siblings[myIndex + searchDirection] || siblings[myIndex - searchDirection];\n }\n } // No focusable siblings found to take focus, try the owner\n\n if (!target && owner.isFocusable) {\n target = owner;\n } // If non of the above found any related focusable widget,\n // Go through these steps for the owner.\n\n target = target ? target.focusElement : owner.getFocusRevertTarget();\n }\n\n return target;\n }", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "get popup() {\n // Use non-null assertion as we only access this when a popup exists.\n return this._componentRef.instance;\n }", "function getHostElement(directive) {\n return getLContext(directive).native;\n}", "function getHostElement(directive) {\n return getLContext(directive).native;\n}", "function getHostElement(directive) {\n return getLContext(directive).native;\n}", "function unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}", "function unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}", "function unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}" ]
[ "0.7377395", "0.7346077", "0.5886794", "0.5758184", "0.5689209", "0.5654649", "0.5633039", "0.5499711", "0.54976517", "0.546422", "0.5449927", "0.5406385", "0.5356184", "0.53408223", "0.53274596", "0.53274596", "0.53274596", "0.5318093", "0.53067136", "0.5289948", "0.52897835", "0.52637094", "0.52357125", "0.5219404", "0.5204338", "0.5084764", "0.5036954", "0.5036954", "0.50318146", "0.5031311", "0.5027326", "0.5027326", "0.5027326", "0.5027326", "0.5015344", "0.5007157", "0.5006675", "0.5000829", "0.49774057", "0.49489698", "0.49454385", "0.4943062", "0.4941593", "0.4929021", "0.49235058", "0.49225393", "0.49218106", "0.4921122", "0.4909054", "0.4907022", "0.4885213", "0.48839554", "0.48737326", "0.48737326", "0.48625964", "0.48625964", "0.48588803", "0.48523116", "0.48523116", "0.4848677", "0.484622", "0.48446763", "0.48440003", "0.48426726", "0.48230216", "0.4819133", "0.4819133", "0.4819133", "0.4819133", "0.48167118", "0.4815129", "0.4815129", "0.4815129", "0.4815129", "0.4815129", "0.4808343", "0.47993267", "0.4796062", "0.4796062", "0.47825116", "0.47822905", "0.4777519", "0.4777519", "0.4777519", "0.4775678", "0.47752368", "0.47752368", "0.47752368", "0.47752368", "0.47752368", "0.47752368", "0.47743762", "0.4770388", "0.4770388", "0.4770388", "0.47643584", "0.47643584", "0.47643584" ]
0.7366127
3
setUserDefaultsStringForKey Store a string in NSUserDefaults The string is retrieved and double checked that it matches
function setUserDefaultsStringForKey(string, key, callback) { NativeBridge.call('setUserDefaultsStringForKey', [string, key], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSettingValue(str){\n const settingsValues = getSettingsValues();\n if(!str || settingsValues.indexOf(str) > -1){\n return false;\n }\n settingsValues.push(str);\n localStorage.setItem('settingValues', JSON.stringify(settingsValues) );\n return true;\n}", "function setPrefString(absolutePrefPath, value){\r\n \r\n //and the top level (as using the absolute path)\r\n \r\n Services.prefs.setStringPref(absolutePrefPath, value);\n \r\n}", "function set_value_in_local_storage(key,value)\n{\n\tif(key == null || value == null)\n\t{\n\t\treturn false;\n\t}\n\t\n\ttry\n\t{\n\t\tif ($(\"#\"+value).val() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).val();\n\t\t\t\n\t\t}\n\t\telse if($(\"#\"+value).html() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).html();\n\t\t\t\n\t\t}\n\t\t// save value in localStorage Object\n\t\tlocalStorage.setItem(key,value);\n\t\t\n\t\t// update current page cache of var your_name\n\t\tyour_name = get_value_from_local_storage(\"name\");\n\t\tupdate_message('Name Saved as ('+your_name+')','form_ok');\n\t\t\n\t\treturn true;\n\t} catch(e)\n\t{\n\t\treturn false;\n\t\tupdate_message('Failed to Save your name','form_error');\n\t}\n}", "function saveUserPreference(){\n if(savePreference.checked){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n var userPreference = [totWords.value,totSpChars.value,totNumbers.value,useSeparator.value,wordCase.value,savePreference.value];\n localStorage.setItem(\"guddi_ca_xkcd_user_preference\", JSON.stringify(userPreference));\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of inner IF\n } else{\n localStorage.clear();\n } //End of outer IF\n } //End of saveUserPreference() function", "settingForKey(key) {\n return NSUserDefaults.standardUserDefaults().objectForKey_(key);\n }", "function saveSettings() {\n\tvar ttc_email = $('#txtEmail').val();\n\t\n\t//take the input value and store it\n localStorage.setItem(\"ttcemail\", ttc_email);\n\t\n\t//retrieve the storage, just to be sure!\n\tvar check_storage = localStorage.getItem(\"ttcemail\");\n\t////alert (\"The NEW storage is \"+check_storage);\n\t\n\t//Now run a check on it and display as appropriate\n\tcheck_credentials (check_storage);\n return false;\n}", "function restoreLastSearchedStr() {\n var s = localStorage[\"restore_last_searched_str\"];\n return s ? s === 'true' : true;\n}", "function addToLocalStorage(){\n var dataString = $(\"#BADefaultEmail\").val();\n localStorage.setItem(\"BADefaultEmail\", dataString );\n alert(\"Default reviewer email saved.\")\n}", "function retrieveAndSetPreference(){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n if(localStorage.guddi_ca_xkcd_user_preference){\n var userPreferenceRetrieved = JSON.parse(localStorage.getItem(\"guddi_ca_xkcd_user_preference\"));\n totWords.value = userPreferenceRetrieved[0];\n totSpChars.value = userPreferenceRetrieved[1];\n totNumbers.value = userPreferenceRetrieved[2];\n useSeparator.value = userPreferenceRetrieved[3];\n wordCase.value = userPreferenceRetrieved[4];\n savePreference.checked = userPreferenceRetrieved[5];\n } //End of inner IF\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of outer IF\n }", "function loadPreference(preference, defaultVar) {\n var savedItem = window.localStorage.getItem(preference);\n if (savedItem !== null) {\n if (savedItem === 'true') {\n window[preference] = true;\n } else if (savedItem === 'false') {\n window[preference] = false;\n } else {\n window[preference] = savedItem;\n }\n window.log('Setting found for ' + preference + ': ' + window[preference]);\n } else {\n window[preference] = defaultVar;\n window.log('No setting found for ' + preference +\n '. Used default: ' + window[preference]);\n }\n return window[preference];\n }", "function saveSettings() {\r\n messenger.storage.local.set({\r\n MailFolderKeyNav: MailFolderKeyNavInput.checked,\r\n MailFolderKeyNavMenuItem: MailFolderKeyNavMenuItemInput.checked\r\n });\r\n}", "function getPrefString(absolutePrefPath){\r\n\r\n var value = Services.prefs.getStringPref(absolutePrefPath);\n\r\n return value;\r\n}", "function SaveInLocalStorage(strKey, strVal){ \n\n\t//encode if obfuscation is enabled\n\tif(obfuscation==1){ \n\t\ttry{ \n\t\t\tstrVal=window.btoa(unescape(encodeURIComponent(strVal)));\n\t\t}\n\t\tcatch(err){\n\t\t\tconsole.error(\"error: \"+err);\n\t\t}\n\t}\n\tlocalStorage.setItem(strKey,strVal); \n}", "function GM_getValue (key, defaultValue) {\n\t\t\tvar value = window.localStorage.getItem(key);\n\t\t\tif (value == null) value = defaultValue;\n\t\t\treturn value;\n\t\t}", "function checkStorage(res){\n var keys = Object.keys(defaults);\n for (var i = 0; i < keys.length;i++){\n var nthKey = keys[i];\n if (!res[nthKey]){\n var storage = {};\n storage[nthKey] = defaults[nthKey];\n browser.storage.local.set(storage);\n // console.log(nthKey+ ' set');\n }\n }\n if (!res.defaults){\n browser.storage.local.set({defaults: defaults});\n // console.log(\"default values set.\");\n }\n}", "function gbDidSuccessGetPreference ( key, valueString )\n{\n\tif ( key == \"location\" )\n\t{\n\t\tif ( (valueString == \"Local\") || (valueString == \"\") )\n\t\t{\n\t\t\tcurrentLocation = \"Local\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurrentLocation = valueString;\n\t\t}\n\t}\n\telse\n\t{\n\t\tcurrentLocation = \"Local\";\n\t}\n\n\tsetCorrectCheckmarks ();\n}", "setSettingForKey(key, value) {\n NSUserDefaults.standardUserDefaults().setObject_forKey_(value, key)\n }", "function betterdouban_setStringPreference(preference, value) {\n // If the preference is set\n if(preference) {\n var supportsStringInterface = Components.interfaces.nsISupportsString;\n var string = Components.classes[\"@mozilla.org/supports-string;1\"].createInstance(supportsStringInterface);\n \n string.data = value;\n \n betterdouban_getPreferencesService().setComplexValue(preference, supportsStringInterface, string);\n }\n}", "function setValue(key, value) {\r\n\tlocalStorage.setItem(\"DCOC_\"+key, value);\r\n}", "function saveSetting() {\n try {\n var data = {\n language: $(\"#select-script-language-id\").val()\n };\n browser.storage.local.set(data);\n } catch (e) {\n console.log(e);\n }\n}", "function appendStringToLocalStorage(key, value, encode) {\n var storedValue = getValueForKeyAsString(key, encode),\n valueToStore;\n if (storedValue) {\n valueToStore = storedValue + value;\n } else {\n valueToStore = value;\n }\n if (encode) {\n valueToStore = encodeURI(valueToStore);\n }\n localStorage.setItem(key, valueToStore);\n }", "function savePrefs()\n{\n let preferences = collatePrefs( prefs );\n browser.storage.local.set({\"preferences\": preferences});\n}", "function restoreSettings() {\n function setCurrentChoice(result) {\n if(result !== undefined && result.insert !== undefined && result.insert !== \"\"){\n document.getElementById('cmn-toggle-1').checked = result.insert;\n }\n else{\n console.log(\"No Settings Found\");\n return null;\n }\n }\n\n chrome.storage.local.get(\"insert\", setCurrentChoice);\n chrome.storage.local.get(\"lang\", function(result) {\n if(result !== undefined && result.lang !== undefined && result.lang !== \"\") {\n lang = result.lang;\n updateStrings();\n var select = document.getElementById('lang-sel').value = result.lang;\n }\n });\n}", "function getSavedValue(key, initialValue){\n const savedValue = JSON.parse(localStorage.getItem(key))// para obtener el valor almacenado en el localstorage\n if(savedValue) return savedValue;\n if(initialValue instanceof Function) return initialValue();\n return initialValue;\n\n}", "function CheckUserPrefs(){\r\n if(UserPrefs.storePrefs && GM_getValue){\r\n for(opt in UserPrefs){\r\n if(opt == \"storePrefs\"){ continue; }\r\n if(opt == \"message\"){ continue; }\r\n if(typeof UserPrefs[opt] !== \"boolean\"){\r\n GM_log(\"CheckUserPrefs: UserPrefs \" + opt +\r\n \" not boolean - must be true or false\");\r\n UserPrefs[opt] = true;\r\n }\r\n UserPrefs[opt] = SetUserPref(opt, UserPrefs[opt]);\r\n }\r\n }\r\n function SetUserPref(pref,val){\r\n try{\r\n var curPref = GM_getValue(pref);\r\n }catch(e){\r\n GM_log(\"SetUserPref(\\\"\" + pref + \"\\\") thew an exception... \" + e.message);\r\n if(e.name === \"NS_ERROR_UNEXPECTED\") alert(\"You need to restart or set pref: \" + pref);\r\n return false;\r\n }\r\n if(curPref !== undefined) return curPref;\r\n var userval = confirm(\"MU_Bundle UserScript option:\\n \" + UserPrefs.message[pref] + \"?\");\r\n if(typeof userval === \"boolean\"){ val = userval }\r\n else{ GM_log(\"SetUserPref: confirm did not return boolean\") }\r\n GM_setValue(pref, val);\r\n return val;\r\n }\r\n}", "function us_saveValue(name, value) {\r\n\tif (isGM) {\r\n\t\tGM_setValue(name, value);\r\n\t} else {\r\n\t\tlocalStorage.setItem(name, value);\r\n\t}\r\n}", "function BALoadFromLocalStorage() {\n $(\"#BAEmail\").val(localStorage.getItem(\"BADefaultEmail\"));\n}", "function testsave()\n{\n var neco = $('#testInput').val();\n console.log(neco);\n window.localStorage.setItem(\"key\", neco );\n}", "function setLS(key,value){\n window.localStorage.setItem(key, JSON.stringify(value));\n\n}", "function restore_options() {\n // Use default value\n chrome.storage.sync.get({\n userLocation: 'Christchurch',\n }, function(items) {\n document.getElementById('locationInput').value = items.userLocation;\n });\n}", "function saveSettings (name, settings) {\n var name = name.toString();\n var settings = settings.toString();\n\n if (typeof(name) === 'string' && typeof(settings) === 'string') {\n localStorage.setItem(name, settings);\n } else {\n console.log('error saving state of: ' + name + ': ' + settings);\n };\n}", "function savePreference(item, value) {\n window.localStorage.setItem(item, value);\n }", "function saveUserSettings(data) {\n chrome.storage.sync.set(data);\n if (chrome.runtime.lastError !== undefined) {\n //throw an error\n console.error('an error occurred while saving to chrome storage: ' +\n chrome.runtime.lastError);\n return false;\n } else {\n return true;\n }\n}", "function saveSetting() {\n new CookieUtil().set(\n \"webchatUserName\",\n $(\"input[name='webchatUserNameTB']\").val(),\n 365\n );\n new CookieUtil().set(\n \"webchatUserColor\",\n $(\"input[name='webchatUserColorCC']\").val(),\n 365\n );\n new CookieUtil().set(\n \"webchatFontSize\",\n $(\"input[name='webchatFontSizeNB']\").val(),\n 365\n );\n new CookieUtil().set(\n \"webchatRememberOpened\",\n $(\"input[name='webchatRememberOpenedCB']\").is(\":checked\"),\n 365\n );\n applySetting();\n\n if (confirm(\"새로고침 하시겠습니까?\")) {\n window.location.reload();\n }\n}", "initializeStrings(strings) {\n if (typeof(Storage) !== \"undefined\") {\n sessionStorage.removeItem('pma2020Strings', strings);\n sessionStorage.pma2020Strings = JSON.stringify(strings);\n } else {\n console.log('Warning: Local Storage is unavailable.');\n }\n }", "function storeSettings() {\n check();\n browser.storage.local.set(f2j(form));\n}", "function setOptionsAsString(options) {\n localStorage.setItem(\"options\", options);\n}", "function senderCheck(){\n var sender = $('#sender3').val().trim().toUpperCase();\n localStorage.setItem(\"senderName\", sender);\n}", "function saveSettings() {\n\tlocalStorage.mylanguagesetting = \"en\"\n }", "function getLS(key){\n let value= window.localStorage.getItem(key);\n let setString= JSON.parse(value);\n return setString;\n\n}", "function saveNickName() {\n localStorage.setItem('receivedNickName', userNickName); //1st argument is a keyword to get the info, 2nd argument - info that has to be rememeber \n userNickName = localStorage.getItem('receivedNickName');\n}", "function restore_options() {\n chrome.storage.sync.get({\n prefixText: '',\n prefixAvailable: false\n }, function(items) {\n document.getElementById('prefix_text').value = items.prefixText\n document.getElementById('prefix_available').checked = items.prefixAvailable\n })\n}", "function saveSetting (szKey, szValue)\n{\n if(typeof(Storage) !== \"undefined\")\n {\n localStorage.setItem (szKey, szValue);\n }\n else\n alert ('Sorry! No Web Storage support..');\n}", "function restore_options() {\r\n var datap = localStorage[\"passwd\"];\r\n if (datap) {\r\n document.getElementById(\"passwd\").value = datap;\r\n }\r\n\r\n var datau = localStorage[\"user\"];\r\n if (datau) {\r\n document.getElementById(\"user\").value = datau;\r\n }\r\n}", "function settingForKey(key) {\n var store = NSUserDefaults.alloc().initWithSuiteName(\"\".concat(SUITE_PREFIX).concat(getPluginIdentifier()));\n var value = store.objectForKey_(key);\n\n if (typeof value === 'undefined' || value == 'undefined' || value === null) {\n return undefined;\n }\n\n return JSON.parse(value);\n}", "function saveSomeData() {\n localStorage.setItem(\"name\", $('#stringPlayerName').val());\n //localStorage.setItem()\n}", "function readSetting (szKey)\n{\n var szResult = '';\n \n if(typeof(Storage) !== \"undefined\")\n {\n szResult = localStorage.getItem(szKey);\n }\n \n return szResult;\n}", "function saveSettingsLocalStorage(){\n settingsObject = {email: emailSwitch.checked, profile: profileSwitch.checked, timezone: timezoneSelect.selectedIndex}; \n localStorage.setItem('settings', JSON.stringify(settingsObject));\n \n}", "function save(key, value) {\n\t\tlocalStorage[key] = value;\n\t}", "function save_options() {\n var num_rows = $(\":text[id^='username']\").length;\n var newSecretKeys = {};\n for (var i = 0; i < num_rows; i++) {\n if ($(`#username${i}`).val()) {\n newSecretKeys[$(`#username${i}`).val()] = $(`#key${i}`).val();\n }\n }\n chrome.storage.sync.set(\n {\n secretKeys: newSecretKeys,\n },\n function () {\n // Update status to let user know options were saved.\n var status = $(\"#status\");\n status.text(\"Save successful!\");\n setTimeout(function () {\n status.empty();\n }, 1000);\n }\n );\n }", "function checkLocalStorage(string) {\n\t\tif (localStorage.getItem(string + '_list') === 'true') {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tvar alternatives = [];\n\t\t\tfor (var i = 0; i < localStorage.length; i++) {\n\t\t\t\tvar key = localStorage.key(i);\n\n\t\t\t\t//we check for any key that returns true... since that was our check initially.\n\t\t\t\tif (localStorage.getItem(key) === 'true') {\n\t\t\t\t\tvar string = key.replace('_list', '');\n\t\t\t\t\talternatives.push(string);\n\t\t\t\t\tdelete string;\n\t\t\t\t}\n\t\t\t\t// key = NULL;\n\t\t\t\tdelete key;\n\t\t\t}\n\t\t\talert('did you mean something else? maybe the following: \\n' + alternatives.toString());\n\t\t\treturn false;\n\t\t}\n\t}", "function saveSettings(){\n\t//Get the user settings\n\tgetSettings();\n\n\t//Create a variable with all user settings\n\tvar settings = {\n\t\tcountry: country,\n\t\tincludeOldResults: String(includeOldResults),\n\t\tsearchStrings: searchStrings,\n\t\tlocations: locations,\n\t\tradiuses: radiuses,\n\t}\n\n\t//Save the user settings to the local storage\n\tlocalStorage.setItem(\"settings\",JSON.stringify(settings));\n\n\tconsole.log(\"Settings saved\");\n\tconsole.log(JSON.stringify(settings));\n}", "function setValue(item, value) {\n window.localStorage[item] = (typeof value === 'string') ? value : JSON.stringify(value);\n}", "function getStored(key, init_value) {\n const d = localStorage.getItem(key);\n if(d) return JSON.parse(d);\n return init_value;\n}", "function saveKey() {\n var devkey = document.getElementById(\"devkey\").value;\n if (devkey.length > 12) {\n try {\n var localSettings = Windows.Storage.ApplicationData.current.localSettings;\n localSettings.values[\"devkey\"] = devkey;\n }\n catch (err) {\n //do nothing;\n }\n toggleControls(true);\n updateDatasource();\n\n } else {\n toggleControls(false);\n }\n }", "function restore_options() { \r\n document.getElementById('pkey').value = window.localStorage.getItem('pkey', key);\r\n}", "function getSavedValue(key, initialValue) {\n const savedValue = JSON.parse(localStorage.getItem(key));\n if (savedValue) return savedValue;\n if (initialValue instanceof Function) return initialValue();\n return initialValue;\n}", "function pharmacistCheck(){\n var pharmacist = $('#pharmacist-input2').val().trim().toUpperCase();\n localStorage.setItem(\"pharmacistName\", pharmacist);\n}", "async setString(key, data) {\n // this.log(`Caching string ${key}`);\n await this.client.set(key, data);\n }", "function polystr2localStorage(str,aIsMaster){\n try {\n localStorage.setItem(\"polygoneStr\", str);\n localStorage.setItem(\"aIsMaster\", aIsMaster);\n } catch(e) {\n console.log('Can\\'t save '+(aIsMaster ? \"A\" : \"D\")+' to Local Storage :(',e.message);\n }\n}", "function setLocaleStorage(name, value){\n localStorage.setItem(name, JSON.stringify(value));\n}", "function handleSaveUserPreferences() {\n\t\t\tvar version = $('#extendedVersionPrefs').find(\":selected\").text();\n\t\t\tvar language = $('#languagePrefs').find(\":selected\").text();\n\t\t\tvar routingLanguage = $('#routingLanguagePrefs').find(\":selected\").text();\n\t\t\tvar distanceUnit = $('#unitPrefs').find(\":selected\").text();\n\n\t\t\t//version: one of list.version\n\t\t\tversion = preferences.reverseTranslate(version);\n\n\t\t\t//language: one of list.languages\n\t\t\tlanguage = preferences.reverseTranslate(language);\n\n\t\t\t//routing language: one of list.routingLanguages\n\t\t\troutingLanguage = preferences.reverseTranslate(routingLanguage);\n\n\t\t\t//units: one of list.distanceUnitsInPopup\n\t\t\tdistanceUnit = distanceUnit.split(' / ');\n\t\t\tfor (var i = 0; i < distanceUnit.length; i++) {\n\t\t\t\tfor (var j = 0; j < list.distanceUnitsPreferences.length; j++) {\n\t\t\t\t\tif (distanceUnit[i] === list.distanceUnitsPreferences[j]) {\n\t\t\t\t\t\tdistanceUnit = list.distanceUnitsPreferences[j];\n\t\t\t\t\t\ti = distanceUnit.length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttheInterface.emit('ui:saveUserPreferences', {\n\t\t\t\tversion : version,\n\t\t\t\tlanguage : language,\n\t\t\t\troutingLanguage : routingLanguage,\n\t\t\t\tdistanceUnit : distanceUnit\n\t\t\t});\n\n\t\t\t//hide preferences window\n\t\t\t$('#sitePrefsModal').modal('hide');\n\t\t}", "function getOrPrompt(lsKeyValue) {\n var valInStorage = localStorage.getItem(lsKeyValue);\n\n if(!valInStorage) {\n valInStorage = prompt(`Enter a value for ${lsKeyValue}`);\n localStorage.setItem(lsKeyValue, valInStorage);\n }\n\n return valInStorage;\n}", "function parse(name, defaultValue) {\n if (!syncLocalStorage || localStorage[name] === undefined) {\n return defaultValue;\n }\n var value = localStorage[name];\n var type = value.substr(0, 1);\n value = value.substring(1, value.length);\n switch (type) {\n case \"o\": return merge(JSON.parse(value), defaultValue);\n case \"b\": return value == \"true\";\n case \"n\": return parseFloat(value);\n default: return value;\n }\n }", "function setPreferenceValue(branch, name, value) {\r\n var prefs = Components.classes[\"@mozilla.org/preferences-service;1\"].getService(Components.interfaces.nsIPrefService).getBranch(branch);\r\n var str = Components.classes[\"@mozilla.org/supports-string;1\"].createInstance(Components.interfaces.nsISupportsString);\r\n str.data = value;\r\n prefs.setComplexValue(name, Components.interfaces.nsISupportsString, str);\r\n}", "function setKey($key, $value) {\r\n try {\r\n if (!Params.env.isFirefox) return window.localStorage['unfriendfinder_'+$key] = $value;\r\n else return GM_setValue($key, $value);\r\n }\r\n catch (exception) {\r\n Console.error('Fatal error: can\\'t store value '+$key);\r\n }\r\n}", "function saveSetting(obj) {\n if (typeof chrome != 'undefined') {\n console.log('saving setting for ', JSON.stringify(obj, null, '\\t'));\n chrome.storage.sync.set(obj);\n } else {\n console.log('saving setting for other clients not implemented.');\n }\n }", "function setPreference(articleIndex, likeOrNotString) {\n\tlocalStorage.setItem('likeArticle' + articleIndex.toString(), likeOrNotString);\n}", "function showUrlIfSaved() {\n chrome.storage.sync.get('tpUrl', function(items) {\n if (items.tpUrl) {\n\n // Update URL value\n $('#aad-tp-url').val(items.tpUrl); \n\n // Store\n tpUrl = items.tpUrl;\n }\n });\n }", "function storeSettingsVariables() {\n $.each(userscriptSettings, function (key, set) {\n var isEnabled = $(\"#\" + set.id).prop(\"checked\");\n var setting = {\n name: set.id,\n value: isEnabled\n };\n Database.update(Database.Table.Settings, setting, undefined, function () {\n })\n });\n}", "function storeSettingsVariables() {\n $.each(userscriptSettings, function (key, set) {\n var isEnabled = $(\"#\" + set.id).prop(\"checked\");\n var setting = {\n name: set.id,\n value: isEnabled\n };\n Database.update(Database.Table.Settings, setting, undefined, function () {\n })\n });\n}", "function saveLocalSettings() {\n if (typeof (window.localStorage) === 'undefined') {\n console.log(\"Local settings cannot be saved. No web storage support!\");\n return;\n }\n\n localStorage.favoritePresets = JSON.stringify(favoritePresetID);\n console.log(\"Saving Parameter [localStorage.favoritePresets]:\");\n console.log(localStorage.favoritePresets);\n\n localStorage.currentAddress = address;\n console.log(\"Saving Parameter [localStorage.currentAddress]:\");\n console.log(localStorage.currentAddress);\n}", "function saveSettings() {\n // debug('Saved');\n localStorage.setItem('autoTrimpSettings', JSON.stringify(autoTrimpSettings));\n}", "restoreAutoSaved() {\n const text = localStorage.getItem(this.backupFileName)\n if (text === null)\n return ''\n else\n return String(text)\n }", "function formatContactName() {\n if (typeof(Storage) == \"undefined\") {\n alert(\"Configuration save failed\");\n return;\n }\n\n\tconst formatChars = document.forms[\"formatForm\"][\"inputChar\"].value;\n\tconst formatNum = document.forms[\"formatForm\"][\"inputNum\"].value;\n\n const formatOptions = getFormatOptions(formatChars, formatNum);\n\n for(var opt in formatOptions) {\n localStorage.setItem(opt, formatOptions[opt]);\n }\n alert(\"Configuration saved succesfully\");\n}", "setUserPreference(key, item) {\n new UserPreference({\n key: key,\n item: item\n }).save(null, {\n success: () => {\n localStorage.setItem(key, item);\n }, \n error: (model, r) => {\n console.error('User preference not saved');\n }\n });\n }", "function getNick() {\n var nick = document.getElementById('nick').value;\n window.localStorage.setItem('nick', nick);\n }", "function saveSettingsValues() {\n browser.storage.local.set({delayBeforeClean: document.getElementById(\"delayBeforeCleanInput\").value});\n\n browser.storage.local.set({activeMode: document.getElementById(\"activeModeSwitch\").checked});\n\n browser.storage.local.set({statLoggingSetting: document.getElementById(\"statLoggingSwitch\").checked});\n\n browser.storage.local.set({showNumberOfCookiesInIconSetting: document.getElementById(\"showNumberOfCookiesInIconSwitch\").checked});\n\n browser.storage.local.set({notifyCookieCleanUpSetting: document.getElementById(\"notifyCookieCleanUpSwitch\").checked});\n\n browser.storage.local.set({contextualIdentitiesEnabledSetting: document.getElementById(\"contextualIdentitiesEnabledSwitch\").checked});\n\n page.onStartUp();\n}", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function saveSettings() {\n\n chrome.storage.local.set({\n\n words: wordArray,\n pages: pagesArray\n\n }, function() {\n\n \t//**********************************\n\t// OPTIONS SAVED INTO LOCAL STORAGE\n\t//**********************************\n\n });\n\n}", "function save_options() {\n chrome.storage.sync.set(\n {\n ERPIITKGP_ERPLoginID: document.getElementById(\"ERPLoginID\").value,\n ERPIITKGP_ERPPassword: document.getElementById(\"ERPPassword\").value,\n ERPIITKGP_answer1: document.getElementById(\"answer1\").value,\n ERPIITKGP_answer2: document.getElementById(\"answer2\").value,\n ERPIITKGP_answer3: document.getElementById(\"answer3\").value,\n ERPIITKGP_question1: document.getElementById(\"question1\").value,\n ERPIITKGP_question2: document.getElementById(\"question2\").value,\n ERPIITKGP_question3: document.getElementById(\"question3\").value\n },\n function() {\n show_open_if_already_saved();\n\n document.getElementById(\"status\").innerHTML =\n '<div class=\"alert alert-info\" role=\"alert\">Changes saved.</div>';\n }\n );\n}", "function saveToLocal( key, value ) {\n var localSavedData = JSON.stringify( value );\n localStorage.setItem( key, localSavedData );\n}", "function setPreferenceValue(branch, name, value) {\n var prefs = Components.classes[\"@mozilla.org/preferences-service;1\"].getService(Components.interfaces.nsIPrefService).getBranch(branch);\n var str = Components.classes[\"@mozilla.org/supports-string;1\"].createInstance(Components.interfaces.nsISupportsString);\n str.data = value;\n prefs.setComplexValue(name, Components.interfaces.nsISupportsString, str);\n}", "_saveToLocalStorage(storage, propObj) {\n try {\n window.localStorage.setItem(storage, propObj);\n return true;\n } catch (e) {\n return false;\n }\n }", "function checkStoredSettings(storedSettings) {\n\tvar temp = storedSettings.configs;\n\tbrowser.storage.local.set({\n\t\tconfigs : configs\n\t});\n\tif(temp){\n\t\tbrowser.storage.local.set({\n\t\t\tconfigs : temp\n\t\t});\n\t}\n}", "function saveName(text) {\n localStorage.setItem('currentUser', text);\n}", "function save_options() {\n chrome.storage.sync.set({\n isNotificationEnabled: document.getElementById(\"is-notification-enabled\").checked,\n mioUrl: document.getElementById(\"mio-url\").value\n },function() {\n if (chrome.runtime.lastError) {\n showMessage(\"<font color='#FF0000'>Failed to save...</font>\");\n } else {\n showMessage(\"Saved!\");\n }\n });\n}", "get defaultValueString() {\n\t\treturn this.__defaultValueString;\n\t}", "static save(key, value) {\r\n value = JSON.stringify(value);\r\n \r\n localStorage.setItem(key, value);\r\n }", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function deleteUserDefaultsForKey(key, callback)\n{\n NativeBridge.call('deleteUserDefaultsStringForKey', [key], callback);\n}", "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}" ]
[ "0.63622683", "0.61682576", "0.59449196", "0.56228584", "0.5621431", "0.55960524", "0.55917424", "0.5587894", "0.55821836", "0.5505531", "0.5492015", "0.54420793", "0.5421833", "0.53816736", "0.5344939", "0.5321491", "0.5271883", "0.5271159", "0.5269831", "0.52665496", "0.52562404", "0.5247211", "0.5246549", "0.52024454", "0.52022415", "0.5187283", "0.5180401", "0.5174997", "0.5168487", "0.5140371", "0.51321065", "0.5131636", "0.5098094", "0.50837845", "0.50785375", "0.50697696", "0.5063834", "0.5036681", "0.50331956", "0.5029973", "0.500465", "0.5003594", "0.4994532", "0.49903384", "0.4988203", "0.49785426", "0.49782342", "0.49726328", "0.49564284", "0.49378723", "0.49329877", "0.4922108", "0.49156433", "0.4910033", "0.4907959", "0.4900057", "0.48983794", "0.48953712", "0.48810273", "0.48739445", "0.48669726", "0.48602143", "0.48600215", "0.48597735", "0.48515666", "0.484848", "0.48484033", "0.48460123", "0.48337227", "0.4833148", "0.4833148", "0.4819719", "0.4817115", "0.48052946", "0.48035684", "0.48015195", "0.47990528", "0.47980762", "0.4790604", "0.4790604", "0.47876027", "0.47876027", "0.47876027", "0.47876027", "0.47876027", "0.47876027", "0.47876027", "0.47865674", "0.4786289", "0.47845802", "0.47786653", "0.47754547", "0.47737563", "0.47717237", "0.4762122", "0.47615874", "0.47592258", "0.47570926", "0.47567314", "0.47545102" ]
0.7059272
0
readUserDefaultsForKey Read a string from NSUserDefaults
function readUserDefaultsForKey(key, callback) { NativeBridge.call('readUserDefaultsForKey', [key], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readSetting (szKey)\n{\n var szResult = '';\n \n if(typeof(Storage) !== \"undefined\")\n {\n szResult = localStorage.getItem(szKey);\n }\n \n return szResult;\n}", "function getPrefString(absolutePrefPath){\r\n\r\n var value = Services.prefs.getStringPref(absolutePrefPath);\n\r\n return value;\r\n}", "settingForKey(key) {\n return NSUserDefaults.standardUserDefaults().objectForKey_(key);\n }", "static getString(key) {\n return Preferences.get(key);\n }", "static getString(key) {\n return Preferences.get(key);\n }", "function setUserDefaultsStringForKey(string, key, callback)\n{\n\tNativeBridge.call('setUserDefaultsStringForKey', [string, key], callback);\n}", "function readLocalStorageKeyConvertToObject (key){\n let value_deserialize = JSON.parse(window.localStorage.getItem(key));\n console.log(value_deserialize);\n return value_deserialize;\n}", "function get(context, key) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n var userDefaults = getUserDefaults(context);\n var storedValue = userDefaults.stringForKey_(key);\n if (!storedValue) {\n return defaultValue;\n }\n try {\n return JSON.parse(storedValue);\n } catch (e) {\n return defaultValue;\n }\n}", "function settingForKey(key) {\n var store = NSUserDefaults.alloc().initWithSuiteName(\"\".concat(SUITE_PREFIX).concat(getPluginIdentifier()));\n var value = store.objectForKey_(key);\n\n if (typeof value === 'undefined' || value == 'undefined' || value === null) {\n return undefined;\n }\n\n return JSON.parse(value);\n}", "function globalSettingForKey(key) {\n var value = NSUserDefaults.standardUserDefaults().objectForKey_(key);\n\n if (typeof value === 'undefined' || value === 'undefined' || value === null) {\n return undefined;\n }\n\n return JSON.parse(value);\n}", "function readPrefs() {\r\ttry {\r\t\tprefsFile.open(\"r\");\r\t\tmyPrefs = eval(prefsFile.readln());\r\t\tprefsFile.close();\r\t} catch(e) {\r\t\tthrowError(\"Could not read preferences: \" + e, false, 2, prefsFile);\r\t}\r}", "function GM_getValue (key, defaultValue) {\n\t\t\tvar value = window.localStorage.getItem(key);\n\t\t\tif (value == null) value = defaultValue;\n\t\t\treturn value;\n\t\t}", "function retrieveAndParseInputStorageItem(key) {\n return JSON.parse(localStorage.getItem(key));\n }", "function retrieveAndSetPreference(){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n if(localStorage.guddi_ca_xkcd_user_preference){\n var userPreferenceRetrieved = JSON.parse(localStorage.getItem(\"guddi_ca_xkcd_user_preference\"));\n totWords.value = userPreferenceRetrieved[0];\n totSpChars.value = userPreferenceRetrieved[1];\n totNumbers.value = userPreferenceRetrieved[2];\n useSeparator.value = userPreferenceRetrieved[3];\n wordCase.value = userPreferenceRetrieved[4];\n savePreference.checked = userPreferenceRetrieved[5];\n } //End of inner IF\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of outer IF\n }", "function loadPreference(preference, defaultVar) {\n var savedItem = window.localStorage.getItem(preference);\n if (savedItem !== null) {\n if (savedItem === 'true') {\n window[preference] = true;\n } else if (savedItem === 'false') {\n window[preference] = false;\n } else {\n window[preference] = savedItem;\n }\n window.log('Setting found for ' + preference + ': ' + window[preference]);\n } else {\n window[preference] = defaultVar;\n window.log('No setting found for ' + preference +\n '. Used default: ' + window[preference]);\n }\n return window[preference];\n }", "get(key, $default = null) {\n let value = localStorage.getItem(key);\n\n try {\n value = JSON.parse(value);\n } catch (e) {\n value = null;\n }\n\n return value === null ? $default : value;\n }", "function readify(k, a){\n try {\n return JSON.parse(localStorage[k])\n\n } catch(e) {\n debu(e.toString())\n return a\n }\n}", "function getStored(key, init_value) {\n const d = localStorage.getItem(key);\n if(d) return JSON.parse(d);\n return init_value;\n}", "function parse(name, defaultValue) {\n if (!syncLocalStorage || localStorage[name] === undefined) {\n return defaultValue;\n }\n var value = localStorage[name];\n var type = value.substr(0, 1);\n value = value.substring(1, value.length);\n switch (type) {\n case \"o\": return merge(JSON.parse(value), defaultValue);\n case \"b\": return value == \"true\";\n case \"n\": return parseFloat(value);\n default: return value;\n }\n }", "function getKeyVal(key) {\n var value = \"\";\n value = window.localStorage.getItem(key);\n if (value === undefined) {\n return \"\";\n }\n return value;\n }", "function getLS(key){\n let value= window.localStorage.getItem(key);\n let setString= JSON.parse(value);\n return setString;\n\n}", "function getFromLocalStorage(keyname) {\n var stringedData = localStorage.getItem(keyname);\n var parsedData = JSON.parse(stringedData);\n return parsedData;\n}", "function getSavedValue(key, initialValue){\n const savedValue = JSON.parse(localStorage.getItem(key))// para obtener el valor almacenado en el localstorage\n if(savedValue) return savedValue;\n if(initialValue instanceof Function) return initialValue();\n return initialValue;\n\n}", "function loadSettings() {\n const jsonSettings = localStorage.getItem(\"mafiaSettings\");\n try {\n if (jsonSettings) {\n settings = JSON.parse(jsonSettings);\n }\n } catch (e) {\n debug.log(\"String is not valid JSON\");\n // No point storing it then\n localStorage.removeItem(\"mafiaSettings\");\n // Use the current definition of settings (above)\n }\n}", "function betterdouban_getStringPreference(preference, userPreference) {\n // If the preference is set\n if(preference) {\n \n // If not a user preference or a user preference is set\n if(!userPreference || betterdouban_isPreferenceSet(preference)) {\n try {\n \n return betterdouban_getPreferencesService().getComplexValue(preference, Components.interfaces.nsISupportsString).data;\n } catch(exception) {\n // Do nothing\n //alert(exception);\n }\n }\n }\n \n return null;\n}", "function GetSetting(key) {\n // Check if local storage is supported\n if (supports_html5_storage()) {\n // If it does then return the value.\n return localStorage.getItem(key);\n } else {\n alert(\"Browser does not support local storage!\")\n }\n}", "function setPrefString(absolutePrefPath, value){\r\n \r\n //and the top level (as using the absolute path)\r\n \r\n Services.prefs.setStringPref(absolutePrefPath, value);\n \r\n}", "function getLocalStorageSetting(confKey) {\n const storageKey = `${confKey}_KEY`\n return window.localStorage.getItem(storageKey)\n}", "function readFromLS(key) {\n \n if( !(\"localStorage\" in window) ) return;\n \n return window.localStorage.getItem(key); // podajemu co ma odczytac z LS\n \n }", "function readUserData() {\r\n\treturn fs.readFileSync(storagePath, \"utf8\");\r\n}", "static load() { return JSON.parse(window.localStorage.getItem('settings')) || {}; }", "static get(key) {\r\n key = localStorage.getItem(key);\r\n \r\n try {\r\n return JSON.parse(key);\r\n } catch {\r\n return key;\r\n }\r\n }", "function get (key) {\n return JSON.parse(window.localStorage.getItem(key));\n}", "function readDictionaryString(){\n return dict[readMultibyteInt31()];\n }", "function getSavedValue(key, initialValue) {\n const savedValue = JSON.parse(localStorage.getItem(key));\n if (savedValue) return savedValue;\n if (initialValue instanceof Function) return initialValue();\n return initialValue;\n}", "function GetFromLocalStorage(strKey){\n\t\n\t\n\tvar stringToDecode = localStorage.getItem(strKey);\n\tvar DRM=1;\n\tif(DRM==1&&stringToDecode!= null&&stringToDecode!= undefined &&stringToDecode.indexOf(\"\\\"ct\")==14){\n\t\tstringToDecode=decryptLS(stringToDecode);\n\t\t}\n\t\t//alert(stringToDecode);\n\telse{\n\tif(stringToDecode!= undefined){\n\t\t//decode if obfuscation is enabled\n\t\tif(obfuscation==1){\n\t\t\ttry{\n\t\t\t\tstringToDecode=decodeURIComponent(escape(window.atob(stringToDecode)));\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(err){\n\t\t\t\tconsole.error(\"error: \"+err);\n\t\t\t}\n\t\t} \n\t}\n\t}\n\treturn stringToDecode;\n}", "function getFromStorage(key) {\n return JSON.parse(window.localStorage.getItem(key))\n}", "function getUserPreferences() {\r\n\treturn JSON.parse(readUserData());\r\n}", "function get_value_from_local_storage(key)\n{\n\ttry\n\t{\n\t\treturn localStorage.getItem(key);\n\t} catch(e)\n\t{\n\t\treturn false;\n\t}\n}", "function getItem(key){\r\n try{\r\n var val = window.localStorage.getItem(key);\r\n if(val == null)\tval = \"\";\r\n return val;\r\n }catch(e){\r\n console.log(\"Unable to return value for key \" + key);\r\n return \"\";\r\n }\r\n}", "findIdentityFromKeybaseConfig() {\n const home = process.env[\"HOME\"] || process.env[\"USERPROFILE\"];\n if (!home) return null;\n\n let json = this.readKeybaseConfig(home + \"/.config/keybase/config.json\");\n if (json && json.user && json.user.name) return json.user.name;\n\n // older location:\n json = this.readKeybaseConfig(home + \"/.keybase/config.json\");\n if (json && json.user && json.user.name) return json.user.name;\n\n return null;\n }", "function us_getValue(name, alternative) {\r\n\tif (isGM) {\r\n\t\treturn (GM_getValue(name, alternative));\r\n\t} else {\r\n\t\treturn (localStorage.getItem(name, alternative));\r\n\t}\t\r\n}", "function getNick() {\n var nick = document.getElementById('nick').value;\n window.localStorage.setItem('nick', nick);\n }", "function restore_options() {\n chrome.storage.local.get({\n username: '',\n password: ''\n }, function(options) {\n document.getElementById('username').value = options.username;\n document.getElementById('password').value = options.password;\n });\n}", "function getFromStorage(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function returnString(key){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//return strings from the local Storage by key\n\treturn localStorage.getItem(localStorage.key(key));\n}", "function getValue(key, value, userid) {\n if (!userid) userid = UID;\n var key = userid + '-' + key;\n var ret = '';\n\n switch (storage) {\n case 'greasemonkey':\n ret = GM_getValue(key, value);\n break;\n\n case 'localstorage':\n var val = localStorage.getItem(SID + '-' + key);\n if (val == 'true') {\n ret = true;\n } else if (val == 'false') {\n ret = false;\n } else if (val) {\n ret = val;\n }\n break;\n\n default:\n ret = value;\n break;\n }\n\n return ret;\n }", "function restore_options() {\n chrome.storage.sync.get({\n username: '',\n password: ''\n }, function(items) {\n document.getElementById('username').value = items.username;\n document.getElementById('password').value = items.password;\n });\n}", "function deleteUserDefaultsForKey(key, callback)\n{\n NativeBridge.call('deleteUserDefaultsStringForKey', [key], callback);\n}", "function getFromLocalStorage(name) {\n var value = JSON.parse(localStorage.getItem(name));\n\n if(value == null) {\n if(name == 'ScriptsRun') value = 1;\n else value = 0;\n }\n\n return value;\n}", "function readUser() {\n \"use strict\";\n var input = fs.readFileSync('./resources/login.config');\n\n var data = input.toString().split(\"\\r\\n\");\n var user_line = data[0];\n var password_line = data[1];\n\n var password = password_line.substring(password_line.indexOf(\":\") + 2, password_line.length);\n var username = user_line.substring(user_line.indexOf(\":\") + 2, user_line.length);\n\n user = {\n username: username,\n password: password\n };\n}", "restoreAutoSaved() {\n const text = localStorage.getItem(this.backupFileName)\n if (text === null)\n return ''\n else\n return String(text)\n }", "function getLocalValue( key ) {\n\tif( window.localStorage.getItem( key ) == null )\n\t\treturn '';\n\telse\n\t\treturn window.localStorage.getItem( key );\n}", "function getSettings(){\n if(localStorage.getItem('settings') !== null){\n settings = JSON.parse(localStorage.getItem('settings'));\n }\n}", "function getPref(id) {\n\tif (id === \"mtd_core_theme\") {\n\t\treturn TD.settings.getTheme();\n\t}\n\n\tvar val;\n\n\tif (exists(store)) {\n\t\tif (store.has(id))\n\t\t\tval = store.get(id);\n\t\telse\n\t\t\tval = undefined;\n\t} else {\n\t\tval = localStorage.getItem(id);\n\t}\n\n\tif (debugStorageSys)\n\t\tconsole.log(\"getPref \"+id+\"? \"+val);\n\n\n\tif (val === \"true\")\n\t\treturn true;\n\telse if (val === \"false\")\n\t\treturn false;\n\telse\n\t\treturn val;\n}", "function loadKey() {\n var devkey = \"\";\n\n try {\n var localSettings = Windows.Storage.ApplicationData.current.localSettings;\n devkey = localSettings.values[\"devkey\"];\n if (devkey === undefined) {\n devkey = \"\";\n }\n }\n catch (err) {\n devkey = \"\";\n }\n if (devkey.length > 12) {\n document.getElementById(\"devkey\").value = devkey;\n toggleControls(true);\n } else {\n toggleControls(false);\n }\n }", "async function load_Prefs() {\r\n let prefs = await browser.storage.local.get(\"Prefs\");\r\n let settings = prefs.Prefs;\r\n if (settings != null && settings != undefined){\r\n for (let key of Object.keys(settings)){\r\n let elem = document.getElementById(key);\r\n if (!elem) {\r\n continue;\r\n }\r\n if (elem.type == \"checkbox\") {\r\n elem.checked = settings[key];\r\n } else {\r\n elem.value = settings[key];\r\n }\r\n }\r\n }else{\r\n resetValues();\r\n }\r\n update_shown_Values();\r\n}", "function getLocal(mode, key) {\n return localStorage.getItem(`${mode}-${key}`);\n}", "async get(key, defaultValue = null) {\n if (!(key instanceof string)) {\n return undefined;\n }\n\n // Replacing local with the sync storage type allows having all stored\n // information available accross logged in browsers.\n // More information about possible key types here: \n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/get\n const data = await browser.storage.local.get({ key: defaultValue });\n return data[key];\n }", "function getValue(key){\n\tif (hasStorage()) {\n\t\treturn thisX.eval('__xstorage = ' + localStorage.getItem(window.xuser.id + '|' + key) + ';');\n\t}\n\treturn null;\n}", "function getPreference(string, def) {\n var pref = nova.config.get(string)\n if (pref == null) {\n console.log(`${string}: ${pref} is null. Returning ${def}`)\n return def\n } else {\n console.log(`${string}: ${pref}`)\n return pref\n }\n}", "function getUserNameValue(){\n\tvar cookieValue = getRememberMe();\n\tif (cookieValue != \"\") {\n\t\tvar cookiePairs = cookieValue.split(\"~\");\n\t\tvar cookiePair = \"\";\n\t\tvar cookiePairContent = \"\";\n\t\tfor(i=0;i<cookiePairs.length;i++){\t\n\t\t\tcookiePair = cookiePairs[i];\n\t\t\tif (cookiePair != \"\") {\n\t\t\t\tcookiePairContent = cookiePair.split(\":\");\n\t\t\t\tif(cookiePairContent.length > 1){\n\t\t\t\t\tif(cookiePairContent[0]==\"userName\"){\n\t\t\t\t\t\treturn cookiePairContent[1];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\treturn \"\";\n}", "function restore_options() {\r\n var datap = localStorage[\"passwd\"];\r\n if (datap) {\r\n document.getElementById(\"passwd\").value = datap;\r\n }\r\n\r\n var datau = localStorage[\"user\"];\r\n if (datau) {\r\n document.getElementById(\"user\").value = datau;\r\n }\r\n}", "function get_config(key){\n return JSON.parse(document.getElementById('config_data').innerHTML)[key];\n}", "function loadKey(filename) {\n return fs.readFileSync(path.join(__dirname, filename));\n}", "function findValue(key) {\n try {\n if (window.localStorage.getItem(key) != null) {\n return JSON.parse(window.localStorage.getItem(key));\n }\n } catch (error) {\n //An older Gecko 1.8.1/1.9.0 method of storage (Deprecated due to the obvious security hole):\n if (window.globalStorage[location.hostname].getItem(key) != null) {\n return JSON.parse(window.globalStorage[location.hostname].getItem(key));\n }\n }\n return null;\n}", "function restore_options() {\r\n var storage = chrome.storage.local;\r\n var key = 'k1';\r\n\r\n storage.get(key, function(result){\r\n document.getElementById('apikey').value = result[key];\r\n });\r\n}", "function restore_options() {\n chrome.storage.sync.get({\n prefixText: '',\n prefixAvailable: false\n }, function(items) {\n document.getElementById('prefix_text').value = items.prefixText\n document.getElementById('prefix_available').checked = items.prefixAvailable\n })\n}", "getItem(itemName) {\r\n if (!is.aPopulatedString(itemName)) { return null; }\r\n const valueToBeDeserialized = localStorage.getItem(itemName);\r\n if (!valueToBeDeserialized) { return null; }\r\n const deserializedValue = JSON.parse(valueToBeDeserialized);\r\n if (deserializedValue.hasOwnProperty('value')) { return deserializedValue.value; }\r\n return null;\r\n }", "function parsePreferenceGroup(options) {\n\t\t//options.group = the name of the preference group\n\t\t//options.string = the returned string from local storage\n\t\t\t\n\t\tif (options.string == null) {\n\t\t\treturn appPreferencesDefault[options.group];\n\t\t} else {\n\t\t\tconst parsedPreferences = JSON.parse(options.string).version;\n\t\t\t\n\t\t\tif (parsedPreferences != appPreferencesVersion) {\n\t\t\t\treturn appPreferencesDefault[options.group]; //This will reset preferences if a breaking change needs to be made\n\t\t\t} else {\n\t\t\t\treturn JSON.parse(options.string);\n\t\t\t}\n\t\t}\n\t}", "function BALoadFromLocalStorage() {\n $(\"#BAEmail\").val(localStorage.getItem(\"BADefaultEmail\"));\n}", "function getSavedValue(key, initialValue) {\n // Create a new value to store the parsed JSON object from localStorage for a value at the passed in key\n const savedValue = JSON.parse(localStorage.getItem(key));\n // If there was a value in storage at the provided key, return it,\n if (savedValue) return savedValue;\n // If the inital value was a function, call the function and return the result of it\n if (initialValue instanceof Function) return initialValue();\n // Otherwise, just return the initialValue\n return initialValue;\n}", "getText (key) {\n\t\tconst s = this.strings[key];\n\t\treturn ((typeof s == \"string\") ? s : \"\");\n\t}", "function pref(key) {\n // Cache the prefbranch after first use\n let {branch, defaults} = pref;\n if (branch == null)\n branch = pref.branch = Services.prefs.getBranch(pref.root);\n\n // Figure out what type of pref to fetch\n switch (typeof defaults[key]) {\n case \"boolean\":\n return branch.getBoolPref(key);\n case \"number\":\n return branch.getIntPref(key);\n case \"string\":\n return branch.getCharPref(key);\n }\n return null;\n}", "getSettingsVariable(key, def = null) {\r\n const setts = this.config.storage.getFrom(this.config.PERSISTENT, this.config.SETTINGS);\r\n if (!setts || typeof setts !== \"object\" || Object.keys(setts).indexOf(key) == -1) {\r\n return def;\r\n }\r\n return setts[key];\r\n }", "function restore_options() {\n // Use default value\n chrome.storage.sync.get({\n userLocation: 'Christchurch',\n }, function(items) {\n document.getElementById('locationInput').value = items.userLocation;\n });\n}", "function getSavedState(key) {\n return JSON.parse(window.localStorage.getItem(key))\n}", "function getStorage(key)\n{\n localStorage.length;\n var value = localStorage.getItem(key);\n if (value && (value.indexOf(\"{\") == 0 || value.indexOf(\"[\") == 0))\n {\n return JSON.parse(value);\n }\n return value;\n}", "function getObject(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "get(key) {\n const value = this.storageMechanism.getItem(key);\n try {\n return JSON.parse(value);\n } catch (error) {\n return value;\n }\n }", "function loadSettings() {\r\n// load settings, if nothing is loaded, use default settings\r\n\tlet loadedSettings = localStorage.getItem(\"highlightFriendsSettings\");\r\n\tif (loadedSettings !== null) {\r\n\t\tsaveData = JSON.parse(loadedSettings);\r\n\t}\r\n}", "function restore_options() { \r\n document.getElementById('pkey').value = window.localStorage.getItem('pkey', key);\r\n}", "function getObject(key) {\n\tvar storage = window.localStorage;\n\tvar value = storage.getItem(key);\n\treturn value && JSON.parse(value);\n}", "function retrieveLocalStorageDict(key) {\r\n var dict = localStorage[key];\r\n if (dict == null) {\r\n dict = {}; /* always return a valid dictionary object */\r\n }\r\n else { /* localStorage values are strings - parse to JSON object */\r\n dict = JSON.parse(dict);\r\n };\r\n return dict;\r\n}", "function loadLocalStore(key) {\n var localString = localStorage.getItem(key);\n // catch undefined case\n localString = (localString) ? localString : \"{}\";\n return JSON.parse(localString);\n}", "function GetDataFromLocalStorage(){\n /*if (storageObject.getItem(\"username\") != null) {\n $(\".usernameval\").val(storageObject.username);\n }\n if (storageObject.getItem(\"password\") != null) {\n $(\".passwordval\").val(storageObject.password);\n }*/\n}", "function getStringSync(guild, string) {\r\n \r\n let language = \"en_us\";\r\n const json = require(\"../languages/\" + language + \".json\");\r\n\r\n return json[string];\r\n}", "function getPref(prefPrefix, prefName) {\n\tvar nimPrefsFile = new File(nimPrefsPath),\n\t\tprefString = prefPrefix + '_' + prefName + '=',\n\t\tcurrentLine,\n\t\tprefPos,\n\t\tfoundPref = false;\n\n\tif (!nimPrefsFile.exists)\n\t\treturn false;\n\n\tnimPrefsFile.open('r');\n\twhile (!nimPrefsFile.eof) {\n\t\tcurrentLine = nimPrefsFile.readln();\n\t\tprefPos = currentLine.indexOf(prefString);\n\t\tif (prefPos != -1) {\n\t\t\tfoundPref = currentLine.substr(prefPos + prefString.length);\n\t\t\tbreak;\n\t\t}\n\t}\n\tnimPrefsFile.close();\n\n\tif (foundPref) return foundPref;\n\telse return false;\n}", "function readUserPreferencesFromLocalStorage() {\n let userPrefences = readObjectFromLocalStorage(userPreferencesKeyInLocalStorage);\n if ( Object.keys(userPrefences).length > 0){\n return userPrefences;\n }\n return {\n favouriteMeals : [],\n favouriteAreas : [],\n }\n}", "function get_settingsFromNeuralNet(settingKey, neuralNet, defaultValue){\n\t\tconst neuralNetName=neuralNet.split('/').pop();\n\t\tif (_settings[settingKey][neuralNetName]){\n\t\t\treturn _settings[settingKey][neuralNetName];\n\t\t} else {\n\t\t\treturn defaultValue;\n\t\t}\n\t}", "function restoreSettings()\n{\n var tmp = System.Gadget.Settings.readString(\"user_name\");\n\tif (tmp != \"\") userName = tmp;\n\ttmp = System.Gadget.Settings.readString(\"api_key\");\n\tif (tmp != \"\") apiKey = tmp;\n\ttmp = System.Gadget.Settings.readString(\"poll_freq\");\n\tif (tmp != \"\") pollFreq = tmp;\n\tvar nameField = document.getElementById(\"user_name\");\n\tnameField.value = userName;\n\tvar keyField = document.getElementById(\"api_key\");\n\tkeyField.value = apiKey;\n\tvar pollField = document.getElementById(\"poll_freq\");\n\tpollField.value = pollFreq;\n\tSystem.Gadget.onSettingsClosing = SettingsClosing;\n}", "function getItem(key) {\n return JSON.parse(localStorage.getItem(key));\n}", "function getUserDataByKey(key) {\n if(!can.isEmptyObject(userData)) {\n return userData[key];\n }\n return \"\";\n}", "function getPref(prefname, type){\n\treturn new Promise(function(resolve, reject) {\n\t\tvar branch = Services.prefs.getBranch(\"extensions.pagesigner.\");\n\t\tif (branch.prefHasUserValue(prefname)){\n\t\t\tif (type === 'bool'){\n\t\t\t\tresolve(branch.getBoolPref(prefname));\n\t\t\t}\n\t\t\telse if (type === 'string'){\n\t\t\t\tresolve(branch.getCharPref(prefname));\t\n\t\t\t}\n\t\t}\n\t\tresolve('not found');\n\t});\n}", "static get(key) {\n if (Preferences.preferenceCache[key] !== null && typeof (Preferences.preferenceCache[key]) !== 'undefined') {\n return Preferences.preferenceCache[key];\n }\n return this.defaults[key];\n }", "static get(key) {\n if (Preferences.preferenceCache[key] !== null && typeof (Preferences.preferenceCache[key]) !== 'undefined') {\n return Preferences.preferenceCache[key];\n }\n return this.defaults[key];\n }", "function readsaveInfoLocalStorage(){\n let saveInfoLocalStorage = JSON.parse(localStorage.getItem('userInfo'));\n if(saveInfoLocalStorage !== null){\n return saveInfoLocalStorage;\n } else {\n return saveInfoLocalStorage = {};\n }\n}", "function getKeyFromLocalStorage(key) {\n return localStorage.getItem(key);\n}", "function loadUser() {\n try {\n return (\n jsonParse(localStorage.getItem(userKey) || sessionStorage.getItem(userKey) || '{}') || {}\n );\n } catch (e) {\n return {};\n }\n}", "function getItem(key) {\n\treturn JSON.parse(localStorage.getItem(key));\n}" ]
[ "0.63825715", "0.6351416", "0.585623", "0.5758448", "0.5758448", "0.57503474", "0.5748897", "0.56163406", "0.55749416", "0.5496849", "0.54894114", "0.54374826", "0.543673", "0.53017104", "0.5291851", "0.52913225", "0.528739", "0.52725315", "0.5269205", "0.52665883", "0.5256698", "0.52390426", "0.52196944", "0.5195381", "0.51881635", "0.5183417", "0.51585567", "0.51059794", "0.5100682", "0.5093758", "0.509045", "0.50821203", "0.5080367", "0.5074119", "0.50735843", "0.5065596", "0.5029046", "0.50209457", "0.49920303", "0.4980679", "0.49802703", "0.4966094", "0.49633828", "0.49557656", "0.49401498", "0.49339312", "0.49155092", "0.49140298", "0.49131462", "0.49093834", "0.49044704", "0.4903042", "0.4899974", "0.48825005", "0.4863498", "0.48448563", "0.48325393", "0.48260674", "0.48236072", "0.48235822", "0.48230556", "0.48157138", "0.4814965", "0.48143205", "0.48136884", "0.48123792", "0.48063055", "0.48001534", "0.47947183", "0.47865433", "0.4785974", "0.47859228", "0.4785585", "0.4784297", "0.47815377", "0.47725397", "0.47698116", "0.47685596", "0.4766615", "0.47359324", "0.4735146", "0.47244114", "0.4719129", "0.47144082", "0.47009668", "0.46974432", "0.46942654", "0.46887782", "0.4688573", "0.46770886", "0.46764535", "0.46743652", "0.46655843", "0.46653682", "0.4663456", "0.4663456", "0.4663071", "0.46627557", "0.46583012", "0.46576917" ]
0.64231205
0
deleteUserDefaultsForKey Delete an object from NSUserDefaults
function deleteUserDefaultsForKey(key, callback) { NativeBridge.call('deleteUserDefaultsStringForKey', [key], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(key) {\n delete this.#defaults[key];\n }", "nuke(key) {\n delete localStorage[key];\n chrome.storage.local.remove(key);\n if (chrome.storage.sync != null) {\n chrome.storage.sync.remove(key);\n }\n }", "function deletePreferences() {\n PropertiesService.getUserProperties().deleteAllProperties();\n}", "function deletePublicPref() {\n\t\tpublicStorage.remove();\n\t}", "unset(key) {\n if (allowedSettings.includes(key)) {\n delete this.settings[key];\n this.save();\n }\n }", "function deleteValue(key){\n\tif (hasStorage()) {\n\t\tlocalStorage.removeItem(window.xuser.id + '|' + key);\n\t}\n}", "function purgePrefs() {\n\tfor (var key in localStorage) {\n\t\tif (key.indexOf(\"mtd_\") >= 0) {\n\t\t\tlocalStorage.removeItem(key);\n\t\t\tconsole.log(\"Removing key \"+key+\"...\");\n\t\t}\n\t}\n\tif (isApp) {\n\t\tconst Store = require('electron-store');\n\t\tconst store = new Store({name:\"mtdsettings\"});\n\t\tstore.clear();\n\t\tconsole.log(\"Clearing electron-store...\");\n\t}\n}", "function deleteValueFromSession(key){\n\tif (hasStorage()) {\n\t\tsessionStorage.removeItem(window.xuser.id + '|' + key);\n\t}\n}", "function delete_save() {\n\tvamp_load_vals.forEach(\n\t\tfunction (val) {\n\t\t\tlocalStorage.removeItem(val);\n\t\t}\n\t);\n\t\t\n\t// Also delete special stuff:\n\tlocalStorage.removeItem('money_flag');\n\tlocalStorage.removeItem('energy_upgrade_flag');\n\tlocalStorage.removeItem('buffer');\n\t\n\tmessage('Your local save has been wiped clean.');\n}", "removeData(key, subkey){\n if(subkey != null){\n let k = JSON.parse(localStorage.getItem(key));\n delete k[subkey];\n localStorage.setItem(key, JSON.stringify(k));\n germination.view.loadSeason(key);\n } else if(subkey == null){\n localStorage.removeItem(key);\n germination.view.loadSeason();\n\n } else {\n return;\n }\n\n }", "function deleteUserData() {\r\n\tlocalStorage.clear();\r\n}", "function deleteLocalStorage(key) {\n localStorage.removeItem(key);\n}", "function deleteUserDataFromSessionStorage() {\n localStorage.removeItem('userData');\n}", "clearUser() {\n window.localStorage.clear(this.userKey)\n }", "function deleteValue(key) {\n try {\n window.localStorage.removeItem(key);\n } catch (error) {\n //An older Gecko 1.8.1/1.9.0 method of storage (Deprecated due to the obvious security hole):\n window.globalStorage[location.hostname].removeItem(key);\n }\n}", "function unset_value_from_local_storage(key)\n{\n\ttry\n\t{\n\t\tlocalStorage.removeItem(key);\n\t\twindow.location = window.location;\n\t}catch(e)\n\t{\n\t\talert(\"Error. \"+e);\n\t}\n}", "function resetCustomMapping() {\n chrome.storage.sync.get('custom',(val) => {\n const custom = val['custom'];\n if (custom == null || custom[hostname] == null) return;\n delete custom[hostname];\n chrome.storage.sync.set({custom:custom},() => {\n if (chrome.runtime.lastError) {\n console.error('Could not reset custom mapping');\n return;\n }\n resetInputBtn.classList.add('hidden');\n });\n });\n}", "function deletePublicKey() {\n var key = document.getElementById(\"deleteKey\").value;\n var keyList = JSON.parse(localStorage.getItem(EE_KEYLIST));\n delete keyList[key];\n \n localStorage.setItem(EE_KEYLIST, JSON.stringify(keyList));\n location.reload();\n}", "static reset() {\n Preferences.preferenceCache = {};\n switch (RoKA.Utilities.getCurrentBrowser()) {\n case Browser.CHROME:\n chrome.storage.sync.remove(Object.keys(Preferences.defaults));\n break;\n }\n }", "static reset() {\n Preferences.preferenceCache = {};\n switch (RoKA.Utilities.getCurrentBrowser()) {\n case Browser.CHROME:\n chrome.storage.sync.remove(Object.keys(Preferences.defaults));\n break;\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 clearSettings() {\n localStorage.removeItem('emailSwitch');\n localStorage.removeItem('publickSwitch');\n localStorage.removeItem('timezone');\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n\t\n // Remove preferences\n widget.setPreferenceForKey(null, createInstancePreferenceKey('url'));\n widget.setPreferenceForKey(null, createInstancePreferenceKey('username'));\n}", "function deleteSave(){\n localStorage.removeItem(\"game\");\n location.reload();\n }", "function delData(key, dominio){\n\tvar data = JSON.parse(GM_getValue('wcr.settings', '{}'));\n\tdominio = dominioData(dominio);\n\n\tif(data[dominio]){\n\t\tif(key) delete data[dominio][key];\n\t\tif(!key || JSON.stringify(data[dominio]) == '{}') delete data[dominio];\n\t}\n\n\tvar json = JSON.stringify(data);\n\tif(json == '{}') GM_deleteValue('wcr.settings');\n\telse GM_setValue('wcr.settings', json);\n\tdataCache = data;\n}", "function clearPair(wizard, user){\n delete userWizardPairs[wizard];\n delete userWizardPairs[user];\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(PREF_KEY_NAME));\n widget.setPreferenceForKey(null, PREF_KEY_NAME);\n}", "function clearUserData()\n {\n userData = userDataDefault;\n window.localStorage.setItem(localStorageName, JSON.stringify(userData));\n }", "function delz (){\n\t//get the ID's of the inputs and remove the keys from local storage\n\tdocument.getElementById('StepsType').value;\n\tlocalStorage.removeItem('key3');\n\tdocument.getElementById('DistanceType').value;\n\tlocalStorage.removeItem('key4');\n\tdocument.getElementById('ActiveType').value;\n\tlocalStorage.removeItem('key5');\n\tdocument.getElementById('CaloriesType').value;\n\tlocalStorage.removeItem('key6');\n\tlocation.reload();\n}", "clearUserFromStorage() {\n this.getSession().forget(this.sessionKeyName);\n this.clearRememberMeCookie();\n }", "function deleteSave() {\n\tlocalStorage.removeItem(\"ArkanusSave\");\n\tdisplayMessage(\"Save deleted.\", 3);\n}", "function resetSettings() {\n let ns = Connector.getNamespace().toLowerCase();\n\n let removeSettings = st => {\n let us = st.userSettings;\n if (us) {\n let o = JSON.parse(us);\n delete o[ns];\n st.userSettings = JSON.stringify(o);\n }\n };\n\n // Remove both from local and session storage\n removeSettings(sessionStorage);\n try {\n removeSettings(localStorage);\n } catch(e) {}\n\n reloadPage();\n }", "function saveObjectOnUnload(key, name, permanent) {\n $(window).unload(function () {\n var item = Go.getProp(name);\n Go.set(key, item, permanent);\n });\n }", "function deleteLocal(key) {\n\t\t\tdelete localStorageObj[key];\n\t\t}", "function deleteFav(key){\n user = firebase.auth().currentUser;\n var delRef = fav.child(user.uid).child(key); \n delRef.remove();\n fav.child(user.uid).on(\"value\", onValue);\n }", "function removeKeyVal(key) {\n window.localStorage.removeItem(key);\n }", "function del (){\n\t\t//get the ID's of the inputs and remove the keys from local storage\n\tdocument.getElementById('heightType').value;\n\tlocalStorage.removeItem('key0');\n\tdocument.getElementById('Age').value;\n\tlocalStorage.removeItem('key1');\n\tdocument.getElementById('weightType').value;\n\tlocalStorage.removeItem('key2');\n\tlocation.reload();\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, createInstancePreferenceKey(\"your-key\"));\n}", "function Excluir(idMeta)\r\n{ \r\n var emailLogado = $(\"#hiddenEmail\").val();\r\n //var usuarioLogado;\r\n\r\n var chkMarcado = $(\":checkbox\", $(\"#\" + idMeta)).is(\":checked\");\r\n\r\n //Recupera usuário do localStorage para excluir sua meta que tem o id do parâmetro\r\n if(chkMarcado)\r\n {\r\n var usuarioLogado = JSON.parse(localStorage.getItem(emailLogado)); \r\n \r\n //Exclui a meta do usuário e salva no localStorage\r\n for(var i=0; i < usuarioLogado.META.length; i++)\r\n if(usuarioLogado.META[i].ID == idMeta)\r\n {\r\n usuarioLogado.META.splice(i,1);\r\n \r\n localStorage.setItem(emailLogado, JSON.stringify(usuarioLogado));\r\n }\r\n \r\n ListarMetas(emailLogado);\r\n }\r\n \r\n \r\n \r\n\r\n}", "function resetSettings() {\r\n\t\tvar keys = GM_listValues();\r\n\t\tfor (var i=0, key=null; key=keys[i]; i++) {\r\n\t\t\tGM_deleteValue(key);\r\n\t\t}\r\n\t}", "deleteLdapSetting(key) {\n this.modal.confirm(\"Are you sure you want to delete LDAP: '\" + key + \"'?\")\n .then(() => this._doDeleteLdapSetting(key));\n }", "function deleteList(){\n\tlocalStorage.removeItem(list.key); // <===== SAVING TO LOCAL STORAGE\n\tlist = new signUpList(\"list\",\"signUpList\");\n\tupdateList();\n}", "deleteProfile() {}", "function deleteActiveUser(delActiveUser) {\n alert(\"User \" + activeUser.nome + \" (\" + activeUser.numero + \") successfully logged out.\");\n localStorage.removeItem(\"ActiveUser\");\n resetVariables();\n}", "function restore_options() {\n\tchrome.storage.sync.get(['auto_duo'], function (items) {\n\t\t(document.getElementById('auto_duo')).checked = items.auto_duo;\n\t});\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "function wipeSave(){\r\n if (supports_html5_storage()){\r\n localStorage.removeItem(\"save\");\r\n cookies = 0;\r\n cursors = 0;\r\n }\r\n}", "function clearSettings() {\n localStorage.removeItem(\"emailToggle\");\n localStorage.removeItem(\"privacyToggle\");\n localStorage.removeItem(\"timezone\");\n}", "function undoStorageItem(){\n var store = JSON.parse(localStorage.getItem(\"toStorage\"));\n console.log(store);\n store.pop();\n console.log(store);\n localStorage.setItem(\"toStorage\", JSON.stringify(store));\n}", "function clearSettingsFile() {\n fs.writeFileSync('json/logins.json', '');\n}", "function removeItemFromLocalStorage (key){\n window.localStorage.removeItem(key);\n}", "function clearSavedData(){\n\t//by removing the saved game tag, SS will think there's no saved game. The new game will just override the old data.\n\t$.store.remove(SL_KEYS.savedGameTag);\n}", "static removeModel(key) {\n delete Model.instanceMap[key];\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 destroyPrefixedStorageItemKeys(prefix) {\n var keys_to_destroy = retrievePrefixedStorageItemKeys(prefix);\n for (var key of keys_to_destroy) {\n localStorage.removeItem(key);\n }\n }", "function deleteCookie(name, path, domain) {\n window.localStorage.removeItem(name);\n}", "function resetValues() {\n\t\tsetValues( Defaults );\n\t\t\n\t\tpreferences.save();\n\t}", "set(obj, callback) {\n return storage.get(\"settings\", function(callback_data) {\n const storedSettings = callback_data.settings;\n for (let key in obj) {\n // If key isn't in in DEFAULTS, don't save it\n if (typeof DEFAULTS[key] === \"undefined\") {\n if (callback) { callback(false); } else { return; }\n }\n if (obj[key] === DEFAULTS[key]) {\n delete storedSettings[key];\n } else {\n storedSettings[key] = obj[key];\n }\n }\n\n return storage.set({settings: storedSettings}, callback);\n });\n }", "function deleteUserLocal(){\n try\n {\n return LocalStorage.removeObject(Constants.USER);\n \n }\n catch(err)\n {\n return {};\n }\n }", "function reset(){\n emailCheck.checked = false;\n profileCheck.checked = false;\n timeZone.value = 'Select a time zone';\n localStorage.clear();\n alert('Your settings have been removed successfully');\n}", "function cleartasksfromlocalstorage(){\n localStorage.clear();\n}", "static removeUserInfoFromStorage() {\n localStorage.removeItem(this.KEY_USER_INFO);\n }", "function delInputWallet() {\r\n address.value = \"\";\r\n publickey.value = \"\";\r\n privatekey.value = \"\";\r\n }", "function restore_options() {\n chrome.storage.sync.get(tcDefaults, function(storage) {\n updateShortcutInputText('popKeyInput', storage.popKeyCode);\n });\n}", "clearNearbyPrefs() {\n chrome.send('clearNearbyPrefs');\n }", "delete(key) {\n this.storageMechanism.removeItem(key);\n }", "function removeSaved(selectElement) {\n //if 'id' is not there, use 'name'\n var key = $(selectElement).attr('id');\n key = key ? key : $(selectElement).attr('name');\n window.localStorage.removeItem(key);\n }", "static purgeSettings() {\n for (const value of GM_listValues()) {\n GM_deleteValue(value);\n }\n }", "function clearSync(){\n $.store.remove(SL_KEYS.passcode);\n}", "function del(obj,key){var ob=obj.__ob__;if(obj._isVue||ob&&ob.vmCount){\"development\"!=='production'&&warn('Avoid deleting properties on a Vue instance or its root $data '+'- just set it to null.');return;}if(!hasOwn(obj,key)){return;}delete obj[key];if(!ob){return;}ob.dep.notify();}", "function reset_save() {\r\n\tsessionStorage.clear()\r\n\twindow.location.reload()\r\n}", "function removePersistent(key) {\n localStore.removeItem(key);\n }", "function deleteValue(key, obj, type = 1) {\n obj[key] -= type\n }", "function delete_cookie() {\n $.cookie(cookie_name, null);\n}", "async remove(guild, key) {\n\t\tif(key === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet guildObj = await this.getGuild(guild);\n\n\t\tdelete guildObj.settings[key];\n\t\tguildObj.markModified('settings');\n\n\t\tawait guildObj.save();\n\t}", "function vaciar_local_storage(){\n localStorage.clear();\n}", "function remove(key) {\n window.localStorage.removeItem(key);\n }", "teardown(obj, keyName, meta$$1) {\n if (!this._volatile) {\n let cache = peekCacheFor(obj);\n\n if (cache !== undefined && cache.delete(keyName)) {\n removeDependentKeys(this, obj, keyName, meta$$1);\n }\n }\n\n super.teardown(obj, keyName, meta$$1);\n }", "function reset(){\n localStorage.removeItem(\"checkbox1\", checkbox.checked);\n localStorage.removeItem('checkbox2', checkboxProfil.checked); \n localStorage.removeItem('selectOptions', selectTimeCity.value);\n document.querySelector('.mailSettings input').checked = false;\n document.querySelector('.profilSettings input').checked = false;\n document.querySelector('#time').value = 'null';\n}", "function signOut() {\n chrome.storage.sync.set({USER: {}}, function() {\n sendMessageToContentJS({'task':'signout'});\n updateUIForSignedOut();\n });\n}", "function clearLocalStorage(key) {\n localStorage.removeItem(key);\n}", "deleteSession(){\n if (localStorage.getItem(\"user\") === null) {\n \n }\n else\n localStorage.removeItem(\"user\");\n localStorage.removeItem(\"roleid\");\n\n }", "function resetLocalStorage(){\n StorageArea.remove(['username', 'freq', 'name', 'gender'], function () {\n console.log('Removed username, name, gender and freq from storage.');\n });\n}", "destroy(guid) {\n this.registry.get(guid).willDestroy();\n this.registry.delete(guid);\n const {type, id} = this.registry.fromGlobalId(guid);\n // Delete from datastore\n }", "logout () {\n AppConfig.emailAddress = undefined;\n AppConfig.save();\n }", "function removeLocalStorageItem(key) {\n localStorage.removeItem(key);\n}", "function deleteFacebookUserLocal(){\n try\n {\n return LocalStorage.removeObject(Constants.USER_FACEBOOK);\n \n }\n catch(err)\n {\n return {};\n }\n }", "function delsaveButton(){\r\n localStorage.removeItem(\"save\")\r\n location.reload();\r\n}", "function clear (key, callback) {\n console.log(\"SETTINGS clear: \" + key);\n nconf.clear(escape(key), function () {\n nconf.save(function (err){\n if (err) {\n console.error(err.message);\n callback(err.message);\n return;\n } else {\n console.log('Configuration saved successfully in ' + currentSettingsFile);\n callback(undefined);\n }\n });\n });\n}", "function mqc_clear_default_config() {\n try {\n var config = localStorage.getItem(\"mqc_config\");\n if (!config) {\n return;\n } else {\n config = JSON.parse(config);\n }\n for (var c in config) {\n if (config.hasOwnProperty(c)) {\n config[c]['default'] = false;\n }\n }\n localStorage.setItem(\"mqc_config\", JSON.stringify(config));\n $('<p class=\"text-danger\" id=\"mqc-cleared-success\">Unset default.</p>').hide().insertBefore($('#mqc_loadconfig_form .actions')).slideDown(function () {\n setTimeout(function () {\n $('#mqc-cleared-success').slideUp(function () { $(this).remove(); });\n }, 5000);\n var name = $('#mqc_loadconfig_form select option:contains(\"default\")').text();\n $('#mqc_loadconfig_form select option:contains(\"default\")').remove();\n name = name.replace(' [default]', '');\n $('#mqc_loadconfig_form select').append('<option>'+name+'</option>').val(name);\n });\n } catch (e) {\n console.log('Could not access localStorage');\n }\n}", "function setSettingForKey(key, value) {\n var store = NSUserDefaults.alloc().initWithSuiteName(\"\".concat(SUITE_PREFIX).concat(getPluginIdentifier()));\n var stringifiedValue = JSON.stringify(value, function (k, v) {\n return util__WEBPACK_IMPORTED_MODULE_0__[\"toJSObject\"](v);\n });\n\n if (!stringifiedValue) {\n store.removeObjectForKey(key);\n } else {\n store.setObject_forKey_(stringifiedValue, key);\n }\n}", "function resetBudgetEntry() {\n getStorage().removeItem(storageKey)\n}", "function deleteNote() {\n const note = notes.value;\n window.localStorage.removeItem(note);\n editor.value = '';\n for (let i = 0; i < notes.length; i++) {\n const option = notes[i];\n if (option.value === note) {\n notes.removeChild(option);\n }\n }\n}", "function destructivelyDeleteFromDriverByKey(obj, key) {\n delete obj[key];\n return obj;\n }", "destroyUserLS() {\n localStorage.removeItem('logedUser');\n }", "function enleverCleLocalStorage(key) {\n localStorage.removeItem(key);\n}", "function deleteStoredData() {\n\t\t// Detects if using cookies or local storage\n\t\tif (ie7) {\n\t\t\t// Grabs select elements on page to remove cookies\n\t\t\tvar selections = document.getElementsByTagName(\"select\");\n\n\t\t\t// Loops through select elements and deletes cookies named the same\n\t\t\tfor (selection in selections) {\n\t\t\t\tif (selections[selection].value != undefined) {\n\t\t\t\t\tDeleteCookie(selections[selection].name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlocalStorage.clear();\n\t\t}\n}", "function reset() {\n\tchrome.runtime.getBackgroundPage(background => {\n\t\tconst ExtensionOptions = background.ExtensionOptions;\n\t\tconst ChromeStorage = background.ChromeStorage;\n\n\t\tExtensionOptions.onChange.once(load);\n\n\t\tChromeStorage.clear().then(() => {\n\t\t\tshowMessage('Settings reset!');\n\t\t});\n\t});\n}", "function deleteLogin () {\n\tlocalStorage.removeItem(\"login\");\n}" ]
[ "0.61938435", "0.5947393", "0.59291816", "0.5828678", "0.5826418", "0.5790587", "0.57888454", "0.55974674", "0.55716825", "0.54869825", "0.5403751", "0.53822756", "0.536381", "0.5341044", "0.53243905", "0.532011", "0.5317304", "0.5315965", "0.52945316", "0.52945316", "0.52934796", "0.5249466", "0.5247986", "0.52091646", "0.5204978", "0.52023727", "0.51821333", "0.51592565", "0.5138874", "0.5136822", "0.5129313", "0.51237583", "0.51162547", "0.51101613", "0.51052123", "0.5066191", "0.506101", "0.5054022", "0.50509965", "0.50505126", "0.5039083", "0.5023417", "0.50171053", "0.5014212", "0.50087297", "0.5000304", "0.5000304", "0.49992383", "0.49687797", "0.4948257", "0.4941689", "0.4940632", "0.49382737", "0.49140525", "0.49139863", "0.49100682", "0.490979", "0.49074936", "0.49062017", "0.48935515", "0.4876819", "0.48729265", "0.48599094", "0.48580346", "0.48531803", "0.48446602", "0.48432195", "0.48431963", "0.48411283", "0.48395854", "0.4834056", "0.48300484", "0.4829976", "0.48268324", "0.48267272", "0.48240802", "0.48182738", "0.48176163", "0.48125044", "0.48100233", "0.48081976", "0.48079097", "0.48066956", "0.4805244", "0.48014954", "0.4800491", "0.4790181", "0.47898138", "0.47858885", "0.4766241", "0.4765268", "0.47651485", "0.4762716", "0.4758235", "0.47479558", "0.47451591", "0.47373474", "0.47270852", "0.4723299", "0.47231925" ]
0.7343193
0
showAlert Display either a UIAlertView or UIAlertController (Depending on iOS version)
function showAlert(title, message, buttons, inputField, callback) { NativeBridge.call('showAlert', [title||'', message||'', buttons||[], inputField], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayAlert(title, message){\n Alert.alert(title,message);\n}", "function showAlert() {\n navigator.notification.alert(\n 'AVF-1207', // message\n alertDismissed, // callback\n 'Carol Gaylor', // title\n 'Done' // buttonName\n );\n}", "function showAlert() {\n navigator.vibrate(200);\n navigator.notification.alert(\n 'Please fill in the required fields', // message\n alertDismissed, // callback\n 'Alert!', // title\n 'Ok' // buttonName\n );\n}", "function showAlertFunc() {\n setShowAlert(true);\n }", "function showAlert(title,message,redirect) {\n\tconsole.log(\"show alert (title,message,redirect)\");\n navigator.notification.alert(\n message, // message\n alertDismissed(redirect), // callback\n title, // title\n 'OK' // buttonName\n );\n}", "function showAlert(txt) {\n if (isMobile()) {\n navigator.notification.alert(txt, function(){}, \"Melding\");\n } else {\n alert(txt);\n }\n}", "function showAlert() {\n alert(\"Thank you for buying mobile from us\")\n}", "function showAlert(type,message){\n var $alert = $('#alertBox');\n $alert.css('display','block');\n $('#alertMessage').text(message);\n switch(type){\n case \"error\":\n $alert.addClass('alert-danger')\n .removeClass('alert-success')\n .find('#alertTitle').text('Error!');\n break;\n case \"success\":\n $alert.addClass('alert-success')\n .removeClass('alert-danger')\n .find('#alertTitle').text('Success!');\n break;\n default:\n break;\n }\n}", "function showAlert() {\n alert = $mdDialog.alert({\n title: 'Attention',\n textContent: 'This is an example of how easy dialogs can be!',\n ok: 'Close'\n });\n\n $mdDialog\n .show(alert)\n .finally(function () {\n alert = undefined;\n });\n }", "function MsgDisplay(message)\n\t {\n\t\t if(showAlert) {\n\t\t\t alert(message);\n\t\t }\n\t }", "function showAlertMessage(mensaje) {\r\n\talert (mensaje);\r\n}", "function _showAlert(_message = '', _type = 'error', _title = '') {\r\n\t\twindow.dispatchEvent(\r\n\t\t\tnew CustomEvent('_showAlert', {\r\n\t\t\t\tdetail: {\r\n\t\t\t\t\tmessage: _message,\r\n\t\t\t\t\ttype: _type,\r\n\t\t\t\t\ttitle: _title,\r\n\t\t\t\t},\r\n\t\t\t\tbubbles: true,\r\n\t\t\t\tcancelable: true,\r\n\t\t\t})\r\n\t\t)\r\n\t}", "function showAlert(message, title, buttom) {\n navigator.notification.alert(\n message, // message\n alertDismissed, // callback\n title, // title\n buttom // buttonName\n );\n}", "function show_alert(type, title, content) {\n\tconst icon = type == 'red' ? 'fa fa-warning' : 'fa fa-check';\n\n\t$.alert({\n\t\t\"type\": type,\n\t\t\"title\": title,\n\t\t\"content\": content,\n\t\t\"icon\": icon,\n\t\t\"backgroundDismiss\": true\n\t})\n}", "function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }", "function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }", "function showMessage(type, title, message, callback, buttons) {\n\n\t title = title || \"default title\";\n\t buttons = buttons || 'OK';\n\n\t if (type == \"alert\") {\n\t\t\t\t\n\t\t if(navigator.notification && navigator.notification.alert) {\n\n\t\t navigator.notification.alert(\n\t\t message, // message\n\t\t callback, // callback\n\t\t title, // title\n\t\t buttons // buttons\n\t\t );\n\n\t\t } else {\n\n\t\t alert(message);\n\t\t callback();\n\t\t } \t\n\t } else if (type == \"confirm\") {\n\t \tif(navigator.notification && navigator.notification.confirm) {\n\n\t\t navigator.notification.confirm(\n\t\t message, // message\n\t\t callback, // callback\n\t\t title, // title\n\t\t buttons // buttons\n\t\t );\n\n\t\t } else {\n\t\t callback(confirm(message));\n\t\t } \n\t }\n\n\t}", "function showAlert() {\n alert = $mdDialog.alert({\n title: 'Attention',\n textContent: 'Incorrect username and/or password. Please enter information again.',\n ok: 'Close'\n });\n $mdDialog\n .show( alert )\n .finally(function() {\n alert = undefined;\n });\n }", "function showAlert(message, alerttype, target) {\n\n showAlertWithSelector(message, alerttype, '#'+target);\n}", "function showAlert(alertMessage){\n $(\"#myAlert\").css(\"display\",\"block\").html(\"<b>\"+alertMessage+\"</b>\");\n}", "function simpleAlert(data){\n\t\t\tvar app = new Alert();\n\t\t\tif(!app.exist()){\n\t\t\t\tif(app.checkObj(data)){\n\t\t\t\t\tapp.load(data);\n\t\t\t\t\tapp.show();\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"Aconteceu algo :/\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tapp.close();\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tif(app.checkObj(data)){\n\t\t\t\t\t\tapp.load(data);\n\t\t\t\t\t\tapp.show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.log(\"Aconteceu algo :/\");\n\t\t\t\t\t}\n\t\t\t\t},500);\n\t\t\t}\n\t\t}", "function showAlert(bool, alertMsg, trigger) {\n\tif (bool == true) {\n\t\t$alert.innerHTML = alertMsg;\n\t\t$alert.style.display = 'block';\n\t\talertOn = true;\n\t\talertTrigger = trigger;\n\t} else {\n\t\t$alert.style.display = 'none';\n\t\talertOn = false;\n\t\talertTrigger = \"\";\n\n\t}\n}", "function showAlert(title, msg, theme)\n{\n\t$.jAlert({\n\t\t'title': title,\n\t\t'content': msg,\n\t\t'theme': theme\n\t});\t\t\n}", "function showAlert(){\n document.getElementById(\"alert\").style.display = 'flex'\n}", "function showAlert(message, title) {\n if (navigator.notification) {\n navigator.notification.alert(message, null, title, 'OK');\n } else {\n alert(title ? (title + \": \" + message) : message);\n }\n }", "function showAlert() {\n navigator.notification.alert(\n 'Time to Rehearse!', // message\n alertDismissed, // callback\n 'Rehearse', // title\n 'Got it' // buttonName\n \t);\n}", "function showAlert(title,message) {\n\tconsole.log(\"show alert (title,message)\");\n navigator.notification.alert(\n message, // message\n alertDismissed, // callback\n title, // title\n 'OK' // buttonName\n );\n}", "function alert() {\r\n var a, msg, onClose, autoClose, i;\r\n\r\n // Process variable number of arguments.\r\n for (i = 0; i < arguments.length; i++) {\r\n a = arguments[i];\r\n if (typeof a === \"string\") {\r\n msg = a;\r\n } else if (typeof a === \"function\") {\r\n onClose = a;\r\n } else if (typeof a === \"number\") {\r\n autoClose = a;\r\n }\r\n }\r\n\r\n function onOpen(dialogEl) {\r\n // Add the alert message to the alert dialog. If wider than 320 pixels change new lines to <br>.\r\n dialogEl.focus().find(\".msg\").html(msg.replace(/\\n/g, (document.body.offsetWidth > 320 ? \"<br>\" : \" \")));\r\n checkEnter(\"alert\");\r\n }\r\n\r\n return open(\"alert\", onOpen, onClose, autoClose);\r\n }", "function showAlert() {\n alert (\"Hello world!\");\n }", "function showAlert() {\n navigator.notification.alert(\n 'temp16percent:'+temp16percent+' topForecastSpace:'+topForecastSpace+' timeTextSpace:'+timeTextSpace+' bottomForecastSpace:'+bottomForecastSpace+' topSunChart:'+topSunChart+' sunChartBottom:'+sunChartBottom+' columnWidth:'+columnWidth+' calc(temp16percent*5+topForecastSpace):'+(temp16percent*5+topForecastSpace), // message\n alertDismissed, // callback\n 'bebug', // title\n 'Done' // buttonName\n );\n }", "function ShowIEAlert(){\nif(is_IE()){\nalert(\"Unsupported Browser!\\nOnomatoPedal will not work in Internet Explorer. Use Microsoft Edge or Google Chrome for the full experience.\\n\\nInternet Explorerでは、このページは正しく動作しません。Microsoft EdgeかGoogle Chromeで再度お試しください。\");\n}\n}", "function _alert( msg, func, title, btn ) {\n\talert(msg);\n\n\tif ( typeof func == 'function' ) {\n\t\tfunc();\n\t};\n\n\t// Read more for device notification:\n\t// http://docs.phonegap.com/en/1.1.0/phonegap_notification_notification.md.html#notification.alert\n}", "function showAlert() {\n navigator.notification.alert(\n 'here is my message!', // message\n alertDismissed, // callback\n 'This is the title!', // title\n 'Done' // buttonName \n );\n}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.alert');if(!data)$this.data('bs.alert',data=new Alert(this));if(typeof option=='string')data[option].call($this);});}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.alert');if(!data)$this.data('bs.alert',data=new Alert(this));if(typeof option=='string')data[option].call($this);});}", "function showAlert(response) {\n if ($('.alert').length == 0) {\n html = \"<div class='alert alert-success'>\" + response + \"</div>\";\n $(html).insertAfter('.col-sm-12');\n } else {\n $('.alert').html(response);\n }\n }", "function wl_alert( obj, message, mode ) {\n\n\t\tmode = (mode) ? mode : 'show';\n\t\tif( mode == 'show' ) {\n\n\t\t\tif( obj.next().hasClass('wpcf7-not-valid-tip') === false ) {\n\t\t\t\tobj.after( '<span role=\"alert\" class=\"wpcf7-not-valid-tip\" style=\"display:none\">' + message + '</span>' );\n\t\t\t\tobj.next().fadeIn('slow');\n\t\t\t} else {\n\t\t\t\tif( obj.parent().find('.wpcf7-not-valid-tip').length > 0 ) {\n\t\t\t\t\tobj.parent().find('.wpcf7-not-valid-tip').remove();\n\t\t\t\t\tobj.after( '<span role=\"alert\" class=\"wpcf7-not-valid-tip\" style=\"display:none\">' + message + '</span>' );\n\t\t\t\t\tobj.next().fadeIn('slow');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif( obj.parent().find('.wpcf7-not-valid-tip').length > 0 ) {\n\t\t\t\tobj.parent().find('.wpcf7-not-valid-tip').fadeOut('slow');\n\t\t\t}\n\t\t}\n\t}", "function showalert(){\n alert(\"Welcome to my mobile!\");\n }", "function DisplayAlert(id) {\ndocument.getElementById(id).style.display='block';\n}", "function showAlert(sender, elMensaje){\n alert(elMensaje);\n}", "function displayAlert(alert, type, message) {\n $('.alertdiv').html('<div class=\"alert alert-dismissable alert-fixed alert-' + alert + '\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><i class=\"pi pi-ios-close-empty\"></i></button><span class=\"mar-right-md\">' + type + '</span>' + message + '</div>');\n setTimeout(function() {\n $('.alertdiv').html('');\n }, 5000);\n}", "function showAlert() {\r\n console.log('show alert');\r\n console.log($mdDialog);\r\n var alert = $mdDialog.alert({\r\n title: 'Manual Jog',\r\n //content: 'This is an example of how easy dialogs can be!',\r\n content: manualHtmlString,\r\n ok: 'Close'\r\n });\r\n $mdDialog\r\n .show( alert )\r\n .finally(function() {\r\n alert = undefined;\r\n });\r\n }", "function showAlert(mess)\n{\n alert(mess);\n}", "function showDialog($type){\n\tif($type == dltOK){\n\n\t}else if($type == dltValidate) {\n\t\tswal(\"Warning\", \"Please check your input key.\",\"warning\");\n\t}\n}", "function presentAlert() {\n const alert = document.createElement('ion-alert');\n alert.header = 'Alert';\n alert.subHeader = 'Input';\n alert.message = 'Input invalid please correct an try again.';\n alert.buttons = ['OK'];\n \n document.body.appendChild(alert);\n return alert.present();\n\n }", "function AlertDialogSuccess(msg) {\n\n $(\"#alertDialogSuccess\").css('display', 'block');\n var success = \"<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span></div>\";\n $(\"#alertDialogSuccess\").html(success);\n}", "function showFormValidationAlert() {\n\tformIsValid()\n\t\t? null\n\t\t: alert('Please complete the order form and try again.')\n}", "function showAlert(){\n $(\"#addAlert\").show();\n}", "show(message){\n this.alert.classList.remove('d-none');\n this.alert.innerText = message;\n }", "function displayWarning(warning) {\n window.alert(warning);\n }", "alert(title, message, positiveText, positiveOnPress, cancelableFlag){\n Alert.alert(title, message,[{text: positiveText, onPress: positiveOnPress},], {cancelable: cancelableFlag}); \n }", "function dt_alert(type, message) {\n bs_alert(\".top-alert-box\", type, message)\n}", "function tryAlert() {\n alert(\"GO TRY THE LES PAUL!\");\n }", "function lb_alert(type, message) {\n bs_alert(\".featherlight .alert-box\", type, message)\n}", "function ourAlert(text){\n\n\talertsEnabled = true\n\t/*\n\t// Chrome\n\tif(navigator.userAgent.indexOf(\"Chrome\") != -1 ) \n { \n \talert('Chrome');\n }\n // Opera\n else if(navigator.userAgent.indexOf(\"Opera\") != -1 )\n {\n \talert('Opera');\n }\n // Firefox\n else if(navigator.userAgent.indexOf(\"Firefox\") != -1 ) \n {\n \talert('Firefox');\n }\n //Internet Explorer\n else if((navigator.userAgent.indexOf(\"MSIE\") != -1 ) || (!!document.documentMode == true )) //IF IE > 10\n {\n \talert('IE'); \n } \n */\n\n if (alertsEnabled && shouldDisplayAlerts){ \n\t\talert(text); \n\t} \n\t \n\tif (displayAlertsInConsole){\n\t\tconsole.log(text)\n\t}\n}", "function AlertSuccess(msg) {\n $(\"#alertSuccess\").css('display', 'block');\n var success = \"<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span></div>\";\n $(\"#alertSuccess\").html(success);\n}", "function showMsg(id,title,text,type)\n { \n $('#alert_content').html('<div class=\"alert alert-'+type+'\" role=\"alert\">'+text+\"</div>\");\n $('#alert_title').html(title);\n $('#'+id).modal('show');\n if (type=='info') {\n AlertSound();\n }; \n }", "function issue_called(text_for_alert){\n window.alert(text_for_alert);\n}", "alert(props) {\n if (typeof props === \"string\") props = { content: props }\n return store.showModal(props, UI.Alert)\n }", "function ShowAlertMsg(msgString, returnAction, winURL, modalFormat, newWinFormat, bArr, PickerVals, cGif)\n{\n\tgeneralErrorCallType = \"alert\";\n\tif (isPostBack && isPostBack== true){\n\t\tsetVars(msgString, returnAction, winURL, modalFormat, newWinFormat, bArr, PickerVals, cGif);\n\t\tTurnOnStyle(\"eTag\");\n\t\tisPostBack = false;\n\t}else{\n\t\tvar currentVars = getVars();\n\t\tif (currentVars){\n\t\t\tif(typeof(msgString) == \"undefined\")\n\n\t\t\t{\n\t\t\t\tmsgString = currentVars[0];\n\t\t\t\treturnAction = currentVars[1];\n\t\t\t\twinURL = currentVars[2];\n\t\t\t\tmodalFormat = currentVars[3],\n\t\t\t\tnewWinFormat = currentVars[4],\n\t\t\t\tbArr = currentVars[5];\n\t\t\t\tPickerVals = currentVars[6];\n\t\t\t\tcGif = currentVars[7];\n\t\t\t}\t\t\n\t\t}\n\t\tcurrentVars = null;\n\t\tconfObj = new UserMsgObject(msgString, returnAction, winURL, modalFormat, newWinFormat, bArr, PickerVals, cGif);\n\t\tconfObj.OpenModalWin(false);\n\t}\t\t\n\t}", "function bsAlert(){return _callWithEmphasis(this, oj.div, 'alert', 'info', arguments)}", "function sc_alert() {\n var len = arguments.length;\n var s = \"\";\n var i;\n\n for( i = 0; i < len; i++ ) {\n s += sc_toDisplayString(arguments[ i ]);\n }\n\n return alert( s );\n}", "function _alert(type, mesg){\n var pop = \n $(\"<div class='alert alert-dismissible alert-\"+type+\" fade in' role='alert'>\"+\n \"<button type='button' class='close' data-dismiss='alert'>&times;</button>\"+\n mesg +\n \"</div>\");\n $(document.body).append(pop);\n pop.alert();\n if(type==='success'){\n window.setTimeout(function(){\n pop.alert('close');\n }, 1500);\n }\n }", "function callAlert(text, web) {\n if (web !== null) {\n alertify.alert(text[0], text[1]).set('label', 'OK');\n location.href = web;\n } else {\n alertify.alert(text[0], text[1]).set('label', 'OK');\n }\n\n}", "function showAlertBar(alertSelector, message, /* boolean */isAppend) {\n\t\tvar $alertBox = $(alertSelector);\n\t\t// the alert bar maybe not exist since user click close button of alert bar will remove it from dom tree, we will try to\n\t\t// init them again.\n\t\tif ($alertBox.length == 0) {\n\t\t\tinitAlertBar();\n\t\t\t$alertBox = $(alertSelector);\n\t\t}\n\n\t\tif ($alertBox.length == 0) {\n\t\t\talert(message);\n\t\t} else {\n\t\t\t// remove exist message dom.\n\t\t\tif (!isAppend === true) {\n\t\t\t\t$alertBox.find(\"span\").html(\" \" + message);\n\t\t\t} else {\n\t\t\t\t$alertBox.find(\"span\").append(\"<br> \" + message);\n\t\t\t}\n\t\t\t$alertBox.removeClass(\"hidden\");\n\t\t}\n\t}", "function show_alert(message, alert) {\n\n alert_wrapper.innerHTML = `\n <div id=\"alert\" class=\"alert alert-${alert} alert-dismissible fade show\" role=\"alert\">\n <span>${message}</span>\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}", "function $Alert(strMessage, strSize, strPopupId, strWindowType, strTitle)\n{\n\tVixen.Popup.Alert(strMessage, strSize, strPopupId, strWindowType, strTitle);\n}", "function showCustomAlert(type, titlePL, textPL, titleEN, textEN){\n\t\n\tvar userLang = document.documentElement.lang;\n\t\n\tif(userLang == \"pl_PL\")\n \tshowToastrAlert(type, textPL ,titlePL);\n else \n \tshowToastrAlert(type, textEN , titleEN);\n}", "function displayAlert(alertBoxId, msg, type) {\n\n\tvar alertBox = $(\"#\" + alertBoxId);\n\n\t// clear any old alert\n\tclearAlerts();\n\n\t// process according to type\t\n\tswitch (type) {\n\t\n\t\tcase 'error':\n\t\t\talertBox.addClass('alert-error');\n\t\t\tbreak;\n\n\t\tcase 'success':\n\t\t\talertBox.addClass('alert-success');\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'info':\n\t\t\talertBox.addClass('alert-info');\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\talertBox.addClass('alert-info');\n\t\t\t\n\t}\n\t\n\t// pack the alert into the alertbox\n\talertBox.find(\"p.alertMsg\").html(msg);\n\n\t// mark as active\n\talertBox.addClass(\"active\");\n\t\n\t//\n\t// display alert box\n\t// -- however, if it is visible already, we pulsate it instead (note: pulsate is part of \"jquery ui\")\n\t//\n\t\n\tif (alertBox.css(\"display\") != \"block\") {\n\t\t// show the alert box\n\t\talertBox.css(\"display\", \"block\");\n\t}\n\telse {\n\t\tpulsateVisibleAlerts();\n\t}\n\t\n}", "function showCustomAlert(type, titlePL, textPL, titleEN, textEN){\n\t\n\tvar userLang = document.documentElement.lang;\n\n\tif(userLang == \"pl_PL\")\n \tshowToastrAlert(type, textPL ,titlePL);\n else \n \tshowToastrAlert(type, textEN , titleEN);\n}", "function displayDialog(alertBoxId, msg, control1_href, control1_name, control2_href, control2_name) {\n\t\n\tvar alertBox = $(\"#\" + alertBoxId);\n\t\n\t// clear any old alert\n\tclearAlerts();\n\t\n\t// pack the alert message into the alertbox\n\talertBox.find(\"p.alertMsg\").html(msg);\n\n\t//\n\t// wire up control and display controls\n\t\n\t// control 1\n\tif ( control1_href !== null ) {\n\t\talertBox.find(\"a.control_1\").attr(\"href\", control1_href);\n\t\talertBox.find(\"a.control_1\").html(control1_name);\n\t\talertBox.find(\"a.control_1\").css(\"display\", \"inline\");\n\t}\n\t\n\t\n\tif ( control2_href !== null ) {\n\t\talertBox.find(\"a.control_2\").attr(\"href\", control2_href);\n\t\talertBox.find(\"a.control_2\").html(control2_name);\n\t\talertBox.find(\"a.control_2\").css(\"display\", \"inline\");\n\t}\n\t\n\talertBox.find(\"div.controls\").css(\"display\", \"block\");\n\n\t// display as info message\n\talertBox.addClass('alert-info');\n\t\n\t// mark as active\n\talertBox.addClass(\"active\");\n\t\n\t// flag dialog as active\n\tactiveDialog = true;\n\t\t\t\n\t//\n\t// display dialog box\n\t// -- however, if it is visible already, we pulsate it instead (note: pulsate is part of \"jquery ui\")\n\t//\n\tif ( alertBox.css(\"display\") != \"block\" ) {\n\t\t// show the alert box\n\t\talertBox.css(\"display\", \"block\");\n\t}\n\telse {\n\t\tpulsateVisibleAlerts();\n\t}\n}", "function alert(title, msg){\n\tif( typeof msg == 'undefined' )\n\t{\n\t\tmsg = title;\n\t\ttitle = '';\n\t}\n\t$.jAlert({\n\t\t'title': title,\n\t\t'content': msg\n\t});\n}", "function pdev_show_alert_box_2() {\n alert( pdev_alert_box_L10n.pdev_box_2 );\n}", "function showWarningAlert(msg)\n{\n $(\"#warningAlertMessage\").html(msg);\n $(\".alert\").hide();\n $(\"#warningAlert\").show();\n\n showAlert(msg);\n}", "function showAlert(d){\n\tconsole.log(\"showing\");\n\n\tvar banner = $(\".banner\");\n\tvar text = $(\"#text\");\n\n\t// Set status on the alert\n\tvar textToShow = d.text;\n\tif(d.type != null)\n\t{\n\t\ttextToShow = d.text + typeOfNotification[d.type].notificationText;\n\t}\n\n\ttext.text(textToShow);\n\n\ttypeOfNotification[d.type].playAlert()\n\n\treturn animate.animateInOut(banner, true, \"bounceInRight\", \"bannerOn\")\n}", "function AlertDialogError(msg) {\n $(\"#alertDialogError\").css('display', 'block');\n var error = \"<div class='alert alert-error'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span></div>\";\n $(\"#alertDialogError\").html(error);\n}", "function customAlert(title, content) {\n $.alert({\n title: title,\n content: content,\n theme: 'black',\n animation: 'left',\n closeAnimation: 'right',\n icon: 'fa fa-warning',\n keyboardEnabled: true,\n confirm: function() {\n // $.alert('Confirmed!'); // shorthand.\n }\n });\n\n}", "function showAlert(msg, type = 'success') {\n M.toast( {html: msg, classes: type })\n}", "function showAlert(message) {\n var divAlert = $('<div class=\"alert alert-danger alert-dismissible\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\">' +\n '<span>&times;</span></button>' + message + '</div>');\n\n divAlert.first().outerWidth($(\"#divLogin\").outerWidth());\n $(\"#divAlertsInner\").append(divAlert);\n}", "function showAlert(message, alerttype, target) {\n\n $('#'+target).append('<div id=\"alertdiv\" class=\"alert ' + alerttype + '\"><a class=\"close\" data-dismiss=\"alert\">×</a><span>'+message+'</span></div>')\n\n setTimeout(function() { // this will automatically close the alert and remove this if the users doesnt close it in 5 secs\n $(\"#alertdiv\").remove();\n }, 5000);\n}", "function showAlert(message,type = 'success'){\n\t\tvar id = Math.floor((Math.random() * 100) + 1);\n\t\tvar alert = '<div class=\"alert alert-' + type + ' alert-dismissable fade show\" id=\"alertBox-' + id + '\">' + message + '<button type=\"button\" class=\"close ml-2\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button></div>';\n\t\t$(\"body\").append(alert);\n\t\tsetTimeout(fadeAlert,5000, '#alertBox-' + id);\n\t}", "function showAlert(message, title, buttonName) {\n $scope.pause();\n navigator.notification.alert(\n message,\n alertDismissed, // callback\n title,\n \"Close\"\n );\n navigator.notification.beep(3);\n navigator.notification.vibrate(4000);\n //navigator.notification.vibrate([1000, 500, 1000, 500, 1000]);\n }", "function showMessage() {\r\n\r\n alert('APASA ESCAPE CA SA AFISEZI COMENTARIILE!');\r\n}", "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.alert')\n\n if (!data) $this.data('bs.alert', (data = new Alert(this)))\n if (typeof option == 'string') data[option].call($this)\n })\n }", "function showAlertDialog(title, content, ev) {\n $mdDialog.show(\n $mdDialog.alert()\n .parent(angular.element(document.body))\n .clickOutsideToClose(true)\n .title(title)\n .textContent(content)\n .ariaLabel('Alert Dialog')\n .ok(Translations.general.gotIt)\n .targetEvent(ev)\n );\n }", "function showValidationAlert(message) {\r\n showModalAlert(message);\r\n}", "function showMsg() {\n\tokButton.textContent = 'OK';\n\talertPre.textContent = demo_msgs;\n\talertArea.style.display = 'block';\n}", "function notify(newAlert){\n\t\t// change the alert message\n\t\tdocument.getElementById(\"alert-content\").innerHTML = newAlert;\n\t\t// alert animations\n\t\tvar box = document.getElementById(\"alert-wrapper\");\n\t\tbox.className = \"visible\";\n\t\tsetTimeout(function(){ box.className = \"hidden\" }, 2500);\n\t}", "function showDialog(title, message, button, zIndex, openFn) {\n \"use strict\";\n var alert = document.createElement(\"div\");\n\n if (typeof (message) == 'string') {\n alert.innerHTML = message;\n }\n else {\n $(alert).append(message);\n }\n\n if (button === undefined || button === null) {\n button = {\n \"OK\" : function(event) {\n $(this).dialog(\"close\");\n if (event.preventDefault)\n event.preventDefault();\n if (event.stopPropagation)\n event.stopPropagation();\n }\n };\n }\n\n $(alert).dialog({\n modal : true,\n dialogClass : \"top-dialog\",\n width : 400,\n title : title,\n buttons : button,\n open: function() {\n \t\n \tif (openFn != null){\n \t\topenFn(alert);\n \t}\n },\n close : function() {\n $(this).dialog(\"destroy\");\n $(this).remove();\n }\n });\n\n // Fix z-index for dialog\n var z = parseInt($(alert).parent().css(\"z-index\"));\n if (z < 10000) {\n z += 9000;\n $(\".top-dialog\").css(\"z-index\", z);\n }\n\n return alert;\n}", "function sendAlert(string) {\n\tif(alerts_on == true) {\n\t\talert(string);\n\t}\n}", "function alertNative (arg) {\n var args = (typeof arg == \"object\")? arg:{title:\"Alert\",id:-1,text:arg, buttons:[\"OK\"]};\n Dialogs.alert(args);\n }", "function alertMessage(errorMessage) {\n $('#alertMessage').html(errorMessage)\n $('#alertMessage').show();\n}", "showCaptchaAlert() {\n this.show('ALERT: Captcha ALERT!', 'Just found a captcha so you better go fill it in as soon as possible!', 'captcha', '3alert3', true);\n }", "function show(alert, showmessage) {\r\n let text;\r\n if (alert === 'success') {\r\n text = 'Success:'\r\n }\r\n else {\r\n text = 'Error:'\r\n }\r\n let message = document.getElementById('message');\r\n message.innerHTML =`<div class=\"alert alert-${alert} alert-dismissible fade show\" role=\"alert\">\r\n <strong>${text}</strong> ${showmessage}\r\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n </div>`\r\n setTimeout(function() {\r\n message.innerHTML = '';\r\n }, 5000);\r\n\r\n}", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.alert')\n\n\t if (!data) $this.data('bs.alert', (data = new Alert(this)))\n\t if (typeof option == 'string') data[option].call($this)\n\t })\n\t }", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.alert')\n\n\t if (!data) $this.data('bs.alert', (data = new Alert(this)))\n\t if (typeof option == 'string') data[option].call($this)\n\t })\n\t }", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.alert')\n\n\t if (!data) $this.data('bs.alert', (data = new Alert(this)))\n\t if (typeof option == 'string') data[option].call($this)\n\t })\n\t }", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.alert')\n\n\t if (!data) $this.data('bs.alert', (data = new Alert(this)))\n\t if (typeof option == 'string') data[option].call($this)\n\t })\n\t }", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.alert')\n\n\t if (!data) $this.data('bs.alert', (data = new Alert(this)))\n\t if (typeof option == 'string') data[option].call($this)\n\t })\n\t }", "function showAlert(message) {\n console.log(message)\n $('#alert').html('<button type=\"button\" class=\"close\">&times;</button>' + message);\n $('#alert').show();\n document.body.scrollTop = 0; // For Safari\n document.documentElement.scrollTop = 0;\n setTimeout(function() {\n $(\"#alert .close\").trigger('click');\n }, 100000);\n // $(window).scrollTop($('#alert').offset().top);\n}" ]
[ "0.6532519", "0.641785", "0.6324318", "0.63139725", "0.6297081", "0.62598234", "0.6259525", "0.6204711", "0.62025195", "0.61807126", "0.6135315", "0.61304265", "0.6115432", "0.6099899", "0.6090424", "0.6090424", "0.60879445", "0.60844815", "0.60686433", "0.60430866", "0.6038227", "0.6036655", "0.6024138", "0.6016113", "0.5957712", "0.5956156", "0.59522784", "0.5948515", "0.590389", "0.58919823", "0.58776844", "0.5873644", "0.5836209", "0.58334106", "0.58334106", "0.582895", "0.5809847", "0.5806951", "0.57891446", "0.5785569", "0.57800335", "0.57769847", "0.5774121", "0.5760284", "0.5758204", "0.5756259", "0.5747643", "0.57406294", "0.57355464", "0.5731793", "0.57302886", "0.57268465", "0.57243955", "0.5723911", "0.5709252", "0.56839657", "0.56808776", "0.5672362", "0.5668755", "0.5659899", "0.5656427", "0.56385416", "0.563339", "0.56264204", "0.56215227", "0.5620894", "0.5611065", "0.55843085", "0.55793196", "0.5579182", "0.55706924", "0.55681115", "0.556168", "0.5553992", "0.55526567", "0.55516416", "0.55492914", "0.553505", "0.552927", "0.5524666", "0.5521293", "0.55182403", "0.5516558", "0.5514269", "0.55077225", "0.5501559", "0.549941", "0.549861", "0.54897285", "0.54885143", "0.54815865", "0.54791284", "0.54754335", "0.5473425", "0.5470052", "0.5470052", "0.5470052", "0.5470052", "0.5470052", "0.5466748" ]
0.6359892
2
complete Signifies to ObjectiveC that you are finished which then fires the completionBlock in ObjectiveC
function complete(string) { NativeBridge.call('complete', [string]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "complete() {}", "function complete() {\n\tconsole.log('Completed');\n}", "completed(data) {}", "function async_completed() {\n\tasync_completions += 1;\n\tD.log(\"completions: \" + async_completions + \" out of \" + async_completions_waiting);\n\tif ( async_completions == async_completions_waiting ) {\n\t completion();\n\t}\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "complete() {\n\t\tthis._subscriber.complete(this._type);\n\t}", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "function _complete() {\n\t\t\tif (_errorState) {\n\t\t\t\t_eventDispatcher.sendEvent(events.ERROR, {message: _errorMessage});\n\t\t\t} else if (!_iscomplete) {\n\t\t\t\t_iscomplete = true;\n\t\t\t\t_status = utils.loaderstatus.COMPLETE;\n\t\t\t\t_eventDispatcher.sendEvent(events.COMPLETE);\n\t\t\t}\n\t\t}", "_complete() {\n this.wrapperEl.addClass(this.options.classes.completed);\n this.element.addClass(this.options.classes.completed);\n this.element.trigger(SnapPuzzleEvents.complete, this);\n }", "function _complete() {\n\t if (!_iscomplete) {\n\t _iscomplete = true;\n\t _status = scriptloader.loaderstatus.COMPLETE;\n\t _this.trigger(events.COMPLETE);\n\t }\n\t }", "setCompleteAsync(value) {\n this.completeAsync_ = value;\n }", "function complete()\n\t{\n\t\t_queryInProgress = false;\n\t\t_dispatcher.trigger(_options.completeEvent);\n\t}", "signalComplete() {\n this.observableFunctions.complete();\n }", "function SetComplete (){\n\tstoreDataValue( \"cmi.completion_status\", \"completed\" );\n}", "_onComplete( response ) {\n if ( this._complete ) return;\n this._callHandler( 'complete', this._xhr, response );\n this._complete = true;\n this._xhr = null;\n }", "async onFinished() {}", "function completed (err, res) {\n if (err) {\n return callback(err);\n }\n\n callback(err, self.data);\n }", "function _callComplete(){\n if( this.callback ){\n this.callback( this.response );\n }\n }", "finish() {\n this.done = true;\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "function finished(err){\n }", "complete(result, next) {\n // Complete\n if (next) {\n if (result instanceof Error) {\n next(result);\n } else {\n next(null, result);\n }\n return this;\n } else {\n return result;\n }\n }", "_taskComplete() {\n //\n }", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\n }", "static complete() {\n\t\tconsole.log('Animation.complete()')\n\t\tVelvet.capture.adComplete()\n\n\t}", "addOnCompleteListener(callback) {\n this.on(this.fileTransferCompleteEvent, callback);\n }", "loadComplete() {\n // Nothing\n }", "end() {\n this.status = 'finished';\n }", "function fileUploadDone() {\n signale.complete('File upload done');\n}", "get complete() {\n if(!this[_complete_]) {\n this[_complete_] = () => {\n this.isRunning = false;\n this.isFinished = true;\n \n // notify the task runner about the completion of the task\n // a method which is supplied by the task runner\n this.__onTaskComplete__ && this.__onTaskComplete__(this); \n };\n }\n return this[_complete_];\n }", "function done() {}", "complete () {\n this.detailBox.innerHTML = 'Click to begin'\n this.container.addEventListener('click', this.begin.bind(this))\n }", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function onCompletion(err) {\n if (err) { return console.error(err);}\n else { console.log(\"All done.\") }\n}", "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "parseComplete(data) {\n this.reset();\n this.end(data);\n }", "function onComplete() {\n if (typeof successCb === \"function\") successCb(redirPath);\n }", "get completion_status() { return this._completion_status; }", "get completion_status() { return this._completion_status; }", "onFinish() {}", "function onFinish() {\n console.log('finished!');\n}", "get isCompleted() { return this.result.isDefined }", "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "complete() {\n const geometry = this.clone_.getGeometry();\n if (geometry) {\n // Clear the interpolate method from the geometry so the original feature can determine interpolation.\n geometry.unset(interpolate.METHOD_FIELD);\n }\n\n this.dispatchEvent(new PayloadEvent(ModifyEventType.COMPLETE, this.clone_));\n this.setActive(false);\n }", "function completed( event ) {\n\t // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {\n\t detach();\n\t ready();\n\t }\n\t }", "function signalingComplete(){\n\t\tif(webrtcDetectedBrowser && webrtcDetectedBrowser === \"firefox\"){\n\t\t\tfirefoxComplete.apply(this, arguments);\n\t\t}else{\n\t\t\tchromeComplete.apply(this, arguments);\n\t\t}\n\t}", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "complete() {\n this.trigger('load_complete');\n }", "function handleComplete(size, status, index) {\n console.log(\"completed\");\n drawProgress(1, status);\n }", "setCompleted() {\nreturn this.isComplete = true;\n}", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n finalize(err, resolve, reject, done);\n }\n }", "function IteratorComplete(iterResult) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(iterResult) is Object.\n\t\tif (Type(iterResult) !== 'object') {\n\t\t\tthrow new Error(Object.prototype.toString.call(iterResult) + 'is not an Object.');\n\t\t}\n\t\t// 2. Return ToBoolean(? Get(iterResult, \"done\")).\n\t\treturn ToBoolean(Get(iterResult, \"done\"));\n\t}", "function complete() {\n\t\t\tcallbackCount++;\n\t\t\tif(callbackCount >= 1) {\n\t\t\t\t//console.log(context);\n\t\t\t\tres.render('UpdateCoach', context);\n\t\t\t}\n\t\t}", "function finish(){\n // console.log (\"finish inner function\")\n resolve();\n }", "function uploadDone(file, event, response) {\n // Update file infos\n file.isUploading = false;\n file.done = true;\n file.progress = 100;\n\n // Execute file-specific callback\n (file.callback || angular.noop)();\n\n // Emit event\n Uploader.onUploadDone(file, event, response);\n\n queueChanged();\n }", "onDispatchComplete(cb){\n this.onDispatchCompleteCbs.push(cb);\n }", "function complete(){\n clearInterval(timer);\n timer = null;\n}", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "_finished( ) { \n\n\t\tif( this.verbose ) { this.log( \"All stages finished.\" ); }\n\n\t\tif( this.rollback ) {\n\t\t\tif( this.verbose ) { this.log( \"Processing failed.\" ); }\n\t\t\tthis.callback.failure( \"failed because of stage \\\"\" + this.failed + \"\\\"\" );\n\t\t} else {\n\t\t\tif( this.verbose ) { this.log( \"Processing succeeded.\" ); }\n\t\t\tthis.callback.success( this.results ); \n\t\t}\n\t\t\n\t}", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "_onComplete() {\n // Ensure worker queues for all paths are stopped at the end of the query\n this.stop();\n }", "_onEnd() {}", "function complete() {\n /* jshint validthis:true */\n if (!this._isDisposed) {\n this._subject.complete();\n }\n}", "function completeRequest(err) {\n if (err) {\n // prepare error message\n res.error = new JsonRpcError.InternalError(err);\n // return error-first and res with err\n return onDone(err, res);\n }\n var returnHandlers = allReturnHandlers.filter(Boolean).reverse();\n onDone(null, { isComplete: isComplete, returnHandlers: returnHandlers });\n }", "function onComplete(evt) {\n var response = JSON.parse(evt.currentTarget.response);\n\n // If the uploader encounters an error, pass along the error name\n if (STATUS_REGEX.test(response.status)) {\n return $rootScope.$broadcast(\"Uploader:failed\", response.message);\n }\n\n $rootScope.$broadcast(\"Uploader:complete\", response.message);\n\n var done = function(valid, progress) {\n // Emit the transcoder's progress\n $rootScope.$emit(\"Poll:progress\", progress);\n\n if (valid) Poll.poll(response.token, response.id, done);\n };\n\n // Call the initial poll\n Poll.poll(response.token, response.id, done);\n\n }", "function setComplete() {\n $timeout.cancel(startTimeout);\n cfpLoadingBar.complete();\n reqsCompleted = 0;\n reqsTotal = 0;\n }", "function finished(result) {\n\t\t\t--self.evaluating;\n\t\t\tself.off('Error', captureError);\n\t\t\tif (callback) callback(err, result);\n\t\t}", "function finishUpload()\n {\n aws_params.MultipartUpload = {\n Parts: aws_parts \n };\n console.log('Completing...', aws_parts);\n\n s3.completeMultipartUpload(aws_params, function(err, data) {\n if (err) setError('Error completing upload: ' + err);\n else \n { \n uploadDone();\n }\n });\n }", "complete(results, file) {\n const bytesUsed = results.meta.cursor;\n // Ensure any final (partial) batch gets emitted\n const batch = tableBatchBuilder.getBatch({bytesUsed});\n if (batch) {\n asyncQueue.enqueue(batch);\n }\n asyncQueue.close();\n }", "function _initComplete(err, result) {\n if( !isResolved ) {\n isResolved = true;\n if( err ) { def.reject(err); }\n else { def.resolve(result); }\n }\n }", "function _initComplete(err, result) {\n if( !isResolved ) {\n isResolved = true;\n if( err ) { def.reject(err); }\n else { def.resolve(result); }\n }\n }", "function done() {\n\tupdateProgressById(\"uploadProgress\", 95)\n\n\t// console.log('finished');\n}", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n finalize(err, resolve, reject, done);\n }\n }", "chunkComplete() {\n this.isChunkComplete = true;\n }", "chunkComplete() {\n this.isChunkComplete = true;\n }", "_complete() {\n if(this.get('isDestroyed') || this.get('isDestroying')){\n return;\n }\n\n invokeAction(this, 'onDragStop', this.get('model'));\n this.set('isDropping', false);\n this.set('wasDropped', true);\n this._tellGroup('commit');\n }", "function fireCompleted (el) {\n const event = {\n element: el,\n event: 'section_completed'\n }\n thiz.$fireProgress(event)\n }", "function complete(r){\n //alert(\"complete \"+r.responseText);\n}", "function handleFinish(event) {\n cleanup(null, responseData)\n }", "end() {\n this.cancel();\n this.callback();\n }", "function handleFinish(values) {\n job.current = getJob(values, job.current, writeMessage);\n setBusy(job.current.pendingTime);\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }" ]
[ "0.73951834", "0.7260894", "0.67804396", "0.6717048", "0.66836447", "0.66746163", "0.66746163", "0.66746163", "0.66746163", "0.65883726", "0.64684737", "0.64595824", "0.6423679", "0.64217687", "0.64076614", "0.6377386", "0.63698685", "0.63645506", "0.6360161", "0.62960315", "0.6258382", "0.62527627", "0.61721605", "0.61592007", "0.61190295", "0.60025024", "0.5996097", "0.5985272", "0.59796244", "0.5973487", "0.59660995", "0.59646094", "0.5942442", "0.59308815", "0.59156114", "0.5908683", "0.59000206", "0.58691365", "0.5860176", "0.58205026", "0.58123064", "0.58118725", "0.58118725", "0.57980376", "0.5748135", "0.57150054", "0.57094", "0.5705224", "0.5695052", "0.5675583", "0.56755424", "0.56755424", "0.56755424", "0.56755424", "0.56755424", "0.56755424", "0.56755424", "0.56755424", "0.56739", "0.5671445", "0.5670006", "0.5652455", "0.5633437", "0.5632199", "0.56306267", "0.5629877", "0.5629288", "0.561774", "0.5609388", "0.5609388", "0.56074154", "0.56074154", "0.56074154", "0.56074154", "0.5605746", "0.56010526", "0.559865", "0.559865", "0.5597688", "0.55850625", "0.55843383", "0.55760175", "0.55656004", "0.5562295", "0.5557515", "0.5554965", "0.5537046", "0.5530919", "0.5530919", "0.5530044", "0.5528516", "0.5521701", "0.5521701", "0.5518818", "0.5508802", "0.54997176", "0.549812", "0.549493", "0.5494138", "0.5493119" ]
0.6644375
9
Create a new ChaCha generator seeded from the given KEY and IV. Both KEY and IV must be ArrayBuffer objects of at least the appropriate byte lengths (CHACHA_KEYSIZE, CHACHA_IVSIZE). Bytes beyond the specified length are ignored. Returns a closure that takes no arguments. This closure, when invoked, returns a 64byte ArrayBuffer of the next 64 bytes of output. Note: This buffer object is "owned" by the closure, and the same buffer object is always returned, each time filled with fresh output.
function ChaCha(key, iv) { "use strict"; if (key.byteLength < CHACHA_KEYSIZE) throw new Error('key too short'); if (iv.byteLength < CHACHA_IVSIZE) throw new Error('IV too short'); const state = new Uint32Array(16); let view = new DataView(key); state[ 0] = 0x61707865; // "expand 32-byte k" state[ 1] = 0x3320646e; // state[ 2] = 0x79622d32; // state[ 3] = 0x6b206574; // state[ 4] = view.getUint32( 0, true); state[ 5] = view.getUint32( 4, true); state[ 6] = view.getUint32( 8, true); state[ 7] = view.getUint32(12, true); state[ 8] = view.getUint32(16, true); state[ 9] = view.getUint32(20, true); state[10] = view.getUint32(24, true); state[11] = view.getUint32(28, true); view = new DataView(iv); state[14] = view.getUint32( 0, true); state[15] = view.getUint32( 4, true); /* Generator */ const output = new Uint32Array(16); const outview = new DataView(output.buffer); return function() { function quarterround(x, a, b, c, d) { function rotate(v, n) { return (v << n) | (v >>> (32 - n)); } x[a] += x[b]; x[d] = rotate(x[d] ^ x[a], 16); x[c] += x[d]; x[b] = rotate(x[b] ^ x[c], 12); x[a] += x[b]; x[d] = rotate(x[d] ^ x[a], 8); x[c] += x[d]; x[b] = rotate(x[b] ^ x[c], 7); } output.set(state); for (let i = 0; i < CHACHA_ROUNDS; i += 2) { quarterround(output, 0, 4, 8, 12); quarterround(output, 1, 5, 9, 13); quarterround(output, 2, 6, 10, 14); quarterround(output, 3, 7, 11, 15); quarterround(output, 0, 5, 10, 15); quarterround(output, 1, 6, 11, 12); quarterround(output, 2, 7, 8, 13); quarterround(output, 3, 4, 9, 14); } for (let i = 0; i < 16; i++) outview.setUint32(i * 4, output[i] + state[i], true); state[12]++; if (state[12] == 0) { state[13]++; if (state[13] == 0) { /* One zebibyte of output reached! */ throw new Error('output exhausted'); } } return output.buffer; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "static newWithMembers(algId, nonce) {\n precondition.ensureNumber('algId', algId);\n precondition.ensureByteArray('nonce', nonce);\n\n // Copy bytes from JS memory to the WASM memory.\n const nonceSize = nonce.length * nonce.BYTES_PER_ELEMENT;\n const noncePtr = Module._malloc(nonceSize);\n Module.HEAP8.set(nonce, noncePtr);\n\n // Create C structure vsc_data_t.\n const nonceCtxSize = Module._vsc_data_ctx_size();\n const nonceCtxPtr = Module._malloc(nonceCtxSize);\n\n // Point created vsc_data_t object to the copied bytes.\n Module._vsc_data(nonceCtxPtr, noncePtr, nonceSize);\n\n let proxyResult;\n\n try {\n proxyResult = Module._vscf_cipher_alg_info_new_with_members(algId, nonceCtxPtr);\n\n const jsResult = CipherAlgInfo.newAndTakeCContext(proxyResult);\n return jsResult;\n } finally {\n Module._free(noncePtr);\n Module._free(nonceCtxPtr);\n }\n }", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n };\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i];\n }\n var keylen = key ? key.length : 0;\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen;\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key);\n // at the end\n ctx.c = 128;\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n const ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n const keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit (outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i]\n }\n var keylen = key ? key.length : 0\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}", "function blake2bInit(outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64');\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64');\n }\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0,\n c: 0,\n outlen: outlen // output length in bytes\n };\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i];\n }\n var keylen = key ? key.length : 0;\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen;\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key);\n // at the end\n ctx.c = 128;\n }\n return ctx;\n}", "function blake2bInit(outlen, key) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64');\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64');\n }\n // state, 'param block'\n var ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0,\n c: 0,\n outlen: outlen // output length in bytes\n };\n // initialize hash state\n for (var i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i];\n }\n var keylen = key ? key.length : 0;\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen;\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key);\n // at the end\n ctx.c = 128;\n }\n return ctx;\n}", "constructor() {\n this.chacha = new ChaCha20();\n this.poly = new Poly1305();\n this.key = Buffer.alloc(64);\n this.mode = -1;\n this.aadLen = 0;\n this.cipherLen = 0;\n }", "derive(data, keyLen) {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n precondition.ensureByteArray('data', data);\n precondition.ensureNumber('keyLen', keyLen);\n\n // Copy bytes from JS memory to the WASM memory.\n const dataSize = data.length * data.BYTES_PER_ELEMENT;\n const dataPtr = Module._malloc(dataSize);\n Module.HEAP8.set(data, dataPtr);\n\n // Create C structure vsc_data_t.\n const dataCtxSize = Module._vsc_data_ctx_size();\n const dataCtxPtr = Module._malloc(dataCtxSize);\n\n // Point created vsc_data_t object to the copied bytes.\n Module._vsc_data(dataCtxPtr, dataPtr, dataSize);\n\n const keyCapacity = keyLen;\n const keyCtxPtr = Module._vsc_buffer_new_with_capacity(keyCapacity);\n\n try {\n Module._vscf_hkdf_derive(this.ctxPtr, dataCtxPtr, keyLen, keyCtxPtr);\n\n const keyPtr = Module._vsc_buffer_bytes(keyCtxPtr);\n const keyPtrLen = Module._vsc_buffer_len(keyCtxPtr);\n const key = Module.HEAPU8.slice(keyPtr, keyPtr + keyPtrLen);\n return key;\n } finally {\n Module._free(dataPtr);\n Module._free(dataCtxPtr);\n Module._vsc_buffer_delete(keyCtxPtr);\n }\n }", "function _createCipher$1(options) {\n\t options = options || {};\n\t var mode = (options.mode || 'CBC').toUpperCase();\n\t var algorithm = 'AES-' + mode;\n\n\t var cipher;\n\t if(options.decrypt) {\n\t cipher = forge.cipher.createDecipher(algorithm, options.key);\n\t } else {\n\t cipher = forge.cipher.createCipher(algorithm, options.key);\n\t }\n\n\t // backwards compatible start API\n\t var start = cipher.start;\n\t cipher.start = function(iv, options) {\n\t // backwards compatibility: support second arg as output buffer\n\t var output = null;\n\t if(options instanceof forge.util.ByteBuffer) {\n\t output = options;\n\t options = {};\n\t }\n\t options = options || {};\n\t options.output = output;\n\t options.iv = iv;\n\t start.call(cipher, options);\n\t };\n\n\t return cipher;\n\t}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0;\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n };\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen;\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key);\n ctx.c = 64; // at the end\n }\n\n return ctx\n}", "function createGen (init = Math.random(), opts = { algo: 'alea', length: 8 }) {\n return function gen (next, len, enc) {\n return enc ? next(len).toString(enc) : next(len)\n }.bind(null, seed(init, opts.algo), opts.length, opts.encoding)\n}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n var keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n var ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint32Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}", "function blake2sInit (outlen, key) {\n if (!(outlen > 0 && outlen <= 32)) {\n throw new Error('Incorrect output length, should be in [1, 32]')\n }\n const keylen = key ? key.length : 0\n if (key && !(keylen > 0 && keylen <= 32)) {\n throw new Error('Incorrect key length, should be in [1, 32]')\n }\n\n const ctx = {\n h: new Uint32Array(BLAKE2S_IV), // hash state\n b: new Uint8Array(64), // input block\n c: 0, // pointer within block\n t: 0, // input count\n outlen: outlen // output length in bytes\n }\n ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n if (keylen > 0) {\n blake2sUpdate(ctx, key)\n ctx.c = 64 // at the end\n }\n\n return ctx\n}", "function ECB(input, output) {\n var outputBuffer;\n if (encrypt) {\n outputBuffer = algo.Encrypt(algo.Key, input, System.Security.Cryptography.CipherMode.ECB);\n //var outputBuffer = input;\n System.Buffer.BlockCopy(outputBuffer, 0, output, 0, blockSizeByte);\n } else {\n outputBuffer = algo.Decrypt(algo.Key, input, System.Security.Cryptography.CipherMode.ECB);\n System.Buffer.BlockCopy(outputBuffer, 0, output, 0, blockSizeByte);\n }\n //Trace.Write(\"call ECB(input[\"+input.length+\"] = \"+System.BitConverter.ToString(input)+\", output[\"+output.length+\"] = \"+System.BitConverter.ToString(output)+\")\");\n }", "function aes(length) {\n const C = function C(key) {\n const aes_ecb = new _ecb.AES_ECB(key);\n\n this.encrypt = function (block) {\n return aes_ecb.encrypt(block);\n };\n\n this.decrypt = function (block) {\n return aes_ecb.decrypt(block);\n };\n };\n\n C.blockSize = C.prototype.blockSize = 16;\n C.keySize = C.prototype.keySize = length / 8;\n\n return C;\n}", "function aes(length) {\n const C = function(key) {\n const aes_ecb = new AES_ECB(key);\n\n this.encrypt = function(block) {\n return aes_ecb.encrypt(block);\n };\n\n this.decrypt = function(block) {\n return aes_ecb.decrypt(block);\n };\n };\n\n C.blockSize = C.prototype.blockSize = 16;\n C.keySize = C.prototype.keySize = length / 8;\n\n return C;\n}", "function aes(length) {\n var C = function C(key) {\n var aes_ecb = new _ecb.AES_ECB(key, _exports._AES_heap_instance, _exports._AES_asm_instance);\n\n this.encrypt = function (block) {\n return aes_ecb.encrypt(block).result;\n };\n\n this.decrypt = function (block) {\n return aes_ecb.decrypt(block).result;\n };\n };\n\n C.blockSize = C.prototype.blockSize = 16;\n C.keySize = C.prototype.keySize = length / 8;\n\n return C;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "function _createCipher(options) {\n options = options || {};\n var mode = (options.mode || 'CBC').toUpperCase();\n var algorithm = 'AES-' + mode;\n\n var cipher;\n if(options.decrypt) {\n cipher = forge.cipher.createDecipher(algorithm, options.key);\n } else {\n cipher = forge.cipher.createCipher(algorithm, options.key);\n }\n\n // backwards compatible start API\n var start = cipher.start;\n cipher.start = function(iv, options) {\n // backwards compatibility: support second arg as output buffer\n var output = null;\n if(options instanceof forge.util.ByteBuffer) {\n output = options;\n options = {};\n }\n options = options || {};\n options.output = output;\n options.iv = iv;\n start.call(cipher, options);\n };\n\n return cipher;\n}", "keyStream(length) {\r\n const dst = new Uint8Array(length);\r\n for (let i = 0; i < dst.length; i++) {\r\n dst[i] = 0;\r\n }\r\n return this.encrypt(dst);\r\n }", "constructor(key) {\r\n this._buffer = new Uint8Array(16);\r\n this._r = new Uint16Array(10);\r\n this._h = new Uint16Array(10);\r\n this._pad = new Uint16Array(8);\r\n this._leftover = 0;\r\n this._fin = 0;\r\n this._finishedMac = new Uint8Array(1);\r\n const t0 = key[0] | (key[1] << 8);\r\n this._r[0] = t0 & 0x1fff;\r\n const t1 = key[2] | (key[3] << 8);\r\n this._r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\r\n const t2 = key[4] | (key[5] << 8);\r\n this._r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\r\n const t3 = key[6] | (key[7] << 8);\r\n this._r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\r\n const t4 = key[8] | (key[9] << 8);\r\n this._r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\r\n this._r[5] = (t4 >>> 1) & 0x1ffe;\r\n const t5 = key[10] | (key[11] << 8);\r\n this._r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\r\n const t6 = key[12] | (key[13] << 8);\r\n this._r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\r\n const t7 = key[14] | (key[15] << 8);\r\n this._r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\r\n this._r[9] = (t7 >>> 5) & 0x007f;\r\n this._pad[0] = key[16] | (key[17] << 8);\r\n this._pad[1] = key[18] | (key[19] << 8);\r\n this._pad[2] = key[20] | (key[21] << 8);\r\n this._pad[3] = key[22] | (key[23] << 8);\r\n this._pad[4] = key[24] | (key[25] << 8);\r\n this._pad[5] = key[26] | (key[27] << 8);\r\n this._pad[6] = key[28] | (key[29] << 8);\r\n this._pad[7] = key[30] | (key[31] << 8);\r\n }", "function Test_GetCa(key) {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_hub_get_ca, out_rpc_hub_get_ca;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetCa\");\n in_rpc_hub_get_ca = new VPN.VpnRpcHubGetCA({\n HubName_str: hub_name,\n Key_u32: key\n });\n return [4 /*yield*/, api.GetCa(in_rpc_hub_get_ca)];\n case 1:\n out_rpc_hub_get_ca = _a.sent();\n console.log(out_rpc_hub_get_ca);\n console.log(\"End: Test_GetCa\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function RC4(key) {\n this.i = 0;\n this.j = 0;\n this.s = [];\n for (var i = 0; i < 256; i++) {\n this.s[i] = i;\n }\n\n // Shuffle the array s using entropy from the key string.\n var j = 0;\n for (var i = 0; i < 256; i++) {\n j += this.s[i] + key.charCodeAt(i % key.length);\n j %= 256;\n this._swap(i, j);\n }\n}", "function createCipher(groupPrimeOrLength) {\n return __awaiter(this, void 0, void 0, function* () {\n let prime;\n if (Buffer.isBuffer(groupPrimeOrLength)) {\n prime = groupPrimeOrLength;\n }\n else if (typeof groupPrimeOrLength === 'number') {\n if (groupPrimeOrLength < MIN_PRIME_LENGTH) {\n throw new TypeError('Cannot create cipher: prime length is too small');\n }\n prime = yield util.generateSafePrime(groupPrimeOrLength);\n }\n else if (typeof groupPrimeOrLength === 'string') {\n prime = util.getPrime(groupPrimeOrLength);\n }\n else if (groupPrimeOrLength === null || groupPrimeOrLength === undefined) {\n prime = util.getPrime('modp2048');\n }\n else {\n throw new TypeError('Cannot create cipher: prime is invalid');\n }\n const key = yield util.generateKey(prime);\n return new Cipher(prime, key);\n });\n}", "function generateAKey() {\n // Create a random key and put its hex encoded version\n // into the 'aes-key' input box for future use.\n\n window.crypto.subtle.generateKey(\n {name: \"AES-CBC\", length: 128}, // Algorithm using this key\n true, // Allow it to be exported\n [\"encrypt\", \"decrypt\"] // Can use for these purposes\n ).\n then(function(aesKey) {\n window.crypto.subtle.exportKey('raw', aesKey).\n then(function(aesKeyBuffer) {\n document.getElementById(\"aes-key\").value = arrayBufferToHexString(aesKeyBuffer);\n }).\n catch(function(err) {\n alert(\"Key export failed: \" + err.message);\n });\n }).\n catch(function(err) {\n alert(\"Key generation failed: \" + err.message);\n });\n }", "_processBuffer() {\n return __awaiter(this, void 0, void 0, function* () {\n xor_1.xor(this._offset.data, this._L[ctz_1.ctz(this._counter + 1)].data);\n xor_1.xor(this._buffer.data, this._offset.data);\n this._counter++;\n yield this._cipher.encryptBlock(this._buffer);\n xor_1.xor(this._tag.data, this._buffer.data);\n this._bufferPos = 0;\n });\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 caesarCipherEncryptor(string, key) {\n\t// initialize new letter array\n\tconst newLetters = []\n\t// mod by number of letters just in case key > 26\n\tconst newKey = key % 26\n\tfor (const letter of string) {\n\t\tnewLetters.push(getNewLetter(letter, newKey))\n\t}\n\treturn newLetters.join('')\n}", "open(ciphertext, nonce, associatedData = new Uint8Array(0)) {\n return __awaiter(this, void 0, void 0, function* () {\n return this._siv.open(ciphertext, [associatedData, nonce]);\n });\n }", "static newAndTakeCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'number');\n return new CipherAlgInfo(ctxPtr);\n }", "generateKeys(cb) {\n // optional private key and initialization vector sizes in bytes\n // (if params is not passed to create, keythereum.constants is used by default)\n const params = {\n keyBytes: 32,\n ivBytes: 16,\n };\n\n // Using a Promise\n keythereum.create(params, cb);\n }", "function deriveKey(keyBuf, saltBuf, keyCount){\n var eachKeyLen = new tool.get('hash')().getOutputBytesLength();\n var stream = new tool.get('hash')(64).pbkdf2(\n keyBuf,\n saltBuf,\n 4, // This is to randomize the result, but not to slow down\n // a rainbow table search. You still need to pass a 512-bit\n // key into `keyBuf`, which may be done by a slowing-down\n // process.\n keyCount * eachKeyLen\n );\n var result = new Array(keyCount);\n for(var i=0; i<keyCount; i++)\n result[i] = new tool.get('hash')(64).hash(\n stream.slice(i * eachKeyLen, (i+1) * eachKeyLen)\n ).buffer;\n return result;\n }", "function generateKeys(keyByte) {\n var key = new Array(56);\n var keys = new Array();\n\n keys[0] = new Array();\n keys[1] = new Array();\n keys[2] = new Array();\n keys[3] = new Array();\n keys[4] = new Array();\n keys[5] = new Array();\n keys[6] = new Array();\n keys[7] = new Array();\n keys[8] = new Array();\n keys[9] = new Array();\n keys[10] = new Array();\n keys[11] = new Array();\n keys[12] = new Array();\n keys[13] = new Array();\n keys[14] = new Array();\n keys[15] = new Array();\n var loop = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\n\n for (i = 0; i < 7; i++) {\n for (j = 0, k = 7; j < 8; j++, k--) {\n key[i * 8 + j] = keyByte[8 * k + i];\n }\n }\n\n var i = 0;\n for (i = 0; i < 16; i++) {\n var tempLeft = 0;\n var tempRight = 0;\n for (j = 0; j < loop[i]; j++) {\n tempLeft = key[0];\n tempRight = key[28];\n for (k = 0; k < 27; k++) {\n key[k] = key[k + 1];\n key[28 + k] = key[29 + k];\n }\n key[27] = tempLeft;\n key[55] = tempRight;\n }\n var tempKey = new Array(48);\n tempKey[0] = key[13];\n tempKey[1] = key[16];\n tempKey[2] = key[10];\n tempKey[3] = key[23];\n tempKey[4] = key[0];\n tempKey[5] = key[4];\n tempKey[6] = key[2];\n tempKey[7] = key[27];\n tempKey[8] = key[14];\n tempKey[9] = key[5];\n tempKey[10] = key[20];\n tempKey[11] = key[9];\n tempKey[12] = key[22];\n tempKey[13] = key[18];\n tempKey[14] = key[11];\n tempKey[15] = key[3];\n tempKey[16] = key[25];\n tempKey[17] = key[7];\n tempKey[18] = key[15];\n tempKey[19] = key[6];\n tempKey[20] = key[26];\n tempKey[21] = key[19];\n tempKey[22] = key[12];\n tempKey[23] = key[1];\n tempKey[24] = key[40];\n tempKey[25] = key[51];\n tempKey[26] = key[30];\n tempKey[27] = key[36];\n tempKey[28] = key[46];\n tempKey[29] = key[54];\n tempKey[30] = key[29];\n tempKey[31] = key[39];\n tempKey[32] = key[50];\n tempKey[33] = key[44];\n tempKey[34] = key[32];\n tempKey[35] = key[47];\n tempKey[36] = key[43];\n tempKey[37] = key[48];\n tempKey[38] = key[38];\n tempKey[39] = key[55];\n tempKey[40] = key[33];\n tempKey[41] = key[52];\n tempKey[42] = key[45];\n tempKey[43] = key[41];\n tempKey[44] = key[49];\n tempKey[45] = key[35];\n tempKey[46] = key[28];\n tempKey[47] = key[31];\n switch (i) {\n case 0:\n for (m = 0; m < 48; m++) { keys[0][m] = tempKey[m]; }\n break;\n case 1:\n for (m = 0; m < 48; m++) { keys[1][m] = tempKey[m]; }\n break;\n case 2:\n for (m = 0; m < 48; m++) { keys[2][m] = tempKey[m]; }\n break;\n case 3:\n for (m = 0; m < 48; m++) { keys[3][m] = tempKey[m]; }\n break;\n case 4:\n for (m = 0; m < 48; m++) { keys[4][m] = tempKey[m]; }\n break;\n case 5:\n for (m = 0; m < 48; m++) { keys[5][m] = tempKey[m]; }\n break;\n case 6:\n for (m = 0; m < 48; m++) { keys[6][m] = tempKey[m]; }\n break;\n case 7:\n for (m = 0; m < 48; m++) { keys[7][m] = tempKey[m]; }\n break;\n case 8:\n for (m = 0; m < 48; m++) { keys[8][m] = tempKey[m]; }\n break;\n case 9:\n for (m = 0; m < 48; m++) { keys[9][m] = tempKey[m]; }\n break;\n case 10:\n for (m = 0; m < 48; m++) { keys[10][m] = tempKey[m]; }\n break;\n case 11:\n for (m = 0; m < 48; m++) { keys[11][m] = tempKey[m]; }\n break;\n case 12:\n for (m = 0; m < 48; m++) { keys[12][m] = tempKey[m]; }\n break;\n case 13:\n for (m = 0; m < 48; m++) { keys[13][m] = tempKey[m]; }\n break;\n case 14:\n for (m = 0; m < 48; m++) { keys[14][m] = tempKey[m]; }\n break;\n case 15:\n for (m = 0; m < 48; m++) { keys[15][m] = tempKey[m]; }\n break;\n }\n }\n return keys;\n}", "function test_chacha20_block(chacha){\n\tKey = \"00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f:10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f\";\n\tnonce=\"00:00:00:09:00:00:00:4a:00:00:00:00\";\n\tcounter=0x6b2065745;\n\tconsole.log(chacha20_block(chacha,Key,counter,nonce));\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}", "static newAndUseCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'number');\n return new CipherAlgInfo(Module._vscf_cipher_alg_info_shallow_copy(ctxPtr));\n }", "encryptBuffers() {\n //\n }", "static newAndUseCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'number');\n return new Hkdf(Module._vscf_hkdf_shallow_copy(ctxPtr));\n }", "function deriveKeyWithKDF(inputKey) {\r\n\r\n var dbAlg = {\r\n // KDF algorithm\r\n name: \"CONCAT\",\r\n hash: { name: \"Sha-256\" },\r\n // Concat parameters\r\n algorithmId: [0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0],\r\n partyUInfo: [0x41, 0x4C, 0x49, 0x43, 0x45, 0x31, 0x32, 0x33],\r\n partyVInfo: [0x42, 0x4F, 0x42, 0x42, 0x59, 0x34, 0x35, 0x36]\r\n };\r\n\r\n subtle.deriveBits(dbAlg, inputKey, 64).then(\r\n\r\n function (e4) {\r\n\r\n var derivedBytes = shared.getArrayResult(e4);\r\n\r\n var expected =\r\n [0xC5, 0xBA, 0xF9, 0x2F, 0x8E, 0xBB, 0xE3, 0x30, 0x4A, 0x6C, 0xF6, 0x82, 0x76, 0x4B, 0xDC, 0x7F, 0x55, 0x94, 0x7A, 0x16, 0xDC, 0xDB, 0x57, 0x2A, 0x0A, 0x0D, 0x20, 0xA0, 0x5A, 0x47, 0xBB, 0xC4, 0x37, 0xFC, 0x7C, 0x97, 0xC2, 0x70, 0x00, 0x09, 0xC8, 0x83, 0x7D, 0x75, 0x75, 0x4E, 0x57, 0x96, 0xCD, 0xFF, 0x53, 0x7F, 0x62, 0xD8, 0x7E, 0x7F, 0x5D, 0x2B, 0x6D, 0xF6, 0x83, 0x73, 0x67, 0xA8];\r\n\r\n start();\r\n\r\n equal(derivedBytes.join(), expected.join(), \"Expected Secret\");\r\n\r\n },\r\n shared.error(\"deriveBits\")\r\n );\r\n }", "function _cipher(p, k, n) {\n // set length for loop to the amount of 128-bit blocks\n const len = p.length / 16;\n // set initial state\n let state = _hmac(n, k);\n // init processed blocks\n let processed = [];\n for (let i = 0; i < len; i++) {\n // advance state\n state = _hmac(state, k);\n // set current pos\n let pos = i * 16;\n // find the current block and xor it with the state\n let toprocess = p.slice(pos, pos + 16);\n processed.push(_xor(toprocess, state));\n }\n // return the processed blocks as a buffer\n return Buffer.concat(processed);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this,\n i = 0,\n j = me.i = me.j = 0,\n s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i,\n j = me.j,\n s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i;\n me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See https://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "static newAndTakeCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'number');\n return new Hkdf(ctxPtr);\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 }", "function encrypt_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 i,\n j,\n len,\n v;\n if (have_ab) {\n var data0,\n data1,\n data2,\n data3;\n len = ab.buffer.byteLength - 16;\n var v = new DataView(ab.buffer);\n for (i = 0; i < len; i += 16) {\n data0 = v.getUint32(i, false);\n data1 = v.getUint32(i + 4, false);\n data2 = v.getUint32(i + 8, false);\n data3 = v.getUint32(i + 12, false);\n // compute MAC\n mac[0] ^= data0;\n mac[1] ^= data1;\n mac[2] ^= data2;\n mac[3] ^= data3;\n mac = aes.encrypt(mac);\n // encrypt using CTR\n enc = aes.encrypt(ctr);\n v.setUint32(i, data0 ^ enc[0], false);\n v.setUint32(i + 4, data1 ^ enc[1], false);\n v.setUint32(i + 8, data2 ^ enc[2], false);\n v.setUint32(i + 12, data3 ^ enc[3], false);\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);\n data1 = v.getUint32(4, false);\n data2 = v.getUint32(8, false);\n data3 = v.getUint32(12, false);\n mac[0] ^= data0;\n mac[1] ^= data1;\n mac[2] ^= data2;\n mac[3] ^= data3;\n mac = aes.encrypt(mac);\n enc = aes.encrypt(ctr);\n v.setUint32(0, data0 ^ enc[0], false);\n v.setUint32(4, data1 ^ enc[1], false);\n v.setUint32(8, data2 ^ enc[2], false);\n v.setUint32(12, data3 ^ enc[3], false);\n fullbuf.set(tmparray.subarray(0, j = fullbuf.length - i), i);\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 mac[0] ^= ab32[i];\n mac[1] ^= ab32[i + 1];\n mac[2] ^= ab32[i + 2];\n mac[3] ^= ab32[i + 3];\n mac = aes.encrypt(mac);\n enc = aes.encrypt(ctr);\n ab32[i] ^= enc[0];\n ab32[i + 1] ^= enc[1];\n ab32[i + 2] ^= enc[2];\n ab32[i + 3] ^= enc[3];\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 mac[0] ^= v[0];\n mac[1] ^= v[1];\n mac[2] ^= v[2];\n mac[3] ^= v[3];\n mac = aes.encrypt(mac);\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 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}", "static InvCipher(input, key, Nk, Nr) {\n input = roteteArray(input);\n //key = roteteArray(key);\n\n let w = this.KeyExpansion(key, Nk, Nr);\n\n let state = input;\n\n state = this.AddRoundKey(state, w, Nr);\n\n for (let round = Nr - 1; round >= 1; --round) {\n state = this.InvShiftRows(state);\n state = this.InvSubBytes(state);\n state = this.AddRoundKey(state, w, round);\n state = this.InvMixColumns(state);\n }\n\n state = this.InvShiftRows(state);\n state = this.InvSubBytes(state);\n state = this.AddRoundKey(state, w, 0);\n\n let output = roteteArray(state);\n return output;\n }", "constructor(key, nonce, counter = 0) {\r\n this._input = new Uint32Array(16);\r\n // https://www.ietf.org/rfc/rfc8439.html#section-2.3\r\n this._input[0] = 1634760805;\r\n this._input[1] = 857760878;\r\n this._input[2] = 2036477234;\r\n this._input[3] = 1797285236;\r\n this._input[4] = BitHelper.u8To32LittleEndian(key, 0);\r\n this._input[5] = BitHelper.u8To32LittleEndian(key, 4);\r\n this._input[6] = BitHelper.u8To32LittleEndian(key, 8);\r\n this._input[7] = BitHelper.u8To32LittleEndian(key, 12);\r\n this._input[8] = BitHelper.u8To32LittleEndian(key, 16);\r\n this._input[9] = BitHelper.u8To32LittleEndian(key, 20);\r\n this._input[10] = BitHelper.u8To32LittleEndian(key, 24);\r\n this._input[11] = BitHelper.u8To32LittleEndian(key, 28);\r\n this._input[12] = counter;\r\n this._input[13] = BitHelper.u8To32LittleEndian(nonce, 0);\r\n this._input[14] = BitHelper.u8To32LittleEndian(nonce, 4);\r\n this._input[15] = BitHelper.u8To32LittleEndian(nonce, 8);\r\n }", "_genRandCrypto(num_bytes) {\n let a = new Uint8Array(num_bytes);\n this._crypto.getRandomValues(a);\n return a;\n }", "function xor(payload, key) {\n var results = []\n var index\n\n for (var i = 0; i < payload.length; i++) {\n index = i % key.length\n results.push(payload[i] ^ key[index])\n }\n\n return new Buffer(results)\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "function cutKeyBuffer(key) {\n var keySha1 = crypto.createHash('sha1').update(key).digest('hex');\n var keyHex = keySha1.slice(0, 32);\n return new Buffer(keyHex);\n }", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "function ARC4(key) {\n var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n // The empty key [] is treated as [0].\n if (!keylen) key = [\n keylen++\n ];\n // Set up S using the standard key scheduling algorithm.\n while(i < width)s[i] = i++;\n for(i = 0; i < width; i++){\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t1, r = 0, i1 = me.i, j1 = me.j, s1 = me.S;\n while(count--){\n t1 = s1[i1 = mask & i1 + 1];\n r = r * width + s1[mask & (s1[i1] = s1[j1 = mask & j1 + t1]) + (s1[j1] = t1)];\n }\n me.i = i1;\n me.j = j1;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n };\n }", "function caeserCipherEncryptor(str, key) {\n // intitalize an array to contain solution\n const newLetters = []\n // if the key is a big number (ie 54), we want the remainder\n // otherwise we want the number is smaller, it will be the remainder so all is well\n const newKey = key % 26\n // loop thru our str\n for (const letter of str) {\n // add the ciphered letter to result array\n newLetters.push(getNewLetter(letter, newKey))\n }\n //return the ciphered letters\n return newLetters.join('')\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 caesarCipherEncryptor(string, key) {\n // Write your code here.\n if (key === 0) return string;\n let result = \"\";\n let alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n for (let i = 0; i < string.length; i++) {\n console.log(\"char\", string[i]);\n //grab the current char from input and find at what idx is it in alphabet\n let curIdx = alphabet.indexOf(string[i]); //23\n console.log(\"currentIdx\", curIdx);\n //find the needed idx of the letter that should replace it (from alphabet)\n let newIdx = curIdx + key; //25\n console.log(\"newIdx\", newIdx);\n while (newIdx >= 26) {\n newIdx = newIdx - 26;\n console.log(\"newIdx in loop\", newIdx);\n }\n //find that new letter and add it to the result string\n result += alphabet.charAt(newIdx);\n console.log(\"results string\", result);\n }\n return result;\n}", "function caesarCipherEncryptor(string, key) {\n const newLetters = []\n\tconst newKey = key % 26\n\tconst alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('')\n\tfor (const letter of string) {\n\t\tnewLetters.push(getNewLetter(letter, newKey, alphabet))\n\t}\n\treturn newLetters.join('')\n}", "static generate() {\n return Promise.resolve().then(() => {\n return crypto.subtle.generateKey({ name: 'ECDH', namedCurve: 'P-256' },\n true /* extractable */, ['deriveBits']);\n\n }).then(keys => new KeyPair(keys.publicKey, keys.privateKey));\n }", "function ARC4(key) {\n\t var t, keylen = key.length,\n\t me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n\t // The empty key [] is treated as [0].\n\t if (!keylen) { key = [keylen++]; }\n\n\t // Set up S using the standard key scheduling algorithm.\n\t while (i < width) {\n\t s[i] = i++;\n\t }\n\t for (i = 0; i < width; i++) {\n\t s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n\t s[j] = t;\n\t }\n\n\t // The \"g\" method returns the next (count) outputs as one number.\n\t (me.g = function(count) {\n\t // Using instance members instead of closure state nearly doubles speed.\n\t var t, r = 0,\n\t i = me.i, j = me.j, s = me.S;\n\t while (count--) {\n\t t = s[i = mask & (i + 1)];\n\t r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n\t }\n\t me.i = i; me.j = j;\n\t return r;\n\t // For robust unpredictability, the function call below automatically\n\t // discards an initial batch of values. This is called RC4-drop[256].\n\t // See http://google.com/search?q=rsa+fluhrer+response&btnI\n\t })(width);\n\t}", "function generateAudioBuffer( freq, fn, duration, volume ) {\n var length = duration * sampleRate;\n\n var buffer = audioContext.createBuffer( 1, length, sampleRate );\n var channel = buffer.getChannelData(0);\n for ( var i = 0; i < length; i++ ) {\n channel[i] = fn( freq * i / sampleRate, i / length ) * volume;\n }\n\n return buffer;\n}", "function ARC4init(key) {\r\n var i, j, t;\r\n for (i = 0; i < 256; ++i)\r\n this.S[i] = i;\r\n j = 0;\r\n for (i = 0; i < 256; ++i) {\r\n j = (j + this.S[i] + key[i % key.length]) & 255;\r\n t = this.S[i];\r\n this.S[i] = this.S[j];\r\n this.S[j] = t;\r\n }\r\n this.i = 0;\r\n this.j = 0;\r\n}", "static Cipher(input, key, Nk, Nr) {\n input = roteteArray(input);\n //key = roteteArray(key);\n\n let w = this.KeyExpansion(key, Nk, Nr);\n\n let state = input;\n\n state = this.AddRoundKey(state, w, 0);\n\n for (let round = 1; round <= Nr - 1; ++round) {\n state = this.SubBytes(state);\n state = this.ShiftRows(state);\n state = this.MixColumns(state);\n state = this.AddRoundKey(state, w, round);\n }\n\n state = this.SubBytes(state);\n state = this.ShiftRows(state);\n state = this.AddRoundKey(state, w, Nr);\n\n let output = roteteArray(state);\n return output;\n }", "function _newIv(text){\n var newIv = _encode(text.substr(0, 16));\n return newIv[0];\n}", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n (me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability, the function call below automatically\r\n // discards an initial batch of values. This is called RC4-drop[256].\r\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\r\n })(width);\r\n }", "function createDecipher() {\n return crypto.createDecipheriv(algoritsymm, Buffer.from(password), initVector);\n }", "function AesEncryptionWrapper(key, plaintext)\r\n{\r\n\tvar xorBlock = GenerateRandomArray(4);\t// generate a random 128-bit IV for the first round\r\n\tif(xorBlock === false)\t\t\t// if there is not enough entropy, abort\r\n\t\treturn false;\r\n\tvar cipher = new AES(key);\r\n\tvar ciphertext = new Array();\t\t// the ciphertext is prepended with the random IV\r\n\tciphertext = ciphertext.concat(xorBlock);\r\n\r\n\twhile(plaintext.length > 0) {\t\t// for all blocks...\r\n\t\tvar plainBlock = plaintext.splice(0, 4);\t\t// get the first 4 words (i.e. one block)\r\n\t\tvar cipherBlock = XorArrays(plainBlock, xorBlock);\t// XOR the plain block with the previous cipher block...\r\n\t\tcipherBlock = cipher.encrypt_core(cipherBlock);\t\t// ... and encrypt it with the key\r\n\t\tciphertext = ciphertext.concat(cipherBlock);\t\t// append the block to the ciphertext\r\n\t\txorBlock = cipherBlock;\t\t\t\t\t// prepare the XOR for the next block\r\n\t}\r\n\r\n\t// emit the ciphertext\r\n\treturn ciphertext;\r\n}", "function hchacha(key, src, dst) {\n var j0 = 0x61707865; // \"expa\" -- ChaCha's \"sigma\" constant\n var j1 = 0x3320646e; // \"nd 3\" for 32-byte keys\n var j2 = 0x79622d32; // \"2-by\"\n var j3 = 0x6b206574; // \"te k\"\n var j4 = (key[3] << 24) | (key[2] << 16) | (key[1] << 8) | key[0];\n var j5 = (key[7] << 24) | (key[6] << 16) | (key[5] << 8) | key[4];\n var j6 = (key[11] << 24) | (key[10] << 16) | (key[9] << 8) | key[8];\n var j7 = (key[15] << 24) | (key[14] << 16) | (key[13] << 8) | key[12];\n var j8 = (key[19] << 24) | (key[18] << 16) | (key[17] << 8) | key[16];\n var j9 = (key[23] << 24) | (key[22] << 16) | (key[21] << 8) | key[20];\n var j10 = (key[27] << 24) | (key[26] << 16) | (key[25] << 8) | key[24];\n var j11 = (key[31] << 24) | (key[30] << 16) | (key[29] << 8) | key[28];\n var j12 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0];\n var j13 = (src[7] << 24) | (src[6] << 16) | (src[5] << 8) | src[4];\n var j14 = (src[11] << 24) | (src[10] << 16) | (src[9] << 8) | src[8];\n var j15 = (src[15] << 24) | (src[14] << 16) | (src[13] << 8) | src[12];\n var x0 = j0;\n var x1 = j1;\n var x2 = j2;\n var x3 = j3;\n var x4 = j4;\n var x5 = j5;\n var x6 = j6;\n var x7 = j7;\n var x8 = j8;\n var x9 = j9;\n var x10 = j10;\n var x11 = j11;\n var x12 = j12;\n var x13 = j13;\n var x14 = j14;\n var x15 = j15;\n for (var i = 0; i < ROUNDS; i += 2) {\n x0 = (x0 + x4) | 0;\n x12 ^= x0;\n x12 = (x12 >>> (32 - 16)) | (x12 << 16);\n x8 = (x8 + x12) | 0;\n x4 ^= x8;\n x4 = (x4 >>> (32 - 12)) | (x4 << 12);\n x1 = (x1 + x5) | 0;\n x13 ^= x1;\n x13 = (x13 >>> (32 - 16)) | (x13 << 16);\n x9 = (x9 + x13) | 0;\n x5 ^= x9;\n x5 = (x5 >>> (32 - 12)) | (x5 << 12);\n x2 = (x2 + x6) | 0;\n x14 ^= x2;\n x14 = (x14 >>> (32 - 16)) | (x14 << 16);\n x10 = (x10 + x14) | 0;\n x6 ^= x10;\n x6 = (x6 >>> (32 - 12)) | (x6 << 12);\n x3 = (x3 + x7) | 0;\n x15 ^= x3;\n x15 = (x15 >>> (32 - 16)) | (x15 << 16);\n x11 = (x11 + x15) | 0;\n x7 ^= x11;\n x7 = (x7 >>> (32 - 12)) | (x7 << 12);\n x2 = (x2 + x6) | 0;\n x14 ^= x2;\n x14 = (x14 >>> (32 - 8)) | (x14 << 8);\n x10 = (x10 + x14) | 0;\n x6 ^= x10;\n x6 = (x6 >>> (32 - 7)) | (x6 << 7);\n x3 = (x3 + x7) | 0;\n x15 ^= x3;\n x15 = (x15 >>> (32 - 8)) | (x15 << 8);\n x11 = (x11 + x15) | 0;\n x7 ^= x11;\n x7 = (x7 >>> (32 - 7)) | (x7 << 7);\n x1 = (x1 + x5) | 0;\n x13 ^= x1;\n x13 = (x13 >>> (32 - 8)) | (x13 << 8);\n x9 = (x9 + x13) | 0;\n x5 ^= x9;\n x5 = (x5 >>> (32 - 7)) | (x5 << 7);\n x0 = (x0 + x4) | 0;\n x12 ^= x0;\n x12 = (x12 >>> (32 - 8)) | (x12 << 8);\n x8 = (x8 + x12) | 0;\n x4 ^= x8;\n x4 = (x4 >>> (32 - 7)) | (x4 << 7);\n x0 = (x0 + x5) | 0;\n x15 ^= x0;\n x15 = (x15 >>> (32 - 16)) | (x15 << 16);\n x10 = (x10 + x15) | 0;\n x5 ^= x10;\n x5 = (x5 >>> (32 - 12)) | (x5 << 12);\n x1 = (x1 + x6) | 0;\n x12 ^= x1;\n x12 = (x12 >>> (32 - 16)) | (x12 << 16);\n x11 = (x11 + x12) | 0;\n x6 ^= x11;\n x6 = (x6 >>> (32 - 12)) | (x6 << 12);\n x2 = (x2 + x7) | 0;\n x13 ^= x2;\n x13 = (x13 >>> (32 - 16)) | (x13 << 16);\n x8 = (x8 + x13) | 0;\n x7 ^= x8;\n x7 = (x7 >>> (32 - 12)) | (x7 << 12);\n x3 = (x3 + x4) | 0;\n x14 ^= x3;\n x14 = (x14 >>> (32 - 16)) | (x14 << 16);\n x9 = (x9 + x14) | 0;\n x4 ^= x9;\n x4 = (x4 >>> (32 - 12)) | (x4 << 12);\n x2 = (x2 + x7) | 0;\n x13 ^= x2;\n x13 = (x13 >>> (32 - 8)) | (x13 << 8);\n x8 = (x8 + x13) | 0;\n x7 ^= x8;\n x7 = (x7 >>> (32 - 7)) | (x7 << 7);\n x3 = (x3 + x4) | 0;\n x14 ^= x3;\n x14 = (x14 >>> (32 - 8)) | (x14 << 8);\n x9 = (x9 + x14) | 0;\n x4 ^= x9;\n x4 = (x4 >>> (32 - 7)) | (x4 << 7);\n x1 = (x1 + x6) | 0;\n x12 ^= x1;\n x12 = (x12 >>> (32 - 8)) | (x12 << 8);\n x11 = (x11 + x12) | 0;\n x6 ^= x11;\n x6 = (x6 >>> (32 - 7)) | (x6 << 7);\n x0 = (x0 + x5) | 0;\n x15 ^= x0;\n x15 = (x15 >>> (32 - 8)) | (x15 << 8);\n x10 = (x10 + x15) | 0;\n x5 ^= x10;\n x5 = (x5 >>> (32 - 7)) | (x5 << 7);\n }\n binary_1.writeUint32LE(x0, dst, 0);\n binary_1.writeUint32LE(x1, dst, 4);\n binary_1.writeUint32LE(x2, dst, 8);\n binary_1.writeUint32LE(x3, dst, 12);\n binary_1.writeUint32LE(x12, dst, 16);\n binary_1.writeUint32LE(x13, dst, 20);\n binary_1.writeUint32LE(x14, dst, 24);\n binary_1.writeUint32LE(x15, dst, 28);\n return dst;\n}", "function init_by_array(init_key, key_length) {\r\n //c//int i, j, k;\r\n var i, j, k;\r\n init_genrand(19650218);\r\n i=1; j=0;\r\n k = (N>key_length ? N : key_length);\r\n for (; k; k--) {\r\n //c//mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525))\r\n //c// + init_key[j] + j; /* non linear */\r\n mt[i] = addition32(addition32(unsigned32(mt[i] ^ multiplication32(unsigned32(mt[i-1] ^ (mt[i-1] >>> 30)), 1664525)), init_key[j]), j);\r\n mt[i] =\r\n //c//mt[i] &= 0xffffffff; /* for WORDSIZE > 32 machines */\r\n unsigned32(mt[i] & 0xffffffff);\r\n i++; j++;\r\n if (i>=N) { mt[0] = mt[N-1]; i=1; }\r\n if (j>=key_length) {\r\n j=0;\r\n }\r\n }\r\n for (k=N-1; k; k--) {\r\n //c//mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941))\r\n //c//- i; /* non linear */\r\n mt[i] = subtraction32(unsigned32((mt[i]) ^ multiplication32(unsigned32(mt[i-1] ^ (mt[i-1] >>> 30)), 1566083941)), i);\r\n //c//mt[i] &= 0xffffffff; /* for WORDSIZE > 32 machines */\r\n mt[i] = unsigned32(mt[i] & 0xffffffff);\r\n i++;\r\n if (i>=N) { mt[0] = mt[N-1]; i=1; }\r\n }\r\n mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\r\n }", "generate(length) {\r\n return new Uint8Array(crypto.randomBytes(length));\r\n }", "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "function createCallbackMemoizer() {\n\t var requireAllKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n\t var cachedIndices = {};\n\n\t return function (_ref) {\n\t var callback = _ref.callback,\n\t indices = _ref.indices;\n\n\t var keys = (0, _keys2.default)(indices);\n\t var allInitialized = !requireAllKeys || keys.every(function (key) {\n\t var value = indices[key];\n\t return Array.isArray(value) ? value.length > 0 : value >= 0;\n\t });\n\t var indexChanged = keys.length !== (0, _keys2.default)(cachedIndices).length || keys.some(function (key) {\n\t var cachedValue = cachedIndices[key];\n\t var value = indices[key];\n\n\t return Array.isArray(value) ? cachedValue.join(',') !== value.join(',') : cachedValue !== value;\n\t });\n\n\t cachedIndices = indices;\n\n\t if (allInitialized && indexChanged) {\n\t callback(indices);\n\t }\n\t };\n\t}", "function concatKDF (keyMaterial, keyLength) {\n const SHA256BlockSize = 64\n const reps = ((keyLength + 7) * 8) / (SHA256BlockSize * 8)\n\n const buffers = []\n for (let counter = 0, tmp = Buffer.allocUnsafe(4); counter <= reps;) {\n counter += 1\n tmp.writeUInt32BE(counter)\n buffers.push(crypto.createHash('sha256').update(tmp).update(keyMaterial).digest())\n }\n\n return Buffer.concat(buffers).slice(0, keyLength)\n}", "function caeserCipherEncryptor(str, key) {\n\t// intitalize an array to contain solution\n\tconst newLetters = []\n\t// mod ur current key by 26, cause theres ony 26 letters\n const newKey = key % 26\n //make the alphaet\n const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('')\n\t// loop thru our str\n\tfor (const letter of str) {\n\t\t// add the ciphered letter to result array\n\t\tnewLetters.push(getNewLetterB(letter, newKey, alphabet))\n\t}\n\n\t//return the ciphered letters\n\treturn newLetters.join('')\n}", "function streamXOR(key, nonce, src, dst) {\n if (nonce.length !== 24) {\n throw new Error(\"XChaCha20 nonce must be 24 bytes\");\n }\n // Use HChaCha one-way function to transform first 16 bytes of\n // 24-byte extended nonce and key into a new key for Salsa\n // stream -- \"subkey\".\n var subkey = hchacha(key, nonce.subarray(0, 16), new Uint8Array(32));\n // Use last 8 bytes of 24-byte extended nonce as an actual nonce prefixed by 4 zero bytes,\n // and a subkey derived in the previous step as key to encrypt.\n var modifiedNonce = new Uint8Array(12);\n modifiedNonce.set(nonce.subarray(16), 4);\n // If nonceInplaceCounterLength > 0, we'll still pass the correct\n // nonce || counter, as we don't limit the end of nonce subarray.\n var result = chacha_1.streamXOR(subkey, modifiedNonce, src, dst);\n // Clean subkey.\n wipe_1.wipe(subkey);\n return result;\n}", "function cmac(encrypt, k, m, len = m.length) {\n\treturn generateSubkey(encrypt, k).then(subkey => {\n\t\tlet n = Math.ceil(len / BLOCK_SIZE);\n\t\tif (n == 0) {\n\t\t\tn = 1;\n\t\t}\n\t\tlogger.trace(\"n=\" + n);\n\t\tlet _loop = ctx => {\n\t\t\tlet block;\n\t\t\tlet i = ctx.index * BLOCK_SIZE;\n\t\t\tlogger.trace(\"index=\" + ctx.index + \", i=\" + i);\n\t\t\tif (ctx.index == (n - 1)) {\n\t\t\t\tlet tmp = m.slice(i);\n\t\t\t\tlet sk;\n\t\t\t\tif (tmp.length != BLOCK_SIZE) {\n\t\t\t\t\t/* Padding */\n\t\t\t\t\tblock = new Uint8Array(BLOCK_SIZE).fill(0);\n\t\t\t\t\tblock.set(tmp);\n\t\t\t\t\tblock[BLOCK_SIZE - 1] = 0x80;\n\t\t\t\t\tsk = subkey.k2;\n\t\t\t\t} else {\n\t\t\t\t\tblock = tmp;\n\t\t\t\t\tsk = subkey.k1;\n\t\t\t\t}\n\t\t\t\t/* LSB First */\n\t\t\t\tblock = BTUtils.arraySwap(block);\n\t\t\t\tblock = BTUtils.arrayXOR(block, sk);\n\t\t\t} else {\n\t\t\t\tblock = m.slice(i, i + BLOCK_SIZE);\n\t\t\t\t/* LSB First */\n\t\t\t\tblock = BTUtils.arraySwap(block);\n\t\t\t}\n\t\t\tlogger.trace(\"Block: \" + Utils.toFrameString(block));\n\t\t\treturn encrypt(k, BTUtils.arrayXOR(ctx.x, block)).then(e => {\n\t\t\t\tctx.x = e;\n\t\t\t\tctx.index++;\n\t\t\t\tif (ctx.index < n) {\n\t\t\t\t\treturn _loop(ctx);\n\t\t\t\t} else {\n\t\t\t\t\treturn ctx.x;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\treturn _loop({\n\t\t\tindex: 0,\n\t\t\tx: ZERO\n\t\t});\n\t});\n}", "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }" ]
[ "0.5142523", "0.51319706", "0.49789298", "0.49736062", "0.4965462", "0.4965462", "0.4965462", "0.4965462", "0.4965462", "0.4965462", "0.49273297", "0.49273297", "0.4814365", "0.4731254", "0.4719029", "0.46989232", "0.4698656", "0.46806735", "0.46806735", "0.46806735", "0.46806735", "0.46806735", "0.46774137", "0.46680668", "0.46651554", "0.46290058", "0.45891577", "0.45604897", "0.45604897", "0.45604897", "0.45604897", "0.45604897", "0.45604897", "0.45604897", "0.4557825", "0.45522663", "0.4537928", "0.45011473", "0.44919488", "0.44839594", "0.44817132", "0.44761884", "0.44722885", "0.4445989", "0.44456825", "0.44435745", "0.4419844", "0.4413254", "0.44097495", "0.4391501", "0.4356687", "0.43407893", "0.43118072", "0.42996866", "0.42931396", "0.42907664", "0.42875496", "0.42738372", "0.4264174", "0.42624292", "0.42617726", "0.42430243", "0.4237821", "0.4227504", "0.4227504", "0.4227504", "0.4227504", "0.4227504", "0.4227504", "0.4227504", "0.4227504", "0.4227504", "0.42250535", "0.4223721", "0.42067406", "0.42033643", "0.41979197", "0.4193086", "0.4192661", "0.4191634", "0.41876537", "0.4184141", "0.4181028", "0.41807407", "0.41795287", "0.41792586", "0.41735646", "0.416685", "0.4164645", "0.41609618", "0.41608086", "0.41606924", "0.41601488", "0.41482198", "0.41460693", "0.4143938", "0.41417485", "0.41322082", "0.41314963", "0.41307253" ]
0.686839
0
this method is called when your extension is activated your extension is activated the very first time the command is executed
function activate(context) { // Use the console to output diagnostic information (console.log) and errors (console.error) // This line of code will only be executed once when your extension is activated console.log('Congratulations, your extension "c51" is now active!'); // The command has been defined in the package.json file // Now provide the implementation of the command with registerCommand // The commandId parameter must match the command field in package.json let disposable = vscode.commands.registerCommand('extension.buildC51', function () { // The code you place here will be executed every time your command is executed // Display a message box to the user var cmd=null; for (let i = 0; i < vscode.window.terminals.length; i++) { if(vscode.window.terminals[i].name=="CMD")cmd=vscode.window.terminals[i]; } if(cmd==null){ cmd=vscode.window.createTerminal("CMD","C:\\Windows\\System32\\cmd.exe"); } cmd.show(); var log=vscode.window.createOutputChannel("C51"); var binDir=vscode.workspace.getConfiguration("C51").get("binDir"); var hexFile=vscode.workspace.getConfiguration("C51").get("OnlyOutputHexFile"); var workDir=vscode.workspace.rootPath; if(workDir==undefined){ vscode.window.showErrorMessage("请先打开工作目录"); return; } if(vscode.workspace.textDocuments.length<=0){ vscode.window.showErrorMessage("请先打开一个文件"); return; } var filePath=vscode.workspace.textDocuments[0].fileName; filePath=filePath.replace(".c",""); cmd.sendText("cls"); cmd.sendText("\""+binDir+"\\C51.exe"+"\" "+"\""+filePath+".c\"",true); cmd.sendText("\""+binDir+"\\BL51.exe"+"\" "+"\""+filePath+".OBJ\"",true); cmd.sendText("\""+binDir+"\\OH51.exe"+"\" "+"\""+filePath+"\"",true); if(hexFile){ cmd.sendText("del "+filePath+".OBJ"); cmd.sendText("del "+filePath+".LST"); cmd.sendText("del "+filePath+".M51"); cmd.sendText("del "+filePath); } }); context.subscriptions.push(disposable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activateExtension() {\n Privly.options.setInjectionEnabled(true);\n updateActivateStatus(true);\n}", "function activate(context) {\n console.log('Congratulations, your extension \"funne\" is now active!');\n let disposable = vscode.commands.registerCommand('funne.init', () => {\n vscode.window.showInformationMessage('welcome to funne!');\n });\n context.subscriptions.push(disposable);\n}", "function activate(context) {\n console.log('Extension \"Zenscript\" is now active!');\n}", "initExtension() {\n\t\treturn;\n\t}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"raiman-tools\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n context.subscriptions.push(vscode.commands.registerCommand('raiman264.fileCheckout', fileCheckout));\n context.subscriptions.push(vscode.commands.registerTextEditorCommand('raiman264.prettyJSON', prettyJSON));\n context.subscriptions.push(vscode.commands.registerTextEditorCommand('raiman264.prettyCurl', prettyCurl));\n}", "function activate() {\n\t\t}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"hello\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n var disposable = vscode.commands.registerCommand('hello.helloWorld', function () {\n // The code you place here will be executed every time your command is executed\n // Display a message box to the user\n vscode.window.showInformationMessage('Hello World from Hello!');\n });\n context.subscriptions.push(disposable);\n}", "function activate() {\n\n }", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"pokemon-code\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n var disposable = vscode.commands.registerCommand('extension.startPokemonCode', function () {\n // The code you place here will be executed every time your command is executed\n\n init_tallgrass();\n\n // Display a message box to the user\n vscode.window.showInformationMessage('Your Pokemon journey has begun!', {});\n\n });\n\n var disposable2 = vscode.commands.registerCommand('extension.showPokemon', function () {\n // The code you place here will be executed every time your command is executed\n\n show_pokemon();\n\n });\n\n var disposable3 = vscode.commands.registerCommand('extension.showInventory', function () {\n // The code you place here will be executed every time your command is executed\n\n show_inventory();\n\n });\n\n context.subscriptions.push(disposable);\n context.subscriptions.push(disposable2);\n context.subscriptions.push(disposable3);\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"logcat\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n var disposable = vscode.commands.registerCommand('logcat.startCapture', startCapture);\n context.subscriptions.push(disposable);\n\n var disposable1 = vscode.commands.registerCommand('logcat.endCapture', endCapture);\n context.subscriptions.push(disposable1);\n\n var disposable2 = vscode.commands.registerCommand('logcat.clear', clear);\n context.subscriptions.push(disposable2);\n\n}", "function activate(){\n\n\t\t}", "function activate() {\n\n\n }", "static activate() {\n \n }", "activate() {\n\n }", "activate() {\n }", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"test\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n var disposable = vscode.commands.registerCommand('extension.pickColor', function () {\n // The code you place here will be executed every time your command is executed\n\n // Open Native Color Picker\n nativeColorPickerExtension.pick();\n });\n\n context.subscriptions.push(disposable);\n}", "onFirstInstalled() {\n\n }", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n //console.log('Congratulations, your extension \"angular-service\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.insertService', () => {\n // The code you place here will be executed every time your command is executed\n insertService();\n // Display a message box to the user\n //vscode.window.showInformationMessage('Hello World!');\n });\n context.subscriptions.push(disposable);\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"ckb-autocomplete\" is now active!');\n\n vscode.workspace.onDidChangeTextDocument(onDidChangeTextDocument);\n}", "function activate(context) {\r\n // Performs Initialization\r\n InitAdamsTool();\r\n // Add to a list of disposables which are disposed when this extension is deactivated.\r\n context.subscriptions.push(adamsTool);\r\n //context.subscriptions.push(disposable);\r\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"dsave\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.saveMe', function () {\n // The code you place here will be executed every time your command is executed\n //workbench.action.files.save\n\n // Display a message box to the user\n //vscode.window.showInformationMessage('Hello World!');\n });\n\n var watcher = vscode.workspace.createFileSystemWatcher(\"**/*-meta.json\"); //glob search string\n watcher.ignoreChangeEvents = false;\n watcher.ignoreCreateEvents = true;\n watcher.ignoreDeleteEvents = true;\n \n watcher.onDidChange(function(event) {\n console.log(\"here: \\n\" + event);\n converter.toXml(event.path);\n vscode.window.showInformationMessage(\"ddod\");\n });\n\n context.subscriptions.push(disposable);\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Fingera UP');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n context.subscriptions.push(new FingeraStatusBarItem());\n\n}", "function activate(context) {\r\n // Use the console to output diagnostic information (console.log) and errors (console.error)\r\n // This line of code will only be executed once when your extension is activated\r\n console.log('Congratulations, your extension \"ctags\" is now active!');\r\n var extension = new Extension(context);\r\n // The command has been defined in the package.json file\r\n // Now provide the implementation of the command with registerCommand\r\n // The commandId parameter must match the command field in package.json\r\n // Options to control the language client\r\n /*let clientOptions: LanguageClientOptions = {\r\n // Register the server for C source codes\r\n documentSelector: ['C'],\r\n } */\r\n}", "function first() {\n console.log(\"my fist extension was called!\");\n vscode.window.showInformationMessage(\"my stormalf-term extension was called!\");\n}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"refactor-jsx\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand(\n 'extension.extractJsx',\n extractComponent\n );\n\n context.subscriptions.push(disposable);\n context.subscriptions.push(extractComponent);\n}", "function activate(context) {\r\n var relativePath = new RelativePath();\r\n // The command has been defined in the package.json file\r\n // Now provide the implementation of the command with registerCommand\r\n // The commandId parameter must match the command field in package.json\r\n var disposable = vscode_1.commands.registerCommand(\"extension.relativePath\", function () {\r\n // The code you place here will be executed every time your command is executed\r\n relativePath.findRelativePath();\r\n });\r\n context.subscriptions.push(relativePath);\r\n context.subscriptions.push(disposable);\r\n}", "activate() {}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error).\n // This line of code will only be executed once when your extension is activated.\n console.log('Congratulations, your extension \"WordCount\" is now active!');\n\n // create a new word counter\n let wordCounter = new WordCounter();\n\n let disposable = vscode.commands.registerCommand('extension.sayHello', () => {\n wordCounter.updateWordCount();\n });\n\n // Add to a list of disposables which are disposed when this extension is deactivated.\n context.subscriptions.push(wordCounter);\n context.subscriptions.push(disposable);\n}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"hwo\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {\n // The code you place here will be executed every time your command is executed\n // Display a message box to the user\n vscode.window.showInformationMessage('Hello World!');\n });\n context.subscriptions.push(disposable);\n let asdasd = vscode.commands.registerCommand('extension.bla', () => {\n // The code you place here will be executed every time your command is executed\n var _a, _b;\n // Display a message box to the user\n vscode.window.showInformationMessage('bla!');\n let frontPosition = new vscode.Position(0, 0);\n let line_one_text = (_a = vscode.window.activeTextEditor) === null || _a === void 0 ? void 0 : _a.document.lineAt(0).text;\n // console.log(vscode.window.activeTextEditor?.document.save());\n // let length_of_first_line = vscode.window.activeTextEditor?.document.lineAt(0).text.length;\n // if (length_of_first_line !== undefined) {\n // \tlet backPosition = new vscode.Position(0, length_of_first_line);\n // \tconsole.log(vscode.window.activeTextEditor?.selection);\n // \tvscode.window.activeTextEditor?.edit(editBuilder => {\n // \t\teditBuilder.insert(backPosition, \").\");\n // \t});\n // }\n (_b = vscode.window.activeTextEditor) === null || _b === void 0 ? void 0 : _b.edit(editBuilder => {\n var _a;\n if (line_one_text !== undefined) {\n let backPosition = new vscode.Position(0, line_one_text.length);\n editBuilder.delete(new vscode.Range(frontPosition, backPosition));\n editBuilder.insert(frontPosition, \"-module(\" + line_one_text + \").\\n-compile(export_all).\");\n (_a = vscode.window.activeTextEditor) === null || _a === void 0 ? void 0 : _a.document.save();\n }\n // editBuilder.replace(frontPosition, \"-module(\" + line_one_text + \").\");\n });\n });\n context.subscriptions.push(asdasd);\n}", "OnActivated() {}", "function activate() {\n _registerLoadQuestionModuleHandler();\n _registerChooseAnswerHandler();\n _registerMakeDecisionHandler();\n }", "function activate() {\n _registerLoadQuestionModuleHandler();\n _registerChooseAnswerHandler();\n _registerMakeDecisionHandler();\n }", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"hellowd\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.sayHello', () => {\n // The code you place here will be executed every time your command is executed\n // Display a message box to the user\n vscode.window.showInformationMessage('Hello World!');\n });\n context.subscriptions.push(disposable);\n let sayName = vscode.commands.registerCommand('extension.sayName', () => {\n vscode.window.showInformationMessage(\"my name is zhujinshan\");\n });\n context.subscriptions.push(sayName);\n // 统计字符个数\n let wordCounter = new WordCounter();\n let controller = new WordCounterController(wordCounter);\n let countWord = vscode.commands.registerCommand('extension.countWord', () => {\n vscode.window.showInformationMessage(\"my name is zhujinshan\");\n wordCounter.updateWordCount();\n });\n context.subscriptions.push(countWord);\n context.subscriptions.push(controller);\n context.subscriptions.push(wordCounter);\n // 创建自定义输出\n let log = vscode.window.createOutputChannel(\"hellowdlog\");\n log.show();\n log.append(\"this is test log out ---- \\n\");\n // 创建终端\n let ternimal = vscode.window.createTerminal(\"hellowd\");\n ternimal.show();\n ternimal.sendText(\"cmd\");\n // 创建状态栏按钮\n let btn = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 7);\n btn.command = \"extension.sayName\"; //与package.json相同\n btn.text = \"$(bug)按钮\";\n btn.tooltip = \"this is btn tips\";\n btn.show();\n // 创建选项列表\n // let items: vscode.QuickPickItem[] = [];\n // items.push({label: \"item111\", description: \"The item 111\"});\n // items.push({label: \"item222\", description: \"The item 222\"});\n // let chose: vscode.QuickPickItem | undefined = vscode.window.showQuickPick(items);\n // if (chose) {\n // btn.text = chose.label;\n // }\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"vscode-plugin-seek\" is now active!');\n\n const os = require('os');\n const createServer = require('./lib/service-bridge/server');\n const driver = require('./lib/driver');\n const spawnElectron = require('./lib/spawnElectron');\n const tmpdir = os.tmpdir();\n const sockPath = `unix://${tmpdir}/seek.sock`;\n\n const currDir = vscode.workspace.rootPath;\n\n createServer(driver, {\n path: sockPath\n });\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n\n const seekAdd = vscode.commands.registerCommand('extension.seekAdd', function () {\n const statusBar = vscode.window.setStatusBarMessage('$(watch)\\t 正在启动添加场景界面...');\n setTimeout(function () {\n statusBar.dispose();\n }, 3000);\n electronProcess = spawnElectron({\n appPath: path.join(__dirname, 'app'),\n sockPath,\n envParams: {\n ELECTRON_CURR_VIEW: 'add',\n ELECTRON_CURR_DIR: currDir\n }\n // others options in the future\n });\n })\n\n context.subscriptions.push(seekAdd);\n}", "activate() {\n\n\t\tthis.arbitrate();\n\n\t}", "function activate(context) {\n\n // Register commands.\n var commandFilesPath = path.join(context.extensionPath, 'commands');\n fs.readdir(commandFilesPath, (err, files) => {\n files.forEach((file) => {\n context.subscriptions.push(\n require('./commands/' + path.basename(file, '.js')).createCommand()\n );\n console.log(path.basename(file, '.js') + ' command added');\n });\n });\n\n ensureDependenciesAreInstalled();\n}", "function activate(context) {\n\n context.subscriptions.push(vscode.commands.registerCommand('extension.switch', switchToOther));\n\n}", "function startExtension() {\n\t\tboolean receiverConfirmed = false;\n\n\t\tif (!receiverConfirmed) {\n\t\t\t//sends auto message to see if other person has extension.\n\t\t\tinsertToTextField(firstString);\n\n\t\t\t//sends Key\n\t\t\tinsertToTextField(publicKeyString);\n\n\n\n\t\t}\n\n\t\telse \n\t\t\tinsertToTextField(publicKeyString);\n\t}", "function startup() {\n toggleOptions();\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"vscode-vue-ui\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.openVueUI', function () {\n exec('vue ui', (error, stdout, stderr) => {\n console.log(error)\n console.log(stdout)\n console.log(stderr)\n })\n });\n\n context.subscriptions.push(disposable);\n}", "function activate() {\n getBreweries();\n }", "activate() {\n super.activate();\n this.interactive = true;\n }", "function activate() {\n\t\t\tconsole.log('Activated Chess View');\n\t\t\t\n\t\t}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"apicontroller\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.apicontroller', () => {\n // The code you place here will be executed every time your command is executed\n vscode.window.showInputBox({ ignoreFocusOut: true, prompt: 'Digite o nome da classe de modelo', value: 'new' + +'.cs' })\n .then((newfilename) => {\n if (typeof newfilename === 'undefined') {\n return;\n }\n if (!newfilename.endsWith('.cs')) {\n newfilename += '.cs';\n }\n var newfilepath = './' + newfilename;\n openTemplateAndSaveNewFile(newfilename.replace('.cs', ''));\n });\n // Display a message box to the user\n });\n context.subscriptions.push(disposable);\n}", "function handleStartup() { //Read from local storage\r\n restoreOptions();\r\n enableGoogle();\r\n enableWikipedia();\r\n enableBing();\r\n enableDuckDuckGo();\r\n enableYahoo();\r\n enableBaidu();\r\n enableYoutube();\r\n enableWolframAlpha();\r\n enableYandex();\r\n enableReddit();\r\n enableImdb();\r\n enableDictionarydotcom();\r\n enableThesaurusdotcom();\r\n enableStackOverflow();\r\n enableGitHub();\r\n enableAmazon();\r\n enableEbay();\r\n enableTwitter();\r\n console.log('Twitter enabled on startup');\r\n enableFacebookPeopleSearch();\r\n}", "function activate(context) {\n get();\n updateTimer();\n // 命令\n // 同步\n const sync = vscode.commands.registerCommand(\"emp-sync-base.syncCommand\", () => {\n get();\n });\n context.subscriptions.push(sync);\n // 初始化项目\n const init = vscode.commands.registerCommand(\"emp-sync-base.initCommand\", () => {\n initProject();\n });\n context.subscriptions.push(init);\n const syncStatusBarItem = initBarButton();\n context.subscriptions.push(syncStatusBarItem);\n}", "activate() {\n this.active = true;\n }", "function activated() {\n if ('konamiOnce' in attr) {\n stopListening();\n }\n // Execute expression.\n scope.$eval(attr.konamiCode);\n }", "function activate() {\n\t\t\twarnings.refreshData().then(function() {\n\t\t\t\tvm.warnings = warnings.getWarnings();\n\t\t\t});\n\t\t}", "start() {\r\n // Add your logic here to be invoked when the application is started\r\n }", "preStart() {\n }", "function setupInitial() {\n\tchrome.storage.local.get({enableNotifications:false},function(obj){\n\t\tenableNotifications = obj.enableNotifications;\n\t});\n\n\tchrome.storage.local.get({\n\t\tdisabled: false\n\t}, function (obj) {\n\t\tif (!obj.disabled) {\n\t\t\tsetUpQuoListener();\n\t\t} else {\n\t\t\tlog('Quoor is disabled');\n\t\t}\n\t});\n}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"dota2_eom_plugin\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n SkinToolInit();\n var SetData = new Array;\n var HeroData = new Array;\n function PrefixInteger(num, length) {\n return (Array(length).join('0') + num).slice(-length);\n }\n function FindWithHeroName(heroname) {\n SetData.forEach(element => {\n if (heroname === element.data.heroname) {\n }\n });\n }\n // 获得Creature字符\n function GetSkinId(setData, defaultData) {\n var Creature = '\\t\\t\\t\"AttachWearables\" // ' + setData.chinese_name + '\\n\\t\\t\\t{\\n';\n for (let i = 0; i < defaultData.AttachWearables.length; i++) {\n const defaultElement = defaultData.AttachWearables[i];\n var ItemDef = defaultElement.ItemDef;\n var item_desc = defaultElement.item_desc;\n for (let j = 0; j < setData.AttachWearables.length; j++) {\n const element = setData.AttachWearables[j];\n if (element.item_type_name === defaultElement.item_type_name && element.item_slot === defaultElement.item_slot) {\n ItemDef = element.ItemDef;\n item_desc = element.item_desc;\n }\n }\n var lineText = new String('\\t\\t\\t\\t\"' + defaultElement.ID + '\" { \"ItemDef\" \"' + ItemDef + '\" } // ' + item_desc + '\\n');\n Creature += lineText;\n }\n Creature += '\\t\\t\\t}';\n return Creature;\n }\n // 根据套装英文名获取数据\n function FindSetDataWithEnglishName(english_name) {\n for (let i = 0; i < SetData.length; i++) {\n const element = SetData[i];\n if (english_name === element.data.english_name) {\n return element.data;\n }\n }\n }\n // 获取英雄数据\n function FindHeroDataWithHeroName(heroname) {\n for (let i = 0; i < HeroData.length; i++) {\n const element = HeroData[i];\n if (heroname === element.data.heroname) {\n return element.data;\n }\n }\n }\n // 获取英雄默认套装\n function FindHeroDefaultSet(heroname) {\n for (let i = 0; i < SetData.length; i++) {\n const set = SetData[i];\n if (set.data.heroname === heroname && set.data.set_name === 'Default ' + heroname) {\n return set.data;\n }\n }\n }\n // 生成skin文件\n function GenerateSkinKV() {\n const skinExcelUri = vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/design/4.kv配置表/npc_heroes_tower_skin.xlsx';\n const heroKVUri = vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/game/dota_td/scripts/npc/kv/npc_heroes_tower.kv');\n const heroSkinKVUri = vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/game/dota_td/scripts/npc/kv/npc_heroes_tower_skin.kv';\n // 打开excel\n var sheetList = node_xlsx_1.default.parse(skinExcelUri);\n var exceldata = sheetList[0].data;\n var outputData = '\"npc_heroes_tower_skin\"\\n{\\n\\t// 主键\\n';\n vscode.workspace.openTextDocument(heroKVUri).then(function (document) {\n return __awaiter(this, void 0, void 0, function* () {\n for (let j = 2; j < exceldata.length; j++) {\n const element = exceldata[j];\n for (let line = 0; line < document.lineCount; line++) {\n var lineText = document.lineAt(line).text;\n // 当找到英雄名字开始行\n var heroLeft = 0;\n var heroRight = 0;\n if (lineText.search(element[6]) !== -1) {\n outputData += '\\t\"' + element[0] + '\"\\n';\n var AttachWearables = false;\n var leftBrackets = 0;\n var rightBrackets = 0;\n for (let index = line + 1; index < document.lineCount; index++) {\n var text = document.lineAt(index).text;\n var heroLeftArr = text.match('{');\n if (heroLeftArr !== null) {\n heroLeft += heroLeftArr.length;\n }\n var heroRightArr = text.match('}');\n if (heroRightArr !== null) {\n heroRight += heroRightArr.length;\n }\n if (heroLeft !== 0 && heroLeft === heroRight) {\n heroLeft = 0;\n heroRight = 0;\n outputData += '\\t}\\n';\n break;\n }\n if (element[1] !== undefined && text.search('\"Model\"') !== -1) {\n outputData += text.replace(text.split('\"')[3], element[1]) + '\\n';\n continue;\n }\n if (element[2] !== undefined && text.search('\"ModelScale\"') !== -1) {\n outputData += text.replace(text.split('\"')[3], element[2]) + '\\n';\n continue;\n }\n if (element[4] !== undefined && text.search('\"HealthBarOffset\"') !== -1) {\n outputData += text.replace(text.split('\"')[3], element[4]) + '\\n';\n continue;\n }\n if (element[5] !== undefined && text.search('\"ProjectileModel\"') !== -1) {\n outputData += text.replace(text.split('\"')[3], element[5]) + '\\n';\n continue;\n }\n if (text.search('\"GhostModelUnitName\"') !== -1) {\n outputData += text + '\\n';\n if (element[3] !== undefined) {\n outputData += '\\t\\t// 皮肤\\n\\t\\t\"Skin\"\\t\"' + element[3] + '\"\\n';\n }\n outputData += '\\t\\t// 继承属性单位\\n\\t\\t\"OverrideUnitName\"\\t\"' + element[6] + '\"\\n';\n continue;\n }\n if (element[8] !== undefined && text.search('\"AttachWearables\"') !== -1) {\n outputData += element[8] + '\\n';\n AttachWearables = true;\n continue;\n }\n if (AttachWearables === false) {\n outputData += text + '\\n';\n }\n else {\n var leftBracketsArr = text.match('{');\n if (leftBracketsArr !== null) {\n leftBrackets += leftBracketsArr.length;\n }\n var rightBracketsArr = text.match('}');\n if (rightBracketsArr !== null) {\n rightBrackets += rightBracketsArr.length;\n }\n if (leftBrackets !== 0 && leftBrackets === rightBrackets) {\n AttachWearables = false;\n leftBrackets = 0;\n rightBrackets = 0;\n }\n }\n }\n break;\n }\n else {\n // outputData += lineText;\n }\n }\n }\n outputData += '}';\n fs.writeFileSync(heroSkinKVUri, outputData);\n vscode.window.setStatusBarMessage('生成完毕..');\n });\n });\n }\n function SkinToolInit() {\n if (vscode.workspace.getConfiguration().has('Dota2EomPlugin.text_url') && vscode.workspace.getConfiguration().has('Dota2EomPlugin.addon_path')) {\n var uri = vscode.workspace.getConfiguration().get('Dota2EomPlugin.text_url') + '/items_info.json';\n fs.readFile(uri, 'utf-8', function (err, data) {\n if (err) {\n InitJson();\n }\n SetData = JSON.parse(data);\n ReadHeroData();\n // 监听npc_heroes_tower_skin.xlsx变化事件\n var fileSystemWatcher = vscode.workspace.createFileSystemWatcher('**/design/4.kv配置表/npc_heroes_tower_skin.xlsx', true, false, true);\n fileSystemWatcher.onDidChange(function (uri) {\n GenerateSkinKV();\n });\n });\n }\n }\n function ReadHeroData() {\n const npc_heroes_tower_uri = vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/game/dota_td/scripts/npc/kv/npc_heroes_tower.kv');\n const npc_heroes_tower_skin_uri = vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/game/dota_td/scripts/npc/kv/npc_heroes_tower_skin.kv');\n // 预载入每个英雄的数据与skin\n vscode.workspace.openTextDocument(npc_heroes_tower_uri).then(function (document) {\n var heroData = { heroname: '', Name: '', Model: '', ModelScale: '', skins: new Array };\n var flagHero = false;\n var leftBrackets = 0; // 记录{数量\n var rightBrackets = 0; // 记录}数量\n function InitSetData() {\n heroData.heroname = '';\n heroData.Name = '';\n heroData.Model = '';\n heroData.ModelScale = '';\n heroData.skins = new Array;\n }\n for (let line = 0; line < document.lineCount; line++) {\n const lineText = document.lineAt(line).text;\n if (lineText.search(/npc_dota_hero_.*_custom/) !== -1 && flagHero === false) {\n heroData.heroname = lineText.split('\"')[1];\n flagHero = true;\n continue;\n }\n // 记录区块\n if (flagHero === true) {\n var leftBracketsArr = lineText.match('{');\n if (leftBracketsArr !== null) {\n leftBrackets += leftBracketsArr.length;\n }\n var rightBracketsArr = lineText.match('}');\n if (rightBracketsArr !== null) {\n rightBrackets += rightBracketsArr.length;\n }\n if (leftBrackets !== 0 && leftBrackets === rightBrackets) {\n flagHero = false; // 结束一个套装区块\n let data = {};\n Object.assign(data, heroData);\n HeroData.push({ data });\n InitSetData();\n }\n if (lineText.split('\"')[1] === 'Name') {\n heroData.Name = lineText.split('\"')[3];\n }\n if (lineText.split('\"')[1] === 'Model') {\n heroData.Model = lineText.split('\"')[3];\n }\n if (lineText.split('\"')[1] === 'ModelScale') {\n heroData.ModelScale = lineText.split('\"')[3];\n }\n }\n //\n }\n }).then(function () {\n vscode.workspace.openTextDocument(npc_heroes_tower_skin_uri).then(function (document) {\n for (let line = 0; line < document.lineCount; line++) {\n const lineText = document.lineAt(line).text;\n if (lineText.search(/npc_dota_hero_.*_skin_../) !== -1) {\n const skinName = lineText.split('\"')[1];\n const heroname = skinName.split('skin')[0] + 'custom';\n for (let i = 0; i < HeroData.length; i++) {\n const element = HeroData[i];\n if (element.data.heroname === heroname) {\n element.data.skins.push(skinName);\n break;\n }\n }\n }\n }\n });\n });\n }\n function InitJson() {\n const addon_path = vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path');\n vscode.workspace.openTextDocument(vscode.Uri.file(addon_path + '/game/dota_td/scripts/AttachWearables.txt')).then(function (document) {\n vscode.window.setStatusBarMessage('读取套装..');\n ReadAttachWearables(document);\n }).then(function () {\n vscode.workspace.openTextDocument(vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.text_url') + '/items_english.txt')).then(function (document) {\n vscode.window.setStatusBarMessage('读取英文..');\n ReadEnglish(document);\n }).then(function () {\n vscode.window.setStatusBarMessage('读取中文..');\n vscode.workspace.openTextDocument(vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.text_url') + '/items_schinese.txt')).then(function (document) {\n ReadChinese(document);\n }).then(function () {\n vscode.window.setStatusBarMessage('读取装备类型..');\n vscode.workspace.openTextDocument(vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.text_url') + '/items_game.txt')).then(function (document) {\n ReadSoltType(document);\n WriteJson();\n vscode.window.setStatusBarMessage('读取完毕');\n SkinToolInit();\n });\n });\n });\n });\n function ReadAttachWearables(document) {\n var setData = { heroname: '', set_name: '', localize_name: '', english_name: '', chinese_name: '', AttachWearables: new Array, };\n var flagSets = false; // 是否进入一个套装区块\n var leftBrackets = 0; // 记录{数量\n var rightBrackets = 0; // 记录}数量\n // 充值套装数据\n function InitSetData() {\n setData.set_name = '';\n setData.english_name = '';\n setData.chinese_name = '';\n // setData.skin_id = '';\n setData.AttachWearables = new Array;\n }\n for (let line = 1; line < document.lineCount; line++) {\n var lineText = document.lineAt(line).text;\n // 查找到一个新英雄\n if (lineText.search('Cosmetic Sets for ') !== -1) {\n setData.heroname = lineText.split('Cosmetic Sets for ')[1]; // 记录英雄名字\n continue;\n }\n if (lineText.search('AttachWearables') !== -1 && flagSets === false) {\n flagSets = true; // 进入一个套装区块\n InitSetData();\n setData.set_name = lineText.split(' // ')[1]; // 记录套装名字\n // setData.skin_id += lineText;\n continue;\n }\n if (flagSets === true) {\n // setData.skin_id = setData.skin_id + '\\n' + lineText;\n var leftBracketsArr = lineText.match('{');\n if (leftBracketsArr !== null) {\n leftBrackets += leftBracketsArr.length;\n }\n var rightBracketsArr = lineText.match('}');\n if (rightBracketsArr !== null) {\n rightBrackets += rightBracketsArr.length;\n }\n if (leftBrackets !== 0 && leftBrackets === rightBrackets) {\n flagSets = false; // 结束一个套装区块\n let data = {};\n Object.assign(data, setData);\n SetData.push({ data });\n continue;\n }\n if (lineText.search('ItemDef') !== -1) {\n var ItemDef = {\n ID: lineText.split('\"')[1],\n ItemDef: lineText.split('\"')[5],\n item_type_name: '',\n item_slot: '',\n item_desc: lineText.split(' // ')[1],\n };\n setData.AttachWearables.push(ItemDef); // 记录套装数据\n continue;\n }\n }\n }\n }\n function ReadEnglish(document) {\n SetData.forEach(element => {\n if (element.data.set_name === 'Default ' + element.data.heroname) {\n element.data.english_name = 'Default ' + element.data.heroname;\n }\n else {\n for (let line = 0; line < document.lineCount; line++) {\n var lineText = document.lineAt(line).text;\n if (lineText.split('\"')[3] === element.data.set_name) {\n element.data.english_name = lineText.split('\"')[3];\n element.data.localize_name = lineText.split('\"')[1];\n break;\n }\n }\n }\n });\n }\n function ReadChinese(document) {\n SetData.forEach(element => {\n if (element.data.set_name === 'Default ' + element.data.heroname) {\n element.data.chinese_name = '默认套装';\n }\n else {\n for (let line = 0; line < document.lineCount; line++) {\n var lineText = document.lineAt(line).text;\n if (lineText.search(element.data.localize_name) !== -1) {\n element.data.chinese_name = lineText.split('\"')[3];\n break;\n }\n }\n }\n });\n }\n function ReadSoltType(document) {\n var start = false;\n var end = false;\n var flagSets = false; // 是否进入一个套装区块\n var skipSets = false; // 跳过一个套装区块\n var wearable = false; // 是否可装备\n var itemsArr = new Array;\n var setData = { id: '', item_type_name: '', item_slot: '' };\n for (let line = 0; line < document.lineCount; line++) {\n var lineText = document.getText(new vscode.Range(new vscode.Position(line, 0), new vscode.Position(line, 100)));\n // let lineText = document.lineAt(line).text;\n // 进入物品区块\n if (lineText.search('\"items\"') !== -1 && start === false) {\n start = true;\n continue;\n }\n // 寻找到套装ID\n if (start === true && lineText.split('\"').length === 3 && lineText.search(/[1-9][0-9]*/) === 3) {\n if (flagSets === true) {\n if (skipSets === false) {\n let data = {};\n Object.assign(data, setData);\n itemsArr.push(data);\n }\n setData.id = lineText.split('\"')[1];\n setData.item_type_name = '';\n setData.item_slot = '';\n }\n else {\n flagSets = true;\n setData.id = lineText.split('\"')[1];\n }\n }\n // 寻找到套装ID下的信息判断是否是装备\n if (flagSets === true && lineText.split('\"')[1] === 'prefab') {\n if (lineText.split('\"')[3] === 'wearable' || lineText.split('\"')[3] === 'default_item') {\n wearable = true;\n skipSets = false;\n }\n else {\n wearable = false;\n skipSets = true;\n }\n }\n // 寻找到套装ID下的装备信息\n if (flagSets === true && skipSets === false && wearable === true && lineText.search('\"item_type_name\"') !== -1) {\n setData.item_type_name = lineText.split('\"')[3];\n }\n // 寻找到套装ID下的装备信息\n if (flagSets === true && skipSets === false && wearable === true && lineText.search('\"item_slot\"') !== -1) {\n setData.item_slot = lineText.split('\"')[3];\n }\n // 结束物品区块\n if (lineText.search('\"item_sets\"') !== -1 && end === false) {\n end = true;\n break;\n }\n }\n SetData.forEach(element => {\n for (let i = 0; i < element.data.AttachWearables.length; i++) {\n const itemData = element.data.AttachWearables[i];\n for (let index = 0; index < itemsArr.length; index++) {\n const obj = itemsArr[index];\n if (obj.id === itemData.ItemDef) {\n itemData.item_type_name = obj.item_type_name;\n itemData.item_slot = obj.item_slot;\n break;\n }\n }\n }\n });\n }\n function WriteJson() {\n var uri = vscode.workspace.getConfiguration().get('Dota2EomPlugin.text_url') + '/items_info.json';\n fs.writeFile(uri, JSON.stringify(SetData), function () { });\n }\n }\n let SkinTool = vscode.commands.registerCommand('extension.SkinTool', () => {\n if (SetData.length > 0) {\n const quickPick = vscode.window.createQuickPick();\n quickPick.canSelectMany = false;\n quickPick.ignoreFocusOut = true;\n // quickPick.step = 1;\n // quickPick.totalSteps = 3;\n quickPick.placeholder = '皮肤名字';\n quickPick.title = '输入皮肤名字';\n // 添加选项\n var items = new Array;\n SetData.forEach(element => {\n if (element.data.set_name.search('Default') === -1) {\n items.push({\n label: element.data.english_name,\n description: element.data.chinese_name,\n });\n }\n });\n quickPick.items = items;\n quickPick.show();\n // 选择选项\n quickPick.onDidChangeSelection((t) => {\n quickPick.value = t[0].label;\n // 打开excel\n var xlsxName = vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/design/4.kv配置表/npc_heroes_tower_skin.xlsx';\n var sheetList = node_xlsx_1.default.parse(xlsxName);\n var exceldata = sheetList[0].data;\n // 修改excel\n const setData = FindSetDataWithEnglishName(t[0].label);\n const heroData = FindHeroDataWithHeroName(setData.heroname + '_custom');\n const defaultSetData = FindHeroDefaultSet(setData.heroname);\n const SkinName = setData.heroname + '_skin_' + '0' + String(heroData.skins.length + 1);\n const Model = heroData.Model;\n const ModelScale = heroData.ModelScale;\n const Skin = null;\n const HealthBarOffset = null;\n const ProjectileModel = null;\n const OverrideUnitName = setData.heroname + '_custom';\n const Name = heroData.Name;\n const Creature = GetSkinId(setData, defaultSetData);\n const SetName = setData.chinese_name;\n var newData = [SkinName, Model, ModelScale, Skin, HealthBarOffset, ProjectileModel, OverrideUnitName, Name, Creature, null, SetName];\n exceldata.push(newData);\n const options = { '!cols': [{ wch: 40 }, { wch: 50 }, { wch: 10 }, { wch: 6 }, { wch: 20 }, { wch: 20 }, { wch: 40 }, { wch: 12 }, { wch: 40 }, { wch: 6 }, { wch: 30 }] };\n var buffer = node_xlsx_1.default.build([{ name: \"Sheet1\", data: exceldata }], options);\n fs.writeFileSync(xlsxName, buffer);\n // 写入商品配置表\n vscode.workspace.openTextDocument(vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/design/6.商业化设计/1.商品配置表/items.csv')).then(function (document) {\n return __awaiter(this, void 0, void 0, function* () {\n var avatarStarLine = 0;\n var avatarEndLine = 0;\n for (let line = 0; line < document.lineCount; line++) {\n var lineText = document.lineAt(line).text;\n if (lineText.search(setData.heroname + '_skin_' + '0' + heroData.skins.length) !== -1) {\n avatarEndLine = line + 1;\n break;\n }\n if (lineText.search('avatar') !== -1 && avatarStarLine === 0) {\n avatarStarLine = line;\n continue;\n }\n if (lineText.search('avatar') === -1 && avatarStarLine !== 0) {\n avatarEndLine = line;\n break;\n }\n }\n var textEditor = vscode.window.showTextDocument(vscode.Uri.file(vscode.workspace.getConfiguration().get('Dota2EomPlugin.addon_path') + '/design/6.商业化设计/1.商品配置表/items.csv'));\n (yield textEditor).edit(function (editBuilder) {\n editBuilder.insert(new vscode.Position(avatarEndLine, 0), SkinName + ',avatar,' + SetName + ',,,1,TRUE,,,\\n');\n });\n });\n });\n quickPick.hide();\n });\n }\n });\n context.subscriptions.push(SkinTool);\n}", "start() {\n // Add your logic here to be invoked when the application is started\n }", "function activate(context) {\n var svc = new RequestService();\n let disposable = vscode_1.commands.registerCommand('extension.getQaToken', () => {\n svc.getAuthorizationToken(false);\n });\n let dispose = vscode_1.commands.registerCommand('extension.getDevToken', () => {\n svc.getAuthorizationToken(true);\n });\n context.subscriptions.push(disposable);\n context.subscriptions.push(dispose);\n}", "function listenStartup() {\n\tchrome.runtime.onStartup.addListener(function () {\n\t\tupdateBadge();\n\t});\n}", "function activate (context) {\n var disposableLocal = vscode.commands.registerCommand('viewReadme.markdown', function () {\n local();\n });\n\n // var disposableRemote = vscode.commands.registerCommand('viewReadme.showRemote', function () {\n // vscode.window.showInputBox({\n // prompt: INPUT_PROMPT\n // }).then(function (moduleName) {\n // new Remote(moduleName);\n // });\n // });\n\n context.subscriptions.push(disposableLocal);\n // context.subscriptions.push(disposableRemote);\n}", "init(){\n\t\tthis._active = true\n\t}", "function updateExtension(){\n ScratchExtensions.unregister('scratch3d');\n ScratchExtensions.register('scratch3d', descriptor, ext);\n }", "function detectFirstRun()\n{\n firstRun = filterStorage.filterStorage.getSubscriptionCount() == 0;\n\n if (firstRun && (!filterStorage.filterStorage.firstRun || prefs.Prefs.currentVersion))\n reinitialized = true;\n\n prefs.Prefs.currentVersion = info_chrome_js.addonVersion;\n}", "_initExtensions() {\n //\tInvoke \"before\" hook.\n this.trigger('initExtensions:before');\n //\tConvert array to object with array.\n if (type(this.opts.extensions) == 'array') {\n this.opts.extensions = {\n all: this.opts.extensions\n };\n }\n //\tLoop over object.\n for (let query in this.opts.extensions) {\n if (this.opts.extensions[query].length) {\n let classnames = this.opts.extensions[query].map(query => 'mm-menu_' + query);\n media.add(query, () => {\n this.node.menu.classList.add(...classnames);\n }, () => {\n this.node.menu.classList.remove(...classnames);\n });\n }\n }\n //\tInvoke \"after\" hook.\n this.trigger('initExtensions:after');\n }", "function activate(context) {\r\n currentState = Promise.resolve({ context, state: null });\r\n context.subscriptions.push(vscode.commands.registerCommand(TOGGLE_COMMAND, toggleAutoAttachSetting.bind(null, context)));\r\n context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => {\r\n // Whenever a setting is changed, disable auto attach, and re-enable\r\n // it (if necessary) to refresh variables.\r\n if (e.affectsConfiguration(`${SETTING_SECTION}.${SETTING_STATE}`) ||\r\n [...SETTINGS_CAUSE_REFRESH].some(setting => e.affectsConfiguration(setting))) {\r\n updateAutoAttach(\"disabled\" /* Disabled */);\r\n updateAutoAttach(readCurrentState());\r\n }\r\n }));\r\n updateAutoAttach(readCurrentState());\r\n}", "function activate(context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"mock-data-generator\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.generateMock', function () {\n // The code you place here will be executed every time your command is executed\n\n // Display a message box to the user\n let editor = vscode.window.activeTextEditor;\n if (editor === undefined) {\n vscode.window.showInformationMessage('Please open a Json file with schema to generate mock data')\n } else {\n\n // getting number of mock data records to be generated\n vscode.window.showInputBox({\n placeHolder: ' Enter the number of mock records to be generated'\n })\n .then(mockCount => {\n if (mockCount !== undefined && parseInt(mockCount) > 0) {\n let document = editor.document;\n // vscode.window.showInformationMessage(document.getText());\n\n try {\n const schema = JSON.parse(document.getText())\n\n // Getting the first line, last line to replace text\n const lastLine = document.lineAt(document.lineCount - 2);\n const start = new vscode.Position(0, 0);\n const end = new vscode.Position(document.lineCount - 1, lastLine.text.length);\n\n editor.edit(builder => {\n\n const mockData = JSON.stringify(generateMockData(schema, parseInt(mockCount)), null, 2)\n\n // Replacing text of the current document with new mock data\n builder.replace(new vscode.Range(start, end), mockData);\n })\n\n } catch (e) {\n vscode.window.showInformationMessage(' Please make sure it is a Json to generate mock data')\n }\n\n } else {\n vscode.window.showInformationMessage('Please enter valid count greater than 0')\n }\n })\n\n }\n\n });\n\n context.subscriptions.push(disposable);\n}", "function activate() {\n get_product_details();\n }", "function initHybugger() {\n\t\treplaceConsole();\n\t\tsendToDebugService('GlobalInitHybugger', { \n });\n\t}", "function activate (context) {\n\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"tinycarecode\" is now active!');\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n const config = vscode.workspace.getConfiguration('tcc');\n let statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);\n \n let T;\n if (config.consumer_key && config.consumer_secret && config.access_token && config.access_token_secret) {\n T = new Twit({\n consumer_key: config.consumer_key,\n consumer_secret: config.consumer_secret,\n access_token: config.access_token,\n access_token_secret: config.access_token_secret,\n });\n statusBar.text = '🤗💖: please take care';\n statusBar.show();\n } else {\n vscode.window.showErrorMessage('tinycarecode: set up the Twitter API keys in your settings and refresh!');\n }\n\n let params = {\n screen_name: 'tinycarebot',\n exclude_replies: true,\n include_rts: false,\n count: 1\n }\n\n let tinyCare = {\n getTweet: function () {\n return new Promise(function (resolve, reject) {\n T.get('statuses/user_timeline', params, function (err, data) {\n if (err) {\n console.log(err);\n reject('⚠️: error getting tweet!');\n } else {\n resolve(data[0].text);\n }\n });\n });\n },\n sendAlert: function (status) {\n vscode.window.showInformationMessage(status);\n },\n updateStatusBar: function (status) {\n statusBar.text = status;\n statusBar.show();\n }\n }\n\n setInterval(function () {\n tinyCare.getTweet().then(function (status) {\n tinyCare.sendAlert(status);\n tinyCare.updateStatusBar(status);\n });\n }, config.refresh_after * 60 * 1000);\n\n context.subscriptions.push(config);\n context.subscriptions.push(statusBar);\n context.subscriptions.push(T);\n context.subscriptions.push(params);\n context.subscriptions.push(tinyCare);\n}", "function onInit() {}", "function activate(context) {\n let disposable = vscode.commands.registerCommand('extension.sayHello', () => __awaiter(this, void 0, void 0, function* () {\n // The code you place here will be executed every time your command is executed\n config = JSON.parse(fs.readFileSync(__dirname + '/config.json', 'utf-8').toString());\n let pName = config.userName || '';\n let user_name = yield vscode.window.showInputBox({ value: pName });\n if (pName == user_name || user_name == null || user_name == undefined) {\n }\n else {\n config.userName = user_name;\n fs.writeFileSync(__dirname + '/config.json', JSON.stringify(config), 'utf8');\n vscode.window.showInformationMessage('用户名更改成功');\n setTimeout(() => {\n // 关闭弹出框\n vscode.commands.executeCommand(\"workbench.action.closeMessages\");\n }, 800);\n }\n }));\n // 统计字数\n let count = vscode.commands.registerCommand('count', () => {\n let editor = vscode.window.activeTextEditor;\n if (!editor) {\n return;\n }\n ;\n var selection = editor.selection;\n var text = editor.document.getText(selection);\n // Display a message box to the user\n vscode.window.showInformationMessage('Selected characters: ' + text.length);\n });\n // 记录文件保存信息\n let saveInfo = vscode.commands.registerCommand('writeLog', () => {\n // 执行文件保存命令\n vscode.commands.executeCommand(\"workbench.action.files.save\");\n /**\n * 判断文件类型,判断是否是js 文件\n * 1. 得到文件名字,判断后缀,\n * 2. 如果是js 文件,判断 首行是否有注释,没有则插入,有则修改\n */\n let fN = dm.fileName;\n if (JsType.exec(fN)) {\n // 判断是否有注释\n let _exit = 0;\n let f_info = {\n user_name: config.userName,\n create_time: format(new Date()),\n last_modify: config.userName,\n modify_time: format(new Date()),\n line_count: dm.lineCount\n };\n for (let i = 0; i < dm.lineCount; i++) {\n let lineText = dm.lineAt(i);\n if (lineText.text == '/***') {\n let wse = new vscode.WorkspaceEdit();\n wse.replace(dm.uri, new vscode.Range(i + 3, 0, i + 8, 0), getFileInfo(wlog.slice(3, wlog.length), f_info));\n wp.applyEdit(wse);\n _exit = 1;\n break;\n }\n ;\n }\n if (_exit === 0) {\n let wse = new vscode.WorkspaceEdit();\n wse.insert(dm.uri, new vscode.Position(0, 0), getFileInfo(wlog, f_info));\n wp.applyEdit(wse);\n }\n }\n else {\n }\n });\n context.subscriptions.push(disposable);\n context.subscriptions.push(saveInfo);\n context.subscriptions.push(count);\n}", "function onInstall() {\n onOpen();\n}", "function onInstall() {\n onOpen();\n}", "function onInstall() {\n onOpen();\n}", "activate(state) {\n this.upgrade_settings();\n\n this.subscriptions = new CompositeDisposable();\n\n // register format command\n this.subscriptions.add(\n atom.commands.add(\"atom-workspace\", {\n \"atom-elixir-formatter:format\": () => formatter.formatActiveTextEditor()\n })\n );\n\n // register to receive text editor events\n this.subscriptions.add(\n atom.workspace.observeTextEditors(e => this.handleTextEvents(e))\n );\n }", "function activate(context) {\n\n EnableZenkaku();\n\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n var disposable1 = vscode.commands.registerCommand('extension.enableZenkaku', () => EnableZenkaku());\n\n function EnableZenkaku() {\n var activeEditor = vscode.window.activeTextEditor;\n if (activeEditor) {\n enabled = true;\n triggerUpdate();\n }\n\n vscode.window.onDidChangeActiveTextEditor(editor => {\n activeEditor = editor;\n if (editor) {\n triggerUpdate();\n }\n }, null, context.subscriptions);\n\n vscode.workspace.onDidChangeTextDocument(event => {\n if (activeEditor && event.document === activeEditor.document) {\n triggerUpdate();\n }\n }, null, context.subscriptions);\n\n var timeout = null;\n\n function triggerUpdate() {\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(updateDecorations, 100);\n }\n\n function updateDecorations() {\n if ((!activeEditor) || (!enabled)) {\n return;\n }\n\n if (whitespaceDecorationSpace == null) { whitespaceDecorationSpace = vscode.window.createTextEditorDecorationType(appearanceSpace); }\n\n var regExSpace = /\\u3000/g;\n var text = activeEditor.document.getText();\n var whitespaceSpaceChars = [];\n\n var match;\n while (match = regExSpace.exec(text)) {\n var startPos = activeEditor.document.positionAt(match.index);\n var endPos = activeEditor.document.positionAt(match.index + match[0].length);\n var decoration = { range: new vscode.Range(startPos, endPos) };\n whitespaceSpaceChars.push(decoration);\n }\n activeEditor.setDecorations(whitespaceDecorationSpace, whitespaceSpaceChars);\n }\n }\n context.subscriptions.push(disposable1);\n\n var disposable2 = vscode.commands.registerCommand('extension.disableZenkaku', function() {\n cleanDecorations();\n enabled = false;\n });\n\n context.subscriptions.push(disposable2);\n\n function cleanDecorations() {\n if (whitespaceDecorationSpace != null) {\n whitespaceDecorationSpace.dispose();\n whitespaceDecorationSpace = null;\n }\n }\n}", "function activate() {\n // Register the ShebangEnchiladaComponent as a role in Compass\n //\n // Available roles are:\n // - Instance.Tab\n // - Database.Tab\n // - Collection.Tab\n // - CollectionHUD.Item\n // - Header.Item\n\n global.hadronApp.appRegistry.registerRole('Instance.Tab', ROLE);\n global.hadronApp.appRegistry.registerAction('ShebangEnchilada.Actions', ShebangEnchiladaActions);\n global.hadronApp.appRegistry.registerStore('ShebangEnchilada.Store', ShebangEnchiladaStore);\n}", "function activate(context) {\n _context = context;\n context.subscriptions.push(vscode.commands.registerCommand(\"ev3-micropython.newProject\", newProject), vscode.commands.registerCommand(\"ev3-micropython.showExampleBrowser\", showExampleBrowser), vscode.commands.registerCommand(\"ev3-micropython.openExample\", openExample), vscode.commands.registerCommand(\"ev3-micropython.openOfflineDocs\", openOfflineDocs), vscode.window.registerTreeDataProvider(\"ev3-micropython.activities\", activitiesProvider));\n}", "function onInstall() {\n onOpen();\n}", "function activate(context) {\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"rapid\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {\n // The code you place here will be executed every time your command is executed\n // Display a message box to the user\n vscode.window.showInformationMessage('Hello World 2!');\n });\n context.subscriptions.push(disposable);\n vscode.languages.registerDocumentFormattingEditProvider('rapid', {\n provideDocumentFormattingEdits(document) {\n // const regexIncIndent = /\\((forall)/;\n const regexIncIndent = /^\\s*\\t*\\((assert|assert-not|forall.*|exists.*|and|or|=>|not)$/;\n const regexDecIndent = /^\\s*\\t*\\)/;\n const regexIsSMTLine = /^\\s*\\t*(\\(|\\))/;\n // for each line, update indentLevel and format line accordingly\n var edits = [];\n var indentLevel = 0;\n for (let index = 0; index < document.lineCount; index++) {\n const line = document.lineAt(index);\n if (!line.isEmptyOrWhitespace && regexIsSMTLine.test(line.text)) {\n // decrement-check for this line\n if (regexDecIndent.test(line.text)) {\n indentLevel = Math.max(indentLevel - 1, 0);\n }\n // format line\n var formattedText = '\\t'.repeat(indentLevel) + line.text.substring(line.firstNonWhitespaceCharacterIndex, line.text.length);\n edits.push(vscode.TextEdit.replace(line.range, formattedText));\n // increment-check for next line\n if (regexIncIndent.test(line.text)) {\n indentLevel = indentLevel + 1;\n }\n }\n }\n return edits;\n }\n });\n}", "onInit() {}", "function activate() {\n $log.debug('header activated');\n }", "function onInstall() {\n\t\n\tif (navigator.onLine) {\n\t\tchrome.tabs.create({url: 'https://singleclickapps.com/merge-windows/postinstall-chrome.html'});\n\t}\n}", "beforeInit() {\r\n return true;\r\n }", "function onStartExecution() {\n startExecutionHook();\n}", "$onInit() {\n \n }", "function Awake () {\n\n\t}", "function Awake () {\n\n\t}", "function activate(context) {\n context.subscriptions.push(commands_1.px2rpxCommand);\n context.subscriptions.push(commands_1.rpx2pxCommand);\n}", "start() {\n //DO BEFORE START APP CONFIGURATION/INITIALIZATION\n super.start();\n }", "_settings_changed() {\n \tif (!this.settings_already_changed) {\n \t\tMain.notify(\"Please restart BaBar extension to apply changes.\");\n \t\tthis.settings_already_changed = true;\n \t}\n }", "function activate(context) {\n let config = vscode.workspace.getConfiguration('rpx2vw');\n const Process = new process_1.default(config);\n const Provider = new provider_1.default(Process);\n // Use the console to output diagnostic information (console.log) and errors (console.error)\n // This line of code will only be executed once when your extension is activated\n console.log('Congratulations, your extension \"rpx2vw\" is now active!');\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n const LANS = ['html', 'vue', 'css', 'less', 'scss', 'sass', 'stylus'];\n // 注册\n for (let lan of LANS) {\n let providerDisposable = vscode.languages.registerCompletionItemProvider(lan, Provider);\n context.subscriptions.push(providerDisposable);\n }\n let disposable = vscode.commands.registerTextEditorCommand('extension.rpx2vw', function (textEditor, edit) {\n const doc = textEditor.document;\n let selection = textEditor.selection;\n if (selection.isEmpty) {\n const start = new vscode.Position(0, 0);\n const end = new vscode.Position(doc.lineCount - 1, doc.lineAt(doc.lineCount - 1).text.length);\n selection = new vscode.Range(start, end);\n }\n let text = doc.getText(selection);\n textEditor.edit(builder => {\n builder.replace(selection, Process.convertAll(text));\n });\n });\n context.subscriptions.push(disposable);\n}", "function onStartup()\n{\n\tprintLog(\"info\", \"onStartup called\");\n}", "onAttach() {}", "function activate() {\n scope.$on('wizard_changes-have-been-made', onChanges);\n scope.$on('text-edit_changes-have-been-made', onChanges);\n\n // array of the IDs of opened ndDialogs\n // will change if some ngDialog have been opened or closed\n scope.ngDialogs = ngDialog.getOpenDialogs();\n\n scope.$watchCollection('ngDialogs', function (newVal, oldVal) {\n if (lodash.isEmpty(oldVal) && newVal.length === 1) {\n $document.on('keyup', onKeyUp);\n } else if (lodash.isEmpty(newVal)) {\n $document.off('keyup', onKeyUp);\n\n isChangesHaveBeenMade = false;\n }\n });\n }", "initHooks() {\n chrome.tabs.onUpdated.addListener(this.onUpdated.bind(this));\n chrome.tabs.onActivated.addListener(this.onActivated.bind(this));\n chrome.runtime.onMessage.addListener(this.onMessage.bind(this));\n // chrome.windows.onFocusChanged is unreliable on Linux/CrOS/Windows\n // so we fall back to polling chrome.windows.getLastFocused\n // see crbug/387377#c30\n chrome.windows.onFocusChanged.addListener(this.onFocusChanged.bind(this));\n if (this.os != \"mac\") this.startPollingWindow();\n }", "_initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}" ]
[ "0.7663007", "0.6947059", "0.6820627", "0.6794852", "0.6790117", "0.6739728", "0.6689884", "0.66443366", "0.6542393", "0.6512419", "0.6511836", "0.6502952", "0.6485095", "0.6482592", "0.6447026", "0.6446627", "0.6429264", "0.6413805", "0.64109546", "0.6405974", "0.6392081", "0.6372685", "0.63625807", "0.6358798", "0.635858", "0.63497144", "0.6324327", "0.6320988", "0.6319184", "0.63162565", "0.6300437", "0.6300437", "0.6298413", "0.6256008", "0.62446254", "0.6233059", "0.6200796", "0.6191287", "0.6130591", "0.6074832", "0.60683376", "0.605704", "0.60450035", "0.60302955", "0.6020458", "0.60180825", "0.6017226", "0.5926286", "0.5905798", "0.5903905", "0.5895776", "0.5882791", "0.58734614", "0.58317333", "0.58205914", "0.5820408", "0.5746497", "0.57163656", "0.57151335", "0.57116157", "0.5693093", "0.5673451", "0.5664592", "0.566308", "0.56469214", "0.5646193", "0.5644079", "0.56411505", "0.5629902", "0.5629902", "0.5629902", "0.56223935", "0.56204116", "0.5617081", "0.5605988", "0.5599943", "0.5599346", "0.55992633", "0.55986214", "0.5591141", "0.55906284", "0.5587778", "0.5581855", "0.5579077", "0.5579077", "0.55723226", "0.55531716", "0.5552573", "0.55393153", "0.553491", "0.55347234", "0.5532005", "0.55278784", "0.55266774", "0.5526077", "0.5526077", "0.5526077", "0.5526077", "0.5526077", "0.5526077" ]
0.57213634
57
this method is called when your extension is deactivated
function deactivate() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivate() {\n extension.nbLine = null;\n extension.editor = null;\n extension.deco.clear();\n extension.deco = null;\n cache_manager_1.default.clearCache();\n}", "function deactivate() {\n console.log(\"deactivating HL7Tools extension\");\n exports.deactivate = deactivate;\n}", "OnDeactivated() {}", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}", "function deactivate() {}" ]
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692" ]
0.0
-1
Set up the canvas and game objects (Executed by d3)
function setup() { createCanvas(600, 600); frameRate(FRAME_RATE); var cols = floor(width / ITEMS_SCALE) var rows = floor(height / ITEMS_SCALE) environment=new Environment(cols,rows); environment.init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n let canvas = createCanvas(canvasContainer.clientWidth, canvasContainer.clientHeight);\n canvas.parent(\"canvas-container\");\n\n rectMode(CENTER);\n ellipseMode(CENTER);\n noStroke();\n\n // Initialize global game objects.\n pong = new Pong();\n ball = new Ball();\n controller = new PaddleController();\n leftPaddle = controller.createLeftPaddle();\n rightPaddle = controller.createRightPaddle();\n}", "function init() {\n // quadTree = new QuadTree();\n showCanvas();\n debug.init();\n keyboard.init();\n menuWindow.init();\n // fillboxes(100);\n Game.init();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n setUpObjects();\n}", "function init() {\n // get a referene to the target <canvas> element.\n if (!(canvas = document.getElementById(\"game-canvas\"))) {\n throw Error(\"Unable to find the required canvas element.\");\n }\n\n // resize the canvas based on the available browser available draw size.\n // this ensures that a full screen window can contain the whole game view.\n canvas.height = (window.screen.availHeight - 100);\n canvas.width = (canvas.height * 0.8);\n\n // get a reference to the 2D drawing context.\n if (!(ctx = canvas.getContext(\"2d\"))) {\n throw Error(\"Unable to get 2D draw context from the canvas.\");\n }\n\n // specify global draw definitions.\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n\n // set the welcome scene as the initial scene.\n setScene(welcomeScene);\n }", "function setup() {\n createCanvas(1280, 720);\n\n clickables = clickablesManager.setup();\n\n // This will load the images, go through state and interation tables, etc\n adventureManager.setup();\n\n\n adventureManager.setClickableManager(clickablesManager);\n setupClickables(); \n content.setup();\n\n textSize(24);\n textAlign(LEFT);\n\n r = int(random(2));\n\n}", "function setup(){\n\tinitVars(); \n\tinitCanvas(); \n\tinitObjects(); \n\n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n createDog();\n createAnimals();\n}", "function setup(){\n\tinitVars();\n\tinitCanvas();\n\tinitObjects();\n}", "function setup() {\n minigameCanvas = createCanvas(1000, 800);\n minigameCanvas.parent(\"#mini-games\");\n textFont(myFont);\n\n // general setup\n userSetup();\n noCursor();\n\n // m-g1 setup\n mouseSetup();\n // m-g2 setup\n fishSetup();\n}", "function setup() {\n\tcreateCanvas(1300, 650);\n\n\t//creating the engine\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\t//Create the Bodies Here.\n\tpaperBall = new Paper();\n\tground = new Ground();\n\tdustbin = new Dustbin(900,485,20,220);\n\tdustbin2 = new Dustbin(1010,585,200,20);\n\tdustbin3 = new Dustbin(1120,485,20,220);\n\n\t//running the engine\n\tEngine.run(engine);\n \n}", "function setup() {\n\tcreateCanvas(800, 300);\n\trectMode(CENTER);\n\timageMode(CENTER);\n\n\ttextAlign(CENTER, CENTER);\n\ttextFont(\"TrebuchetMS\"); // sans-serif font\n\n\trectX = 50;\n\trectY = height / 2;\n\trectSize = 90;\n\tplayGame = false;\n\tshowHelp = false;\n\n\tinitialization();\n}", "function initObjects() {\n\t\tparticles = new ParticleGroup();\n\t\t// create our stage instance\n\t\tstage = new Stage(document.querySelector(\"canvas\"));\n\t\t// init the canvas bounds and fidelity\n\t\tstage.resize();\n\t\t// populate particle group collection\n\t\tparticles.populate();\n\t\t// begin stage rendering with the renderAll draw routine on each tick\n\t\tstage.render.begin(\n\t\t\tparticles.render.bind(particles));\n\t}", "function setup(){\n\tinitVars(); \n\tinitCanvas(); \n\tinitObjects(); \n\tinitListeners(); \n\n}", "function init() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.width = canvasWidth;\n\t\tcanvas.height = canvasHeight;\n\t\tcanvas.style.border = \"15px groove gray\";\n\t\tcanvas.style.margin = \"25px auto\";\n\t\tcanvas.style.display = \"block\";\n\t\tcanvas.style.background = \"#ddd\";\n\t\tdocument.body.appendChild(canvas);\n\t\tctx = canvas.getContext('2d');\n\t\tnewGame()\n\t}", "function setup() {\n createCanvas(1280, 768);\n createBackground();\n createShip();\n createAsteroids();\n}", "function setup() {\n createCanvas(1280, 720);\n\n // setup the clickables = this will allocate the array\n clickables = clickablesManager.setup();\n\n // this is optional but will manage turning visibility of buttons on/off\n // based on the state name in the clickableLayout\n adventureManager.setClickableManager(clickablesManager);\n\n // This will load the images, go through state and interation tables, etc\n adventureManager.setup();\n\n // load all text screens\n loadAllText();\n\n // call OUR function to setup additional information about the p5.clickables\n // that are not in the array \n setupClickables();\n\n setupEndings();\n\n fs = fullscreen();\n console.log(\"finished setup\")\n}", "function setup() {\n console.log(\"setup\");\n canvas.setBackgroundImage(BG_1);\n\n UP_ARROW.set({\n left: 250,\n top: 50,\n selectable: false,\n hoverCursor: \"pointer\",\n }).on(\"mouseup\", () => {\n changeScene(\"up\");\n });\n canvas.add(UP_ARROW);\n\n DOWN_ARROW.set({\n left: 250,\n top: 200,\n selectable: false,\n hoverCursor: \"pointer\",\n }).on(\"mouseup\", () => {\n changeScene(\"down\");\n });\n canvas.add(DOWN_ARROW);\n\n RIGHT_ARROW.set({\n left: 400,\n top: 150,\n selectable: false,\n hoverCursor: \"pointer\",\n }).on(\"mouseup\", () => {\n changeScene(\"right\");\n });\n canvas.add(RIGHT_ARROW);\n\n LEFT_ARROW.set({\n left: 100,\n top: 150,\n selectable: false,\n hoverCursor: \"pointer\",\n }).on(\"mouseup\", () => {\n changeScene(\"left\");\n });\n canvas.add(LEFT_ARROW);\n\n TALK.set({\n selectable: false,\n hoverCursor: \"pointer\",\n });\n\n //HEY NACHTE: THESE PROPERTIES ARE POSSIBLY REDUNDANT SINCE WE SET THE GROUP PROPERTIES THAT OVERRIDE THIS IN\n //DRAWHIDDENINTERACTABLES\n TALKBOX.set({\n selectable: false,\n hoverCursor: \"pointer\",\n });\n\n //CONSOLE LOG ALERTS SO WE CAN SEE WHATS GETTING DRAWN AND REMOVED\n canvas.on('object:removed', function (object) {\n console.warn(`REMOVED ${object}`);\n });\n canvas.on('object:added', function (object) {\n console.warn(`ADDED: ${object}`);\n })\n\n drawSceneHiddenInteractables(\"scene1\");\n drawSceneInteractables(\"scene1\");\n canvas.requestRenderAll();\n}", "function setup() {\n createCanvas(windowWidth, windowWidth * 0.4);\n setupActors();\n}", "function setup() {\n createCanvas(1280, 720);\n\n // setting up class for scorecard function\n stressCard = new scoreCard();\n\n // setup the clickables = this will allocate the array\n clickables = clickablesManager.setup();\n\n \n // based on the state name in the clickableLayout\n adventureManager.setClickableManager(clickablesManager);\n\n // This will load the images, go through state and interation tables, etc\n adventureManager.setup();\n\n // load all text screens\n loadAllText();\n\n // call OUR function to setup additional information about the p5.clickables\n setupClickables(); \n\n fs = fullscreen();\n}", "function setup() {\n database = firebase.database();\n\n canvas = createCanvas(500, 500);\n game = new Game();\n game.getState();\n game.start();\n}", "function setup() {\r\n\tlet cnv = createCanvas(600, 400);\r\n\tcnv.parent(\"cnvContainer\");\r\n\tnoStroke();\r\n\t\r\n\t// Initialize Global Variables\r\n\tbgColor = \"white\";\r\n\tinitMovingShapes();\r\n\tinitRandomShapes();\r\n}", "function setup() {\n\tcreateCanvas(1800, 700);\n\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\t//Create the Bodies Here.\n\tbg = new Background(900,350,0,0);\n\ttree = new Tree(1400,320,0,0);\n\tboy = new Boy(250,540,0,0);\n\tfs1 = new FakeStone(370,600,0,0);\n\tfs2 = new FakeStone(400,600,0,0);\n\tfs3 = new FakeStone(375,640,0,0);\n\tfs4 = new FakeStone(345,650,0,0);\n\tfs5 = new FakeStone(400,640,0,0);\n\tfs6 = new FakeStone(350,615,0,0);\n\tstone = new Stone(150,380,50);\n\tmango1 = new Mango(1400,200,50);\n\tmango2 = new Mango(1500,200,50);\n\tmango3 = new Mango(1450,100,50);\n\tmango4 = new Mango(1300,250,50);\n\tmango5 = new Mango(1360,100,50);\n\tmango6 = new Mango(1590,240,50);\n\tground = new Ground(900,600,1800,30);\n\trope = new Rope(stone.body,{x:150,y:380});\n\n\t// var render = Render.create({\n\t// \telement:document.body,\n\t// \tengine: engine,\n\t// \toptions: {\n\t// \t width: 1800,\n\t// \t height: 700,\n\t// \t wireframes:true,\n\t// \t showAngleIndicator: true\n\t// \t},\n\t \n\t// });\n\t// Render.run(render);\n\n\tEngine.run(engine);\n \n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n //create array of many walker objects\n // for (let i = 0; i < numWalkers; i++) {\n // // walkers[i] = new Walker();\n // // OR alternatively say:\n // walkers.push(new Walker());\n // }\n }", "initWorld()\n {\n canvas.id = \"mycanvas\";\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n document.body.appendChild(canvas);\n canvas = document.getElementById('mycanvas');\n\n // Create instance of classes needed\n this.gamePlay = new GamePlay(this.ctx, this.document);\n }", "function setup() {\n\n\t//creating the canvas that will appear on screen\n\tcreateCanvas(500, 500);\n\n\n}", "function setup () {\n createCanvas(world.width, world.height);\n\n // load the font\n textFont(font);\n\n // initialize game objects\n initializeGame();\n\n // start the game!\n startGame();\n}", "function setup() {\n var obj1 = {};\n var cnv = createCanvas(800,800);\n cnv.position((windowWidth-width)/2,30);\n background(80,80,80);\n loadBalls(12);\n\n}", "_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 }", "function setup() {\n\n // init globals\n InitializeGlobals();\n\n // cnv = createCanvas(WIDTH, HEIGHT, WEBGL);\n cnv = createCanvas(windowWidth, windowHeight, WEBGL);\n // createCanvas(600, 600, P3D);\n background(backgroundColor);\n\n if (useTests) {\n createTests();\n }\n else if (generatedReady) {\n // should not be the case at setup, unless an example were to be shown\n }\n\n gui = new GUI();\n if (DEBUG) {\n // this.debuggui = newGUIdebug();\n }\n}", "function init() {\n\tinitializeCanvas();\n\n\twidth = canvas.width;\n\theight = canvas.height;\n\n // initialize snake & food object\n snake = new Snake();\n food = createFood();\n}", "function setup()\n {\n console.log('setup called');\n\n // check for options\n if( typeof user_options !== 'undefined' )\n {\n console.log('we detected options: ' , user_options);\n // override the default properties with user-set ones (if they exist)\n for( var option in user_options ){\n if( typeof option !== 'undefined' ){\n properties[option] = user_options[option];\n }\n };\n }\n\n // set text/font options\n canvas.textAlign = \"center\";\n canvas.textBaseline = \"middle\";\n canvas.font = \"bold 24px sans-serif\";\n\n \n // add the player to the screen\n player = new Player(); // use the \"global\" player var to store the player\n\n // let's get this show on the road!\n startGame();\n\n // run one frame of the game loop, then pause for the user to get acquainted\n gameLoop();\n pauseGame();\n\n }", "function setup() { \n createCanvas(wMax, hMax); \n \n session = new Session();\n session.newMenu();\n}", "function setup() {\n\tcreateCanvas(windowWidth, windowHeight);\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n updateCanvasScale();\n frameRate(IDEAL_FRAME_RATE);\n networkArray = new CleanableSpriteArray();\n hiddentext = new HiddenText(networkArray);\n cursorShapeColor = new ShapeColor(null, color(255));\n backgroundColor = color(0);\n}", "function setup() {\n\tlet canvas = createCanvas(600, 400);\n canvas.parent('canvasDiv');\n\tPopulation.initialize();\n\tStage.initialize();\n Stage.addBarrier({ rx: 200, ry: 250, rw: 200, rh: 12 });\n Stage.addBarrier({ rx: 0, ry: 140, rw: 150, rh: 12 });\n Stage.addBarrier({ rx: 450, ry: 140, rw: 150, rh: 12 });\n\tcreateUI();\n}", "function setup() {\n\tconsole.log(\"Iniciando setup\");\n\t// cria o quadro, com dimensoes 800 x 400\n\tcreateCanvas(800, 400);\n\n\t// faz o mouse sumir\n\tnoCursor();\n\n\t// inicializando as posicoes\n\tj1 = createVector(23, 99);\n\tj2 = createVector(744, 129);\n\tb = createVector(385, 119);\n\n\t// inicializa o deslocamento\n\tdeslocamento = createVector(1, -1);\n\n\tconsole.log(\"Terminando setup\");\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n setStationLocations();\n initDots();\n}", "function setup(){\n\tcreateCanvas(windowWidth, windowHeight);\n\n}", "function setup() {\r\n\r\n\r\n var cnv = createCanvas(1200, 800);\r\n cnv.position((windowWidth-width)/2, 30);\r\n zGame = new Game();\r\n Background = new Background();\r\n // assests object\r\n var numCoins = 0;\r\n var numZombs = 5;\r\n var numPlatforms = 120;\r\n loadMyImages();\r\n\r\n\r\n}", "function init()\n{\n //\tInitialize the canvas and context\n canvas = document.createElement(\"canvas\");\n window.ctx = canvas.getContext(\"2d\");\n canvas.width = TILE_S * COLS;\n canvas.height = TILE_S * ROWS;\n\n //\tAdding canvas to canvas div\n document.getElementById(\"canvas_div\").appendChild(canvas);\n\n //\tUniverse object initialized\n univ = new Universe();\n\n}", "function setup() { //this function executes once at the beginning.\n \n initial = createVector(0,0);\n \n frameRate(50);\n \n var canv = createCanvas(window.innerWidth*.95, window.innerHeight*.9);\n canv.parent(\"myCanvas\"); //<----delete this line to run on web editor\n \n massSlider = createSlider(.5,6,.5,.1);\n massSlider.parent(\"mySlider\"); //<----delete this one too\n \n universe = new Array(); //Array where the planets(entity objects) are gonna be stored\n}", "function setup() {\n createCanvas(720, 720);\n\n // setup the clickables = this will allocate the array\n clickables = clickablesManager.setup();\n\n // create a sprite and add the 3 animations\n playerSprite = createSprite(width/2, height/2, 80, 80);\n\n // every animation needs a descriptor, since we aren't switching animations, this string value doesn't matter\n playerSprite.addAnimation('regular', loadAnimation('assets/avatars/sprite-01.png', 'assets/avatars/sprite-04.png'));\n \n\n // use this to track movement from toom to room in adventureManager.draw()\n adventureManager.setPlayerSprite(playerSprite);\n\n // this is optional but will manage turning visibility of buttons on/off\n // based on the state name in the clickableLayout\n adventureManager.setClickableManager(clickablesManager);\n\n // This will load the images, go through state and interation tables, etc\n adventureManager.setup();\n\n // call OUR function to setup additional information about the p5.clickables\n // that are not in the array \n setupClickables(); \n}", "function setup() {\n\t\n\t// Window Detection\n\tclientHeight = document.getElementById('window').clientHeight;\n\tclientWidth = document.getElementById('window').clientWidth;\n\t\n\t// Creating Canvas\n\tcanvas = createCanvas (clientWidth, clientHeight);\n\tcanvas.position(0,0);\n\tcanvas.style('z-index', '-10');\n\t\n\t// Creating Slider\n\tfoodSlider = createSlider(2,10,.1);\n\tfoodSlider.position(20,125);\n\t\n\t// Background Color\n\tbackground(0);\n\n\t// Creating an instance of the Fish object\n\t//goldFish = new Fish();\n\n\tfor (let i = 0; i < fishes.length; i++) {\n\t\tfishes[i] = new Fish();\n\t}\n\n}", "setup(canvas) {\n this.engine.renderer.setup(canvas);\n this.start();\n }", "function init() {\n // Initialize all base variables and preload assets. Once assets are loaded it will call init. \n\n // Canvas info\n canvas = document.getElementById(\"canvas\"); \n fullScreenCanvas(canvas); // Sets width and height to fill screen\n // Stage info\n stage = new createjs.Stage(canvas); // Creates a EaselJS Stage for drawing\n stage.addChild(backgroundLayer, midLayer, foregroundLayer, overlayLayer); // Add layers\n // Detection\n createjs.Touch.enable(stage); \n\n // Initialize global variables for layout and sizing\n initializeVariables(canvas.width, canvas.height);\n\n // Preload all assets (crucial for first rendering)\n preload.loadManifest(manifest);\n}", "function setup() {\n // Environment setup\n createCanvas(windowWidth, windowHeight, WEBGL);\n angleMode(DEGREES);\n createMenu();\n\n debugMode();\n\n // Test objects\n\n //bondMolecules.push(new Molecule(0, 0, 0, 'D'));\n //bondMolecules.push(new Molecule(0, 0, 0, 'G2D'));\n //bondMolecules.push(new Molecule(0, 0, -100, 'G3D'));\n}", "function setup() {\n\n // background\n createCanvas(windowWidth, windowHeight);\n\n scene1.setup()\n scene2.setup()\n scene3.setup()\n scene4.setup()\n \n setupAudio()\n\n}", "function setup() {\n setupHTMLPointers(); // store all the pointers to the html elements\n // style/theme\n createCanvas(windowWidth, windowHeight);\n background(BG_COLOR);\n textFont(\"Gill Sans\");\n textStyle(BOLD);\n textSize(16);\n textAlign(CENTER, CENTER);\n rectMode(CENTER);\n imageMode(CENTER);\n noStroke();\n // create objects\n gameBackground = new Background(BG_FRONT);\n textBox = new TextBox();\n textBox.insertText(TEXT_BEGIN[0]);\n textBox.buffer(TEXT_BEGIN[1]);\n\n setupMainMenu(); // set up main menu\n setupObjTriggers(); // set up triggers\n setupKeypad(); // create the keypad in html\n setupLock(); // create the lock in html\n\n setupSFX(); // set up sounds\n\n // make sure the width of objTrigger containers is the same as the width of the background image\n let containerLeftMargin = (gameBackground.width) / 2;\n $(\".container\").css({\n \"width\": gameBackground.width.toString() + \"px\",\n // center it\n \"margin-left\": \"-\" + containerLeftMargin.toString() + \"px\"\n });\n // make sure the inventory and direction indicator containers do not overlay the background\n let sideStripWidth = (width - gameBackground.width) / 2;\n $inventory.css({\n \"width\": sideStripWidth.toString() + \"px\"\n });\n $directionIndicator.css({\n \"width\": sideStripWidth.toString() + \"px\"\n });\n}", "function setup() {\n \n // Configure the world.\n w = new p$.World(\"canvasContainer\", draw, resize);\n w.scaleY.set(70, -0.25, \"\");\n w.axis.outsideNumbers = false;\n w.axis.draggable(false);\n\n // Add plots to data cursor.\n dc.add(g1, g2);\n\n // Add objects to world.\n w.add(g1, g2, dc);\n\n}", "function setup() {\n createCanvas(700, 500);\n frameRate(30);\n dinoStegosaurus = new Dino(200, 200, 5, 40, 87, 83, 65, 68, 16, [babyStegosaurusImage, childStegosaurusImage, dinoStegosaurusImage]);\n dinoTriceratops = new Dino(100, 100, 5, 40, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, 32, [babyTriceratopsImage, childTriceratopsImage, dinoTriceratopsImage]);\n foodLeaves = new Food(100, 100, 10, 25, foodLeavesImage);\n foodBerries = new Food(100, 100, 8, 25, foodBerriesImage);\n foodPlant = new Food(100, 100, 20, 25, foodPlantImage);\n\n // Place dinos and food into array\n dinos = [dinoStegosaurus, dinoTriceratops];\n food = [foodLeaves, foodBerries, foodPlant];\n\n // Title screen is active at the start\n titleScreen = true;\n}", "function setup() {\n\n\t//create a canvas\n\tcreateCanvas(1100, 570);\n\n\timageMode(CENTER);\n\n\t//create the Engine and add it to world\n\tengine = Engine.create();\n\tworld = engine.world;\n\t\n\t//create a paper objectx\n\tpaper = new Paper(212, 390, 80, 80);\n\n\t//create a ground\n\tground = new Ground(width / 2, 560, width, 20);\n\n\t//create the dustbin\n\tdustbin = createSprite(1002, 450, 180, 175);\n\tdustbin.addImage(\"dustbin\", dustbin_img);\n\tdustbin.scale = 0.6;\n\n\t//create the dustbin\n\tdustbin1 = new Dustbin(930, 490, 20, 110);\n\tdustbin2 = new Dustbin(1080, 490, 20, 110);\n\tdustbin3 = new Dustbin(1010, 543, 150, 10);\n\n\t//create the walls\n\t//wall = new Wall(1000, 300, 30, 100);\n\n\t//running the Engine\n\tEngine.run(engine);\n \n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n cursor(CROSS);\n \n // initial positions, use the mouse to move\n player = createVector(50, 50);\n zombie = createVector(width/2, height/2);\n}", "function setup() {\n //menuButtons = new Button[3];\n //\tcreateCanvas(displayWidth, displayHeight);\n createCanvas(screenX, screenY);\n \tsandwich = loadImage(\"../img/GameSprites/sandwich.png\"); // \n \tapple = loadImage(\"../img/GameSprites/apple.png\");\n \tbg = loadImage(\"../img/GameSprites/background.jpg\")\n //\tspeedX = 2;\n //\tspeedY = 2;\n \n//\tstrokeWeight(0);\n//\tstroke(0);\n}", "function setup() {\n // createCanvas(windowWidth,windowHeight);\n var heightSetting = 800;\n var widthSetting = heightSetting*windowWidth/windowHeight;\n const canvasElt = createCanvas(widthSetting, heightSetting).elt;\n canvasElt.style.width = '100%', canvasElt.style.height = '100%';\n background(0100);\n \n collideDebug(true);\n}", "setup() {\n\t\tthis.stage.removeAllChildren();\n\t\tthis.initBackground();\n\t\tthis.initReceptors();\n\t\tthis.initNotetrack();\n\t\tthis.initStats();\n\t\tthis.initTimeline();\n\t\tthis.initBackButton();\n\t}", "function setup() {\n\n\t//Created canvas\n\tcreateCanvas(800, 700);\n\n\t//Set rectangle's Mode(starting point of making rectangle ) as (CENTRE)\n\trectMode(CENTER);\n\n\t//Created Sprite with (x-position,y-position,width,height) coordinates\n\tpackageSprite = createSprite(width / 2, 80, 10, 10);\n\n\t//Added an image to the sprite\n\tpackageSprite.addImage(packageIMG)\n\n\t//Resized the image under the sprite using scale property\n\tpackageSprite.scale = 0.2\n\n\t//Created Sprite with (x-position,y-position,width,height) coordinates\n\thelicopterSprite = createSprite(width / 2, 200, 10, 10);\n\n\t//Added an image to the sprite\n\thelicopterSprite.addImage(helicopterIMG)\n\n\t//Resized the image under the sprite using scale property\n\thelicopterSprite.scale = 0.6\n\n\t//Created Sprite with (x-position,y-position,width,height) coordinates\n\tgroundSprite = createSprite(width / 2, height - 35, width, 10);\n\n\t//Set the color of sprite using RGB\n\tgroundSprite.shapeColor = color(255)\n\n\t//Created Engine inside the variable engine\n\tengine = Engine.create();\n\n\t//Set the value of world equal to engine.world\n\tworld = engine.world;\n\n\t//Created packageBody\n\tpackageBody = Bodies.circle(width / 2, 200, 5, { restitution: 0.4, isStatic: true });\n\n\t//Added packageBody to world\n\tWorld.add(world, packageBody);\n\n\t//Created a Ground (which is static)\n\tground = Bodies.rectangle(width / 2, 650, width, 10, { isStatic: true });\n\n\t//Added ground to world\n\tWorld.add(world, ground);\n\n\t//Set box's X position as 100 subtracted from width/2\n\tboxPosition = width / 2 - 100\n\n\t//Set box's Y position as 610\n\tboxY = 610;\n\n\t//Created Sprite with (x-position,y-position,width,height) coordinates\n\tboxleftSprite = createSprite(boxPosition, boxY, 20, 100);\n\n\t//Set the color of sprite using RGB\n\tboxleftSprite.shapeColor = color(255, 0, 0);\n\n\t//Created boxleftBody\n\tboxLeftBody = Bodies.rectangle(boxPosition + 20, boxY, 20, 100, { isStatic: true });\n\n\t//Added boxLeftBody to World\n\tWorld.add(world, boxLeftBody);\n\n\t//Created Sprite with (x-position,y-position,width,height) coordinates\n\tboxBase = createSprite(boxPosition + 100, boxY + 40, 200, 20);\n\n\t//Set the color of sprite using RGB \n\tboxBase.shapeColor = color(255, 0, 0);\n\n\t//Created boxBottomBody \n\tboxBottomBody = Bodies.rectangle(boxPosition + 100, boxY + 45 - 20, 200, 20, { isStatic: true });\n\n\t//Added boxBottomBody to World\n\tWorld.add(world, boxBottomBody);\n\n\t//Created Sprite with (x-position,y-position,width,height) coordinates\n\tboxleftSprite = createSprite(boxPosition + 200, boxY, 20, 100);\n\n\t//Set the color of sprite using RGB \n\tboxleftSprite.shapeColor = color(255, 0, 0);\n\n\t//Created boxRightBody \n\tboxRightBody = Bodies.rectangle(boxPosition + 200 - 20, boxY, 20, 100, { isStatic: true });\n\n\t//Added boxRightBody to the World\n\tWorld.add(world, boxRightBody);\n\n\t//Running the engine\n\tEngine.run(engine);\n\n}", "function setup() {\n \n // create an HL app to start retrieving kinect datas\n // and automatically call the function update, onUserIn and onUserOut\n app = new HL.App();\n\n // set it up with our project's metadatas\n app.setup({\n projectName : 'Ball Bounce',\n author1 : 'Prenom Nom',\n author2 : 'Prenom Nom'\n });\n\n setupBall();\n setupObstacles();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n var mgr = new SceneManager();\n // attach preloaded sound files to the scene manager for retrieval by scene code\n mgr.sounds = sounds;\n mgr.audioguide = audioguide;\n // connect P5 events\n mgr.wire();\n // start the first scene\n mgr.showScene(Intro);\n}", "function setup() {\r\n\tcreateCanvas(225, 800);\r\n\r\n\t// Initialize the beatmap using a var called gamemap or whatever you want to call it. This loads the notes of the beatmap and the NoteBuilder\r\n\tgamemap = new Beatmap();\r\n}", "function init() {\n\tstage = new createjs.Stage(\"gameCanvas\");\n\tSTAGE_HEIGHT = stage.canvas.height;\n\tSTAGE_WIDTH = stage.canvas.width;\n\tSTAGE_WIDTH_BLOCKS = STAGE_WIDTH / BLOCK_SIZE;\n\tSTAGE_HEIGHT_BLOCKS = STAGE_HEIGHT / BLOCK_SIZE;\n\t// gridLines = buildGrid();\n\t// stage.addChild(gridLines);\n\tlevel = new Level();\n\tcreatejs.Ticker.setFPS(60);\n\tcreatejs.Ticker.addEventListener(\"tick\", update);\n}", "function setup()\n{\n // create engine\n engine = Engine.create();\n\n // remove gravity\n engine.gravity.y = 0;\n\n world = engine.world;\n\n matterCanvas = document.getElementById('matterJS-canvas');\n\n // create renderer\n render = Render.create({\n element: document.body,\n canvas: matterCanvas,\n engine: engine,\n options: {\n width: sandbox_width,\n height: sandbox_height,\n showAngleIndicator: true,\n wireframes: false,\n background: \"transparent\",\n strokeStyle: \"black\"\n }\n });\n\n Render.run(render);\n\n // create runner\n var runner = Runner.create();\n // Runner.run(runner, engine);\n\n addWalls();\n\n // fit the render viewport to the scene\n Render.lookAt(render, {\n min: { x: 0, y: 0 },\n max: { x: matterCanvas.width, y: matterCanvas.height }\n });\n\n // run the renderer\n Render.run(render);\n\n // create runner\n var runner = Runner.create();\n\n // run the engine\n Runner.run(runner, engine);\n\n initDataSets();\n\n initUI();\n\n}", "function setup() {\n if (state == 1) {\n createCanvas(windowWidth, windowHeight, WEBGL);\n pos = 500;\n a = 2;\n velocity = -48;\n dir = -1;\n } else {\n createCanvas(windowWidth, windowHeight);\n boxSize = [windowWidth/25, windowHeight/4];\n pos = windowWidth*.75;\n dir = -1;\n velocity = 0;\n a = 2;\n count = 1;\n }\n}", "function initCanvasAndEditor() {\n // Editor\n initEditor();\n\n // Canvas\n canvasResizer();\n renderCanvas();\n\n // Listeners\n addListeners();\n}", "function setup() {\r\n\r\n //Canvas\r\n var canvas = createCanvas(1200,600);\r\n\r\n //Engine on which the Elements of Matter run\r\n engine = Engine.create();\r\n\r\n //To create world.\r\n world = engine.world;\r\n\r\n //To create the platform.\r\n surface = new Surface(600, 550, 1200, 10);\r\n\r\n\r\n\r\n\r\n\r\n //To create a renderer to view the Matter bodies.\r\n var render = Matter.Render.create({ \r\n element: document.body,\r\n engine: engine,\r\n options: { \r\n width: 1200, \r\n height: 600, \r\n showAngleIndicator: true,\r\n showVelocity: true,\r\n wireframes: true\r\n } \r\n }); \r\n\r\n Matter.Render.run(render); \r\n }", "function setup() {\n\tcreateCanvas(1280, 720);\n\n\t// setup the clickables = this will allocate the array\n\tclickables = clickablesManager.setup();\n\n\t// based on the state name in the clickableLayout\n\tadventureManager.setClickableManager(clickablesManager);\n\n\t// This will load the images, go through state and interation tables, etc\n\tadventureManager.setup();\n\n // create the player sprite and add the animation\n playerSprite = createSprite(width/2, height/2, 80, 80);\n playerSprite.addAnimation('regular', 'assets/avatars/movement1.png', 'assets/avatars/movement6.png');\n\n // use this to track movement from toom to room in adventureManager.draw()\n adventureManager.setPlayerSprite(playerSprite);\n adventureManager.setChangedStateCallback(changedState);\n\n // call OUR function to setup additional information about the p5.clickables\n // that are not in the array \n setupClickables(); \n\n // to use later if helped piggy\n let bookRandom = int(random(20,50));\n let moneyRandom = int(random(20,50));\n\n newBookNumber = bookNumber + bookRandom;\n newMoneyNumber = moneyNumber + moneyRandom;\n}", "function setup() {\n\t// create full-window canvas\n\tlet cnvs = createCanvas(windowWidth, windowHeight);\n\tcnvs.parent('container');\n\n\tLogo.init();\n\tLogo.makeui();\n\n\tard.init();\n/*\n\tspeech = new p5.Speech();\n\tgetAudioContext().resume(); // this is needed to get the speech api to work\n\t//foo.speak(\"I said don't touch me\");\n\tspeech.listVoices()\n*/\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 setup() { // we started with our function with function setup which follows the code order.\n\tcreateCanvas(400, 400); // the canvas function tells us how big is the canvas.\n}", "function setup() {\n createCanvas(settings.canvasWidth, settings.canvasHeight);\n background(40);\n settings.ctx = document.getElementById(\"defaultCanvas0\").getContext(\"2d\");\n settings.ctx.webkitImageSmoothingEnabled = settings.ctx.imageSmoothingEnabled = settings.ctx.mozImageSmoothingEnabled = settings.ctx.oImageSmoothingEnabled = false; // Antialiasing disabled\n\n try {\n level = new Level(1);\n level.generate();\n }\n catch (error) {\n level = new Level(1);\n level.generate();\n console.log(\"DUDE THERE WAS LIKE A DANGEROUS VIRUS AND I LIKE DUCKS\");\n }\n\n player = new Player();\n\n\n\n mob.push(new Mob(player.x + 2, player.y, 1));\n \n\n\n\n setTimeout(function delayDraw() { // Initialize-draws the level and canvas after a delay to make sure the sprites have time to load\n level.draw(); \n }, 10);\n}", "function setup() {\n createCanvas(CANVAS_WIDTH, CANVAS_HEIGHT);\n createButtons();\n setupLeftRighMovement();\n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n positionFood();\n noCursor();\n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n positionFood();\n noCursor();\n}", "function setup() {\r\n createCanvas(windowWidth, windowHeight);\r\n noStroke();\r\n }", "function setup() {\n // set up canvas\n let canvas = createCanvas(canvasW, canvasH);\n canvas.parent('canvas');\n\n}", "function setup() {\n createCanvas(CANVAS_WIDTH, CANVAS_HEIGHT);\n startScreen();\n}", "function run() {\n let canvas = getCanvas() //this is a function that is on the helper section\n canvas.addEventListener('mousedown', onMouseDown);\n canvas.addEventListener('mousemove', onMouseMove);\n window.addEventListener('keyup', onKeyUp);\n _model.points = new _rhino3dm.Point3dList();\n _model.viewport = new _rhino3dm.ViewportInfo();\n _model.viewport.screenPort = [0, 0, canvas.clientWidth, canvas.clientHeight];\n let proportion = canvas.clientWidth / canvas.clientHeight;\n _model.viewport.setFrustum(-30 * proportion, 30 * proportion, -30, 30, 1, 1000);\n draw();\n}", "function main() {\n console.log('main');\n g = new Globals(); //instatiates object which encaspulates globals in game (encapuslates 'singleton' components)\n systemManager = new SystemManager(); //instantiate object responsble for updating systems\n\n //create canvas\n ctx = createCanvas(window.innerWidth, window.innerHeight);\n bgColor = [255, 192, 40, 1];\n\n createEntitiesFromBlueprint('player');\n\n createEntitiesFromBlueprint('mesh', 50);\n\n update();\n setInterval(update, fps); //begin update loop in which all systems update / act on all their relevant entities\n\n}", "function setup() {\n var cnv = createCanvas(800, 800);\n cnv.position((windowWidth-width)/2, 30);\n background(5, 5, 5);\n loadBalls(0);\n loadRects(0);\n loadShips(20);\n\n\n}", "function init() {\r\n\t\r\n\t/* Initialize the scene framework */\r\n\t// Cameras\r\n\tcameras();\r\n\t// Renderer\r\n\tinitRenderer();\r\n\t// Lights\r\n\tlights();\r\n\t// Axes\r\n\taxes( 300 , true );\t\r\n\t// Materials\r\n\tmaterials();\r\n\r\n\t/* Initialize the UI */\r\n\tUI( 'browser' );\r\n\t\r\n\t/* Initialize the settings of the lucidChart object */\r\n\tlucidChart.init();\r\n\t\r\n\t/* Initialize the event listeners */\r\n\tinitEventListeners();\r\n\t\r\n\t// GEOMETRIES\r\n\tentities();\r\n\t\r\n\t// Create the Stereoscopic viewing object (Not applied yet)\r\n\tvar effect = new THREE.StereoEffect(renderer);\r\n\t\t\r\n\tdebug.master && debug.renderer && console.log ('About to call the render function' );\r\n\trender();\t\t \r\n\tdebug.master && debug.renderer && console.log ( 'Now Rendering' );\r\n}", "function setup() {\n var canvas = createCanvas(640, 530);\n canvas.parent('gameBoard');\n gameReset();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n // Center our drawing objects\n imageMode(CENTER);\n textAlign(CENTER);\n textSize(24);\n\n // set to one for startup\n drawFunction = drawOne;\n}", "function init() {\n\t\t//console.log(\"scene.init()\");\n\t\t// Check if there is already a canvas in the scene.\n\t\tcanvas = dojo.query(\"canvas\")[0];\n\t\tif(!dojo.isObject(canvas)) {\n\t\t\tconsole.error(\"Scene: No canvas found.\")\n\t\t\treturn;\n\t\t}\n\t\t// Get the drawing context.\n\t\tif(canvas.getContext) {\n\t\t\tctx = canvas.getContext(\"2d\");\n\t\t}\n\t\t// Get background-color from canvas to pass to the framebuffer.\n\t\tvar bgColorStyle = domStyle.get(canvas, \"backgroundColor\");\n\t\t//console.log(\"background-color: \"+bgColorStyle);\n\t\trgb = bgColorStyle.match(/rgb\\((\\d+),\\s(\\d+),\\s(\\d+)\\)/);\n\t\tvar bgColor = rgb.slice(1, 4);\n\t\t//console.log(rgb);\n\t\t//console.log(bgColor);\n\t\t// Also store dimension of the canvas in the context,\n\t\t// to pass them all together as parameter.\n\t\tctx.width = canvas.width;\n\t\tctx.height = canvas.height;\n\t\t// Default display setting.\n\t\tctx.strokeStyle = defaultColor;\n\t\tctx.fillStyle = defaultColor;\n\t\tctx.font = font;\n\t\tctx.textAlign = \"left\";\n\n\t\t// Initialize an calculate matrices that do not chance.\n\t\tsetProjection();\n\t\tsetViewport();\n\t\tcalcviewportProjection();\n\n\t\traster.init(ctx, bgColor);\n\t\tscenegraph.init(triangulateDataOnInit);\n\t\t// Create the scene.\n\t\tcreateScene.init();\n\t\tshader.init();\t\t\n\t}", "create() {\n // Reset the data to initial values.\n this.resetData();\n // Setup the data for the game.\n this.setupData();\n // Create the grid, with all its numbers.\n this.makeGrid();\n // Set up collisions for bullets/other harmful objects.\n this.setupBullets();\n // Create the player.\n this.makePlayer();\n // Create all audio assets.\n this.makeAudio();\n // Create the UI.\n this.makeUI();\n // Create the timer sprites (horizontal lines to the sides of the board.)\n this.makeTimerSprites();\n // Create particle emitter.\n this.makeParticles();\n gameState.cursors = this.input.keyboard.createCursorKeys(); // Setup taking input.\n\t}", "function setup() { // Creates the canvas\r\n\r\n createCanvas(800, 600);\r\n\r\n}", "function init() {\n\t\n\tCatOnARoomba = {\n\t\tcanvas: \"undefined\",\n\t\tctx: \"undefined\",\n\t\tstopMain: \"undefined\",\n\t\tmouseDown: false,\n\t\troomba: \"undefined\",\n\t\tlayout: \"undefined\"\n\t};\n\t// Initalize canvas\n\tCatOnARoomba.canvas = document.querySelector(\"#canvas\");\n\tCatOnARoomba.ctx = canvas.getContext(\"2d\");\n\t// Roomba Obj\n\tCatOnARoomba.roomba = {\n\t\tx : 0,\n\t\ty : 0,\n\t\tforward : [0,0],\n\t\trunning : false,\n\t\tpathPoints : [],\n\t\tradius : 15,\n\t\tcurrentTarget : 0\n\t};\n\t\n\tsetMouseListeners();\n\tloadLevel();\n\tmain();\n}", "function setup() {\r\n createCanvas(1280,880);\r\n\tengine = Engine.create();\r\n\tworld = engine.world;\r\n monster1=new Monster(700,200,40);\r\n monster2=new Monster(950,240,50);\r\n monster3=new Monster(1180,100,45); \r\n monster4=new Monster(1090,700,55);\r\n monster5=new Monster(710,650,55);\r\n monster6=new Monster(1000,500,40);\r\n ground1=new Ground(700,250,75,10);\r\n ground2=new Ground(950,290,75,10);\r\n ground3=new Ground(1180,150,75,10);\r\n ground4=new Ground(1090,750,75,10);\r\n ground5=new Ground(710,700,75,10);\r\n ground6=new Ground(1000,550,75,10);\r\n arrow=new Arrow(200,410,100,100);\r\n slingshot=new Slingshot(arrow.body,{x:245,y:320});\r\n slingshot1=new Slingshot(arrow.body,{x:245,y:500});\r\n var bow=createSprite(250,410,100,100);\r\n bow.addImage(bowImg);\r\n bow.scale=0.9;\r\n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n avatar = new Avatar(mouseX,mouseY,AVATAR_MAX_SIZE,AVATAR_SIZE_LOSS_PER_FRAME);\n for (let i = 0; i < NUM_FOOD; i++) {\n foods.push(new Food(random(0,width),random(0,height),random(-FOOD_MAX_SPEED,FOOD_MAX_SPEED),random(-FOOD_MAX_SPEED,FOOD_MAX_SPEED),FOOD_MAX_SPEED,FOOD_MIN_SIZE,FOOD_MAX_SIZE));\n }\n noCursor();\n}", "function setup() {\n cnv = createCanvas(800, 600);\n centerCanvas(); // centering the canvas\n background(0); // setting the background to black\n barPlayer1 = new BarPlayer1();\n barPlayer2 = new BarPlayer2();\n ball = new Ball();\n}", "function setup() {\n createCanvas(800, 600);\n }", "function init() {\n STAGE_WIDTH = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"width\"));\n STAGE_HEIGHT = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"height\"));\n\n // init state object\n stage = new createjs.Stage(\"gameCanvas\"); // canvas id is gameCanvas\n stage.mouseEventsEnabled = true;\n stage.enableMouseOver(); // Default, checks the mouse 20 times/second for hovering cursor changes\n\n setupManifest(); // preloadJS\n startPreload();\n\n stage.update();\n}", "setup() {\n this.createShapes();\n\n this.map = this.createMap();\n }", "function setup() {\n // Create a p5.js canvas 800px wide and 600px high, and assign it to the global variable \"cnv\".\n g.cnv = createCanvas(800, 600);\n // Set the parent element to \"graphics-wrapper\"\n g.cnv.parent(\"graphics-wrapper\");\n // The \"main\" element is unnecessary. Don't worry about this too much\n document.getElementsByTagName(\"main\")[0].remove();\n}", "function setup() {\n // Working in WEBGL\n createCanvas(windowWidth, windowHeight, WEBGL);\n\n // Background (stars and fog)\n bg();\n\n planetButtons();\n\n // Storing HTML elements inside their respective variables\n $sunInfo = $('.sunInfo');\n $mercuryInfo = $('.mercuryInfo');\n $venusInfo = $('.venusInfo');\n $earthInfo = $('.earthInfo');\n $marsInfo = $('.marsInfo');\n $jupiterInfo = $('.jupiterInfo');\n $saturnInfo = $('.saturnInfo');\n $uranusInfo = $('.uranusInfo');\n $neptuneInfo = $('.neptuneInfo');\n $plutoInfo = $('.plutoInfo');\n $buttonGroup = $('.buttonGroup');\n\n // Creating objects (planet spheres)\n sun = new Planet(sunSize, sunTextureImg, 0, 0);\n mercury = new Planet(baseSize, mercuryTextureImg, mercurySpeed, mercuryDistance);\n venus = new Planet(venusSize, venusTextureImg, venusSpeed, venusDistance);\n earth = new Planet(earthSize, earthTextureImg, earthSpeed, earthDistance);\n mars = new Planet(marsSize, marsTextureImg, marsSpeed, marsDistance);\n jupiter = new Planet(jupiterSize, jupiterTextureImg, jupiterSpeed, jupiterDistance);\n saturn = new Planet(saturnSize, saturnTextureImg, saturnSpeed, saturnDistance);\n uranus = new Planet(uranusSize, uranusTextureImg, uranusSpeed, uranusDistance);\n neptune = new Planet(neptuneSize, neptuneTextureImg, neptuneSpeed, neptuneDistance);\n pluto = new Planet(baseSize, plutoTextureImg, plutoSpeed, plutoDistance);\n\n // Creating objects (sound effects)\n sunSound = new Sound(sunSFX);\n mercurySound = new Sound(mercurySFX);\n venusSound = new Sound(venusSFX);\n earthSound = new Sound(earthSFX);\n marsSound = new Sound(marsSFX);\n jupiterSound = new Sound(jupiterSFX);\n saturnSound = new Sound(saturnSFX);\n uranusSound = new Sound(uranusSFX);\n neptuneSound = new Sound(neptuneSFX);\n plutoSound = new Sound(plutoSFX);\n}", "setup() {\n\t\t\tspeed = 5;\n\t\t\tposition = new Vector2D(this.canvas.width/2, this.canvas.height/2);\n\t\t}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n \n}", "function setupCanvas() {\n// setup everything else\n\tconsole.log(\"Setting up canvas...\")\n\tcanvas = document.getElementById(\"drone-sim-canvas\");\n\twindow.addEventListener(\"keyup\", keyFunctionUp, false);\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\twindow.onresize = doResize;\n\tcanvas.width = window.innerWidth-16;\n\tcanvas.height = window.innerHeight-200;\n\tconsole.log(\"Done.\")\n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n agents.push(new Avatar(mouseX,mouseY,AVATAR_MAX_SIZE,AVATAR_SIZE_LOSS_PER_FRAME));\n for (let i = 0; i < 15; i++){\n agents.push(new Food(random(0,width),random(0,height),random(2,5),random(2,5),FOOD_MIN_SIZE,FOOD_MAX_SIZE));\n }\n noCursor();\n}", "function setup() \n{\n pauseMenu();\n var canvas = createCanvas(Clength, Cheight);\n background(\"#96c9e3\");\n\tplayer = createSprite((Cheight/2)-25,Cheight/2,pSize,pSize);\n\tplayer.addImage(playerImage);\n\trocks = new Group();\n\tboundaries = new Group();\n}", "function setUpCanvas() {\n /* clearing up the screen */\n clear();\n /* Set display size (vw/vh). */\n var sizeWidth = (80 * window.innerWidth) / 100,\n sizeHeight = window.innerHeight;\n //Setting the canvas site and width to be responsive\n upperLayer.width = sizeWidth;\n upperLayer.height = sizeHeight;\n upperLayer.style.width = sizeWidth;\n upperLayer.style.height = sizeHeight;\n lowerLayer.width = sizeWidth;\n lowerLayer.height = sizeHeight;\n lowerLayer.style.width = sizeWidth;\n lowerLayer.style.height = sizeHeight;\n rect = upperLayer.getBoundingClientRect();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n // Center our drawing objects\n imageMode(CENTER);\n textAlign(CENTER);\n textSize(24);\n\n // set to one for startup\n drawFunction = drawHouse;\n}" ]
[ "0.77229285", "0.7714343", "0.7528946", "0.7351579", "0.73130625", "0.72914696", "0.7288986", "0.72774637", "0.7268133", "0.7224917", "0.72179705", "0.7195941", "0.71698034", "0.7162266", "0.71571875", "0.7149469", "0.71475816", "0.714474", "0.71308744", "0.7125858", "0.7096251", "0.70946854", "0.7089447", "0.7088051", "0.7085235", "0.7078887", "0.7065151", "0.70606536", "0.7054509", "0.70510066", "0.7036005", "0.7020096", "0.7012394", "0.7011648", "0.70001894", "0.69998455", "0.6990591", "0.6975687", "0.6962577", "0.69620883", "0.69616896", "0.69564736", "0.6951136", "0.6949998", "0.6948577", "0.6945264", "0.6944921", "0.6935988", "0.6933847", "0.6932746", "0.6911691", "0.69092983", "0.6900589", "0.69001263", "0.689494", "0.6894892", "0.68943125", "0.6891884", "0.68899554", "0.6883245", "0.68784267", "0.6877097", "0.68603194", "0.6849472", "0.68472826", "0.6841146", "0.683519", "0.68205905", "0.6816996", "0.6805657", "0.67980677", "0.67980677", "0.6794296", "0.67920804", "0.67856884", "0.6777115", "0.67758054", "0.6773094", "0.67650914", "0.67641115", "0.6761003", "0.67506677", "0.67465174", "0.6744134", "0.6739482", "0.67371285", "0.6734085", "0.6730866", "0.6728466", "0.67212754", "0.67186654", "0.671818", "0.67122096", "0.6710921", "0.6707741", "0.67048675", "0.6704379", "0.6703641", "0.67030585", "0.670165" ]
0.7048346
30
Draw every tick of the clock (FRAME_RATE)
function draw() { background(10,0,40); environment.draw() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clockLoop(){\n\t//update the time\n\tupdate();\n\n\t//draw the clock\n\tdraw();\n}", "function drawClock() {\r\n drawFace(ctx,radius);\r\n drawNumbers(ctx,radius);\r\n drawTime(ctx,radius);\r\n}", "function drawClock() {\n drawFace(ctx, radius);\n drawNumbers(ctx, radius);\n drawTime(ctx, radius);\n}", "function draw() {\n\n var currentTime = new Date(),\n time = pad2(currentTime.getHours()) + pad2(currentTime.getMinutes()) + pad2(currentTime.getSeconds()),\n iDigit;\n\n clearCanvas();\n\n\n for (iDigit = 0; iDigit < 4; iDigit++) {\n drawHHMMDigit(time, iDigit);\n }\n\n //Sekunden zeichnen\n ctx.drawImage(clock_face, time.substr(4, 1) * DIGIT_WIDTH, 0, DIGIT_WIDTH, DIGIT_HEIGHT, xSecondStartPos, 5, secondWidth, secondHeight);\n ctx.drawImage(clock_face, time.substr(5, 1) * DIGIT_WIDTH, 0, DIGIT_WIDTH, DIGIT_HEIGHT, xSecondStartPos + secondWidth, 5, secondWidth, secondHeight);\n}", "function drawClock()\n{\n\tclockCtx.clearRect(0,0,clockCWidth, clockCHeight);\n\tdrawClockOutline();\n\tdrawNumbers();\n\tdrawHands();\n\tsetTimeout(drawClock, 20);\n}", "function tick() {\n requestAnimFrame(tick);\n draw();\n}", "function tick() {\n requestAnimFrame(tick);\n draw();\n}", "function tick(){\n // Save the current time\n g_seconds = performance.now()/1000.0-g_startTime;\n //console.log(g_seconds);\n\n //Update animation angles:\n updateAnimationAngles();\n\n // Draw Everything: \n renderAllShapes();\n\n // Tell the browser to update again when it has time \n requestAnimationFrame(tick);\n}", "function tick() {\n // Save the current time\n g_seconds = performance.now() / 1000.0 - g_startTime;\n\n // Draw everything\n renderAllShapes();\n\n // Tell the browser to update again when it has time\n requestAnimationFrame(tick);\n}", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n}", "function tick() {\n requestAnimFrame(tick);\n draw();\n animate();\n}", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "function tick() {\r\n\trequestAnimFrame(tick);\r\n\tdraw();\r\n\tanimate();\r\n}", "Tick()\n {\n let resized = this.Resize(false, true);\n\n const\n now = this.now,\n previousTime = this.previousTime === null ? now : this.previousTime;\n\n this.currentTime = (now - this.startTime) * 0.001;\n this.dt = (now - previousTime) * 0.001;\n this.previousTime = now;\n\n this.tw2.variables.SetValue(\"Time\", [\n this.currentTime,\n this.currentTime - Math.floor(this.currentTime),\n this.frameCounter,\n previousTime * 0.001\n ]);\n\n this._fpsFrameCount++;\n if (now >= this._fpsPreviousTime + 1000)\n {\n this.fps = Math.floor((this._fpsFrameCount * 1000) / (now - this._fpsPreviousTime));\n this._fpsFrameCount = 0;\n this._fpsPreviousTime = now;\n }\n\n this.frameCounter++;\n\n // Auto redraw canvas 2d\n if (this.canvas2d && (this.autoClearCanvas2dPerFrame || resized && this.autoClearCanvas2dOnResize))\n {\n this.ClearCanvas2d();\n }\n }", "function tick() {\n requestAnimFrame(tick);\n draw();\n handleKeys();\n animate();\n}", "function tick()\r\n {\r\n try\r\n {\r\n var now = new Date();\r\n var dt = Math.max(0, now - (last_frame_time || now)) / 1000;\r\n last_frame_time = now;\r\n // TODO: smoother updates, particularly on Windows where the timer\r\n // is limited to ~16msec resolution\r\n\r\n game.game_tick(gctx, w, h, keys, dt);\r\n if (game.render_ctx !== screen_ctx)\r\n {\r\n screen_ctx.drawImage(game.render_canvas, 0, 0);\r\n }\r\n\r\n profile_report();\r\n framerate_update();\r\n write_status_data(status_data);\r\n status_data.clear();\r\n game.cursor_move.clear();\r\n }\r\n catch (e)\r\n {\r\n debug(e);\r\n }\r\n }", "function tick() {\r\n requestAnimFrame(tick);\r\n handleKeys();\r\n draw();\r\n\r\n\r\n animate();\r\n}", "function drawTimer() {\n\t\t\n\t\t// Clear the canvas\n\t\tcontext.clearRect( 0, 0, canvasSide, canvasSide );\n\t\t\n\t\tcenter = canvasSide/2;\n\t\tradius = center - lineThickness - timerPadding;\n\t\t\n\t\t// Red circle\n\t\tcontext.beginPath();\n\t\tcontext.strokeStyle = '#8C8255';\n\t\tcontext.fillStyle = '#D0CFD7';\n\t\tcontext.lineWidth = lineThickness;\n\t\tcontext.arc( center, center, radius, (Math.PI/180)*0, (Math.PI/180)*360, false );\n\t\t\n\t\tcontext.stroke();\n\t\tcontext.fill();\n\t\tcontext.closePath();\n\t\t\n\t\t//addTicks();\n\t\t\n\t\tmarkTime();\n\t}", "function runTimeFrame() {\n g.beginPath();\n evolve();\n draw();\n g.stroke();\n }", "function renderTime() {\n ctx.fillStyle = \"#333\";\n ctx.fillRect(690, 10, 90, 31);\n\n ctx.fillStyle = \"#FFF\";\n ctx.font = \"14px sans-serif\";\n ctx.fillText(\"Time: \", 700, 30);\n\n var timeNow = new Date();\n timePlayed = msToMMSS(timeNow - startToPlay);\n ctx.fillStyle = \"#FFF\";\n ctx.font = \"14px sans-serif\";\n ctx.fillText(timePlayed, 740, 31);\n\n if (!gameOver) {\n requestAnimationFrame(renderTime);\n }\n}", "function gameDraw()\n{\n\tstate.gameDraw();\t\n\t/* repeat */\n\trequestAnimationFrame(gameDraw);\n}", "function drawTimer() {\n\t\t\n\t\t// Clear the canvas\n\t\tcontext.clearRect( 0, 0, canvasSide, canvasSide );\n\t\t\n\t\tcenter = canvasSide/2;\n\t\tradius = center - lineThickness - timerPadding;\n\t\t\n\t\t// Red circle\n\t\tcontext.beginPath();\n\t\tcontext.strokeStyle = '#979797';\n\t\tcontext.fillStyle = '#7B0B0B';\n\t\tcontext.lineWidth = lineThickness;\n\t\tcontext.arc( center, center, radius, (Math.PI/180)*0, (Math.PI/180)*360, false );\n\t\t\n\t\tcontext.stroke();\n\t\tcontext.fill();\n\t\tcontext.closePath();\n\t\t\n\t\t// Mustard circle\n\t\tradius = center - 20 - timerPadding;\n\t\tcontext.beginPath();\n\t\tcontext.strokeStyle = '#979797';\n\t\tcontext.fillStyle = '#F0CB8E';\n\t\tcontext.lineWidth = lineThickness;\n\t\tcontext.arc( center, center, radius, (Math.PI/180)*0, (Math.PI/180)*360, false );\n\t\t\n\t\tcontext.stroke();\n\t\tcontext.fill();\n\t\tcontext.closePath();\n\t\t\n\t\taddTicks();\n\t\t\n\t\tmarkTime();\n\t}", "function drawFPS() {\n if (fps === 0)\n return;\n\n ctx.font = '16px Arial';\n ctx.fillStyle = fpsColor;\n ctx.textAlign = 'right';\n ctx.fillText(fps, width - 10, 20);\n }", "function tick () {\n // This will use or `now` function to\n // get the current time in the right format.\n // Then we'll update the element's HTML with the time\n let time = now('time');\n clock.innerHTML = time;\n\n // This will use or `now` function to\n // get the current time in the right format.\n // Then we'll update the body's background with the color\n let color = now('color');\n body.style.backgroundColor = color;\n}", "function tick()\n{\n\thandleKeys();\n\tdraw();\n\tanimate();\n\trequestAnimationFrame(tick);\n}", "function loop(){\r\n update(); \r\n draw();\r\n frames++;\r\n requestAnimationFrame(loop);\r\n}", "function tick() {\n gameLogic();\n drawFrame();\n \n if (gameRunning) setTimeout(tick, 100);\n}", "loop() {\n if (document.hidden) { this.running = false }\n\n let now = Date.now(),\n delta = now - (this.lastRender || now)\n this.lastRender = now;\n\n if (this.running) {\n this.draw(delta)\n this.frames++\n }\n\n requestAnimationFrame(() => this.loop());\n\n // Display fps and position\n if (now - this.lastFps > 999) {\n this.fpsMeter.innerText = this.frames\n this.lastFps = now;\n this.frames = 0;\n }\n }", "function draw(){\n\tctx.clearRect(0,0,width,height); //清空工作区重画,不然所有的轨迹都有\n\tvar now = new Date();\n\tvar hour = now.getHours();\n\tvar min = now.getMinutes();\n\tvar sec = now.getSeconds();\n\tdrawBackground();\n\tdrawHour(hour,min);\n\tdrawMin(min);\n\tdrawSec(sec);\n\tdrawDot();\n\tctx.restore();//恢复原来环境,坐标原点左上角.因为中间调用了一次原点是设置,所以需要还原\n}", "handleTick() {\n this.update()\n this.draw()\n }", "function frame() {\n rAF = requestAnimationFrame(frame);\n\n now = performance.now();\n dt = now - last;\n last = now;\n\n // prevent updating the game with a very large dt if the game were to lose focus\n // and then regain focus later\n if (dt > 1E3) {\n return;\n }\n\n emit('tick');\n accumulator += dt;\n\n while (accumulator >= delta) {\n loop.update(step);\n\n accumulator -= delta;\n }\n\n clearFn(context);\n loop.render();\n }", "function loop() {\n update();\n draw();\n // When ready to redraw the canvas call the loop function\n // first. Runs about 60 frames a second\n window.requestAnimationFrame(loop);\n}", "function loop() {\n draw();\n update();\n frames++;\n requestAnimationFrame(loop);\n}", "function render() {\n\t\trate = (droppedFrames > 0) ?\n\t\t\t((rate+(FPS/(droppedFrames*2)))/2):\n\t\t\t((rate + FPS)/2);\n\t\t\t\n\t\tcycleCounter = (cycleCounter + 1) % FPS;\n\t\tframeCounter = (frameCounter + 1) % 1e15;\n\t\t// just render every N frames to avoid a jarring display\n\t\tdroppedFrames = -1;\n\t\trdCallback();\n\t}", "loop() {\n this.display();\n this.draw();\n setTimeout(()=>this.loop(), 200)\n\n }", "function draw() {\r\n\tdrawTimer();\r\n\t//drawGratii();\r\n}", "function render() {\n timer.innerHTML = (clock / 1000).toFixed(3);\n }", "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 }", "draw() {\n let minCount = this.minuteCount();\n let minPosition = this.minutePosition();\n this.drawBG();\n this.drawFog(this.getFogOpacity(minCount, minPosition));\n this.drawActiveVisitors();\n this.drawTime(minCount);\n }", "tick() {\n if (this.isRunning) {\n const now = Date.now();\n this.elapsedTime = this.elapsedTime + (now - this.previousTime);\n this.previousTime = now; \n }\n this.display.updateTime(this.elapsedTime);\n this.display.updateDisplay();\n }", "start() {\n var time = new Date;\n var _this = this;\n\n if (this.fps == 60) {\n this.runLoop = displayBind(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = displayBind(tick);\n time = new Date;\n });\n } else {\n this.runLoop = setTimeout(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = setTimeout(tick, 1000 / _this.fps);\n time = new Date;\n }, 1000 / this.fps);\n }\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 draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 30);\n\t\t\t}", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 20);\n\t\t\t}", "function clockTick() {\n\tvar current_time = new Date();\n\t currTimeFormatted = formatTimeElement(current_time);\n\n\tupdateTimer(current_time);\n\tsetTimeout(clockTick, 500);\n}", "runClock() {\n this.running = true;\n this.setTime();\n window.requestAnimationFrame(() => this.setTime());\n }", "function tick() {\n\n //make framecount always be a number between 0 to 600\n if (framecount<600) \n framecount++;\n else\n { \n flag++;\n framecount=framecount%600;\n }\n\n requestAnimFrame(tick);\n draw();\n animate();\n \n \n\n}", "function draw() {\n count += .1;\n requestAnimationFrame( draw );\n render();\n }", "function svgClock() {\n\t\t\t// Get current time.. again\n\t\t\tvar now = new Date();\n\t\t\tvar h, m, s;\n\t\t\th = 30 * ((now.getHours() % 12) + now.getMinutes() / 60);\n\t\t\tm = 6 * now.getMinutes();\n\t\t\ts = 6 * now.getSeconds();\n\n\t\t\t// Find pointers of the clock, rotate\n\t\t\tdocument.getElementById('h_pointer').setAttribute('transform', 'rotate(' + h + ', 50, 50)');\n\t\t\tdocument.getElementById('m_pointer').setAttribute('transform', 'rotate(' + m + ', 50, 50)'); \n\t\t\tdocument.getElementById('s_pointer').setAttribute('transform', 'rotate(' + s + ', 50, 50)');\n\t\t\t\n\t\t\t// Loop every second\n\t\t\tsetTimeout(svgClock, 1000);\n\t\t}", "function drawClock() {\n ctx.arc(0, 0, radius, 0, 2 * Math.PI);\n ctx.fillStyle = \"white\";\n ctx.fill();\n}", "function tick() {\n var interval = 40, //TODO: parameterize for user to throttle speed\n canvas = this.canvas,\n grid = this.grid;\n\n var runStep = function () {\n draw(canvas, grid);\n grid = nextStep(grid);\n };\n\n this.isRunning = setInterval(runStep, interval);\n}", "function drawFrame() {\n\tif (drawNext) {\n\t\trenderFrame();\n\t\tdrawNext = false;\n\t}\n}", "function draw() {\n if(video.paused || video.ended) return false;\n context.drawImage(video,0,0);\n processImage();\n var nowTime = new Date();\n var diffTime = Math.ceil((nowTime.getTime() - lastTime.getTime()));\n if (diffTime >= 1000) {\n fps = frameCount;\n frameCount = 0.0;\n lastTime = nowTime;\n }\n\n context.fillStyle = '#000000';\n context.fillRect(0, context.width - 15, 0, 15);\n context.fillStyle = '#FFF';\n context.font = 'bold 14px helvetica';\n context.fillText('FPS: ' + fps + '/' + maxfps, 4, canvas.height - 4);\n context.restore();\n frameCount++;\n setTimeout(draw,drawInterval);\n}", "function tick() {\r\n now = window.performance.now();\r\n delta = (now-last); // in milliseconds\r\n if(t_cooldown>0) {\r\n t_cooldown -= delta*dcd;\r\n } else {\r\n t -= delta*dt;\r\n }\r\n t = t<0 ? 0 : t;\r\n last = now;\r\n\r\n // Update fps counter\r\n fhStart = (fhStart+1)%100;\r\n fhEnd = (fhEnd+1)%100;\r\n frameHistory[fhEnd] = now;\r\n fpsElement.textContent = Math.ceil( 1000.0*frameHistory.length/(now-frameHistory[fhStart]) )\r\n }", "startClock() {\n const _this = this;\n\n this.clock = setInterval(() => {\n _this.tick();\n }, 1); // 1 ms delay == 1 KHz clock == 0.000001 GHz\n }", "function tick() {\n requestAnimationFrame(tick);\n\n drawScene();\n animate();\n}", "function loop(){\n stats.begin();\n\n canv_draw();\n \n sim_update();\n\n stats.end();\n \n requestAnimationFrame(loop);\n}", "_gameLoop () {\r\n\t\tthis.particleThread = setInterval(() => {\r\n\t\t\tthis._draw();\r\n\t\t}, this._cycleTimer);\r\n\t}", "doDraw() {\n let v = Math.min(Math.floor(Math.abs((this.life_time%120)-60.0)*(16/60)),15);\n draw_context.strokeStyle = \"#000\" + v.toString(16);\n draw_context.fillStyle = \"#FFF\" + v.toString(16);\n draw_context.font = \"40px Times\";\n draw_context.lineWidth = 10;\n draw_context.strokeText(this.text, canvas_element.width/2, 400);\n draw_context.fillText(this.text, canvas_element.width/2, 400);\n }", "function make_loop(renderer, time){\n\tsetInterval(function(){ game_draw(renderer)}, time);\n}", "displayFPS(f) {\r\n\t\tthis.ctx.beginPath()\r\n\t\tthis.ctx.font = \"10px Arial\"\r\n\t\tthis.ctx.fillStyle = \"#00ff00\"\r\n\t\tthis.ctx.fillText('FPS: '+ Math.round(f),10,15);\r\n\t\tthis.ctx.fill()\r\n\t\tthis.ctx.closePath()\r\n\t}", "function drawAnimated(timeStamp) {\n updateDrawables(timeStamp);\n draw();\n window.requestAnimationFrame(drawAnimated);\n}", "function draw() {\n\t//updating all the partical\n\tupdate();\n\t//drawing\n\tbackground(41, 128, 185);\n\tfor(var index = 0; index < particleSystem.length; index++) {\n\t\tparticleSystem[index].draw()\n\t}\n\n\t//text(\"fps\" + frameRate(), 25, 100);\n}", "function loop(){\n update();\n draw();\n window.requestAnimationFrame(loop);\n}", "function drawFrame() {\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n }", "function drawTime()\n{\n let dt = adjustedNow();\n let date = \"\";\n let timeDef;\n let x = 0;\n dt.setDate(dt.getDate());\n if(addTimeDigit){\n x =\n 10368*dt.getHours()+172.8*dt.getMinutes()+2.88*dt.getSeconds()+0.00288*dt.getMilliseconds();\n let msg = \"00000\"+Math.floor(x).toString(12);\n let time = msg.substr(-5,3)+\".\"+msg.substr(-2);\n let wait = 347*(1-(x%1));\n timeDef = time6;\n } else {\n x =\n 864*dt.getHours()+14.4*dt.getMinutes()+0.24*dt.getSeconds()+0.00024*dt.getMilliseconds();\n let msg = \"0000\"+Math.floor(x).toString(12);\n let time = msg.substr(-4,3)+\".\"+msg.substr(-1);\n let wait = 4167*(1-(x%1));\n timeDef = time5;\n }\n if(lastX > x){ res = getDate(dt); } // calculate date once at start-up and once when turning over to a new day\n date = formatDate(res,dateFormat);\n if(dt<timeActiveUntil)\n {\n // Write to background buffers, then display on screen\n writeDozDate(date,calenDef,res.colour);\n writeDozTime(time,timeDef);\n g.flip();\n // Ready next interval\n drawtime_timeout = setTimeout(drawTime,wait);\n }\n else\n {\n // Clear screen\n g_d.clear();\n g_t.clear();\n g.flip();\n\n }\n lastX = x;\n}", "function animate() {\n // request another frame\n requestAnimationFrame(animate);\n\n // calc elapsed time since last loop\n now = Date.now();\n elapsed = now - then;\n\n // if enough time has elapsed, draw the next frame\n if (elapsed > fpsInterval) {\n then = now - (elapsed % fpsInterval);\n\n // Put your drawing code here\n buildBoard();\n headSnake();\n drawPlayer();\n //checkPoint();\n drawPoints();\n }\n}", "function draw() {\n background(250);\n\n push();\n \n let step = frameCount % 600; // Modulus operator limits step variable to between 0 and 600.\n\n // An example of how to draw a graphic with the P5.js library. This statement draws a line that moves across the canvas every 10 seconds (10000 ms). Recall that 16.67 ms * 600 = 10000 ms or 10 seconds.\n\n stroke(255, 100, 100); // Color of the line\n strokeWeight(3); // Width of the line\n // \"line\" syntax: line(x1, y2, x2, y2)\n line(\n (step / 600) * width,\n height / 2 - 150,\n (step / 600) * width,\n height / 2 + 150\n );\n pop();\n}", "function loop() {\n draw();\n requestAnimFrame(loop);\n}", "function drawTimer() {\r\n ctx.font = \"24px Arial\";\r\n ctx.fillStyle = \"#FF0000\";\r\n ctx.fillText(\"Time: \"+time, 400, 25);\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 gameLoop() \n{\n window.requestAnimationFrame(gameLoop);\n var now = new Date().getTime();\n var dt = (now - (time || now))/FRAME_RATE;\n\tmyControl.updateGame(myGame,dt);\n time = now;\n \n\t//***DEBUGING text lines example\n //myControl.m_Dev.debugText(myGame.playState,50,50);\n}", "function FPS() {\n\t\tresize();\n\t\ttimeouts();\n\t\t(CS.tab === 'game' && S && S.firstTick && CS.enableGraphics) && R.drawCanvas();\n\t\t$timeout(FPS, Math.round(1000/CS.FPS));\n\t}", "function render( timestamp )\n\t{\n\t\t\n\t\trequestAnimationFrame( render );\n\t\t\n\t\tcanvas_handler.draw_all( );\n\t\t\n\t}", "function fpsTick(thisFrame) {\n fpsStart = fpsStart || new Date().getTime();\n if (thisFrame - fpsStart >= 1000) {\n fpsStart += 1000;\n fps = fpsCounting;\n fpsCounting = 0;\n fpsText.innerHTML = fps + \" fps\";\n }\n fpsCounting++;\n if (debug)\n addTaskForFrame(fpsTick);\n }", "function loop(){\r\n // Updates the game\r\n update();\r\n // Calls the \"draw\"-function\r\n draw();\r\n // Counts frames drawn to the canvas\r\n frames++;\r\n // Loops\r\n requestAnimationFrame(loop);\r\n}", "function updateClock(x)\n {\n setClock(x);\n dimOutClock(x.length, 8, 20);\n }", "startGameClock() {\n var that = this;\n (function animationLoop() {\n that.tick();\n\n if (that.isRunning)\n requestAnimationFrame(animationLoop);\n })()\n }", "function draw() { \n requestAnimationFrame(draw);\n \n now = Date.now();\n delta = now - then;\n \n if (delta > interval_frame) {\n\n // update time stuffs \n then = now - (delta % interval_frame);\n\n /* -------- CODE --------- */\n\n \tctx.globalCompositeOperation = 'destination-over';\n\t\tctx.clearRect(0,0,canvas.width,canvas.height);\t// clear canvas \n\n\t\t// game is paused\n\t\tif (!isRunning) {\n\t\t\tctx.save();\n\t\t\tctx.fillStyle=\"white\";\n\t\t\tctx.textAlign=\"center\"; \n\t\t\tif (isBeginning) {\n\t\t\t\tctx.font = \"normal normal 700 6em Montserrat\";\n\t\t\t\tctx.fillText(\"LEVEL \"+(level+1), canvas.width/2, canvas.height/2*0.95);\n\t\t\t\tctx.font = \"normal normal normal 2.4em Montserrat\";\n\t\t\t\tctx.fillText(\"click to start\", canvas.width/2, canvas.height/2*1.1);\n\t\t\t} else if (isGameover) {\n\t\t\t\tctx.font = \"normal normal 700 6em Montserrat\";\n\t\t\t\tctx.fillText(\"GAMEOVER\", canvas.width/2, canvas.height/2*0.95);\n\t\t\t\tctx.font = \"normal normal normal 2.4em Montserrat\";\n\t\t\t\tctx.fillText(\"click to restart the game\", canvas.width/2, canvas.height/2*1.1);\n\t\t\t}else if (isCought) {\n\t\t\t\tctx.font = \"normal normal 700 6em Montserrat\";\n\t\t\t\tctx.fillText(\"CAUGHT\", canvas.width/2, canvas.height/2*0.95);\n\t\t\t\tctx.font = \"normal normal normal 2.4em Montserrat\";\n\t\t\t\tctx.fillText(\"click to try again\", canvas.width/2, canvas.height/2*1.1);\n\t\t\t} else if (isWon) { \n\t\t\t\tctx.font = \"normal normal 700 6em Montserrat\";\n\t\t\t\tctx.fillText(\"YOU WON\", canvas.width/2, canvas.height/2*0.95);\n\t\t\t\tctx.font = \"normal normal normal 2.4em Montserrat\";\n\t\t\t\tctx.fillText(\"click to play again\", canvas.width/2, canvas.height/2*1.1);\n\t\t\t} else {\n\t\t\t\tctx.font = \"normal normal 700 6em Montserrat\";\n\t\t\t\tctx.fillText(\"PAUSED\", canvas.width/2, canvas.height/2*0.95);\n\t\t\t\tctx.font = \"normal normal normal 2.4em Montserrat\";\n\t\t\t\tctx.fillText(\"click to continue\", canvas.width/2, canvas.height/2*1.1);\n\t\t\t}\n\t\t\t\n\t\t\t// overlay\n\t\t\tctx.fillStyle=\"rgba(44,62,80,0.8)\";\n\t\t\tctx.fillRect(0,0,canvas.width, canvas.height);\n\t\t\tctx.restore();\n\t\t} else {\n\t\t\tisBeginning = false;\n\t\t\tisGameover = false;\n\t\t\tisCought = false;\n\t\t}\n\t\t\n\t\t// draw backgroundImage\n\t\tctx.drawImage(grid.image, \n\t \t0, 0, grid.image.width, grid.image.height, \n\t \t0, 0, canvas.width, canvas.height);\n\n\t\tdrawPacman();\n\t\tdrawGhosts();\n\n\t\t// draw dots\n\t\ttry {\n\t\t\tvar wMax = grid.x\n\t\t for (var w = 0; w < wMax; w++) {\n\t\t \tvar hMax = grid.y\n\t\t\t\tfor (var h = 0; h < hMax; h++) {\n\t\t\t\t\tif (dots[w][h]) {\n\t\t\t\t\t\tdot = getPixelCenter(w, h);\n\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t ctx.arc(dot.x, dot.y, characterSize*0.15, 0, 2 * Math.PI);\n\t\t\t\t\t ctx.fillStyle = '#cccccc';\n\t\t\t\t\t ctx.fill();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\th = 0;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// do nothing\n\t\t\t// not critical, just annoying\n\t\t}\t\n\t\t\n }\n}", "function run(now_in=null) {\n\n if(now_in === null) {\n var now = new Date();\n requestAnimationFrame(function() {run(null); });\n } else\n var now = now_in;\n\n var sec = now.getSeconds();\n\n var w = canvas.width;\n var h = canvas.height;\n\n if(canvas.offsetWidth === w && canvas.offsetHeight === h\n && oldSec === sec)\n // Nothing new to draw. We do not draw if there is no change\n // in what we would draw.\n return;\n else if(canvas.offsetWidth === 0 || canvas.offsetHeight === 0)\n // It must be hidden\n return;\n else {\n //console.log(\"w,h=\" + w + ',' + h);\n w = canvas.width = canvas.offsetWidth;\n h = canvas.height = canvas.offsetHeight;\n oldSec = sec;\n }\n\n ctx.save();\n ctx.clearRect(0, 0, w, h);\n ctx.translate(w/2, h/2);\n ctx.scale(w/300,h/300);\n ctx.rotate(-Math.PI / 2);\n ctx.strokeStyle = 'black';\n ctx.fillStyle = 'white';\n ctx.lineWidth = 8;\n ctx.lineCap = 'round';\n\n // Hour marks\n ctx.save();\n for (var i = 0; i < 12; i++) {\n ctx.beginPath();\n ctx.rotate(Math.PI / 6);\n ctx.moveTo(100, 0);\n ctx.lineTo(120, 0);\n ctx.stroke();\n }\n ctx.restore();\n\n // Minute marks\n ctx.save();\n ctx.lineWidth = 5;\n for (i = 0; i < 60; i++) {\n if (i % 5!= 0) {\n ctx.beginPath();\n ctx.moveTo(117, 0);\n ctx.lineTo(120, 0);\n ctx.stroke();\n }\n ctx.rotate(Math.PI / 30);\n }\n ctx.restore();\n \n var min = now.getMinutes();\n var hr = now.getHours();\n hr = hr >= 12 ? hr - 12 : hr;\n\n ctx.fillStyle = 'black';\n\n // write Hours\n ctx.save();\n ctx.rotate(hr * (Math.PI / 6) + (Math.PI / 360) * min + (Math.PI / 21600) *sec);\n ctx.lineWidth = 14;\n ctx.beginPath();\n ctx.moveTo(-20, 0);\n ctx.lineTo(80, 0);\n ctx.stroke();\n ctx.restore();\n\n // write Minutes\n ctx.save();\n ctx.rotate((Math.PI / 30) * min + (Math.PI / 1800) * sec);\n ctx.lineWidth = 10;\n ctx.beginPath();\n ctx.moveTo(-28, 0);\n ctx.lineTo(112, 0);\n ctx.stroke();\n ctx.restore();\n \n // Write seconds\n ctx.save();\n ctx.rotate(sec * Math.PI / 30);\n ctx.strokeStyle = '#D40000';\n ctx.fillStyle = '#D40000';\n ctx.lineWidth = 6;\n ctx.beginPath();\n ctx.moveTo(-30, 0);\n ctx.lineTo(83, 0);\n ctx.stroke();\n ctx.beginPath();\n ctx.arc(0, 0, 10, 0, Math.PI * 2, true);\n ctx.fill();\n ctx.beginPath();\n ctx.arc(95, 0, 10, 0, Math.PI * 2, true);\n ctx.stroke();\n ctx.fillStyle = 'rgba(0, 0, 0, 0)';\n ctx.arc(0, 0, 3, 0, Math.PI * 2, true);\n ctx.fill();\n ctx.restore();\n\n ctx.beginPath();\n ctx.lineWidth = 14;\n ctx.strokeStyle = '#325FA2';\n ctx.arc(0, 0, 142, 0, Math.PI * 2, true);\n ctx.stroke();\n\n ctx.restore();\n }", "cycle() {\n this.scanline_cycle();\n this.clock.vdp_frame_cycle += this.clock.vdp_divisor;\n this.clock.hpos++;\n if (this.clock.hpos === 342) this.new_scanline();\n }", "function drawNumbers()\n{\n\tclockCtx.fillStyle=\"white\";\n\tclockCtx.font=\"20px Arial\";\n\tvar nX, nY, radius = (clockCWidth/2)-15;\n\tvar nXOffset = -6, nYOffset = 7;\n\tfor (var i = 0; i < 12; i++)\n\t{\n\t\tnX = Math.cos(Math.PI/6*i-Math.PI/3)*radius + clockCenter + nXOffset;\n\t\tnY = Math.sin(Math.PI/6*i-Math.PI/3)*radius + clockCenter + nYOffset;\n\t\tclockCtx.fillText(i+1, nX, nY, 500);\n\t}\n}", "function loop() {\n redDrawBg();\n reDrawParticles();\n drawLines();\n requestAnimationFrame(loop);\n }", "update() {\n this.tickCount += 1;\n if (this.tickCount > this.ticksPerFrame) {\n this.tickCount = 0;\n // If the current frame index is in range\n if (this.frameIndex < this.numberOfFrames - 1) {\n // Go to the next frame\n this.frameIndex += 1;\n } else {\n this.frameIndex = 0;\n }\n }\n }", "function startGame()\n{\n\tsetInterval(draw, Math.floor(1000/30));\n}", "function draw(canvas, ctx) {\n\t\n \n\n ctx.beginPath();\n ctx.fillStyle = \"rgba(0, 0, 0, 0.02)\";\n ctx.fillRect(-width, -height, 2*width, 2*height);\n\t\n //ctx.beginPath();\n //ctx.arc(Math.floor(width * Math.random()), Math.floor(height * Math.random()),10,Math.PI*2, false);\n \t//ctx.strokeStyle=\"white\";\n\n\n\n if (frameCount % wait === 0) {\n \n drawcycle(ctx,width/4, height/4,20*i,15,89,208,38,1-i%10/10); //89,208,38\n drawcycle(ctx,width*3/4, height/4,20*i,15,241,235,52,1-i%10/10);//241, 235, 52\n drawcycle(ctx,width/4, height*3/4,20*i,15,30,178,239,1-i%10/10);//30, 178, 239\n drawcycle(ctx,width*3/4, height*3/4,20*i,15,240,114,61,1-i%10/10);//240, 114, 61 \n i+=1;\n\n if(i==20){\n i=1;\n ctx.fillStyle = \"black\";\n ctx.fillRect(-width, -height, 2*width, 2*height);\n\n }\n\n }\n frameCount += 1;\n\n // for event handler\n for (var j=0; j<cycles.length; j++) {\n \n //random = Math.floor((Math.random() * 4));\n //drawcycle(ctx,cycles[j].x, cycles[j].y,20*i,15,colors[random].r,colors[random].g,colors[random].r.b,1-i%10/10);\n drawcycle(ctx,cycles[j].x, cycles[j].y,20*i,15,colors[j%4].r,colors[j%4].g,colors[j%4].b,1-i%10/10);\n \n }\n\n\n \n}", "function draw_clock(obj) {\n let sec = map((second ()),0,60,0,360);\n let timecolour = 255;\n\n if((second()) % 2 == 0 ){\n timecolour = 0\n }\n else{\n timecolour = 150\n }\n \n background(0);\n angleMode(DEGREES);\n push();\n fill(timecolour);\n textAlign(CENTER);\n textFont('Courier New');\n translate(width/2, height/2);\n textSize(50);\n text(day() + \" / \" + month(), 0, 0);\n rotate(180+sec);\n fill(255);\n textSize(30);\n text(hour(), 0, 120);\n push();\n fill(255,0,0);\n textSize(30);\n text('-', 0, 148);\n pop();\n textSize(30);\n text(minute(), 0, 180);\n pop();\n\n}", "function loop() {\r\n update();\r\n // When ready to redraw the canvas call the loop function\r\n // first. Runs about 60 frames a second\r\n window.requestAnimationFrame(loop, canvas);\r\n}", "function run() {\n var frame = 0;\n var loop = function() {\n update();\n frame++;\n // update();\n render();\n setTimeout(function() {\n window.requestAnimationFrame(loop, canvas);\n }, 1000/20);\n\n };\n window.requestAnimationFrame(loop, canvas);\n}", "static draw() {\n tick++;\n\n background(51);\n\n for( let b of Ball.zeBalls ) {\n b.show();\n b.step(tick);\n }\n\n // if( tick < 1000 )\n // Ball.saveScreenshot( \"balls-\" + Ball.leadingZeroes(tick, 3) );\n }", "function tickTheClock(){\n\n \n \n}", "updateFrame() {\n this._drawFrame();\n }", "_loop () {\n // Start stat recording for this frame\n if (this.stats) this.stats.begin()\n // Clear the canvas if autoclear is set\n if (this._autoClear) this.clear()\n // Loop!\n if (this.loop) this.loop()\n // Increment time\n this._time++\n // End stat recording for this frame\n if (this.stats) this.stats.end()\n this._animationFrame = window.requestAnimationFrame(this._loop.bind(this))\n }", "function paint()\n{\n\t//timerCount used when frameRate required is 10% of the interval set.\n\t//if timer count reaches 10 (500ms), code is carried out and the count is reset. Otherwise the count increases by 1.\n\tif(timerCount == 10)\n\t{\n\t\t//chapter 3\n\t\t//draw square at x and add to x\n\t\tg2d = canvas3.getContext(\"2d\");\n\t\tg2d.fillRect(canvas3x,200,10,10);\n\t\tcanvas3x += 10;\n\t\t//reset animation when x-coordinates are off-screen\n\t\tif(canvas3x == 650)\n\t\t{\n\t\t\tg2d.fillStyle = \"#FFF\";\n\t\t\tg2d.fillRect(0,0,640,480);\n\t\t\tg2d.fillStyle = \"#000\";\n\t\t\tcanvas3x = 0;\n\t\t}\n\t\ttimerCount = 0;\n\t}\n\telse\n\t\ttimerCount ++;\n\n\t//Draw Canvas in Chapter 4\n\t//Code was designed to replicate that of the java tutorial; a refresh rate based on input could be implemented for performance using booleans.\n\t//speed from input above is added to x-coord, square is then drawn.\n\tplayerx += leftSpeed + rightSpeed;\n\tg2d = canvas4.getContext(\"2d\");\n\tg2d.fillStyle = \"#FFF\";\n\tg2d.fillRect(0,0,640,480);\n\tg2d.fillStyle = \"#000\";\n\tg2d.fillRect(playerx,200,20,20);\n\n\t//Draw Canvas in Chapter 5\n\t//uses playerx and speeds from chapter 4 to save memory\n\tif(start && !dead)\n\t{\n\t\tenemyy+=10;\n\t\tg2d = canvas5.getContext(\"2d\");\n\t\tg2d.fillStyle = \"#FFF\";\n\t\tg2d.fillRect(0,0,640,480);\n\t\tg2d.fillStyle = \"#000\";\n\t\tg2d.fillRect(playerx,400,20,20);\n\t\tg2d.fillStyle = \"#CCC\";\n\t\tg2d.fillRect(enemyx,enemyy,40,40);\n\t\tif(420>enemyy && 360<enemyy && playerx+20>enemyx && playerx<enemyx+40)\n\t\t\tdead = true;\n\t\telse if(enemyy == 480)\n\t\t{\n\t\t\tenemyy = -40;\n\t\t\tenemyx = Math.random()*640;\n\t\t}\n\t}\n}", "function tick() {\n // Remove old points\n points = points.filter(function(point) {\n var age = Date.now() - point.time;\n return age < pointLifetime;\n });\n\n drawLineCanvas();\n drawImageCanvas();\n requestAnimationFrame(tick);\n}", "function startClock() { \n timer = setInterval(displayTime, 500); \n }", "function displayFPS() {\r\n let fps = frameRate();\r\n fill(255);\r\n stroke(0);\r\n text(\"FPS: \" + fps.toFixed(2), 10, height - 10);\r\n}", "calculateFrame() {\n const nowTime = (new Date()).getTime();\n this.tick += 1;\n if (nowTime - this.beforeTime >= 1000) {\n console.log(`fps: ${this.tick}`);\n this.tick = 0;\n this.beforeTime = nowTime;\n }\n }", "function update() {\n clock += change();\n render();\n }", "runAnimation() {\n if (!this.running) { return; }\n this.animationFrame = requestAnimationFrame(this.runAnimation);\n\n this.tick();\n this.draw();\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 }" ]
[ "0.7908788", "0.7850909", "0.7777773", "0.7712145", "0.7663644", "0.7486984", "0.7486984", "0.74633825", "0.7458211", "0.74477315", "0.7404649", "0.73671913", "0.72880125", "0.7235867", "0.72325844", "0.72000074", "0.7106527", "0.7100267", "0.7075389", "0.7051553", "0.7035438", "0.70256513", "0.69987506", "0.6998464", "0.69824165", "0.6960218", "0.6945474", "0.69446486", "0.6932984", "0.6927547", "0.6910868", "0.6893854", "0.6890622", "0.68817985", "0.68735325", "0.686938", "0.6859896", "0.68275815", "0.6822379", "0.68220335", "0.6816288", "0.6813122", "0.68031937", "0.6801127", "0.6799906", "0.67976505", "0.6790989", "0.67879844", "0.6773646", "0.67669994", "0.67551404", "0.6731043", "0.67248404", "0.6706835", "0.6699211", "0.6695986", "0.66935414", "0.6691601", "0.6688915", "0.6680076", "0.6679359", "0.6672188", "0.66710854", "0.6667012", "0.66659904", "0.6654622", "0.66521776", "0.66486734", "0.6644259", "0.66352093", "0.6627463", "0.66267216", "0.6620577", "0.6618737", "0.66082466", "0.66078585", "0.6602582", "0.6601182", "0.65996933", "0.65932727", "0.6591087", "0.65906996", "0.65903395", "0.6584302", "0.6582904", "0.6581253", "0.6571854", "0.6566591", "0.6559745", "0.65577567", "0.6557458", "0.65518683", "0.6531557", "0.6530079", "0.651823", "0.6514245", "0.6512013", "0.6509424", "0.6508388", "0.65031475", "0.64990485" ]
0.0
-1
Environment object, holds the user interface and the game
function Environment(cols,rows){ this.init=function(){ this.game = new Game(cols,rows); this.game.init() } this.manageInput = function(keyCode){ if(this.game.started){ this.game.manageInput(keyCode) } else if (keyCode === ENTER) { this.game.init(); this.game.start(); } } this.showGameOver=function(){ let gameOverMessage = "GAME OVER" let optionsMessage = "Press ENTER to play again" textFont(game_font); textSize(height / 6); textAlign(CENTER, CENTER); fill(200,0,0); text(gameOverMessage, width*0.1, height/4, width*0.8, height/6); textSize(height / 10); fill(200,0,180); text(optionsMessage, width*0.1, height/2, width*0.8, height/6); } this.draw=function(){ if(this.game.started){ this.game.draw() }else{ this.showGameOver() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "environment() {\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // custom texture of environment simulation\n texture(venusEnviro);\n\n // calling the superclass environment() method\n super.environment();\n pop();\n }\n }\n }", "environment() {\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // custom texture of environment simulation\n texture(saturnEnviro);\n\n // calling the superclass environment() method\n super.environment();\n pop();\n }\n }\n }", "function environment(){\r\n push();\r\n table();\r\n pop();\r\n \r\n push();\r\n flower_display();\r\n pop();\r\n \r\n push();\r\n translate(-80,0,0);\r\n flower_display();\r\n pop();\r\n \r\n push();\r\n yoyo_plate();\r\n pop();\r\n}", "function GameUI() {}", "function main() {\n console.log('main');\n g = new Globals(); //instatiates object which encaspulates globals in game (encapuslates 'singleton' components)\n systemManager = new SystemManager(); //instantiate object responsble for updating systems\n\n //create canvas\n ctx = createCanvas(window.innerWidth, window.innerHeight);\n bgColor = [255, 192, 40, 1];\n\n createEntitiesFromBlueprint('player');\n\n createEntitiesFromBlueprint('mesh', 50);\n\n update();\n setInterval(update, fps); //begin update loop in which all systems update / act on all their relevant entities\n\n}", "function environment() {\r\n let gradient = FutterNemo.crc2.createLinearGradient(0, 0, 0, 500);\r\n // Hintergrund Einf�rben\r\n gradient.addColorStop(0, \"#a1beea\");\r\n gradient.addColorStop(1, \"#62d1c9\");\r\n FutterNemo.crc2.fillStyle = gradient;\r\n FutterNemo.crc2.fillRect(0, 0, 1000, 600);\r\n // Funktionsaufrufe - wer zuerst kommt, malt zuerst\r\n drawRocks(350, 460);\r\n drawRocks(400, 410);\r\n drawGrass(925, 150);\r\n drawSand();\r\n drawBox(120, 550);\r\n }", "function init() {\n cookies = new Cookies();\n ui = new UI();\n game = new Game();\n}", "function setupEnvironment() {\n\tconsole.log(\"Setting up Suspend Application\");\n\thideTemplates();\n\tstartClock();\n\tsetupStorage();\n\trender();\n\tattachListeners();\n\tcheckFileAPI();\n}", "function updateEnvironment() {\n // animate environment\n for (var i = 0; i < environment.length; i++) {\n environment[i].update();\n environment[i].draw();\n }\n\n // remove environment that have gone off screen\n if (environment[0] && environment[0].x < -platformWidth) {\n environment.splice(0, 1);\n }\n }", "run() {\n let background = new PIXI.extras.TilingSprite(\n PIXI.loader.resources.blocks.textures.background, \n this.app.renderer.width,\n this.app.renderer.height);\n this.app.stage.addChild(background);\n \n this.key = new Keyboard();\n this.scores = new ScoreTable();\n \n // define available game states\n this.addState('play', new GamePlay(this));\n this.addState('pause', new GamePaused(this));\n this.addState('menu', new GameMenu(this));\n this.addState('gameover', new GameOver(this));\n \n // set initial state\n this.setState('menu');\n \n // start the updates\n this.app.ticker.add(this.update, this);\n }", "init() {\n super.init();\n this.html = require('./sim-html.js');\n\n this.engine.world.gravity.y = 0; // Disable universial downward gravity\n this.scene.load(this.stage, Matter.World, this.engine); // Load the current scene (Add all objects)\n Matter.World.add(this.engine.world, []); // Init the current world\n\n // Start the scene\n Matter.Engine.run(this.engine);\n\n // Add all the planets\n for (let planet of this.planets) {\n planet.addToStage(PIXI, this.stage);\n }\n }", "init() { \n this.ecs.set(this, \"Game\", \"game\", \"scene\")\n }", "function runGame() {\n\tvar g = new Main('game', 'container');\n\tg.init();\n}", "function GameApp() {\n _super.call(this);\n this.Vy = 0;\n this.mouseX = 0;\n this.yLand = 0;\n this.oldX = 0;\n this.frame = 0;\n this.bellFrame = 0;\n this.head = 1;\n this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);\n }", "setupUI () {\n let asteroidsTitle = this.uiObjects['asteroids-title'] = this.add.bitmapText(\n this.physics.world.bounds.centerX, \n this.physics.world.bounds.centerY - this.physics.world.bounds.height / 4,\n 'hyperspace-bold',\n 'JSTEROIDS',\n this.constructor.TITLE_SIZE, 0\n );\n let copyrightText = this.uiObjects['copyright-text'] = this.add.bitmapText(\n this.physics.world.bounds.centerX, \n this.physics.world.bounds.height - this.physics.world.bounds.height / 16,\n 'hyperspace',\n '2019 Petar Nikolov',\n this.constructor.COPYRIGHT_TEXT_SIZE, 0\n );\n let versionText = this.uiObjects['version-text'] = this.add.bitmapText(\n this.physics.world.bounds.width - this.physics.world.bounds.width / 16, \n this.physics.world.bounds.height - this.physics.world.bounds.height / 16,\n 'hyperspace-bold',\n 'v1.0.1',\n this.constructor.VERSION_TEXT_SIZE, 0\n );\n let startGameButton = this.uiObjects['start-game-button'] = new MenuTextButton(\n this, \n this.physics.world.bounds.centerX, \n this.physics.world.bounds.centerY + this.physics.world.bounds.height / 8,\n 'hyperspace',\n 'START GAME',\n this.constructor.BUTTON_SIZE, 0,\n () => { this.game.switchScene('Main'); }\n );\n\n // Center all bitmap texts\n asteroidsTitle.setOrigin(0.5, 0.5);\n copyrightText.setOrigin(0.5, 0.5);\n versionText.setOrigin(0.5, 0.5);\n startGameButton.setOrigin(0.5, 0.5);\n }", "function startGame() {\n\n\t\tvar gss = new Game(win.canvas);\n\n\t\t// shared zone used to share resources.\n gss.set('keyboard', new KeyboardInput());\n gss.set('loader', loader);\n\n\t\tgss.start();\n\t}", "function init() {\n \"use strict\";\n \n resizeCanvas();\n \n background = new CreateBackground();\n Player = new CreatePlayer();\n \n if (window.innerHeight <= 768) {\n background.setup(resources.get(imgFileBackground_small));\n } else {\n background.setup(resources.get(imgFileBackground));\n }\n\n gameArray.splice(0,gameArray.length);\n \n // HTML Components\n htmlBody.addEventListener('keydown', function() {\n uniKeyCode(event);\n });\n \n btnNewGame.addEventListener('click', function() {\n setGameControls(btnNewGame, 'new');\n }); \n \n btnPauseResume.addEventListener('click', function() {\n setGameControls(btnPauseResume, 'pauseResume');\n }); \n \n btnEndGame.addEventListener('click', function() {\n setGameControls(btnEndGame, 'askEnd');\n }); \n \n btnOptions.addEventListener('click', function() {\n setGameControls(btnOptions, 'options');\n });\n \n btnJournal.addEventListener('click', function() {\n setGameControls(btnJournal, 'journal');\n }); \n \n btnAbout.addEventListener('click', function() {\n setGameControls(btnAbout, 'about');\n });\n \n window.addEventListener('resize', resizeCanvas);\n \n setGameControls(btnNewGame, \"init\");\n \n }", "bootUp() {\n // get all functuions of screen class\n // put all heroes in screen/visible\n this.screen.updateImages(this.earlyHeroes)\n // bind(this) -> force screen to use THIS of the GameManager\n this.screen.configurePlayButton(this.play.bind(this))\n this.screen.configureVerifySelectionButton(this.verifySelection.bind(this))\n }", "function setup() {\n createCanvas(1280, 720);\n\n // setup the clickables = this will allocate the array\n clickables = clickablesManager.setup();\n\n // this is optional but will manage turning visibility of buttons on/off\n // based on the state name in the clickableLayout\n adventureManager.setClickableManager(clickablesManager);\n\n // This will load the images, go through state and interation tables, etc\n adventureManager.setup();\n\n // load all text screens\n loadAllText();\n\n // call OUR function to setup additional information about the p5.clickables\n // that are not in the array \n setupClickables();\n\n setupEndings();\n\n fs = fullscreen();\n console.log(\"finished setup\")\n}", "function setupGame(){\n //Build the stage\n stage=new Stage(15,15,\"stage\");\n stage.initialize();\n console.log('stage built');\n}", "constructor(){\n this.dm = new DependencyManager();\n this.em = this.dm.getEntityManager();\n this.screen = this.dm.getScreen();\n \n this.current_gamestate = new InGameState(this.dm);\n }", "function environmentSetUp(){\n \n //Draws background\n var bkg = two.makeRectangle(origin.x, origin.y, canvasWidth, canvasHeight);\n bkg.fill = 'rgba(0, 20, 255, 0.07)';\n\n \n //Draws grid lines\n createGrid();\n\n \n //Draws x and y axes\n var xAxis = two.makeLine(0, midHeight, canvasWidth, midHeight);\n var yAxis = two.makeLine(midWidth, 0, midWidth, canvasHeight);\n \n \n //Draws borders\n var topBorder = two.makeLine(0, 0, canvasWidth, 0);\n topBorder.stroke = '#1976D2'\n topBorder.linewidth = 5;\n \n var rightBorder = two.makeLine(canvasWidth, 0, canvasWidth, canvasHeight);\n rightBorder.stroke = '#1976D2';\n rightBorder.linewidth = 5;\n \n var bottomBorder = two.makeLine(0, canvasHeight, canvasWidth, canvasHeight);\n bottomBorder.stroke = '#1976D2';\n bottomBorder.linewidth = 5;\n \n var leftBorder = two.makeLine(0, 0, 0, canvasHeight);\n leftBorder.stroke = '#1976D2';\n leftBorder.linewidth = 5;\n}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n milliseconds = 1000.0,\n dt = (now - lastTime) / milliseconds;\n\n if (game.currentScene !== previousScene) {\n currentUI.close();\n\n switch (game.currentScene) {\n case game.scenes.gameLost:\n currentUI = new GameLostUI(canvas, ctx, game);\n break;\n\n case game.scenes.gameWon:\n currentUI = new GameWonUI(canvas, ctx, game);\n break;\n\n case game.scenes.game:\n currentUI = new GameUI(canvas, ctx, game);\n break;\n\n case game.scenes.credits:\n currentUI = new CreditsUI(canvas, ctx, game);\n break;\n\n case game.scenes.selectPlayer:\n currentUI = new SelectPlayerUI(canvas, ctx, game);\n break;\n\n case game.scenes.intro:\n currentUI = new IntroUI(canvas, ctx, game);\n break;\n\n default:\n case game.scenes.preload:\n currentUI = new PreloadUI(canvas, ctx, game);\n break;\n }\n }\n\n /* In the next loop we need to know the previous scene in order to detect\n * when the player changed scene, ans we can change the scene object.\n */\n previousScene = game.currentScene;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n currentUI.init(dt);\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function setupGame() {\n // animate the grass and fence\n $(\"#game-screen\").fadeIn(0, function () {\n // uses callbacks to nest the animations\n $(\"#fence\").fadeIn(750, function() {\n $(\"#grass\").fadeIn(500);\n $(\"#input-container\").fadeIn(500);\n });\n });\n \n }", "function Screen(game){\n this.game = game;\n this.environmentManager = new EnvironmentManager(this);\n //this.load();\n this.isActive = false;\n this.isScreenOver = false;\n this.screenStartTime = null;\n this.state = \"none\";\n this.lastMouseX = 0;\n this.lastMouseY = 0;\n this.mousex = 0;\n this.mousey = 0;\n}", "function setup() {\n setupHTMLPointers(); // store all the pointers to the html elements\n // style/theme\n createCanvas(windowWidth, windowHeight);\n background(BG_COLOR);\n textFont(\"Gill Sans\");\n textStyle(BOLD);\n textSize(16);\n textAlign(CENTER, CENTER);\n rectMode(CENTER);\n imageMode(CENTER);\n noStroke();\n // create objects\n gameBackground = new Background(BG_FRONT);\n textBox = new TextBox();\n textBox.insertText(TEXT_BEGIN[0]);\n textBox.buffer(TEXT_BEGIN[1]);\n\n setupMainMenu(); // set up main menu\n setupObjTriggers(); // set up triggers\n setupKeypad(); // create the keypad in html\n setupLock(); // create the lock in html\n\n setupSFX(); // set up sounds\n\n // make sure the width of objTrigger containers is the same as the width of the background image\n let containerLeftMargin = (gameBackground.width) / 2;\n $(\".container\").css({\n \"width\": gameBackground.width.toString() + \"px\",\n // center it\n \"margin-left\": \"-\" + containerLeftMargin.toString() + \"px\"\n });\n // make sure the inventory and direction indicator containers do not overlay the background\n let sideStripWidth = (width - gameBackground.width) / 2;\n $inventory.css({\n \"width\": sideStripWidth.toString() + \"px\"\n });\n $directionIndicator.css({\n \"width\": sideStripWidth.toString() + \"px\"\n });\n}", "function globalContainer() {\n\tvar gameMode = null;\n\tvar globalPlayer1 = new player(1);\n\tvar globalPlayer2 = new player(2);\n\n\t// event driven gameMenu with callbacks to handle initializers\n\tgameMenu(gameMode, globalPlayer1, globalPlayer2);\n\n\t// ==========================================================================\n\t// GLOBAL CONTAINER OBJECTS\n\t// ==========================================================================\n\n\t// Constructor function to prototype player object\n\tfunction player(id) {\n\t\tself.id = id,\n\t\tself.name = \"\",\n\t\tself.wins = 0,\n\t\tself.losses = 0,\n\t\tself.draws = 0,\n\t\tself.avatar = \"\"\n\t}\n\n\t// ==========================================================================\n\t// INITIALIZE SETTINGS\n\t// ==========================================================================\n\n\tfunction gameMenu(gameMode, globalPlayer1, globalPlayer2) {\n\t\t$('#pve-button').click(function() {\n\t\t\tgameMode = 'pve';\n\t\t\t\n\t\t\t// initialize scoreboard, set player names\n\t\t\tinitializeScoreboard(gameMode, globalPlayer1, globalPlayer2);\n\n\t\t\t// Closes overlay\n\t\t\ttoggleWrapper();\n\n\t\t\t// Start game initializer\n\t\t\tinitiateGameType(gameMode, globalPlayer1, globalPlayer2);\n\t\t})\n\n\t\t$('#pvp-button').click(function() {\n\t\t\tgameMode = 'pvp';\n\n\t\t\t// initialize scoreboard, set player names\n\t\t\tinitializeScoreboard(gameMode, globalPlayer1, globalPlayer2);\n\n\t\t\t// Closes overlay\n\t\t\ttoggleWrapper();\n\n\t\t\t// Start game initializer\n\t\t\tinitiateGameType(gameMode, globalPlayer1, globalPlayer2);\n\t\t})\n\t}\n\n\tfunction initializeScoreboard(gameMode, globalPlayer1, globalPlayer2) {\n\t\t// initialize for 1 player vs AI\n\t\tif(gameMode == 'pve') {\n\t\t\tglobalPlayer1.name = prompt('Please enter name for player 1');\n\t\t\t$('#player1-name').text(globalPlayer1.name);\n\t\t\t\n\t\t\tvar namesArray = ['Evil Robot', 'T-1000', 'Cylon', 'Megatron', 'SkyNet'];\n\t\t\tglobalPlayer2.name = namesArray[Math.floor(Math.random()*namesArray.length)];\n\t\t\t$('#player2-name').text(globalPlayer2.name);\n\n\t\t} else {\n\t\t// initialize for 2 players head to head\n\t\t\tglobalPlayer1.name = prompt('Please enter name for player 1');\n\t\t\t$('#player1-name').text(globalPlayer1.name);\n\n\t\t\tglobalPlayer2.name = prompt('Please enter name for player 2');\n\t\t\t$('#player2-name').text(globalPlayer2.name);\n\t\t}\n\t}\n\n\t// Close overlay and render wrapper\n\tfunction toggleWrapper(){\n\t\t$('#wrapper').toggle();\n\t\t$('#overlay').toggle();\n\t}\n\n\t// Update messageboard\n\tfunction status(msg) {\n\t\t$('#status').empty();\n\t\t$('#status').append(msg);\n\t}\n\n\t// ==========================================================================\n\t// INITIALIZE GAME\n\t// ==========================================================================\n\tfunction initiateGameType(gameMode, globalPlayer1, globalPlayer2) {\n\t\tif(gameMode == 'pve') {\n\t\t\tconsole.log('started a pve game');\n\t\t} else {\n\t\t\tconsole.log('started a pvp game');\n\t\t\t// Mutate currentGame object in order to prevent memory leaks with future games / lack of gc support\n\t\t\tcurrentGame = new pvpGame(globalPlayer1, globalPlayer2);\n\t\t}\n\t\treturn;\n\t}\n\n\tfunction pvpGame(player1, player2) {\n\t\t// Initialize board, move, turn, turncounter, randomize players and avatars\n\t\t// var board = [null, null, null, null, null, null, null, null, null]\n\t\t// var turn = null;\n\t\t// var currentMove;\n\t\t// var turnCounter = 1;\n\t\t// var gameOver = false;\n\t\t// var players = [player1, player2];\n\t\t// var playerX = {\n\t\t// \tplayer : randomPlayer(player1, player2),\n\t\t// \tavatar : 'X'\n\t\t// }\n\t\t// var playerO = {\n\t\t// \tplayer : _.without(players, playerX.player)[0],\n\t\t// \tavatar : 'O'\n\t\t// }\n\t\tvar self = this;\n\n\t\tself.board = [null, null, null, null, null, null, null, null, null],\n\t\tself.turn = null,\n\t\tself.currentMove = null,\n\t\tself.turnCounter = 1,\n\t\tself.gameOver = false,\n\t\tself.players = [player1, player2],\n\t\tself.playerX = {\n\t\t\tplayer : randomPlayer(player1, player2),\n\t\t\tavatar : 'X'\n\t\t},\n\t\tself.playerO = {\n\t\t\tplayer : _.without(self.players, self.playerX.player)[0],\n\t\t\tavatar : 'O'\n\t\t}\n\n\t\tfunction freshGame() {\n\t\t\t$('.box').empty();\n\t\t\t$('.box').removeClass('closed');\n\t\t\t$('.box').removeClass('O');\n\t\t\t$('.box').removeClass('X');\n\t\t\t$('.box').addClass('open');\n\t\t}\n\n\t\t// Game Control Flow\n\t\tfreshGame();\n\t\tconsole.log('turncounter is ' + self.turnCounter);\n\t\tself.turn = self.playerX;\n\t\tstatus('<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar);\n\n\t\t$('.box').on('click', function() {\n\t\t\tvar convertToJqueryID = ('#' + this.id);\n\t\t\tself.currentMove = $(convertToJqueryID);\n\t\t\tmove(self.currentMove);\n\t\t\tconsole.log(\"Turn: \" + self.turnCounter);\n\t\t\tif(checkWin(self.turn.avatar) && self.gameOver === true) {\n\t\t\t\tupdateScoreForWin();\n\t\t\t\tupdateScoreBoard();\n\t\t\t\tstatus('<strong>' + self.turn.player.name + ' wins!</strong>');\n\t\t\t\tendGame();\n\t\t\t} else if (self.turnCounter < 10 && self.gameOver === false) {\n\t\t\t\tswitchTurn()\n\t\t\t} else {\n\t\t\t\tupdateScoreForDraw();\n\t\t\t\tupdateScoreBoard();\n\t\t\t\tstatus('<strong>Draw game!</strong>');\n\t\t\t\tendGame();\n\t\t\t}\n\t\t})\n\n\n\n\t\t// Helper functions\n\t\t// Return randomized player\n\t\tfunction randomPlayer(player1, player2) {\n\t\t\treturn (Math.floor(Math.random() * 2) == 0 ? player1 : player2);\n\t\t}\n\n\t\t// Conditional on click handler to process moves\n\t\tfunction move(square) {\n\t\t\tif(square.hasClass('open')) {\n\t\t\t\tsquare.removeClass('open');\n\t\t\t\tsquare.addClass('closed');\n\t\t\t\tsquare.addClass(self.turn.avatar);\n\t\t\t\tsquare.text(self.turn.avatar);\n\t\t\t\tvar index = square.attr('id');\n\t\t\t\tself.board[index] = self.turn.avatar;\n\t\t\t\tself.turnCounter++;\n\t\t\t} else {\n\t\t\t\t// [Note] Call switchTurn on illegal move as double negative will handle this quite well.\n\t\t\t\tswitchTurn();\n\t\t\t\tstatus('Invalid move! \\n<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar); \n\t\t\t}\n\t\t}\n\n\t\t// Check for win condition\n\t\tfunction checkWin(avatar) {\n\t\t\t// First condition checks for null via max turn count\n\t\t\tif(self.board[0] == avatar && self.board[1] == avatar && self.board[2] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[3] == avatar && self.board[4] == avatar && self.board[5] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[6] == avatar && self.board[7] == avatar && self.board[8] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[0] == avatar && self.board[3] == avatar && self.board[6] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[1] == avatar && self.board[4] == avatar && self.board[7] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[2] == avatar && self.board[5] == avatar && self.board[8] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[0] == avatar && self.board[4] == avatar && self.board[8] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[2] == avatar && self.board[4] == avatar && self.board[6] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfunction switchTurn() {\n\t\t\tif(self.turn == self.playerX && self.gameOver === false) {\n\t\t\t\tself.turn = self.playerO;\n\t\t\t\tstatus('<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar);\n\t\t\t} else if(self.turn == self.playerO && self.gameOver === false) {\n\t\t\t\tself.turn = self.playerX;\n\t\t\t\tstatus('<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar);\n\t\t\t}\n\t\t}\n\n\t\tfunction endGame() {\n\t\t\tupdateScoreBoard();\n\t\t\t// Disable boxes to prevent score hacking\n\t\t\t$(\"#box *\").attr(\"disabled\", \"disabled\").off('click');\n\n\t\t\tif(confirm(\"Rematch?\")) {\n\t\t\t\tcurrentGame = null;\n\t\t\t\tdelete currentGame;\n\t\t\t\tcurrentGame = new pvpGame(globalPlayer1, globalPlayer2);\n\t\t\t}\n\t\t}\n\n\t\tfunction updateScoreForWin() {\n\t\t\tself.turn.player.wins++;\n\t\t\t_.without(self.players, self.turn.player)[0].losses++;\n\t\t}\n\n\t\tfunction updateScoreForDraw() {\n\t\t\tself.player1.draws++;\n\t\t\tself.player2.draws++;\n\t\t}\n\n\t\tfunction updateScoreBoard(){\n\t\t\t$('#player1-wins').text(player1.wins);\n\t\t\t$('#player1-losses').text(player1.losses);\n\t\t\t$('#player1-draws').text(player1.draws);\n\n\t\t\t$('#player2-wins').text(player2.wins);\n\t\t\t$('#player2-losses').text(player2.losses);\n\t\t\t$('#player2-draws').text(player2.draws);\n\t\t}\n\n\t} // <--- End of pvpGame \n\n\n\n\n} // <---- End of Global Container", "function AppSolarSystem() {\n this.initialize();\n //this.createBox();\n this.createPlanet(\"mercury\", 0.4, 3, 0.6, 0.8, \"img/textures/mercury/planet.jpg\");\n this.createPlanet(\"venus\", 1, 5, 0.6, 0.7, \"img/textures/venus/planet.jpg\");\n this.createPlanet(\"earth\", 1, 8, 0.5, 0.5, \"img/textures/earth/planet.jpg\", \"img/textures/earth/specular.jpg\");\n this.createPlanet(\"mars\", 0.6, 10, 0.5, 0.3, \"img/textures/mars/planet.jpg\");\n this.createSun();\n }", "function Glados() {\n this.version = 2112;\n\n this.init = function() {\n var msg = \"Hello Daniel. Let's test project THREE.\\n\";\n alert(msg);\n };\n\n this.afterStartup = function() {\n\n // Force scrolling with a few 'help' commands.\n _KernelInputQueue.enqueue('h');\n _KernelInputQueue.enqueue('e');\n _KernelInputQueue.enqueue('l');\n _KernelInputQueue.enqueue('p');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n _KernelInputQueue.enqueue('h');\n _KernelInputQueue.enqueue('e');\n _KernelInputQueue.enqueue('l');\n _KernelInputQueue.enqueue('p');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n\n // Test the 'ver' command.\n _KernelInputQueue.enqueue('v');\n _KernelInputQueue.enqueue('e');\n _KernelInputQueue.enqueue('r');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n\n // Test the 'date' command.\n _KernelInputQueue.enqueue('d');\n _KernelInputQueue.enqueue('a');\n _KernelInputQueue.enqueue('t');\n _KernelInputQueue.enqueue('e');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n\n // Test the 'whereami' command.\n _KernelInputQueue.enqueue('w');\n _KernelInputQueue.enqueue('h');\n _KernelInputQueue.enqueue('e');\n _KernelInputQueue.enqueue('r');\n _KernelInputQueue.enqueue('e');\n _KernelInputQueue.enqueue('a');\n _KernelInputQueue.enqueue('m');\n _KernelInputQueue.enqueue('i');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n \n // Test the 'status' command.\n _KernelInputQueue.enqueue('S');\n _KernelInputQueue.enqueue('t');\n _KernelInputQueue.enqueue('A');\n _KernelInputQueue.enqueue('t');\n _KernelInputQueue.enqueue('U');\n _KernelInputQueue.enqueue('s');\n _KernelInputQueue.enqueue(' ');\n _KernelInputQueue.enqueue('C');\n _KernelInputQueue.enqueue('a');\n _KernelInputQueue.enqueue('k');\n _KernelInputQueue.enqueue('e');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n \n // Load some invalid user program code\n document.getElementById(\"taProgramInput\").value=\"This is NOT hex.\";\n _KernelInputQueue.enqueue('l');\n _KernelInputQueue.enqueue('o');\n _KernelInputQueue.enqueue('a');\n _KernelInputQueue.enqueue('d');\n DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n\n // _KernelInputQueue.enqueue('q');\n // _KernelInputQueue.enqueue('u');\n // _KernelInputQueue.enqueue('a');\n // _KernelInputQueue.enqueue('n');\n // _KernelInputQueue.enqueue('t');\n // _KernelInputQueue.enqueue('u');\n // _KernelInputQueue.enqueue('m');\n // _KernelInputQueue.enqueue(' ');\n // _KernelInputQueue.enqueue('1');\n // DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\n\n // Load THREE (slightly different) valid user programs code and run them. The differences are . . . . . . here . . . . . . and here.\n var code1 = \"A9 00 8D 7B 00 A9 00 8D 7B 00 A9 00 8D 7C 00 A9 00 8D 7C 00 A9 01 8D 7A 00 A2 00 EC 7A 00 D0 39 A0 7D A2 02 FF AC 7B 00 A2 01 FF AD 7B 00 8D 7A 00 A9 01 6D 7A 00 8D 7B 00 A9 03 AE 7B 00 8D 7A 00 A9 00 EC 7A 00 D0 02 A9 01 8D 7A 00 A2 01 EC 7A 00 D0 05 A9 01 8D 7C 00 A9 00 AE 7C 00 8D 7A 00 A9 00 EC 7A 00 D0 02 A9 01 8D 7A 00 A2 00 EC 7A 00 D0 AC A0 7F A2 02 FF 00 00 00 00 61 00 61 64 6F 6E 65 00\";\n var code2 = \"A9 00 8D 7B 00 A9 00 8D 7B 00 A9 00 8D 7C 00 A9 00 8D 7C 00 A9 01 8D 7A 00 A2 00 EC 7A 00 D0 39 A0 7D A2 02 FF AC 7B 00 A2 01 FF AD 7B 00 8D 7A 00 A9 01 6D 7A 00 8D 7B 00 A9 06 AE 7B 00 8D 7A 00 A9 00 EC 7A 00 D0 02 A9 01 8D 7A 00 A2 01 EC 7A 00 D0 05 A9 01 8D 7C 00 A9 00 AE 7C 00 8D 7A 00 A9 00 EC 7A 00 D0 02 A9 01 8D 7A 00 A2 00 EC 7A 00 D0 AC A0 7F A2 02 FF 00 00 00 00 62 00 62 64 6F 6E 65 00\";\n var code3 = \"A9 00 8D 7B 00 A9 00 8D 7B 00 A9 00 8D 7C 00 A9 00 8D 7C 00 A9 01 8D 7A 00 A2 00 EC 7A 00 D0 39 A0 7D A2 02 FF AC 7B 00 A2 01 FF AD 7B 00 8D 7A 00 A9 01 6D 7A 00 8D 7B 00 A9 09 AE 7B 00 8D 7A 00 A9 00 EC 7A 00 D0 02 A9 01 8D 7A 00 A2 01 EC 7A 00 D0 05 A9 01 8D 7C 00 A9 00 AE 7C 00 8D 7A 00 A9 00 EC 7A 00 D0 02 A9 01 8D 7A 00 A2 00 EC 7A 00 D0 AC A0 7F A2 02 FF 00 00 00 00 63 00 63 64 6F 6E 65 00\";\n\n\t\tsetTimeout(function(){ document.getElementById(\"taProgramInput\").value = code1;\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('l');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('o');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('a');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('d');\n\t\t\t\t\t\t\t\t DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]); \t \t\t\t\t\n\t\t\t\t\t\t\t\t\t}, 1000);\n\n\t\tsetTimeout(function(){ document.getElementById(\"taProgramInput\").value = code2;\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('l');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('o');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('a');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('d');\n\t\t\t\t\t\t\t\t DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]); \t \t\t\t\t\n\t\t\t\t\t\t\t\t\t}, 2000);\n\n\t\tsetTimeout(function(){ document.getElementById(\"taProgramInput\").value = code3;\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('l');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('o');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('a');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('d');\n\t\t\t\t\t\t\t\t DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]); \t \t\t\t\t\n\t\t\t\t\t\t\t\t\t}, 3000);\n\n\t\tsetTimeout(function(){ _KernelInputQueue.enqueue('r');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('u');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('n');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('a');\n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('l'); \n\t\t\t\t\t\t\t\t _KernelInputQueue.enqueue('l'); \n\t\t\t\t\t\t\t\t DOS.Kernel.prototype.krnInterruptHandler(KEYBOARD_IRQ, [13, false]);\t\t\n\t\t\t\t\t\t\t\t\t}, 4000);\n };\n\t\t\n}", "function __initGame() {\n\n __HUDContext = canvasModalWidget.getHUDContext();\n\n __showTitleScreen();\n __bindKeyEvents();\n\n // reset the FPS meter\n canvasModalWidget.setFPSVal(0);\n\n __resetGame();\n\n return __game;\n }", "function init() {\n // quadTree = new QuadTree();\n showCanvas();\n debug.init();\n keyboard.init();\n menuWindow.init();\n // fillboxes(100);\n Game.init();\n}", "function init() {\n lobby.init();\n game.init();\n}", "function GameEngine() {\n this.sceneManager = new SceneManager(this);\n this.collisionBox = {\n ground: [],\n };\n this.ui = [];\n this.entities = [];\n this.big = [];\n this.mid = [];\n this.small = [];\n this.food = [];\n this.ctx = null;\n this.surfaceWidth = null;\n this.surfaceHeight = null;\n\n this.movedAmount = 0;\n\n //events\n this.mouse = {click: false,\n x: undefined,\n y: undefined,\n width: 1,\n height: 1,\n pressed: false,\n reset: function() {\n this.click = false;\n // this.pressed = false;\n }};\n this.events = {\n }\n this.save = false;\n this.load = false;\n}", "function GameController() {\n\t\t// everything related to the game that doesn't directly touch the DOM\n\t\tthis.myDeck = new Deck();\n\t\tthis.betObj = new Betting();\n\t\tthis.playerOne = new Player('John','playerOne');\n\t\t//this.playerRender = new PlayerUI(); // not sure why i created this. they don't do anything\n\t\tthis.gameDealer = new Player('Dealer','gameDealer');\n\t\t// this.dealerRender = new PlayerUI(); // not sure why i created this. they don't do anything\n\t}", "function Main(){\n PubSub.call(this); // super();\n\n // ui system\n this.screens = new Screens(this);\n\n this.onceOn('init', this.init, this);\n }", "function init() {\n // get a referene to the target <canvas> element.\n if (!(canvas = document.getElementById(\"game-canvas\"))) {\n throw Error(\"Unable to find the required canvas element.\");\n }\n\n // resize the canvas based on the available browser available draw size.\n // this ensures that a full screen window can contain the whole game view.\n canvas.height = (window.screen.availHeight - 100);\n canvas.width = (canvas.height * 0.8);\n\n // get a reference to the 2D drawing context.\n if (!(ctx = canvas.getContext(\"2d\"))) {\n throw Error(\"Unable to get 2D draw context from the canvas.\");\n }\n\n // specify global draw definitions.\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n\n // set the welcome scene as the initial scene.\n setScene(welcomeScene);\n }", "function setup() {\n\n // create_platform(0, 600);\n // create_platform(127, 600);\n // create_platform(254, 600);\n // create_platform(381, 600);\n // create_platform(507, 600);\n // create_platform(634, 600);\n // create_platform(734, 400);\n\n create_platform_group(0, 600, 6);\n create_platform_group(500, 400, 6);\n create_platform_tower(100, 200, 20);\n create_platform_tower(-700, 250, 20);\n create_platform_tower(1200, 350, 20);\n // create_platform_group(100, 200, 5);\n // create_platform_group(400, 0, 5);\n // create_platform_group(100, -200, 5);\n // create_platform_group(400, -400, 5);\n // create_platform_group(100, -600, 5);\n // create_platform_group(400, -800, 5);\n // create_platform_group(100, -1000, 5);\n create_platform_group(-1000, 1000, 20);\n create_platform_group(-200, 800, 2);\n create_player(500, 500);\n app.stage.addChild(player_view);\n app.stage.addChild(environment);\n //console.log(player.getBounds());\n\n state = play_screen;\n\n app.ticker.add(delta => game_loop(delta));\n\n }", "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function initialize() {\n console.log('game initializing...');\n\n document\n .getElementById('game-quit-btn')\n .addEventListener('click', function() {\n network.emit(NetworkIds.DISCONNECT_GAME);\n network.unlistenGameEvents();\n menu.showScreen('main-menu');\n });\n\n //\n // Get the intial viewport settings prepared.\n graphics.viewport.set(\n 0,\n 0,\n 0.5,\n graphics.world.width,\n graphics.world.height\n ); // The buffer can't really be any larger than world.buffer, guess I could protect against that.\n\n //\n // Define the TiledImage model we'll be using for our background.\n background = components.TiledImage({\n pixel: {\n width: assets.background.width,\n height: assets.background.height,\n },\n size: { width: graphics.world.width, height: graphics.world.height },\n tileSize: assets.background.tileSize,\n assetKey: 'background',\n });\n }", "function FluencyApp () {\n // You must always call the super class version of init\n FluencyApp.superclass.constructor.call(this);\n \n Content.initialize();\n \n this.loadGame();\n this.isMouseEnabled = false; // mvy\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"gameCanvas\"));\n game = new createjs.Container();\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n // When game begins, current state will be opening menu (MENU_STATE)\n //scoreboard = new objects.scoreBoard(stage, game);\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "display() {\n let currentTheme = this.gameOrchestrator.getCurrentTheme();\n currentTheme.displayScene();\n this.displayGameboard(currentTheme);\n }", "function setupSystemGUI(){\n\t\n\t\t// Start water audio\n\t\tsoundPlayer.play_water_sound();\n\t\n\t\t// Add items on the left of the systemOptions\n\t\tsystemGUI.add(systemOptions, \"Title\");\n\t\tsystemGUI.add(systemOptions, \"Sound\").onFinishChange(function(){\n\t\t\tui_sound_enabled = systemOptions['Sound'];\n\t\t\tif(ui_sound_enabled === true){\n\t\t\t\tsoundPlayer.play_water_sound();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsoundPlayer.stop_water_sound();\n\t\t\t}\n\t\t});\n\t\t\n\t\tsystemGUI.add(systemOptions, \"Terrain_size\", 4, 16).step(2).onFinishChange(function(){\n\t\t\t// on change stopAnimationFrame, terrain = new Terrain, start it again\n\t\t\twindow.cancelAnimationFrame(animationFrameID);\n\t\t\trequestId = undefined;\n\t\t\t\n\t\t\t// Remake terrain\n\t\t\tui_terrain_size = systemOptions['Terrain_size'];\n\t\t\tui_noise_scale = systemOptions['Terrain_noise_scale'];\n\t\t\tterrain = new Terrain();\n\t\t\t\n\t\t\tcamera = new Camera();\n\t\t\t\n\t\t\t// Also need to remake rocks\n\t\t\tui_min_rocks = systemOptions['Min_rocks_per_section'];\n\t\t\tui_max_rocks = systemOptions['Max_rocks_per_section'];\n\t\t\trockGenerator = new RockGenerator();\n\t\t\t\n\t\t\tcollisionTester = new CollisionTester();\n\n\t\t\tscene.start();\n\t\t});\n\t\tsystemGUI.add(systemOptions, \"Terrain_noise_scale\", 1, 50).step(1).onFinishChange(function(){\n\t\t\t// on change stopAnimationFrame, terrain = new Terrain, start it again\n\t\t\twindow.cancelAnimationFrame(animationFrameID);\n\t\t\trequestId = undefined;\n\t\t\tui_noise_scale = systemOptions['Terrain_noise_scale'];\n\t\t\tterrain = new Terrain();\n\t\t\t// Also need to remake rocks\n\t\t\tui_min_rocks = systemOptions['Min_rocks_per_section'];\n\t\t\tui_max_rocks = systemOptions['Max_rocks_per_section'];\n\t\t\trockGenerator = new RockGenerator();\n\t\t\tscene.start();\n\t\t});\n\t\tsystemGUI.add(systemOptions, \"Terrain_noise_octaves\", 4, 12).step(1).onFinishChange(function(){\n\t\t\t// on change stopAnimationFrame, terrain = new Terrain, start it again\n\t\t\twindow.cancelAnimationFrame(animationFrameID);\n\t\t\trequestId = undefined;\n\t\t\tui_noise_octaves = systemOptions['Terrain_noise_octaves'];\n\t\t\tterrain = new Terrain();\n\t\t\t// Also need to remake rocks\n\t\t\tui_min_rocks = systemOptions['Min_rocks_per_section'];\n\t\t\tui_max_rocks = systemOptions['Max_rocks_per_section'];\n\t\t\trockGenerator = new RockGenerator();\n\t\t\tscene.start();\n\t\t});\n\t\tsystemGUI.add(systemOptions, \"Min_rocks_per_section\", 0, 2048).onFinishChange(function(){\n\t\t\t// on change stopAnimationFrame, terrain = new Terrain, start it again\n\t\t\twindow.cancelAnimationFrame(animationFrameID);\n\t\t\trequestId = undefined;\n\t\t\tui_min_rocks = systemOptions['Min_rocks_per_section'];\n\t\t\trockGenerator = new RockGenerator();\n\t\t\tscene.start();\n\t\t});\n\t\tsystemGUI.add(systemOptions, \"Max_rocks_per_section\", 0, 2048).onFinishChange(function(){\n\t\t\t// on change stopAnimationFrame, terrain = new Terrain, start it again\n\t\t\twindow.cancelAnimationFrame(animationFrameID);\n\t\t\trequestId = undefined;\n\t\t\tui_max_rocks = systemOptions['Max_rocks_per_section'];\n\t\t\trockGenerator = new RockGenerator();\n\t\t\tscene.start();\n\t\t});\n\t\tsystemGUI.add(systemOptions, \"Water_strength\", 0.001, 0.5).onFinishChange(function(){\n\t\t\tui_water_strength = systemOptions['Water_strength'];\n\t\t});\t\t\n\t}", "function MyGame() {\n this.mainview = new Mainview();\n\n}", "static start(){\n return new Game(State.ready())\n }", "setupUI () {\n this.html.canvas.width = this.canvasWidth\n this.html.canvas.height = this.canvasHeight\n \n // Prevent \"touch and hold to open context menu\" menu on touchscreens.\n this.html.canvas.addEventListener('touchstart', stopEvent)\n this.html.canvas.addEventListener('touchmove', stopEvent)\n this.html.canvas.addEventListener('touchend', stopEvent)\n this.html.canvas.addEventListener('touchcancel', stopEvent)\n \n this.html.buttonHome.addEventListener('click', this.buttonHome_onClick.bind(this))\n this.html.buttonReload.addEventListener('click', this.buttonReload_onClick.bind(this))\n this.html.buttonLeft.addEventListener('click', this.buttonLeft_onClick.bind(this))\n this.html.buttonRight.addEventListener('click', this.buttonRight_onClick.bind(this))\n \n this.html.main.addEventListener('keydown', this.onKeyDown.bind(this))\n \n window.addEventListener('resize', this.updateUI.bind(this))\n this.updateUI()\n this.hideUI() // Hide until all assets are loaded\n \n this.html.main.focus()\n }", "init(game) {\n\n }", "function EnvironmentLoader(){var environmentLoader=this;eventing(environmentLoader);function isReady(){return domState.isDomLoaded()&&!domState.isDomUnloaded();}function onLoaded(){if(isReady()){environmentLoader.dispatchEvent(new Events.EnvLoadedEvent(eventNames.ENV_LOADED));}}function onDomReady(){domState.whenUnloaded.then(onDomUnload);onLoaded();}function onDomUnload(){environmentLoader.dispatchEvent(new Events.EnvLoadedEvent(eventNames.ENV_UNLOADED));}domState.whenLoaded.then(onDomReady);this.onLoad=function(cb,context){if(isReady()){cb.call(context);return;}environmentLoader.on(eventNames.ENV_LOADED,cb,context);};this.onUnload=function(cb,context){if(this.isUnloaded()){cb.call(context);return;}environmentLoader.on(eventNames.ENV_UNLOADED,cb,context);};this.isUnloaded=function(){return domState.isDomUnloaded();};}", "function init() {\n\t\t\t// Mount all riot tags\n\t\t\triot.mount('loadingscreen');\n\t\t\triot.mount('applauncher');\n\n\t\t\t//window.wm.mode = 'exposeHack';\n //window.wm.mode = 'default';\n\t\t}", "function Game()\n{\n\tthis.screenWidth = window.innerWidth;\n\tthis.screenheight = window.innerHeight;\n}", "function init() {\n //Detect server/client and import other modules\n if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n utils = require('../utils.js');\n time = require('../time.js');\n state = require('../../server/js/serverState');\n\n Vector = require('victor');\n Manifold = require('./physicsObjects').Manifold;\n GameObject = require('./physicsObjects').GameObject;\n Platform = require('./physicsObjects').Platform;\n } else {\n utils = app.utils;\n time = app.time;\n state = app.state;\n\n Vector = Victor;\n Manifold = app.physObj.Manifold;\n GameObject = app.physObj.GameObject;\n Platform = app.physObj.Platform;\n }\n\n sp = state.physics;\n\n //Set up physics constants in the state. These are hardcoded values based\n //on game design\n sp.speedLimit = 60;\n\n //Acceleration due to gravity\n // a = 2d / t^2\n // d = jump height = 6gu\n // t = time to apex = 0.5s\n sp.jumpHeight = 4;\n sp.jumpTime = 0.3;\n sp.gravity = new Vector(0.0, (2.0 * sp.jumpHeight) / (sp.jumpTime * sp.jumpTime));\n\n //Jump velocity\n // v = -sqrt(2*a*d)\n // a = sp.gravity\n // d = jump height\n sp.jumpVel = new Vector(0.0, -Math.sqrt(2 * sp.gravity.y * sp.jumpHeight));\n\n sp.moveSpeed = 10;\n sp.sprintMult = 2;\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}", "function setup() {\n createCanvas(600, 600);\n frameRate(FRAME_RATE);\n var cols = floor(width\n / ITEMS_SCALE)\n var rows = floor(height / ITEMS_SCALE)\n environment=new Environment(cols,rows);\n environment.init();\n}", "initGame() {\n\n //--setup user input--//\n this._player.initControl();\n\n //--add players to array--//\n this._players.push(this._player, this._opponent);\n\n //--position both players--//\n this._player.x = -Game.view.width * 0.5 + this._player.width;\n this._opponent.x = Game.view.width * 0.5 - this._opponent.width;\n }", "function Main() {\n\tvar self = this;\n\tthis.renderer = new THREE.WebGLRenderer({\n\t\tantialias: true\n\t});\n\n\tthis.controllers = [];\n\tthis.callback = this.update.bind( this );\n\n\tthis.settings = {};\n\twindow.location.href.replace(\n\t\t/[?&]+([^=&]+)=([^&]*)/gi,\n\t\tfunction(m,key,value) {\n\t\t\tself.settings[key] = value;\n\t\t}\n\t);\n\n\tthis.container = document.createElement('div');\n\tthis.container.setAttribute('class', 'game');\n\tthis.container.appendChild(this.renderer.domElement);\n\tthis.operations = [];\n\tdocument.body.appendChild(this.container);\n\twindow.onresize = this.resize.bind( this );\n\n\twindow.main = this;\n\twindow.game_score = 0;\n\twindow.game_win = false;\n\n\tthis.setState( new Loading() );\n\n\tthis.loader = new Loader();\n\tthis.loader.load( this.getAssets() );\n\n\t// start the shit\n\tthis.lastFrame = 0;\n\tthis.resize();\n\trequestAnimFrame( this.callback );\n}", "function GameManager() {\n\n /**\n * The current scene data.\n * @property sceneData\n * @type Object\n */\n this.sceneData = {};\n\n /**\n * The scene viewport containing all visual objects which are part of the scene and influenced\n * by the in-game camera.\n * @property sceneViewport\n * @type gs.Object_Viewport\n */\n this.sceneViewport = null;\n\n /**\n * The list of common events.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.commonEvents = [];\n\n /**\n * Indicates if the GameManager is initialized.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.initialized = false;\n\n /**\n * Temporary game settings.\n * @property tempSettings\n * @type Object\n */\n this.tempSettings = {\n skip: false,\n skipTime: 5,\n loadMenuAccess: true,\n menuAccess: true,\n backlogAccess: true,\n saveMenuAccess: true,\n messageFading: {\n animation: {\n type: 1\n },\n duration: 15,\n easing: null\n }\n\n /**\n * Temporary game fields.\n * @property tempFields\n * @type Object\n */\n };\n this.tempFields = null;\n\n /**\n * Stores default values for backgrounds, pictures, etc.\n * @property defaults\n * @type Object\n */\n this.defaults = {\n background: {\n \"duration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"loopVertical\": 0,\n \"loopHorizontal\": 0,\n \"easing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"animation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n picture: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n character: {\n \"expressionDuration\": 0,\n \"appearDuration\": 40,\n \"disappearDuration\": 40,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 2,\n \"inOut\": 2\n },\n \"disappearEasing\": {\n \"type\": 1,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n },\n \"changeAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"fading\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"changeEasing\": {\n \"type\": 2,\n \"inOut\": 2\n }\n },\n text: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"positionOrigin\": 0,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n video: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n live2d: {\n \"motionFadeInTime\": 1000,\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n messageBox: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n audio: {\n \"musicFadeInDuration\": 0,\n \"musicFadeOutDuration\": 0,\n \"musicVolume\": 100,\n \"musicPlaybackRate\": 100,\n \"soundVolume\": 100,\n \"soundPlaybackRate\": 100,\n \"voiceVolume\": 100,\n \"voicePlaybackRate\": 100\n }\n };\n\n /**\n * The game's backlog.\n * @property backlog\n * @type Object[]\n */\n this.backlog = [];\n\n /**\n * Character parameters by character ID.\n * @property characterParams\n * @type Object[]\n */\n this.characterParams = [];\n\n /**\n * The game's chapter\n * @property chapters\n * @type gs.Document[]\n */\n this.chapters = [];\n\n /**\n * The game's current displayed messages. Especially in NVL mode the messages \n * of the current page are stored here.\n * @property messages\n * @type Object[]\n */\n this.messages = [];\n\n /**\n * Count of save slots. Default is 100.\n * @property saveSlotCount\n * @type number\n */\n this.saveSlotCount = 100;\n\n /**\n * The index of save games. Contains the header-info for each save game slot.\n * @property saveGameSlots\n * @type Object[]\n */\n this.saveGameSlots = [];\n\n /**\n * Stores global data like the state of persistent game variables.\n * @property globalData\n * @type Object\n */\n this.globalData = null;\n\n /**\n * Indicates if the game runs in editor's live-preview.\n * @property inLivePreview\n * @type Object\n */\n this.inLivePreview = false;\n }", "function GameManager() {\n\n /**\n * The current scene data.\n * @property sceneData\n * @type Object\n */\n this.sceneData = {};\n\n /**\n * The scene viewport containing all visual objects which are part of the scene and influenced\n * by the in-game camera.\n * @property sceneViewport\n * @type gs.Object_Viewport\n */\n this.sceneViewport = null;\n\n /**\n * The list of common events.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.commonEvents = [];\n\n /**\n * Indicates if the GameManager is initialized.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.initialized = false;\n\n /**\n * Temporary game settings.\n * @property tempSettings\n * @type Object\n */\n this.tempSettings = {\n skip: false,\n skipTime: 5,\n loadMenuAccess: true,\n menuAccess: true,\n backlogAccess: true,\n saveMenuAccess: true,\n messageFading: {\n animation: {\n type: 1\n },\n duration: 15,\n easing: null\n }\n\n /**\n * Temporary game fields.\n * @property tempFields\n * @type Object\n */\n };\n this.tempFields = null;\n\n /**\n * Stores default values for backgrounds, pictures, etc.\n * @property defaults\n * @type Object\n */\n this.defaults = {\n background: {\n \"duration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"loopVertical\": 0,\n \"loopHorizontal\": 0,\n \"easing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"animation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n picture: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 1,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n character: {\n \"expressionDuration\": 0,\n \"appearDuration\": 40,\n \"disappearDuration\": 40,\n \"origin\": 1,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 2,\n \"inOut\": 2\n },\n \"disappearEasing\": {\n \"type\": 1,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n },\n \"changeAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"fading\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"changeEasing\": {\n \"type\": 2,\n \"inOut\": 2\n }\n },\n text: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"positionOrigin\": 0,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n video: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n live2d: {\n \"motionFadeInTime\": 1000,\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n messageBox: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n audio: {\n \"musicFadeInDuration\": 0,\n \"musicFadeOutDuration\": 0,\n \"musicVolume\": 100,\n \"musicPlaybackRate\": 100,\n \"soundVolume\": 100,\n \"soundPlaybackRate\": 100,\n \"voiceVolume\": 100,\n \"voicePlaybackRate\": 100\n }\n };\n\n /**\n * The game's backlog.\n * @property backlog\n * @type Object[]\n */\n this.backlog = [];\n\n /**\n * Character parameters by character ID.\n * @property characterParams\n * @type Object[]\n */\n this.characterParams = [];\n\n /**\n * The game's chapter\n * @property chapters\n * @type gs.Document[]\n */\n this.chapters = [];\n\n /**\n * The game's current displayed messages. Especially in NVL mode the messages\n * of the current page are stored here.\n * @property messages\n * @type Object[]\n */\n this.messages = [];\n\n /**\n * Count of save slots. Default is 100.\n * @property saveSlotCount\n * @type number\n */\n this.saveSlotCount = 100;\n\n /**\n * The index of save games. Contains the header-info for each save game slot.\n * @property saveGameSlots\n * @type Object[]\n */\n this.saveGameSlots = [];\n\n /**\n * Stores global data like the state of persistent game variables.\n * @property globalData\n * @type Object\n */\n this.globalData = null;\n\n /**\n * Indicates if the game runs in editor's live-preview.\n * @property inLivePreview\n * @type Object\n */\n this.inLivePreview = false;\n }", "function MyGame() {\n //this.kUIButton = \"assets/UI/button.png\";\n this.kUIButton = \"assets/Game/play.png\";\n this.kBG = \"assets/Game/forest.png\";\n this.kSky = \"assets/Game/sky.png\";\n \n // The camera to view the scene\n this.mCamera = null;\n this.mSmallCamera = null;\n this.ParticleButton = null;\n this.PhysicsButton = null;\n this.UIButton = null;\n this.UIText = null;\n this.LevelSelect = null;\n \n this.bg = null;\n this.sky = null;\n}", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "function init() {\n\n initFloorsMapping(Config.BUILDINGS);\n createElevators(Config.BUILDINGS);\n\n AppUI.init();\n attachEvents(Config.BUILDINGS);\n }", "function setup() {\n database = firebase.database();\n\n canvas = createCanvas(500, 500);\n game = new Game();\n game.getState();\n game.start();\n}", "constructor() {\n this._gameData = GameData;\n this._interface = new Interface();\n this._map;\n this._virtualMap;\n this._environnement;\n this._players = [null, null];\n this._pattern = null;\n this._composition = null;\n this._turn = new Turn();\n this._fightMode = false;\n this._activePlayerMovementCounter = -1;\n this._fightStatus = -1;\n this._fightPlayerAction = [null, null];\n document.getElementById('homemenu-interface-validation').addEventListener('click', () => {\n this.startGame();\n });\n document.getElementById('gameend-newgame').addEventListener('click', () => {\n this.restartGame();\n });\n }", "setEnvironment(env) {\n const INPUT_SETTINGS = global.settings.input;\n if(['*', 'gui'].indexOf(env) === -1 && this.environments.indexOf(env) !== -1) \n {\n INPUT_SETTINGS.I_ENVIRONMENT = this.environment = env;\n }\n }", "function init() {\n\tif (logFull) console.log(\"%s(%j)\", arguments.callee.name, Array.prototype.slice.call(arguments).sort());\n\tcanvas = document.getElementById(\"game-canvas\");\n\tctx = canvas.getContext(\"2d\");\n\n\tdocument.body.style.backgroundColor = BACKGROUND_COLOR;\n\n\thandleResize();\n}", "function Start()\n{\n\t\n\t// Grab the handle of the current window.\n\twindowHandle = GetForegroundWindow();\n\t\n\t// Set the screen resolution.\n\tScreen.SetResolution(ScreenWidth[index], ScreenHeight[index], false);\n\t\n\t// Wait for one frame before undecorating to make sure we don't break everything.\n\tyield;\n\t\t\n\t// place it in the right location if we're not in the editor.\n\tif(!Application.isEditor) {\n\t\tif(undecorate) {\n\t\t\tUndecorateAndPlace(ScreenCoordinates[index].x, ScreenCoordinates[index].y, ScreenWidth[index], ScreenHeight[index]);\n\t\t}\n\t\telse {\n\t\t\tPlaceWindow(ScreenCoordinates[index].x, ScreenCoordinates[index].y, ScreenWidth[index], ScreenHeight[index]);\n\t\t}\n\t\t\n\t\t// Set the screen name for the window that has focus.\n\t\tRenameWindow(windowHandle, WindowName);\n\t\t\n\t\t// Minimize and maximize so that after the client windows are made, regain focus to server.\n//\t\tRegainFocus();\n\t}\n\t\n}", "function main() {\n init(fontSize);\n\n renderModel = ReadModel();\n renderUI = ReaderBaseFrame(RootContainer);\n renderModel.init(function (data) {\n renderUI(data);\n });\n\n EventHandler();\n }", "function setup() {\n minigameCanvas = createCanvas(1000, 800);\n minigameCanvas.parent(\"#mini-games\");\n textFont(myFont);\n\n // general setup\n userSetup();\n noCursor();\n\n // m-g1 setup\n mouseSetup();\n // m-g2 setup\n fishSetup();\n}", "function startGame(){\r\n // This object has parentesis because we will work on it later.\r\n window.game= new Game()\r\n}", "function ui_window(){\n init();\n\tvar args = arrayfromargs(arguments);\n\tif(args[0] == 'mouse'){\n\t\targs.splice(0, 1);\n\t\tuiEvent.mouse(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7], 0.);\n\t} else if(args[0] == 'mouseidle'){\n\t\targs.splice(0, 1);\n\t\tuiEvent.mouse(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7], 0.);\n\t} else if(args[0] == 'mouseidleout'){\n outlet(OUTLET_WINDOW, \"getsize\");\n\t} else if(args[0] == 'mousewheel'){\n\t\targs.splice(0, 1);\n\t\tuiEvent.mouse(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]);\n\t} else if(args[0] == 'pickray'){\n\t\targs.splice(0, 1);\n if(cameraObj.enable == 1){\n args = cameraObj.getviewportray(uiEvent.currentPosX, uiEvent.currentPosY);\n if(args != null)\n uiEvent.pickray(args[0],args[1],args[2],args[3],args[4],args[5]);\n }\n\t} else if(args[0] == 'size'){\n\t\targs.splice(0, 1);\n\t\tuiEvent.windowSize(args[0],args[1]);\n\t}\n}", "setup() {\n\t\tthis.stage.removeAllChildren();\n\t\tthis.initBackground();\n\t\tthis.initReceptors();\n\t\tthis.initNotetrack();\n\t\tthis.initStats();\n\t\tthis.initTimeline();\n\t\tthis.initBackButton();\n\t}", "function setupGame() {\n game.bombsOnBoard = 0;\n game.flagsAvaliable = gameConfig.bombCount;\n buildSweeperGrid();\n plantBombs();\n addClickListeners();\n updateFlagsIndicator();\n}", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function setupInterfaces() {\r\n var centerVer, centerHor;\r\n \r\n //centerVer = backgroundImg.canvas.width/2;\r\n\r\n /*Set up the intro/menu interface*/\r\n backgroundImg.introBackground(gameImage.loadedImg[\"introMenuBgd\"], 0, 0, 800, 500); //Set up the background\r\n backgroundImg.setTitle(\"Red vs Wolf\", 220, 200, \"bold 60px Arial\" );//Set up the title\r\n backgroundImg.setStartButton(\"Start\", 350, 350, \"bold 24px Arial\" ); //Set up the start button\r\n \r\n /*Set up the Game Over Interface screen*/\r\n backgroundImg.setGameOverMsg(\"GAME OVER\", 125, 160, \"bold 60px Arial\", \"red\");\r\n backgroundImg.setNewGameButton(\"New Game\", 125, 360,\"bold 30px Arial\", \"black\", \"blue\");\r\n}", "function init() {\n\n browserManager = new BrowserManager();\n screenshotsAndroid = new ScreenshotsAndroid();\n magazine = new Magazine();\n workFlowManager = new WorkFlowManager();\n buttonsManager = new ButtonsManager();\n fieldsEdit = new FieldsEdit();\n tableEdit = new TableEdit();\n workFlowEdit = new WorkFlowEdit();\n\n //View Manager\n viewManager = new ViewManager();\n\n // table\n tileManager.drawTable();\n\n // ScreenshotsAndroid\n screenshotsAndroid.init();\n\n // BrowserManager\n browserManager.init();\n\n var dimensions = tileManager.dimensions;\n\n // groups icons\n headers = new Headers(dimensions.columnWidth, dimensions.superLayerMaxHeight, dimensions.groupsQtty,\n dimensions.layersQtty, dimensions.superLayerPosition);\n\n // uncomment for testing\n //create_stats();\n\n $('#backButton').click(function() {\n\n if(viewManager.views[window.actualView])\n viewManager.views[window.actualView].backButton();\n\n });\n\n $('#container').click(onClick);\n\n //Disabled Menu\n //initMenu();\n\n setTimeout(function() { initPage(); }, 500);\n\n setTimeout(function (){\n guide.active = true;\n if(actualView === 'home'){\n guide.showHelp();\n }\n }, 15000);\n\n /*setTimeout(function() {\n var loader = new Loader();\n loader.findThemAll();\n }, 2000);*/\n\n //TWEEN.removeAll();\n}", "function preload () {\n window.width = GAME_WIDTH;\n window.height = GAME_HEIGHT;\n gameFont = loadFont('data/fonts/GameOverFont.ttf');\n\n screens.push(new Background());\n screens.push(new Menu());\n screens.push(new Highscores());\n screens.push(new GameLauncher());\n screens.push(new Weather());\n /*game itself will be added from game launcher\n /*in order to maintain access to it from there */\n screens.push(createCancelButton());\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function ZFarmApp() {\n StageSetup.init();\n\n AssetLib.addManifest(GeneralManifest.NAME, new GeneralManifest());\n AssetLib.addManifest(PlayerManifest.NAME, new PlayerManifest());\n AssetLib.addManifest(GunManifest.NAME, new GunManifest());\n AssetLib.addManifest(SceneryManifest.NAME, new SceneryManifest());\n AssetLib.addManifest(CropManifest.NAME, new CropManifest());\n AssetLib.addManifest(InventoryManifest.NAME, new InventoryManifest());\n AssetLib.addManifest(NavigationManifest.NAME, new NavigationManifest());\n AssetLib.addManifest(ZombieManifest.NAME, new ZombieManifest());\n AssetLib.addManifest(FenceManifest.NAME, new FenceManifest());\n AssetLib.addManifest(MenuManifest.NAME, new MenuManifest());\n\n var root = StageSetup.rootContainer;\n var overlay = StageSetup.overlayContainer;\n var portrait = StageSetup.portraitContainer;\n\n // Start PureMVC core\n this.facade = puremvc.Facade.getInstance(ZFarmApp.CORE_NAME);\n\n // Register commands\n this.facade.registerCommand(PreloaderConstants.DO_START_PRELOADER, StartPreloadCommand);\n this.facade.registerCommand(PreloaderConstants.WHEN_PRELOADER_COMPLETE, PreloadCompleteMacro);\n\n // Register proxies\n this.facade.registerProxy(new PreloaderProxy());\n\n // Register mediators\n var progressBarSkin = new PercentageTextSkin(null);\n progressBarSkin.getContainer().x = 480;\n progressBarSkin.getContainer().y = 270;\n progressBarSkin.addToContainer(overlay);\n\n var progressComponent = new ProgressBarComponent(progressBarSkin);\n\n var preloaderMediator = new PreloaderMediator(progressComponent);\n\n this.facade.registerMediator(preloaderMediator);\n\n var rotatePrompt = new RotatePromptSkin(AssetLib.getManifest(GeneralManifest.NAME));\n rotatePrompt.addToContainer(portrait);\n\n var screenComponent = new ScreenComponent(rotatePrompt, 960, 540, true);\n var screenMediator = new ScreenMediator(screenComponent);\n this.facade.registerMediator(screenMediator);\n\n this.startPreload();\n}", "function main() {\n init();\n render();\n handleVisibilityChange();\n}", "function init()\n{\n game = new Phaser.Game(768, 432, Phaser.CANVAS, '', null, false, false);\n\n\tgame.state.add(\"MainGame\", MainGame);\n\tgame.state.start(\"MainGame\");\n}", "function startGame() {\n (new SBar.Engine()).startGame();\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n //set the current game staate to MENU_STATE\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function Browser() {\n\tthis.width = 1280;\n\tthis.height = 768;\n\n\tthis.window = new BrowserWindow({\n\t\twidth: this.width,\n\t\theight: this.height,\n\t\tframe: false,\n\t\t\"web-preferences\": {\n\t\t\tplugins: true,\n\t\t\tjavascript: true\n\t\t}\n\t});\n\n\t// todo change to global brand\n\tthis.window.setTitle(\"Infinium\");\n\trequire(\"./modules/applicationMenu.js\")();\n\n\tthis.window.loadUrl(\"file://\" + __dirname + \"/browser.html\");\n\tthis.window.on(\"closed\", function () {\n\t\tthis.window = null;\n\t}.bind(this));\n\n\tthis.window.focus();\n}", "function initGame()\n{\n //This is run in the beginning. Draws Space, sets settings etc\n \n //Update JSON\n}", "function windowReady() {\n\tvar body = $(this).find(\"body\");\n\t\n\tGameEngine.CANVAS_WIDTH = window.innerWidth;//body.width();\n\tGameEngine.CANVAS_HEIGHT = window.innerHeight;//body.height();\n\t\n\t//Create canvas\n\tvar canvasElement = $(\"<canvas width='\" + GameEngine.CANVAS_WIDTH + \n \"' height='\" + GameEngine.CANVAS_HEIGHT + \"'></canvas>\");\n\tcontext = canvasElement.get(0).getContext(\"2d\");\n\tcanvasElement.appendTo('body');\n\t//Set up background.\n\tcontext.fillStyle = 'rgb(0, 0, 0)' ;\n\tcontext.fillRect(0, 0, GameEngine.CANVAS_WIDTH, GameEngine.CANVAS_HEIGHT ) ;\n\t\n\t//TODO refactor this into GameEngine.tiledMap.\n\tGameEngine.currentMap = new TiledMap(GameEngine.CANVAS_WIDTH+300,GameEngine.CANVAS_HEIGHT+300,32,32);\n\n\t//add fake player sprite, centerd in middle of screen\n\tGameEngine.player = EntityManager.createEntity('Player');\n\tGameEngine.player.x = (3*32);\n\tGameEngine.player.y = (11*32);\n\tGameEngine.player.name = \"Lee\";\n\tGameEngine.player.spriteImg.src = \"res/player.png\";\n\t//GameEngine.player.deadImg.src = \"res/bones.png\";\n\tGameEngine.player.weaponWielded = EntityManager.weaponFactory('Sword');\n\t\n\tsetUpPlayerImg();\n\t//set up player spriteSheet for animation. ABOVE\t\n\t \n\t\n\t//Test Monster\n\tdragon = EntityManager.createCreature('Green Dragon');\n\tdragon.x = 12*32;\n\tdragon.y = 8*32;\n\tdragon.name = \"Green Dragon\";\n\tdragon.spriteImg.src = \"res/dragon.png\";\n\tdragon.deadImg.src = \"res/bones.png\";\n\tdragon.agression = 7; //yikes!\n\tdragon.range = 5;\n\tdragon.hp = 8;\n \tdragon.hpMax = 8;\n \tsetDragonImg(dragon);\n\t\n\tGameEngine.monsters.push(dragon);\n\t\n\tdragon2 = EntityManager.createCreature('Green Dragon');\n\tdragon2.x = 3*32;\n\tdragon2.y = 4*32;\n\tdragon2.name = \"Puff The Dragon\";\n\tdragon2.spriteImg.src = \"res/dragon.png\";\n\tdragon2.deadImg.src = \"res/bones.png\";\n\tdragon2.agression = 2;\n\tdragon2.range = 4;\n\tdragon2.hp = 9;\n\tdragon2.ac = 10;\n \tdragon2.hpMax = 8;\n\tsetDragonImg(dragon2);\n\t\n\tGameEngine.monsters.push(dragon2);\n\t\n\tdragon3 = EntityManager.createCreature('Green Dragon');\n\tdragon3.x = 14*32;\n\tdragon3.y = 13*32;\n\tdragon3.name = \"Green Dragon\";\n\tdragon3.spriteImg.src = \"res/dragon.png\";\n\tdragon3.deadImg.src = \"res/bones.png\";\n\tdragon3.agression = 7; //yikes!\n\tdragon3.range = 5;\n\tdragon3.hp = 8;\n \tdragon3.hpMax = 8;\n \tsetDragonImg(dragon3);\n\t\n\tGameEngine.monsters.push(dragon3);\n\n\ttestManagerConfig = {\"tileWidth\":32, \"tileHeight\":32, \"src\":\"res/dungeontiles.gif\", \"namedTiles\":[\n\t\t{\"id\":0,\"name\":\"WALL1\",\"col\":0,\"row\":0},\n\t\t{\"id\":1,\"name\":\"FLOOR1\",\"col\":1,\"row\":8},\n\t\t{\"id\":2,\"name\":\"DOOR1\",\"col\":4,\"row\":2},\n\t\t{\"id\":3,\"name\":\"DOOR2\",\"col\":1,\"row\":6}\n\t]};\n\t\n\ttileMapManager = new SpriteTileManager(testManagerConfig);\n\n\t//'id' is the sprite id and type is the \n\tmapTiles = [\n\t\t\t\t[{},{}],\n\t\t\t\t[{},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}],\n\t\t\t\t[{\"id\":1, \"type\":1},{\"id\":2, \"type\":2},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":3, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":3, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":3, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{},{},{},{},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{},{},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\t\t\t\t\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":3, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":1, \"type\":1},{\"id\":0, \"type\":0}],\t\t\n\t\t\t\t[{},{},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0},{\"id\":0, \"type\":0}]\n\t\t];\n\tGameEngine.currentMap.tileMapManager = tileMapManager;\n\tGameEngine.currentMap.updateMap(mapTiles);\n\t\n\t//draw to canvas\t\t\n\tGameEngine.render();\n\tsetInterval(main, 30);\n}", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function initialise() {\n\tboard = new Board();\n\n\tvar handler = createDiv();\n\thandler.parent('#bagh-chal');\n\thandler.id('handler');\n\n\t// --- Game Properties ---\n\tvar propertiesDiv = createDiv();\n\tpropertiesDiv.child(createElement('h3', 'Game'));\n\tpropertiesDiv.parent('#handler');\n\tpropertiesDiv.id('properties');\n\n\t// Turn\n\tvar turnSpan = createSpan('Turn: ');\n\tturnSpan.parent('#properties');\n\tturnSpan.child(turnP = createP('?'));\n\n\t// Goats In-Hand\n\tvar goatsInHandSpan = createSpan('Goats In-Hand: ');\n\tgoatsInHandSpan.parent('#properties');\n\tgoatsInHandSpan.child(goatsInHandP = createP('?'));\n\n\t// Goats Captured\n\tvar goatsCapturedSpan = createSpan('Goats Captured: ');\n\tgoatsCapturedSpan.parent('#properties');\n\tgoatsCapturedSpan.child(goatsCapturedP = createP('?'));\n\n\t// Tigers Trapped\n\tvar tigersTrappedSpan = createSpan('Tigers Trapped: ');\n\ttigersTrappedSpan.parent('#properties');\n\ttigersTrappedSpan.child(tigersTrappedP = createP('?'));\n\n\t// Status\n\tvar statusSpan = createSpan('Status: ');\n\tstatusSpan.parent('#properties');\n\tstatusSpan.child(statusP = createP('Running').class('running'));\n\n\t// --- Controls ---\n\tvar controlsDiv = createDiv();\n\tcontrolsDiv.parent('#handler');\n\tcontrolsDiv.id('controls');\n\tcontrolsDiv.child(createElement('h3', 'Controls'));\n\n\t// Game Mode\n\tcontrolsDiv.child(gameMode = createSelect());\n\tgameMode.option('Game Mode');\n\tgameMode.option('Player vs Player', 0);\n\tgameMode.option('Player vs AI', 1);\n\tgameMode.option('AI vs AI', 2);\n\tgameMode.value(1);\n\tgameMode.changed(updateHandler);\n\n\t// Play As\n\tcontrolsDiv.child(playAsSelect = createSelect());\n\tplayAsSelect.option('Play As');\n\tplayAsSelect.option('Tiger', 0);\n\tplayAsSelect.option('Goat', 1);\n\tplayAsSelect.value(playAsTiger ? 0 : 1);\n\tplayAsSelect.changed(changePlayAs);\n\n\t// Goat Algorithm/Depth\n\tcontrolsDiv.child(goatP = createP('Goat'));\n\tcontrolsDiv.child(goatAlgorithm = createSelect());\n\tgoatAlgorithm.option('Algorithm');\n\tgoatAlgorithm.option('Minimax', 0);\n\tgoatAlgorithm.option('Alpha-Beta', 1);\n\tgoatAlgorithm.option('MCTS', 2);\n\tgoatAlgorithm.value(1);\n\tgoatAlgorithm.changed(updateHandler);\n\n\tcontrolsDiv.child(goatDepth = createSelect());\n\tgoatDepth.option('Depth');\n\tgoatDepth.option('Depth 1 (Very Easy)', 1);\n\tgoatDepth.option('Depth 2 (Easy)', 2);\n\tgoatDepth.option('Depth 3 (Moderate)', 3);\n\tgoatDepth.option('Depth 4 (Hard)', 4);\n\tgoatDepth.option('Depth 5 (Very Hard)', 5);\n\tgoatDepth.value(3);\n\tgoatDepth.changed(reset);\n\n\tcontrolsDiv.child(goatTime = createSelect());\n\tgoatTime.option('Time');\n\tgoatTime.option('2s', 2);\n\tgoatTime.option('4s', 4);\n\tgoatTime.option('6s', 6);\n\tgoatTime.option('8s', 8);\n\tgoatTime.option('10s', 10);\n\tgoatTime.value(2);\n\tgoatTime.changed(reset);\n\n\t// Tiger Algorithm/Depth\n\tcontrolsDiv.child(tigerP = createP('Tiger'));\n\tcontrolsDiv.child(tigerAlgorithm = createSelect());\n\ttigerAlgorithm.option('Algorithm');\n\ttigerAlgorithm.option('Minimax', 0);\n\ttigerAlgorithm.option('Alpha-Beta', 1);\n\ttigerAlgorithm.option('MCTS', 2);\n\ttigerAlgorithm.value(1);\n\ttigerAlgorithm.changed(updateHandler);\n\n\tcontrolsDiv.child(tigerDepth = createSelect());\n\ttigerDepth.option('Depth');\n\ttigerDepth.option('Depth 1 (Very Easy)', 1);\n\ttigerDepth.option('Depth 2 (Easy)', 2);\n\ttigerDepth.option('Depth 3 (Moderate)', 3);\n\ttigerDepth.option('Depth 4 (Hard)', 4);\n\ttigerDepth.option('Depth 5 (Very Hard)', 5);\n\ttigerDepth.value(3);\n\ttigerDepth.changed(reset);\n\n\tcontrolsDiv.child(tigerTime = createSelect());\n\ttigerTime.option('Time');\n\ttigerTime.option('2s', 2);\n\ttigerTime.option('4s', 4);\n\ttigerTime.option('6s', 6);\n\ttigerTime.option('8s', 8);\n\ttigerTime.option('10s', 10);\n\ttigerTime.value(2);\n\ttigerTime.changed(reset);\n\n\t// Delay\n\tdelaySpan = createSpan('Min. Simulation Delay');\n\tdelaySpan.parent('#controls');\n\tdelaySpan.child(delaySlider = createSlider(0, 500, 250));\n\n\t// Reset\n\tcontrolsDiv.child(resetButton = createButton('Reset'));\n\tresetButton.mousePressed(reset);\n\n\t// Pause\n\tcontrolsDiv.child(pauseButton = createButton('Pause'));\n\tpauseButton.mousePressed(togglePause);\n\n\t// --- AI Debugging ---\n\tdebuggingDiv = createDiv();\n\tdebuggingDiv.parent('#handler');\n\tdebuggingDiv.id('debugging');\n\tdebuggingDiv.child(createElement('h3', 'AI Debugging'));\n\n\t// Iterations\n\tvar iterationsSpan = createSpan('Iterations: ');\n\titerationsSpan.parent('#debugging');\n\titerationsSpan.child(countP = createP('?'));\n\n\t// Time\n\tvar timeSpan = createSpan('Time to Run: ');\n\ttimeSpan.parent('#debugging');\n\ttimeSpan.child(timeP = createP('?'));\n\n\t// Score\n\tvar scoreSpan = createSpan('Score/Wins: ');\n\tscoreSpan.parent('#debugging');\n\tscoreSpan.child(scoreP = createP('?'));\n\n\t// Tiger Wins\n\t//var scoreSpan = createSpan('Tiger Wins: ');\n\t//scoreSpan.parent('#debugging');\n\t//scoreSpan.child(tigerWinsP = createP('?'));\n\n\t// Goat Wins\n\t//var scoreSpan = createSpan('Goat Wins: ');\n\t//scoreSpan.parent('#debugging');\n\t//scoreSpan.child(goatWinsP = createP('?'));\n\n\t// Draws\n\t//var scoreSpan = createSpan('Draws: ');\n\t//scoreSpan.parent('#debugging');\n\t//scoreSpan.child(drawsP = createP('?'));\n\n\t// Update what's disabled/hidden\n\t$('select > option:first-child').attr('disabled', true);\n\tupdateHandler();\n}", "function main() {\n var game;\n var splashScreen;\n var gameOverScreen;\n\n // SPLASH SCREEN\n function createSplashScreen() {\n splashScreen = buildDom(`\n <main>\n <h1>Eternal Enemies</h1>\n <button>Start</button>\n </main>`);\n\n document.body.appendChild(splashScreen);\n\n var startButton = splashScreen.querySelector(\"button\");\n\n startButton.addEventListener(\"click\", function() {\n startGame();\n });\n }\n\n function removeSplashScreen() {\n splashScreen.remove(); // remove() is an HTML method that removes the element entirely\n }\n\n //\n // GAME SCREEN\n function createGameScreen() {\n var gameScreen = buildDom(`\n <main class=\"game container\">\n <header>\n <div class=\"lives\">\n <span class=\"label\">Lives:</span>\n <span class=\"value\"></span>\n </div>\n <div class=\"score\">\n <span class=\"label\">Score:</span>\n <span class=\"value\"></span>\n </div>\n </header>\n <div class=\"canvas-container\">\n <canvas></canvas>\n </div>\n </main>\n `);\n\n document.body.appendChild(gameScreen);\n\n return gameScreen;\n }\n\n function removeGameScreen() {\n game.gameScreen.remove(); // We will implement it in the game object\n }\n\n //\n // GAME OVER SCREEN\n function createGameOverScreen(score) {\n gameOverScreen = buildDom(`\n <main>\n <h1>Game over</h1>\n <p>Your score: <span>${score}</span></p>\n <button>Restart</button>\n </main>\n `);\n\n document.body.appendChild(gameOverScreen);\n\n var button = gameOverScreen.querySelector(\"button\");\n\n button.addEventListener(\"click\", startGame);\n }\n\n function removeGameOverScreen() {\n if (gameOverScreen !== undefined) {\n // if it exists saved in a variable\n gameOverScreen.remove();\n }\n }\n\n //\n // SETTING GAME STATE\n function startGame() {\n removeSplashScreen();\n removeGameOverScreen();\n\n game = new Game();\n game.gameScreen = createGameScreen();\n\n // Start the game\n game.start();\n game.passGameOverCallback(gameOver);\n\n // End the game\n }\n\n function gameOver() {\n removeGameScreen();\n createGameOverScreen(); // <--\n\n console.log(\"GAME OVER IN MAIN\");\n }\n\n // Initialize the start screen\n createSplashScreen();\n}", "function Game() {\n // call parent constructor\n return _super.call(this, 800, 600, Phaser.CANVAS, \"game\", null) || this;\n // add some game states\n // start with boot state\n }", "start() {\r\n //if the game state is in wait state(gamestate=0) we are creating a player object and a form object\r\n if(gameState === 0) {\r\n player = new Player();\r\n player.getCount();\r\n\r\n form = new Form();\r\n form.display();\r\n \r\n }\r\n }", "static spawn() {\n const env = new Environment();\n const chat = require('./chat').spawn({ code: 'Global' });\n\n env.set('code', 'Global');\n env.set('games', 1);\n\n env.set('onMaintenance', false);\n\n env.set('discordWebhookURL', '/');\n\n env.set('ipBlacklist', require('../security/databases/untrusted-ips'));\n env.set('emailWhitelist', require('../security/databases/trusted-emails'));\n\n env.set('chat', chat);\n\n return env;\n }", "constructor(){\n this.airtable = new AirtableInterface;\n // button setup\n this.buttonSetup();\n\n // Loading up user's console\n this.updateNow(true);\n this.loopUpdate();\n }", "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\"use strict\";\n\tconsole.log(\"init() called\");\n\n\tDemoScriptsController.checkDemoScripts();\n\n\t$('#bottomPanel').bottomPanel('init');\n\t$(\"#topBarIcons\").topBarIconsPlugin('init');\n\n\t$('#properties').library(\"init\");\n\t$('#properties').library('setAlphabetVisible', false);\n\n\t$(\"#libraryButton\").click(function() {\n\t\tPropertiesController.initializeLibrary();\n\t});\n\n\t$('#loadConfigButton').on('click', function() {\n\t\tScriptController.loadScript();\n\t});\n\n\t$('#saveConfigButton').on('click', function() {\n\t\tScriptController.saveScript();\n\t});\n\n\t$('#runConfigButton').on('click', function() {\n\t\tScriptController.runScript();\n\t});\n\n\t$('#clearConsoleBtn').on('click', function() {\n\t\t$('#ambConsole').empty();\n\t});\n\n\t//Simulator init\n\tSimulator.ambConsole = $('#ambConsole');\n\n\t// editor init - not used due to TIVI-2181\n\t// editor = ace.edit(\"textArea\");\n\t// editor.setTheme(\"ace/theme/ambiance\");\n\t// editor.getSession().setMode(\"ace/mode/javascript\");\n\n\t// vehicle init\n\tvehicle = new Vehicle(PropertiesController.wsStart, PropertiesController.wsError, \"ws://localhost:23001\");\n}", "function setup() {\n \n // create an HL app to start retrieving kinect datas\n // and automatically call the function update, onUserIn and onUserOut\n app = new HL.App();\n\n // set it up with our project's metadatas\n app.setup({\n projectName : 'Ball Bounce',\n author1 : 'Prenom Nom',\n author2 : 'Prenom Nom'\n });\n\n setupBall();\n setupObstacles();\n}", "function Game(){\n\n\t// PROTECTED\n\tvar game = this; // this is an evil thing\n\tvar isRunning = false;\n\n\t// temporary hack\n\tthis.canvas = document.getElementById('myCanvas');\n\n\t// PUBLIC\n\tthis.stage = new Stage(this.canvas);\n\tthis.eventManager = new EventManager();\n\tthis.loader = new Loader();\n\n\t// Lookup tables\n\tthis.assets = {};\n\tthis.colors = {};\n\n\t// Components\n\tthis.scenes = [];\n\tthis.currentScene = null;\n\n\tthis.encounters = [];\n\tthis.currentEncounter = null;\n\n\tthis.mode = \"SCENE\"; // SCENE, INVENTORY/PLACE_OBJECT (?) or ENCOUNTER\n\n\tthis.addColor = function(name,style){\n\t\tthis.colors[name] = style;\n\t};\n\n\tthis.getColor = function(name){\n\n\t\tvar style = this.colors[name] || \"rgba(255,0,0,0.5)\";\n\t\treturn style;\n\t};\n\n\tthis.addScene = function(scene){\n\n\t\tscene.game = game;\n\n\t\tif(game.scenes.indexOf(scene) === -1){\n\t\t\tconsole.log(\"Game: Adding new scene,\",scene.name);\n\t\t\tscene.load();\n\t\t\tgame.scenes.push(scene);\n\t\t}\n\n\t\tif(game.currentScene === null) game.currentScene = scene;\n\t};\n\n\t// MAKING PROTECTED - trigger via event!\n\tvar gotoScene = function(sceneName){\n\n\t\tgame.eventManager.finished('gotoScene');\n\n\t\tfor(var i=0;i<game.scenes.length;i++){\n\t\t\tvar scene = game.scenes[i];\n\n\t\t\tif(scene.name == sceneName){\n\t\t\t\tif(game.currentScene) game.currentScene.unload();\n\t\t\t\tgame.currentScene = scene;\n\t\t\t\tgame.currentScene.load();\n\t\t\t\tgame.mode = \"SCENE\";\n\t\t\t\treturn scene;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\n\tthis.addEncounter = function(encounter){\n\n\t\tencounter.game = game;\n\n\t\tif(game.encounters.indexOf(encounter) === -1){\n\t\t\tconsole.log(\"Game: Adding new encounter,\",encounter.name);\n\t\t\tencounter.load();\n\t\t\tgame.encounters.push(encounter);\n\t\t}\n\n\t};\n\n\t// PROTECTED !!!\n\tvar startEncounter = function(encounterName){\n\n\t\tfor(var i=0;i<game.encounters.length;i++){\n\t\t\tvar encounter = game.encounters[i];\n\n\t\t\tif(encounter.name == encounterName){\n\t\t\t\tif(game.currentEncounter) game.currentEncounter.unload();\n\t\t\t\tgame.currentEncounter = encounter;\n\t\t\t\tgame.currentEncounter.load();\n\t\t\t\tgame.mode = \"ENCOUNTER\";\n\t\t\t\treturn encounter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\n\tthis.start = function(){\n\n\t\tconsole.log(\"\\n\\nStarting game...\\n\");\n\n\t\t// ADD EVENT HANDLERS for SCENE & ENCOUNTER\n\t\tgame.eventManager.on(\"gotoScene\",gotoScene,game);\n\t\tgame.eventManager.on(\"startEncounter\",startEncounter,game);\n\n\n\t\trequestAnimationFrame(game.update);\n\t};\n\n\tthis.update = function(){\n\t\t// Update animation timer\n\t\tgame.eventManager.send('Tick',Date.now(),game);\n\t\trequestAnimationFrame(game.update);\n\t};\n\n\t// EVENT HANDLER - click/drag by STATE --- TO DO - drag events\n\t// put these handlers in the STAGE!!! TODO\n\n\tvar canvas = game.canvas;\n\tcanvas.addEventListener('click',clickHandler,true);\n\n\tfunction clickHandler(e){\n\t\tvar event = {};\n\t\tevent.x = e.clientX;\n\t\tevent.y = e.clientY;\n\n\t\tconsole.log(\"Clicked at:\",event.x,event.y);\n\n\t\tswitch(game.mode){\n\n\t\t\tcase \"SCENE\":\n\t\t\t\tgame.eventManager.send('click:'+game.currentScene.name,event,game);\n\t\t\t\tbreak;\n\t\t\tcase \"ENCOUNTER\":\n\t\t\t\tgame.eventManager.send('click:'+game.currentEncounter.name,event,game);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"Do nothing for mode:\",game.mode);\n\t\t}\n\t}\n}", "makeUI() {\n gameState.criteriaText = this.add.text(gameState.CENTER_X, gameState.CRITERIA_HEIGHT, `MULTIPLES OF ${gameState.criteriaNum}`, {\n font: gameState.INFO_FONT,\n fill: '#00ffff'\n }).setOrigin(0.5);\n gameState.creditsText = this.add.text(192, 684, `Created by Jon So, 2021`, {\n font: gameState.DECO_FONT,\n fill: '#ffffff'\n });\n gameState.scoreText = this.add.text(gameState.CENTER_X, gameState.SCORE_HEIGHT, `${gameState.score}`, {\n font: gameState.SCORE_FONT,\n fill: '#ffffff'\n }).setOrigin(0.5);\n gameState.levelText = this.add.text(3 * gameState.CENTER_X / 2, 3 * gameState.CENTER_Y / 2, `LV. ${gameState.level}: ${gameState.FLAVORS[gameState.colorFlavorIndex]}`, {\n font: gameState.INFO_FONT,\n fill: '#ffffff'\n }).setOrigin(0.5);\n gameState.readyPrompt = this.add.text(gameState.CENTER_X, 9 * gameState.CENTER_Y / 16, ``, {\n font: gameState.READY_FONT,\n fill: '#ff0000'\n }).setOrigin(0.5);\n gameState.comboCounterTextLeft = this.add.text(gameState.CENTER_X / 7 + 8, gameState.CENTER_Y - 32, `1x`, {\n font: gameState.COMBO_FONT,\n fill: '#ffffff',\n }).setOrigin(0.5).setFontStyle('bold italic');\n gameState.comboCounterTextRight = this.add.text(config.width - gameState.CENTER_X / 7 - 8, gameState.CENTER_Y - 32, `1x`, {\n font: gameState.COMBO_FONT,\n fill: '#ffffff',\n }).setOrigin(0.5).setFontStyle('bold italic');\n // Display the high score/highest level/ highest combo\n\t\tgameState.highText = this.add.text(gameState.CENTER_X, 16, \n\t\t\t`HI SCORE-${localStorage.getItem(gameState.LS_HISCORE_KEY)}\\t\\tHI COMBO-${localStorage.getItem(gameState.LS_HICOMBO_KEY)}\\t\\tHI LEVEL-${localStorage.getItem(gameState.LS_HILEVEL_KEY)}`, {\n\t\t\t\tfont: gameState.INFO_FONT,\n \tfill: '#ffffff'\n }).setOrigin(0.5).setTint(0xff0000).setFontStyle(\"bold\"); \n this.showReadyPrompt();\n gameState.levelText.setTint(gameState.COLOR_HEXS[gameState.colorFlavorIndex]);\n this.setupLivesDisplay();\n }", "function init() {\n // physics engine\n engine = Matter.Engine.create();\n\n // setup game world \n world = engine.world;\n world.bounds = {\n min: { x: 0, y: 0 },\n max: { x: WINDOWWIDTH, y: WINDOWHEIGHT }\n };\n world.gravity.y = GRAVITY;\n\n // setup render\n render = Matter.Render.create({\n element: document.body,\n engine: engine,\n canvas: canvas,\n options: {\n width: WINDOWWIDTH,\n height: WINDOWHEIGHT,\n wireframes: false,\n background: 'transparent'\n }\n });\n Matter.Render.run(render);\n\n // setup game runner\n let runner = Matter.Runner.create();\n Matter.Runner.run(runner, engine);\n\n // starting values\n updateScore(0);\n\n //handle device rotation\n window.addEventListener('orientationchange', function () {\n //TODO: DJC\n });\n }", "loaded() {\n me.pool.register('player', game.Player);\n me.pool.register('enemy', game.Enemy);\n me.pool.register('laser', game.Laser);\n\n me.state.WIN = me.state.USER + 1;\n me.state.LOSE = me.state.USER + 2;\n me.state.LEVEL_1 = me.state.USER + 3;\n me.state.LEVEL_2 = me.state.USER + 4;\n me.state.LEVEL_3 = me.state.USER + 5;\n me.state.LEVEL_4 = me.state.USER + 6;\n\n // set the \"Play/Ingame\" Screen Object\n this.level1 = new game.PlayScreen();\n this.level2 = new game.PlayScreen(2, 'teal');\n this.level3 = new game.PlayScreen(3, 'orange');\n this.level4 = new game.PlayScreen(4, '#49B');\n\n this.winScreen = new game.WinScreen();\n this.loseScreen = new game.LoseScreen();\n\n me.state.set(me.state.LEVEL_1, this.level1);\n me.state.set(me.state.LEVEL_2, this.level2);\n me.state.set(me.state.LEVEL_3, this.level3);\n me.state.set(me.state.LEVEL_4, this.level4);\n\n me.state.set(me.state.WIN, this.winScreen);\n me.state.set(me.state.LOSE, this.loseScreen);\n\n // start the game\n me.state.change(me.state[`LEVEL_${store.getState().level}`]);\n }", "function initGame() {\n return new Phaser.Game(defaultConfiguration());\n}" ]
[ "0.70051646", "0.6926149", "0.65775865", "0.64752847", "0.6363604", "0.6296091", "0.62769145", "0.6237525", "0.62159944", "0.6214841", "0.6214795", "0.61867076", "0.6126275", "0.61189485", "0.6085924", "0.608459", "0.6083135", "0.6063203", "0.6055547", "0.60475576", "0.60391027", "0.6030479", "0.6017109", "0.59963626", "0.59935343", "0.599337", "0.5978527", "0.5973919", "0.59527576", "0.59455866", "0.5940221", "0.5927823", "0.5904555", "0.58977807", "0.58760047", "0.58753127", "0.5869732", "0.58695436", "0.58498174", "0.58463705", "0.5845159", "0.5830711", "0.5828407", "0.58169556", "0.58158857", "0.5815494", "0.5805223", "0.58035165", "0.57980114", "0.579415", "0.57910514", "0.5790381", "0.57876825", "0.5787667", "0.5782886", "0.57804483", "0.578026", "0.5778603", "0.57768446", "0.57726693", "0.57715607", "0.5769775", "0.576686", "0.576672", "0.57657164", "0.5759395", "0.57534075", "0.5748513", "0.574412", "0.5742988", "0.5739826", "0.573624", "0.5732565", "0.572823", "0.5719856", "0.57073593", "0.56991446", "0.5682612", "0.5678011", "0.5675585", "0.56749433", "0.5674121", "0.5664682", "0.56572074", "0.56564283", "0.5650017", "0.56474024", "0.5645572", "0.5642389", "0.5634488", "0.5633365", "0.56308925", "0.5628681", "0.56276375", "0.5627526", "0.5620573", "0.56184214", "0.56130254", "0.5612127", "0.56104887" ]
0.7006322
0
Game object, holds the game related objects
function Game(cols,rows){ started=false /* Initialize the snake and the food location */ this.init = function(){ this.score=0 this.snake = new Snake() this.pickFoodLocation(); } /* Start the game */ this.start = function(){ this.started = true; } /* Pick a random position and put a coin there */ this.pickFoodLocation = function() { this.food = createVector(floor(random(cols)), floor(random(rows))) this.food.mult(ITEMS_SCALE) } this.manageInput=function(keyCode){ if (keyCode === UP_ARROW) { this.snake.dir(0, -1); } else if (keyCode === DOWN_ARROW) { this.snake.dir(0, 1); } else if (keyCode === RIGHT_ARROW) { this.snake.dir(1, 0); } else if (keyCode === LEFT_ARROW) { this.snake.dir(-1, 0); } } /* Draw the components of the game */ this.draw = function(){ if (this.snake.eat(this.food)) { this.pickFoodLocation(); if (coin_sound.isPlaying()) { coin_sound.stop(); } coin_sound.play(); this.score += BASIC_FOOD_SCORE } if(this.started){ this.snake.update(); } if(this.snake.checkSelfCollision()){ if (game_over_sound.isPlaying()) { game_over_sound.stop(); } game_over_sound.play(); this.started = false; } textFont(game_font); textSize(height / 6); textAlign(CENTER, CENTER); fill(20,200,200); text(this.score+'', width*0.8, 0, width*0.2, height/6); this.snake.show(); fill(255, 200, 0); rect(this.food.x, this.food.y, ITEMS_SCALE, ITEMS_SCALE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Game() {\n // Module constants and variables\n var _this = this;\n _this.gameObjects = {};\n /**\n * Initialize the Game and call the custom init function if a custom\n * init function is connected to the Game.\n *\n * @function init\n * @param {number} FPS The game's frames per second.\n * @param {object} ctx The 2D context of the game canvas.\n * @param {object} canvas The game canvas.\n */\n function init(FPS, ctx, canvas) {\n _this.FPS = FPS;\n _this.ctx = ctx;\n _this.canvas = canvas;\n // Call the custom init function if it is defined\n if (_this.customInit) {\n _this.customInit(_this.ctx);\n }\n }\n /**\n * Reset the Game and call the custom reset function if a custom reset\n * function is connected to the Game.\n *\n * @function reset\n */\n function reset() {\n // Clear all the GameObjects\n Object.keys(_this.gameObjects).forEach(function (type) {\n _this.gameObjects[type] = [];\n });\n // Call the custom reset function if it is defined\n if (_this.customReset) {\n _this.customReset();\n }\n }\n /**\n * Delete a conrete GameObject from the Game if it is flaged for\n * removal.\n *\n * @private\n * @function handleDelete\n * @param {object} gameObject The concrete GameObject.\n * @param {string} type The concrete GameObject's type.\n */\n function handleDelete(gameObject, type) {\n if (gameObject.canDelete()) {\n _this.gameObjects[type].splice(\n _this.gameObjects[type].indexOf(gameObject),\n 1\n );\n }\n }\n /**\n * Update the Game and call the custom update function if a custom\n * update function is connected to the Game.\n *\n * @function update\n */\n function update() {\n // Call the custom update function if it is defined\n if (_this.customUpdate) {\n _this.customUpdate(_this.FPS, _this.canvas);\n }\n // Update all of the GameObjects and handle GameObject deletion\n Object.keys(_this.gameObjects).forEach(function (type) {\n _this.gameObjects[type].forEach(function (obj) {\n obj.update(_this.FPS);\n handleDelete(obj, type);\n });\n });\n }\n /**\n * Render the Game and call the custom render function if a custom\n * render function is connected to the Game.\n *\n * @function render\n */\n function render() {\n // Clear the canvas prior to rendering\n _this.ctx.clearRect(0, 0, _this.canvas.width, _this.canvas.height);\n // Call the custom render function if it is defined\n if (_this.customRender) {\n _this.customRender(_this.ctx, _this.canvas);\n }\n // Render all of the GameObjects in order of their render priority\n $.map(_this.gameObjects, function (value) {\n return value;\n }).sort(function (gameObjA, gameObjB) {\n return gameObjA.getDrawPriority() - gameObjB.getDrawPriority();\n }).forEach(function (obj) {\n obj.render(_this.ctx);\n });\n }\n /**\n * Return the Game's collection of GameObjects specified by type, if the\n * collection of GameObjects do not exist for the specified type return\n * an empty array.\n *\n * @function getGameObjects\n * @param {string} type The Type of GameObjects to return.\n * @return {object} The GameObjects.\n */\n function getGameObjects(type) {\n return _this.gameObjects[type] || [];\n }\n /**\n * Add a concrete GameObject with a specific type to the Game.\n *\n * @function addGameObject\n * @param {object} gameObject The concrete GameObject.\n * @param {string} type The concrete GameObject's type.\n */\n function addGameObject(gameObject, type) {\n // If array of specific objects doesn't exist then create it\n if (Object.keys(_this.gameObjects).indexOf(type) < 0) {\n // Create an new array of items\n _this.gameObjects[type] = [];\n }\n _this.gameObjects[type].push(gameObject);\n }\n /**\n * Connect a custom Init function to the Game.\n *\n * @function connectCustomInit\n * @param {function} customInit The custom init function.\n */\n function connectCustomInit(customInit) {\n _this.customInit = customInit;\n }\n /**\n * Connect a custom reset function to the Game.\n *\n * @function connectCustomReset\n * @param {function} customReset The custom reset function.\n */\n function connectCustomReset(customReset) {\n _this.customReset = customReset;\n }\n /**\n * Connect a custom update function to the Game.\n *\n * @function connectCustomUpdate\n * @param {function} customUpdate The custom update function.\n */\n function connectCustomUpdate(customUpdate) {\n _this.customUpdate = customUpdate;\n }\n /**\n * Connect a custom render function to the Game.\n *\n * @function connectCustomRender\n * @param {function} customRender The custom render function.\n */\n function connectCustomRender(customRender) {\n _this.customRender = customRender;\n }\n /**\n * Abstract function that defines the Game's mouse click event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function mouseClickEvent\n * @throws {Error} Abstract function.\n */\n function mouseClickEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's mouse release event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function mouseReleaseEvent\n * @throws {Error} Abstract function.\n */\n function mouseReleaseEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's mouse movement event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function mouseMoveEvent\n * @throws {Error} Abstract function.\n */\n function mouseMoveEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's keyboard press event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function keyPressEvent\n * @throws {Error} Abstract function.\n */\n function keyPressEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's keyboard release event.\n * This function needs to be overriden.\n *\n * @abstract\n * @function keyReleaseEvent\n * @throws {Error} Abstract function.\n */\n function keyReleaseEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n // Functions returned by the module\n return {\n init: init,\n reset: reset,\n update: update,\n render: render,\n addGameObject: addGameObject,\n keyPressEvent: keyPressEvent,\n mouseMoveEvent: mouseMoveEvent,\n getGameObjects: getGameObjects,\n mouseClickEvent: mouseClickEvent,\n keyReleaseEvent: keyReleaseEvent,\n mouseReleaseEvent: mouseReleaseEvent,\n connectCustomInit: connectCustomInit,\n connectCustomReset: connectCustomReset,\n connectCustomRender: connectCustomRender,\n connectCustomUpdate: connectCustomUpdate\n };\n }", "function Game() {\n this.clients = {};\n this.players = {};\n\n this.bullets = [];\n\n this.gameAlerts = [];\n}", "constructor(){\n this.current_game = new Game()\n }", "function GameManager() {\n\n /**\n * The current scene data.\n * @property sceneData\n * @type Object\n */\n this.sceneData = {};\n\n /**\n * The scene viewport containing all visual objects which are part of the scene and influenced\n * by the in-game camera.\n * @property sceneViewport\n * @type gs.Object_Viewport\n */\n this.sceneViewport = null;\n\n /**\n * The list of common events.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.commonEvents = [];\n\n /**\n * Indicates if the GameManager is initialized.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.initialized = false;\n\n /**\n * Temporary game settings.\n * @property tempSettings\n * @type Object\n */\n this.tempSettings = {\n skip: false,\n skipTime: 5,\n loadMenuAccess: true,\n menuAccess: true,\n backlogAccess: true,\n saveMenuAccess: true,\n messageFading: {\n animation: {\n type: 1\n },\n duration: 15,\n easing: null\n }\n\n /**\n * Temporary game fields.\n * @property tempFields\n * @type Object\n */\n };\n this.tempFields = null;\n\n /**\n * Stores default values for backgrounds, pictures, etc.\n * @property defaults\n * @type Object\n */\n this.defaults = {\n background: {\n \"duration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"loopVertical\": 0,\n \"loopHorizontal\": 0,\n \"easing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"animation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n picture: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n character: {\n \"expressionDuration\": 0,\n \"appearDuration\": 40,\n \"disappearDuration\": 40,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 2,\n \"inOut\": 2\n },\n \"disappearEasing\": {\n \"type\": 1,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n },\n \"changeAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"fading\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"changeEasing\": {\n \"type\": 2,\n \"inOut\": 2\n }\n },\n text: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"positionOrigin\": 0,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n video: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n live2d: {\n \"motionFadeInTime\": 1000,\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n messageBox: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n audio: {\n \"musicFadeInDuration\": 0,\n \"musicFadeOutDuration\": 0,\n \"musicVolume\": 100,\n \"musicPlaybackRate\": 100,\n \"soundVolume\": 100,\n \"soundPlaybackRate\": 100,\n \"voiceVolume\": 100,\n \"voicePlaybackRate\": 100\n }\n };\n\n /**\n * The game's backlog.\n * @property backlog\n * @type Object[]\n */\n this.backlog = [];\n\n /**\n * Character parameters by character ID.\n * @property characterParams\n * @type Object[]\n */\n this.characterParams = [];\n\n /**\n * The game's chapter\n * @property chapters\n * @type gs.Document[]\n */\n this.chapters = [];\n\n /**\n * The game's current displayed messages. Especially in NVL mode the messages \n * of the current page are stored here.\n * @property messages\n * @type Object[]\n */\n this.messages = [];\n\n /**\n * Count of save slots. Default is 100.\n * @property saveSlotCount\n * @type number\n */\n this.saveSlotCount = 100;\n\n /**\n * The index of save games. Contains the header-info for each save game slot.\n * @property saveGameSlots\n * @type Object[]\n */\n this.saveGameSlots = [];\n\n /**\n * Stores global data like the state of persistent game variables.\n * @property globalData\n * @type Object\n */\n this.globalData = null;\n\n /**\n * Indicates if the game runs in editor's live-preview.\n * @property inLivePreview\n * @type Object\n */\n this.inLivePreview = false;\n }", "function GameManager() {\n\n /**\n * The current scene data.\n * @property sceneData\n * @type Object\n */\n this.sceneData = {};\n\n /**\n * The scene viewport containing all visual objects which are part of the scene and influenced\n * by the in-game camera.\n * @property sceneViewport\n * @type gs.Object_Viewport\n */\n this.sceneViewport = null;\n\n /**\n * The list of common events.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.commonEvents = [];\n\n /**\n * Indicates if the GameManager is initialized.\n * @property commonEvents\n * @type gs.Object_CommonEvent[]\n */\n this.initialized = false;\n\n /**\n * Temporary game settings.\n * @property tempSettings\n * @type Object\n */\n this.tempSettings = {\n skip: false,\n skipTime: 5,\n loadMenuAccess: true,\n menuAccess: true,\n backlogAccess: true,\n saveMenuAccess: true,\n messageFading: {\n animation: {\n type: 1\n },\n duration: 15,\n easing: null\n }\n\n /**\n * Temporary game fields.\n * @property tempFields\n * @type Object\n */\n };\n this.tempFields = null;\n\n /**\n * Stores default values for backgrounds, pictures, etc.\n * @property defaults\n * @type Object\n */\n this.defaults = {\n background: {\n \"duration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"loopVertical\": 0,\n \"loopHorizontal\": 0,\n \"easing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"animation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n picture: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 1,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n character: {\n \"expressionDuration\": 0,\n \"appearDuration\": 40,\n \"disappearDuration\": 40,\n \"origin\": 1,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 2,\n \"inOut\": 2\n },\n \"disappearEasing\": {\n \"type\": 1,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n },\n \"changeAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"fading\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"changeEasing\": {\n \"type\": 2,\n \"inOut\": 2\n }\n },\n text: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"positionOrigin\": 0,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n video: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"origin\": 0,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"motionBlur\": {\n \"enabled\": 0,\n \"delay\": 2,\n \"opacity\": 100,\n \"dissolveSpeed\": 3\n }\n },\n live2d: {\n \"motionFadeInTime\": 1000,\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 1,\n \"movement\": 0,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n messageBox: {\n \"appearDuration\": 30,\n \"disappearDuration\": 30,\n \"zOrder\": 0,\n \"appearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"disappearEasing\": {\n \"type\": 0,\n \"inOut\": 1\n },\n \"appearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n },\n \"disappearAnimation\": {\n \"type\": 0,\n \"movement\": 3,\n \"mask\": {\n \"graphic\": null,\n \"vague\": 30\n }\n }\n },\n audio: {\n \"musicFadeInDuration\": 0,\n \"musicFadeOutDuration\": 0,\n \"musicVolume\": 100,\n \"musicPlaybackRate\": 100,\n \"soundVolume\": 100,\n \"soundPlaybackRate\": 100,\n \"voiceVolume\": 100,\n \"voicePlaybackRate\": 100\n }\n };\n\n /**\n * The game's backlog.\n * @property backlog\n * @type Object[]\n */\n this.backlog = [];\n\n /**\n * Character parameters by character ID.\n * @property characterParams\n * @type Object[]\n */\n this.characterParams = [];\n\n /**\n * The game's chapter\n * @property chapters\n * @type gs.Document[]\n */\n this.chapters = [];\n\n /**\n * The game's current displayed messages. Especially in NVL mode the messages\n * of the current page are stored here.\n * @property messages\n * @type Object[]\n */\n this.messages = [];\n\n /**\n * Count of save slots. Default is 100.\n * @property saveSlotCount\n * @type number\n */\n this.saveSlotCount = 100;\n\n /**\n * The index of save games. Contains the header-info for each save game slot.\n * @property saveGameSlots\n * @type Object[]\n */\n this.saveGameSlots = [];\n\n /**\n * Stores global data like the state of persistent game variables.\n * @property globalData\n * @type Object\n */\n this.globalData = null;\n\n /**\n * Indicates if the game runs in editor's live-preview.\n * @property inLivePreview\n * @type Object\n */\n this.inLivePreview = false;\n }", "function GameManager() {\n this.games = {};\n}", "constructor(game) {\n // make the game instance available to the scene\n this.game = game;\n\n // easy access to the canvas and canvas context\n this.Canvas = this.game.Canvas;\n this.ctx = this.game.Canvas.ctx;\n\n // each access to the object factory\n this.Objects = this.game.Objects;\n\n // the scene contains objects to be drawn\n this.scene = [];\n\n // additional constructor actions for child classes\n this.init();\n }", "function MyGame() { \r\n // The camera to view the scene\r\n this.mCamera = null;\r\n\r\n this.mMsg = null;\r\n\r\n this.mAllObjs = null;\r\n \r\n this.mCurrentObj = 0;\r\n \r\n this.mNumObjs = 6;\r\n \r\n this.timer = Date.now();\r\n \r\n this.cInfos = [];\r\n}", "function GameManager() {\n\tthis.player = new Player();\n\tthis.world = new World();\n}", "function gameObj() {\n this.gamenum=0;\n this.init = function() {\n this.items=[];\n this.times=[];\n this.firsttime=[];\n this.category=\"\";\n this.starttime=0;\n this.countdown=timeperlist;\n }\n this.init();\n }", "function Game(){\n\n\t// PROTECTED\n\tvar game = this; // this is an evil thing\n\tvar isRunning = false;\n\n\t// temporary hack\n\tthis.canvas = document.getElementById('myCanvas');\n\n\t// PUBLIC\n\tthis.stage = new Stage(this.canvas);\n\tthis.eventManager = new EventManager();\n\tthis.loader = new Loader();\n\n\t// Lookup tables\n\tthis.assets = {};\n\tthis.colors = {};\n\n\t// Components\n\tthis.scenes = [];\n\tthis.currentScene = null;\n\n\tthis.encounters = [];\n\tthis.currentEncounter = null;\n\n\tthis.mode = \"SCENE\"; // SCENE, INVENTORY/PLACE_OBJECT (?) or ENCOUNTER\n\n\tthis.addColor = function(name,style){\n\t\tthis.colors[name] = style;\n\t};\n\n\tthis.getColor = function(name){\n\n\t\tvar style = this.colors[name] || \"rgba(255,0,0,0.5)\";\n\t\treturn style;\n\t};\n\n\tthis.addScene = function(scene){\n\n\t\tscene.game = game;\n\n\t\tif(game.scenes.indexOf(scene) === -1){\n\t\t\tconsole.log(\"Game: Adding new scene,\",scene.name);\n\t\t\tscene.load();\n\t\t\tgame.scenes.push(scene);\n\t\t}\n\n\t\tif(game.currentScene === null) game.currentScene = scene;\n\t};\n\n\t// MAKING PROTECTED - trigger via event!\n\tvar gotoScene = function(sceneName){\n\n\t\tgame.eventManager.finished('gotoScene');\n\n\t\tfor(var i=0;i<game.scenes.length;i++){\n\t\t\tvar scene = game.scenes[i];\n\n\t\t\tif(scene.name == sceneName){\n\t\t\t\tif(game.currentScene) game.currentScene.unload();\n\t\t\t\tgame.currentScene = scene;\n\t\t\t\tgame.currentScene.load();\n\t\t\t\tgame.mode = \"SCENE\";\n\t\t\t\treturn scene;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\n\tthis.addEncounter = function(encounter){\n\n\t\tencounter.game = game;\n\n\t\tif(game.encounters.indexOf(encounter) === -1){\n\t\t\tconsole.log(\"Game: Adding new encounter,\",encounter.name);\n\t\t\tencounter.load();\n\t\t\tgame.encounters.push(encounter);\n\t\t}\n\n\t};\n\n\t// PROTECTED !!!\n\tvar startEncounter = function(encounterName){\n\n\t\tfor(var i=0;i<game.encounters.length;i++){\n\t\t\tvar encounter = game.encounters[i];\n\n\t\t\tif(encounter.name == encounterName){\n\t\t\t\tif(game.currentEncounter) game.currentEncounter.unload();\n\t\t\t\tgame.currentEncounter = encounter;\n\t\t\t\tgame.currentEncounter.load();\n\t\t\t\tgame.mode = \"ENCOUNTER\";\n\t\t\t\treturn encounter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t};\n\n\tthis.start = function(){\n\n\t\tconsole.log(\"\\n\\nStarting game...\\n\");\n\n\t\t// ADD EVENT HANDLERS for SCENE & ENCOUNTER\n\t\tgame.eventManager.on(\"gotoScene\",gotoScene,game);\n\t\tgame.eventManager.on(\"startEncounter\",startEncounter,game);\n\n\n\t\trequestAnimationFrame(game.update);\n\t};\n\n\tthis.update = function(){\n\t\t// Update animation timer\n\t\tgame.eventManager.send('Tick',Date.now(),game);\n\t\trequestAnimationFrame(game.update);\n\t};\n\n\t// EVENT HANDLER - click/drag by STATE --- TO DO - drag events\n\t// put these handlers in the STAGE!!! TODO\n\n\tvar canvas = game.canvas;\n\tcanvas.addEventListener('click',clickHandler,true);\n\n\tfunction clickHandler(e){\n\t\tvar event = {};\n\t\tevent.x = e.clientX;\n\t\tevent.y = e.clientY;\n\n\t\tconsole.log(\"Clicked at:\",event.x,event.y);\n\n\t\tswitch(game.mode){\n\n\t\t\tcase \"SCENE\":\n\t\t\t\tgame.eventManager.send('click:'+game.currentScene.name,event,game);\n\t\t\t\tbreak;\n\t\t\tcase \"ENCOUNTER\":\n\t\t\t\tgame.eventManager.send('click:'+game.currentEncounter.name,event,game);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"Do nothing for mode:\",game.mode);\n\t\t}\n\t}\n}", "function GameBase()\n{ \n //*************\n // Data members\n //*************\n this.m_RootGameObject = null;\n \n var m_Cameras = [];\n \n this.getCameras = function(){return m_Cameras;};\n \n //***************\n // Game interface\n //***************\n this.superStart = function()\n {\n this.m_RootGameObject = new GameObject();\n this.m_RootGameObject.setName(\"RootGameObject\");\n this.m_RootGameObject.getMesh().draw = null;\n \n };\n \n this.start = function()\n {\n initializeRootGameObject();\n \n };\n \n this.update = function()\n {\n this.m_RootGameObject.update();\n \n };\n \n this.draw = function()\n { \n //Draw scene for each camera\n for(var i = 0; i < m_Cameras.length; i++)\n {\n GRAPHICS.setActiveCamera(m_Cameras[i]);\n \n if (m_Cameras[i].draw != undefined)\n m_Cameras[i].draw();\n \n this.m_RootGameObject.draw();\n \n }\n \n };\n \n}", "createObjects() {\n\t\tgame.level_frame = 0;\n\t\tlet l = window.app.level.split( '|' ).map( ( a ) => {\n\t\t\treturn a.split( ',' );\n\t\t} );\n\t\tterrain.set();\n\t\tlet obj = {\n\t\t\tw: ( arr ) => { //wait\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 5 ];\n\t\t\t\ts.wait = arr[ 2 ];\n\t\t\t\ts.type = arr[ 6 ];\n\t\t\t\ts.level = arr[ 7 ];\n\t\t\t\ts.amt = arr[ 8 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tu: ( arr ) => { //uplink\n\t\t\t\tgame.a.push( new Plug( 'plug', pInt( arr[ 1 ] ), pInt( arr[ 2 ] ) , arr[ 3 ] ) );\n\t\t\t},\n\t\t\tc: ( arr ) => { //cache\n\t\t\t\t//game.a.push( new GroundCache( ...arr.slice( 1 ) ) );\n\t\t\t\tgame.a.push( new GroundCache( arr[ 1 ], arr[ 2 ], arr[ 3 ], arr[ 4 ] ) );\n\t\t\t},\n\t\t\tp: ( arr ) => { //pause\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.pscds = pInt( arr[ 2 ] );\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\ts: ( arr ) => { //spawn\n\t\t\t\t// [ \"s\", 32, \"c\", \"a\", 1, \"12\" ]\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 2 ];\n\t\t\t\ts.type = arr[ 3 ];\n\t\t\t\ts.level = arr[ 4 ];\n\t\t\t\ts.amt = arr[ 5 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tg: ( arr ) => { //ground\n\t\t\t\tgame.a.push( new GroundTank( 'ground' + arr[ 3 ], arr[ 1 ], arr[ 2 ] ) );\n\t\t\t},\n\t\t\tt: ( arr ) => { //text particle, permanent\n\t\t\t\tgame.a.push( new TextParticle( arr[ 3 ], arr[ 1 ] * 25, arr[ 2 ] * 32, true ) );\n\t\t\t},\n\t\t\tbl: ( arr ) => { //begin level\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.blvl = arr[ 2 ];\n\t\t\t\ts.amt = 0;\n\t\t\t\ts.y = pInt( arr[ 1 ] );\n\t\t\t\ts.x = 0;\n\t\t\t\tgame.a.push( s );\n\t\t\t},\n\t\t\tsl: ( arr ) => { //end level\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.elvl = arr[ 2 ];\n\t\t\t\tgame.a.push( s );\n\t\t\t}\n\t\t};\n\n\t\tl.forEach( ( arr ) => {\n\t\t\tobj[ arr[ 0 ] ]( arr );\n\t\t} );\n\t}", "function CoreGame(){\n\t\t//console.log(this);\n\t\tthis.initialize();\n\t}", "constructor(game) {\n this.realGame = game;\n }", "function Game() {\n this.player = [],\n this.currentId = 0\n}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "loadGame() {\n this.player = new Player(100, 100);\n this.treasure = new Treasure()\n this.playerImg = loadImage(\"assets/character-down.png\");\n this.treasureImg = loadImage(\"assets/treasure.png\");\n this.score = 0\n this.bg = loadImage(\"assets/background.png\");\n }", "function Game() {\n\tthis.round = null;\n\tthis.deck = [];\n\tthis.playerHand = [];\n\tthis.dealerHand = [];\n}", "function GameEngine() {\r\n\r\n this.allMaps = [];\r\n // Entities of the Game\r\n this.entities = []; // All entities of the game\r\n this.weapons = []; // All the weapons of the game\r\n this.items = [];\r\n this.villains = []; // All the Zombies | TODO ? Get rid or change ?\r\n this.players = []; // All the Players | TODO ? Get rid or change ?\r\n this.gameRunning = true;\r\n this.musicPlaying = true;\r\n this.deadPlayers = [];\r\n\r\n // This is the x and y of the game, they control the rotation of the player\r\n this.x;\r\n this.y;\r\n\r\n this.map = null;\r\n //this.menuMode = \"Game\";\r\n this.menuMode = \"Start\";\r\n this.hasSeenIntro = false;\r\n\r\n this.zombieCooldownNumInitial = 3; // how often a zombie will appear initially\r\n this.zombieCooldown = this.zombieCooldownNumInitial; // the cooldown until the next zombie appears\r\n \r\n \r\n this.spiderCooldownNumInitial = 2; // how often a spider will appear\r\n this.spiderCooldown = this.zombieCooldownNumInitial; // the cooldown until the next spider appears\r\n \r\n this.skeletonCooldownNumInitial = 4; // how often a skeleton will appear\r\n this.skeletonCooldown = this.zombieCooldownNumInitial; // the cooldown until the next skeleton appears\r\n\r\n this.kills = 0; // this is the number of kills that the player has total\r\n\r\n this.showOutlines = false; // this shows the outline of the entities\r\n this.ctx = null; // this is the object being used to draw on the map\r\n this.click = null; // this is the click value (if null, not being clicked)\r\n\r\n this.mouse = {x:0, y:0, mousedown:false}; // this is the mouse coordinates and whether the mouse is pressed or not\r\n\r\n this.surfaceWidth = null; // the width of the canvas\r\n this.surfaceHeight = null; // the height of the canvas\r\n\r\n // var source= document.createElement('source');\r\n // source.type= 'audio/ogg';\r\n // source.src= \"./sound/backgroundmusic1.ogg\";\r\n // this.backgroundaudio.appendChild(source);\r\n // source= document.createElement('source');\r\n // source.type= 'audio/mpeg';\r\n // source.src= \"./sound/fastfoot.mp3\";\r\n // this.backgroundaudio.appendChild(source);\r\n // console.log(this.backgroundaudio);\r\n this.setupSounds();\r\n\r\n \r\n this.attributePoints = 0;\r\n // FOREST MAP\r\n // this.worldWidth = 1600; // the width of the world within the canvas FOREST\r\n // this.worldHeight = 1600; // the height of the world within the canvas FOREST\r\n\r\n // this.mapRatioWidth = 1600; //\r\n // this.mapRationHeight = 1600;\r\n\r\n // HOSPITAL MAP\r\n // this.worldWidth = 1400; // the width of the world within the canvas HOSPITAL\r\n // this.worldHeight = 1350; // the height of the world within the canvas HOSPITAL\r\n\r\n // this.mapRatioWidth = 400;\r\n // this.mapRatioHeight = 400;\r\n\r\n this.windowX = 0; // This is the x-coordinate of the top left corner of the canvas currently\r\n this.windowY = 0; // This is the y-coordinate of the top left corner of the canvas currently\r\n\r\n // Quinn's Additions\r\n this.timer = new Timer(); // this creates the Object Timer for the Game Engine\r\n this.keyState = {}; // this is the current keystate which is an object that is nothing\r\n\r\n this.expToLevelUp = 10;\r\n this.level = 1;\r\n this.expEarned = 0;\r\n\r\n this.menuBackground = ASSET_MANAGER.getAsset(menuBackground);\r\n this.aura = false;\r\n\r\n this.maxHalo = 10;\r\n this.halo = this.maxHalo;\r\n}", "function GameEngine() {\n this.sceneManager = new SceneManager(this);\n this.collisionBox = {\n ground: [],\n };\n this.ui = [];\n this.entities = [];\n this.big = [];\n this.mid = [];\n this.small = [];\n this.food = [];\n this.ctx = null;\n this.surfaceWidth = null;\n this.surfaceHeight = null;\n\n this.movedAmount = 0;\n\n //events\n this.mouse = {click: false,\n x: undefined,\n y: undefined,\n width: 1,\n height: 1,\n pressed: false,\n reset: function() {\n this.click = false;\n // this.pressed = false;\n }};\n this.events = {\n }\n this.save = false;\n this.load = false;\n}", "function startGame(){\r\n // This object has parentesis because we will work on it later.\r\n window.game= new Game()\r\n}", "function Game() { }", "function GameController() {\n\t\t// everything related to the game that doesn't directly touch the DOM\n\t\tthis.myDeck = new Deck();\n\t\tthis.betObj = new Betting();\n\t\tthis.playerOne = new Player('John','playerOne');\n\t\t//this.playerRender = new PlayerUI(); // not sure why i created this. they don't do anything\n\t\tthis.gameDealer = new Player('Dealer','gameDealer');\n\t\t// this.dealerRender = new PlayerUI(); // not sure why i created this. they don't do anything\n\t}", "init(game) {\n\n }", "function initObject(){\n\tmyplayer = new Player(img, 0, 0, 30, 50);\n\tanimals.push(new Animal(animalImgUp, 0, 800, 30, 50));\n\tanimals.push(new Animal(animalImgDown, 1000, 0, 30 ,50));\n\tanimals.push(new Animal(animalImgLeft, 600, 500, 30, 50));\n\tanimals.push(new Animal(animalImgRight, 100, 600, 30, 50));\n\tmyGame = new Game();\n}", "init() { \n this.ecs.set(this, \"Game\", \"game\", \"scene\")\n }", "function Game(){\n\t}", "function MyGame() {\n this.sceneFile_Level0 = \"assets/Scenes/Level0.json\";\n this.kPlatformTexture = \"assets/Ground.png\";\n this.kWallTexture = \"assets/wall.png\";\n this.kHeroSprite = \"assets/Me.png\";\n this.kCatherine = \"assets/Catherine.png\";\n this.kHuman = \"assets/Human.png\";\n this.kFlower = \"assets/flower.png\";\n this.kFontCon72 = \"assets/fonts/Consolas-72\";\n\n this.sceneParser = null;\n this.mCameras = [];\n this.mPlatformAttrs = [];\n this.mWallAttrs = [];\n this.mTextAttrs = [];\n this.mHumanAttrs = [];\n \n this.mCamera = null;\n this.mHero = null;\n this.mCatherine = null; \n this.mFlower = null;\n this.mGameStatus = 0;\n\n this.nextLevel = null;\n \n this.mAllPlatforms = new GameObjectSet();\n this.mAllHumans = new GameObjectSet();\n\n this.mTexts = new GameObjectSet();\n this.mAllWalls = new GameObjectSet();\n}", "constructor()\n {\n // Transformation\n this.position = new Vector(0, 0);\n this.scale = new Vector(1, 1);\n\n // List of child game objects\n this.parent = undefined;\n this.gameObjects = [];\n }", "function MyGame() {\n this.mainview = new Mainview();\n\n}", "function Game()\n{\n\t/*\n\t * Gets canvas information and context and sets up all game\n\t * objects.\n\t *\n\t */\n\tthis.init = function()\n {\n\t\t// Get the canvas element\n\t\tthis.bgCanvas = document.getElementById('background');\n this.shipCanvas = document.getElementById('ship');\n\t\tthis.mainCanvas = document.getElementById('main');\n\t\tdocument.getElementById(\"go\").style.visibility = \"visible\";\n\n\n\t\t// Test to see if canvas is supported\n\t\tif (this.bgCanvas.getContext)\n {\n\t\t\tthis.bgContext = this.bgCanvas.getContext('2d');\n this.shipContext = this.shipCanvas.getContext('2d');\n\t\t\tthis.mainContext = this.mainCanvas.getContext('2d');\n\t\t\t// Initialize objects to contain their context and canvas\n\t\t\t// information\n\t\t\tBackground.prototype.context = this.bgContext;\n\t\t\tBackground.prototype.canvasWidth = this.bgCanvas.width;\n\t\t\tBackground.prototype.canvasHeight = this.bgCanvas.height;\n\n Ship.prototype.context = this.shipContext;\n\t\t\tShip.prototype.canvasWidth = this.shipCanvas.width;\n\t\t\tShip.prototype.canvasHeight = this.shipCanvas.height;\n\n\t\t\tBullet.prototype.context = this.mainContext;\n\t\t\tBullet.prototype.canvasWidth = this.mainCanvas.width;\n\t\t\tBullet.prototype.canvasHeight = this.mainCanvas.height;\n\n Enemy.prototype.context = this.mainContext;\n\t\t\tEnemy.prototype.canvasWidth = this.mainCanvas.width;\n\t\t\tEnemy.prototype.canvasHeight = this.mainCanvas.height;\n\n\t\t\tElite.prototype.context = this.mainContext;\n\t\t\tElite.prototype.canvasWidth = this.mainCanvas.width;\n\t\t\tElite.prototype.canvasHeight = this.mainCanvas.height;\n\n\t\t\tTitan.prototype.context = this.mainContext;\n\t\t\tTitan.prototype.canvasWidth = this.mainCanvas.width;\n\t\t\tTitan.prototype.canvasHeight = this.mainCanvas.height;\n\n\t\t\tGoliath.prototype.context = this.mainContext;\n\t\t\tGoliath.prototype.canvasWidth = this.mainCanvas.width;\n\t\t\tGoliath.prototype.canvasHeight = this.mainCanvas.height;\n\n\t\t\t// Initialize the background object\n\t\t\tthis.background = new Background();\n\t\t\tthis.background.init(0,0); // Set draw point to 0,0\n\n // Initialize the ship object\n this.ship = new Ship();\n\t\t\t// Set the ship to start near the bottom middle of the canvas\n\t\t\tthis.shipStartX = this.shipCanvas.width/2 - imageRepository.spaceship.width;\n\t\t\tthis.shipStartY = this.shipCanvas.height/4*3 + imageRepository.spaceship.height*2;\n\t\t\tthis.ship.init(this.shipStartX, this.shipStartY, imageRepository.spaceship.width, imageRepository.spaceship.height);\n\n // Initialize the enemy pool object\n\t\t\tthis.enemyPool = new Pool(30);\n\t\t\tthis.enemyPool.init(\"enemy\");\n this.spawnWave();\n this.enemyBulletPool = new Pool(50);\n\t\t\tthis.enemyBulletPool.init(\"enemyBullet\");\n\n\n\t\t\tthis.elitePool = new Pool(30);\n\t\t\tthis.elitePool.init(\"elite\");\n this.eliteBulletPool = new Pool(50);\n\t\t\tthis.eliteBulletPool.init(\"eliteBullet\");\n\n\t\t\tthis.titanPool = new Pool(30);\n this.titanPool.init(\"titan\");\n\t\t\tthis.titanBulletPool = new Pool(100);\n this.titanBulletPool.init(\"titanBullet\");\n\t\t\tthis.titanBigBulletPool = new Pool(50);\n this.titanBigBulletPool.init(\"titanBigBullet\");\n\n\t\t\tthis.goliathPool = new Pool(30);\n\t\t\tthis.goliathPool.init(\"goliath\");\n\t\t\tthis.goliathBulletPool = new Pool(100);\n this.goliathBulletPool.init(\"goliathBullet\");\n\t\t\tthis.goliathSecondaryBulletPool = new Pool(50);\n this.goliathSecondaryBulletPool.init(\"goliathSecondaryBullet\");\n\t\t\tthis.goliathBigBulletPool = new Pool(25);\n this.goliathBigBulletPool.init(\"goliathBigBullet\");\n\n // Start QuadTree\n this.quadTree = new QuadTree({x:0,y:0,width:this.mainCanvas.width,height:this.mainCanvas.height});\n\n this.playerScore = 0;\n\n // Audio files\n\t\t\tthis.laser = new SoundPool(10);\n\t\t\tthis.laser.init(\"laser\");\n\n\t\t\tthis.explosion = new SoundPool(20);\n\t\t\tthis.explosion.init(\"explosion\");\n\n\t\t\tthis.enemyLaser = new SoundPool(20);\n\t\t\tthis.enemyLaser.init(\"enemyLaser\");\n\n\t\t\tthis.eliteLaser = new SoundPool(20);\n\t\t\tthis.eliteLaser.init(\"enemyLaser\");\n\n\t\t\tthis.titanLaser = new SoundPool(20);\n\t\t\tthis.titanLaser.init(\"titanLaser\");\n\n\t\t\tthis.goliathFire = new SoundPool(20);\n\t\t\tthis.goliathFire.init(\"goliathFire\");\n\n\t\t\tthis.goliathRockets = new SoundPool(20);\n\t\t\tthis.goliathRockets.init(\"goliathRockets\");\n\n\t\t\tthis.healthUp = new SoundPool(20);\n\t\t\tthis.healthUp.init(\"healthUp\");\n\n\t\t\tthis.healthDown = new SoundPool(20);\n\t\t\tthis.healthDown.init(\"healthDown\");\n\n\n\t\t\tthis.backgroundAudio = new Audio(\"/assets/kick_shock.wav\");\n\t\t\tthis.backgroundAudio.loop = true;\n\t\t\tthis.backgroundAudio.volume = .25;\n\t\t\tthis.backgroundAudio.load();\n\n\t\t\tthis.gameOverAudio = new Audio(\"/assets/game_over.wav\");\n\t\t\tthis.gameOverAudio.loop = false;\n\t\t\tthis.gameOverAudio.volume = .25;\n\t\t\tthis.gameOverAudio.load();\n\n\n\t\t\tthis.checkAudio = window.setInterval(function(){checkReadyState()},1000);\n\n\t\t\t//return true;\n\t\t}\n // else\n //{\n\t\t//\treturn false;\n\t\t//}\n\t};\n\n // Spawn a new wave of enemies\n\tthis.spawnWave = function() {\n\t\tvar height = imageRepository.enemy.height;\n\t\tvar width = imageRepository.enemy.width;\n\t\tvar x = 100;\n\t\tvar y = -height;\n\t\tvar spacer = y * 1.5;\n\t\tfor (var i = 1; i <= 30; i++) {\n\t\t\tthis.enemyPool.get(x,y,2);\n\t\t\tx += width + 25;\n\t\t\tif (i % 10 == 0) {\n\t\t\t\tx = 100;\n\t\t\t\ty += spacer\n\t\t\t}\n\n\t\t}\n\t}\n\n\tthis.spawnWaveA = function() {\n\t\tvar height = imageRepository.elite.height;\n\t\tvar width = imageRepository.elite.width;\n\t\tvar x = 100;\n\t\tvar y = -height;\n\t\tvar spacer = y * 1.5;\n\t\tfor (var i = 1; i <= 10; i++) {\n\t\t\tthis.elitePool.get(x,y,2);\n\t\t\tx += width + 75;\n\t\t\tif (i % 5 == 0) {\n\t\t\t\tx = 100;\n\t\t\t\ty += spacer\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.spawnWaveB = function() {\n\t\tvar height = imageRepository.titan.height;\n\t\tvar width = imageRepository.titan.width;\n\t\tvar x = 100;\n\t\tvar y = -height;\n\t\tvar spacer = y * 1.5;\n\t\tfor (var i = 1; i <= 2; i++) {\n\t\t\tthis.titanPool.get(x,y,2);\n\t\t\tx += width + 75;\n\t\t\tif (i % 2 == 0) {\n\t\t\t\tx = 100;\n\t\t\t\ty += spacer\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.spawnWaveC = function() {\n\t\tvar height = imageRepository.goliath.height;\n\t\tvar width = imageRepository.goliath.width;\n\t\tvar x = 100;\n\t\tvar y = -height + 50;\n\t\tvar spacer = y * .5;\n\t\tfor (var i = 1; i <= 1; i++) {\n\t\t\tthis.goliathPool.get(x,y,2);\n\t\t\tx += width + 75;\n\t\t\tif (i % 1 == 0) {\n\t\t\t\tx = 100;\n\t\t\t\ty += spacer\n\t\t\t}\n\t\t}\n\t}\n\n\t// Start the animation loop\n\tthis.start = function()\n {\n\t\tdocument.getElementById(\"loadingScreen\").style.visibility = \"hidden\";\n\n\t\tdocument.getElementById(\"do\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"so\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"go\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"gs\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"sp\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"bp\").style.visibility = \"hidden\";\n\n document.getElementById(\"remaining\").style.height = \"225px\";\n\t\tdocument.getElementById(\"remaining\").style.backgroundColor = \"green\";\n this.ship.draw();\n this.backgroundAudio.play();\n\t\tanimate();\n\t};\n\n // Restart the game\n\tthis.restart = function()\n {\n\t\tthis.gameOverAudio.pause();\n\n\t\tdocument.getElementById('game-over').style.display = \"none\";\n\t\tthis.bgContext.clearRect(0, 0, this.bgCanvas.width, this.bgCanvas.height);\n\t\tthis.shipContext.clearRect(0, 0, this.shipCanvas.width, this.shipCanvas.height);\n\t\tthis.mainContext.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height);\n\n\t\tthis.quadTree.clear();\n\n\t\tthis.background.init(0,0);\n\t\tthis.ship.init(this.shipStartX, this.shipStartY, imageRepository.spaceship.width, imageRepository.spaceship.height);\n\n\t\tthis.enemyPool.init(\"enemy\");\n\t\tthis.spawnWave();\n\t\tthis.enemyBulletPool.init(\"enemyBullet\");\n\n\t\tthis.elitePool.init(\"elite\");\n\t\tthis.eliteBulletPool.init(\"eliteBullet\");\n\n\t\tthis.titanPool.init(\"titan\");\n\t\tthis.titanBulletPool.init(\"titanBullet\");\n\t\tthis.titanBigBulletPool.init(\"titanBigBullet\");\n\n\t\tthis.goliathPool.init(\"goliath\");\n\t\tthis.goliathBulletPool.init(\"goliathBullet\");\n\t\tthis.goliathSecondaryBulletPool.init(\"goliathSecondaryBullet\");\n\t\tthis.goliathBigBulletPool.init(\"goliathBigBullet\");\n\n\t\tthis.playerScore = 0;\n\n\t\tthis.backgroundAudio.currentTime = 0;\n\t\tthis.backgroundAudio.play();\n\n\t\tdocument.getElementById('score_form').style.visibility = \"hidden\";\n\n\t\tthis.start();\n\t};\n\n // Game over\n\tthis.gameOver = function()\n {\n\t\tdocument.getElementById('score_form').style.visibility = \"visible\";\n\t\tdocument.getElementById('hidden-score').value =game.playerScore;\n\t\tthis.backgroundAudio.pause();\n\t\tthis.gameOverAudio.currentTime = 0;\n\t\tthis.gameOverAudio.play();\n\t\tdocument.getElementById('game-over').style.display = \"block\";\n\t};\n}", "function initObjs() {\n // Default tile size\n TS = canHeight/16;\n\n // Make default background\n BG = new Background(0, 0, canWidth, canHeight, 'rgba(255,255,255,1');\n\n // Make sure player size is slightly smaller than tile size!!\n // This is in order to fit between gaps\n // 3.5 is fastest w/out skipping over gaps w/ current size+speed\n player = new Player(TS, TS, TS*0.94, TS*0.94, 2, 'rgba(240,0,0,1)');\n \n // Default checkpoint\n checkpoint = new Checkpoint(999, 999, TS/2, 'rgba(80,80,255,1)', player);\n\n // Empty walls\n walls = [];\n }", "function Game() {\n this.userHeroList = [];\n this.userItemList = [];\n this.inventory = null;\n this.gameTime = 0;\n this.elapsedTime = 0;\n this.state = \"none\";\n this.targetState = \"none\";\n this.battle = null;\n this.battleEndScreen = null;\n this.mainMenuScreen = null;\n this.fade = new Fade();\n}", "start() {\n this.keepAlive = true;\n dispatcher.trigger('game.init', this);\n this.eachObject(function (o) {\n dispatcher.on('game.reset', o.onReset.bind(o));\n dispatcher.on('game.update', o.onUpdate.bind(o));\n dispatcher.on('game.draw', o.onDraw.bind(o));\n dispatcher.trigger('game.object.init', o);\n });\n if (this.isDead()) {\n this.reset();\n }\n this.placeObjects();\n this.animate();\n }", "function Game() {\n this.state = \"selection\";\n this.player = null;\n this.defenders = [];\n this.currentDefender = null;\n}", "constructor() { \n \n Game.initialize(this);\n }", "function Game() {\n\n // establecen los parametros iniciales del juego\n this.config = {\n bombRate: 0.1, //cantidad de bombas que se lanzan\n bombMinVelocity: 60,//velocidades de las bombas\n bombMaxVelocity: 60,\n invaderInitialVelocity: 30,//velocidad a la que se mueven los aliens\n invaderAcceleration: 0,\n invaderDropDistance: 20,\n rocketVelocity: 120,//velovidad de los metioritos\n rocketMaxFireRate: 2,\n gameWidth: 600,\n gameHeight: 300,\n fps: 50,\n debugMode: false,\n invaderRanks: 3,//columnas de aliens\n invaderFiles: 8,//filas de aliens\n shipSpeed: 140,//velocidad de disparo\n levelDifficultyMultiplier: 0.4,//por cada nivel se incrementara en un 0.4\n pointsPerInvader: 5,//puntos por matar\n limitLevelIncrease: 25,\n \n };\n\n \n\n // los parametos iniciales del juego.\n this.lives = 5;//cantidad de vidas\n this.width = 0;\n this.height = 0;\n this.gameBounds = {left: 0, top: 0, right: 0, bottom: 0};\n this.intervalId = 0;\n this.score = 0;\n this.level = 1;\n\n \n this.stateStack = [];\n\n \n this.pressedKeys = {};\n this.gameCanvas = null;\n\n \n this.sounds = null;\n\n // variable que guardara la posision anterior\n this.previousX = 0;\n}", "constructor(game) {\n this.game = game;\n this.sprite = null; // Children will deal with this\n this.health = 1;\n this.speed = 60;\n this.damage = 1;\n this.componentList = [];\n }", "function Gamestate() {\n this.eventEmitter;\n this.minPlayers;\n this.started = false;\n \n this.init = function(eventEmitter) {\n this.eventEmitter = eventEmitter;\n }\n \n \n // singleWorld or multipleWorld\n this.type = 'multipleWorld';\n //turnBased or realTime\n this.timing = 'turnBased';\n //if games can end (the games dont persist and/or have a \"win\" condition)\n this.endable = true;\n \n //returns the players in the game \n this.getPlayers = function() {\n return this.players; \n }\n \n //Sends a message to all players in a game\n\t//accepts an object and a socket\n\t//Sends the object to the clients via the socket\n\tthis.sendAllPlayers = function(obj, socket) {\n this.players.forEach(function(player) {\n\t\t\tsocket.clients[player.sessionId].send(obj);\n\t\t});\n\t}\n \n this.getPlayerBySessionId = function(sessionId) {\n var returnPlayer;\n this.players.forEach(function(player) {\n if (player.sessionId == sessionId) {\n returnPlayer = player;\n }\n });\n return returnPlayer;\n }\n\t\n\t//Sends a message to a single player in a game\n\t//accepts an object and the players sessionId, and a socket\n\t//Sends the object to the client via the socket\n\tthis.sendPlayer = function(obj, player, socket) {\n\t\tif (typeof player != 'object') {\n player = this.getPlayerBySessionId(player);\n }\n socket.clients[player.sessionId].send(obj);\n\t}\n \n //sends a game over event to the players and sends out the event\n this.gameOver = function(obj) {\n if (this.endable) {\n obj.players = this.players;\n this.sendAllPlayers({type: 'gameOver', args: {winner: obj.winner}}, obj.socket);\n this.eventEmitter.emit('gameEnd', obj);\n }\n else {\n throw new Error('gameEnd command sent on a non-endable game type')\n }\n }\n \n /*\n *Adds a player to the game. If the game is full, begins the game\n *\n *@arg obj.\n * client client object\n * socket the socket object\n * connectedUsers connectedUsers obj, keyed by sessionId\n */\n this.addPlayer = function(obj) {\n //add the player to the game\n this.players.push({sessionId: obj.client.sessionId});\n //if the game has the min players, start it\n if (this.players.length == this.minPlayers) {\n this.startGame(obj)\n }\n }\n \n /*\n *Notified when a player in this game disconnects from the service\n *\n *@arg obj.\n * client client object\n * socket the socket object\n * connectedUsers connectedUsers obj, keyed by sessionId\n */\n this.userDisconnect = function(obj) {\n var game = this;\n var i = 0;\n var toDelete = null;\n this.players.forEach(function(player) {\n if (player.sessionId != obj.client.sessionId) {\n //telling player disco happened\n game.sendPlayer({type: 'opponentDisconnect', args: {opponentDisconnect: obj.client.sessionId}}, player.sessionId, obj.socket);\n }\n if (player.sessionId == obj.client.sessionId) {\n //found a player to delete\n toDelete = i;\n }\n i++;\n });\n this.players.remove(toDelete);\n this.checkGameEnd(obj);\n }\n \n /*\n *Required on all Gamestates, function to determine if the game has ended. \n *Should either return a winning player object, the string 'tie' or the bool false\n *\n *@arg obj.\n * client client object\n * socket the socket object\n * connectedUsers connectedUsers obj, keyed by sessionId\n */\n this.checkGameEnd = function(obj) {\n return false;\n }\n}", "function gameObject() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.image = null;\r\n}", "constructor() {\n this.core = new Map();\n this.endedgames = new Set();\n }", "constructor(game, parent) {\n super(game,parent);\n\n }", "function stage(top) {\n this.owned_objects = [];\n this.push = function(obj) { this.owned_objects.push(obj);}\n this.pop = function() {this.owned_objects.pop();} \n this.will_destroy = false;\n this.destroy = function(obj) {\n \tvar i = this.owned_objects.indexOf(obj);\n this.owned_objects.splice(i, 1);\n }\n if(!top){\n \tthis.on_top = false;\n } else {\n this.on_top = true;\n } \n this.get = function(obj){\n \treturn this.owned_objects[this.owned_objects.indexOf(obj)];\n }\n \n this.remove_enemies = function(){\n \tthis.owned_objects = this.owned_objects.filter(function(obj){\n \t return obj.type != \"enemy\";\t\n \t});\n \tthis.owned_objects = this.owned_objects.filter(function(obj){\n \t return obj.type != \"bullet\";\t\n \t});\n }\n \n this.always_update = true;\n this.always_draw = true;\n \n this.clear = function(){\n \tthis.owned_objects = [];\n }\n \n this.remove_obstacles = function(){\n \tthis.owned_objects = this.owned_objects.filter(function(obj){\n \t return obj.is_obstacle == undefined;\t\n \t});\n\t\tconsole.log(this.owned_objects);\n \t\n }\n \n this.check_num_enemies = function(){\n \tvar count = 0;\n \tfor(var i = 0; i < this.owned_objects.length; i++){\n \t\tif(this.owned_objects[i].type == \"enemy\"){\n \t\t\tcount++;\n \t\t}\n \t}\n\t\treturn count;\n } \n}", "function globalContainer() {\n\tvar gameMode = null;\n\tvar globalPlayer1 = new player(1);\n\tvar globalPlayer2 = new player(2);\n\n\t// event driven gameMenu with callbacks to handle initializers\n\tgameMenu(gameMode, globalPlayer1, globalPlayer2);\n\n\t// ==========================================================================\n\t// GLOBAL CONTAINER OBJECTS\n\t// ==========================================================================\n\n\t// Constructor function to prototype player object\n\tfunction player(id) {\n\t\tself.id = id,\n\t\tself.name = \"\",\n\t\tself.wins = 0,\n\t\tself.losses = 0,\n\t\tself.draws = 0,\n\t\tself.avatar = \"\"\n\t}\n\n\t// ==========================================================================\n\t// INITIALIZE SETTINGS\n\t// ==========================================================================\n\n\tfunction gameMenu(gameMode, globalPlayer1, globalPlayer2) {\n\t\t$('#pve-button').click(function() {\n\t\t\tgameMode = 'pve';\n\t\t\t\n\t\t\t// initialize scoreboard, set player names\n\t\t\tinitializeScoreboard(gameMode, globalPlayer1, globalPlayer2);\n\n\t\t\t// Closes overlay\n\t\t\ttoggleWrapper();\n\n\t\t\t// Start game initializer\n\t\t\tinitiateGameType(gameMode, globalPlayer1, globalPlayer2);\n\t\t})\n\n\t\t$('#pvp-button').click(function() {\n\t\t\tgameMode = 'pvp';\n\n\t\t\t// initialize scoreboard, set player names\n\t\t\tinitializeScoreboard(gameMode, globalPlayer1, globalPlayer2);\n\n\t\t\t// Closes overlay\n\t\t\ttoggleWrapper();\n\n\t\t\t// Start game initializer\n\t\t\tinitiateGameType(gameMode, globalPlayer1, globalPlayer2);\n\t\t})\n\t}\n\n\tfunction initializeScoreboard(gameMode, globalPlayer1, globalPlayer2) {\n\t\t// initialize for 1 player vs AI\n\t\tif(gameMode == 'pve') {\n\t\t\tglobalPlayer1.name = prompt('Please enter name for player 1');\n\t\t\t$('#player1-name').text(globalPlayer1.name);\n\t\t\t\n\t\t\tvar namesArray = ['Evil Robot', 'T-1000', 'Cylon', 'Megatron', 'SkyNet'];\n\t\t\tglobalPlayer2.name = namesArray[Math.floor(Math.random()*namesArray.length)];\n\t\t\t$('#player2-name').text(globalPlayer2.name);\n\n\t\t} else {\n\t\t// initialize for 2 players head to head\n\t\t\tglobalPlayer1.name = prompt('Please enter name for player 1');\n\t\t\t$('#player1-name').text(globalPlayer1.name);\n\n\t\t\tglobalPlayer2.name = prompt('Please enter name for player 2');\n\t\t\t$('#player2-name').text(globalPlayer2.name);\n\t\t}\n\t}\n\n\t// Close overlay and render wrapper\n\tfunction toggleWrapper(){\n\t\t$('#wrapper').toggle();\n\t\t$('#overlay').toggle();\n\t}\n\n\t// Update messageboard\n\tfunction status(msg) {\n\t\t$('#status').empty();\n\t\t$('#status').append(msg);\n\t}\n\n\t// ==========================================================================\n\t// INITIALIZE GAME\n\t// ==========================================================================\n\tfunction initiateGameType(gameMode, globalPlayer1, globalPlayer2) {\n\t\tif(gameMode == 'pve') {\n\t\t\tconsole.log('started a pve game');\n\t\t} else {\n\t\t\tconsole.log('started a pvp game');\n\t\t\t// Mutate currentGame object in order to prevent memory leaks with future games / lack of gc support\n\t\t\tcurrentGame = new pvpGame(globalPlayer1, globalPlayer2);\n\t\t}\n\t\treturn;\n\t}\n\n\tfunction pvpGame(player1, player2) {\n\t\t// Initialize board, move, turn, turncounter, randomize players and avatars\n\t\t// var board = [null, null, null, null, null, null, null, null, null]\n\t\t// var turn = null;\n\t\t// var currentMove;\n\t\t// var turnCounter = 1;\n\t\t// var gameOver = false;\n\t\t// var players = [player1, player2];\n\t\t// var playerX = {\n\t\t// \tplayer : randomPlayer(player1, player2),\n\t\t// \tavatar : 'X'\n\t\t// }\n\t\t// var playerO = {\n\t\t// \tplayer : _.without(players, playerX.player)[0],\n\t\t// \tavatar : 'O'\n\t\t// }\n\t\tvar self = this;\n\n\t\tself.board = [null, null, null, null, null, null, null, null, null],\n\t\tself.turn = null,\n\t\tself.currentMove = null,\n\t\tself.turnCounter = 1,\n\t\tself.gameOver = false,\n\t\tself.players = [player1, player2],\n\t\tself.playerX = {\n\t\t\tplayer : randomPlayer(player1, player2),\n\t\t\tavatar : 'X'\n\t\t},\n\t\tself.playerO = {\n\t\t\tplayer : _.without(self.players, self.playerX.player)[0],\n\t\t\tavatar : 'O'\n\t\t}\n\n\t\tfunction freshGame() {\n\t\t\t$('.box').empty();\n\t\t\t$('.box').removeClass('closed');\n\t\t\t$('.box').removeClass('O');\n\t\t\t$('.box').removeClass('X');\n\t\t\t$('.box').addClass('open');\n\t\t}\n\n\t\t// Game Control Flow\n\t\tfreshGame();\n\t\tconsole.log('turncounter is ' + self.turnCounter);\n\t\tself.turn = self.playerX;\n\t\tstatus('<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar);\n\n\t\t$('.box').on('click', function() {\n\t\t\tvar convertToJqueryID = ('#' + this.id);\n\t\t\tself.currentMove = $(convertToJqueryID);\n\t\t\tmove(self.currentMove);\n\t\t\tconsole.log(\"Turn: \" + self.turnCounter);\n\t\t\tif(checkWin(self.turn.avatar) && self.gameOver === true) {\n\t\t\t\tupdateScoreForWin();\n\t\t\t\tupdateScoreBoard();\n\t\t\t\tstatus('<strong>' + self.turn.player.name + ' wins!</strong>');\n\t\t\t\tendGame();\n\t\t\t} else if (self.turnCounter < 10 && self.gameOver === false) {\n\t\t\t\tswitchTurn()\n\t\t\t} else {\n\t\t\t\tupdateScoreForDraw();\n\t\t\t\tupdateScoreBoard();\n\t\t\t\tstatus('<strong>Draw game!</strong>');\n\t\t\t\tendGame();\n\t\t\t}\n\t\t})\n\n\n\n\t\t// Helper functions\n\t\t// Return randomized player\n\t\tfunction randomPlayer(player1, player2) {\n\t\t\treturn (Math.floor(Math.random() * 2) == 0 ? player1 : player2);\n\t\t}\n\n\t\t// Conditional on click handler to process moves\n\t\tfunction move(square) {\n\t\t\tif(square.hasClass('open')) {\n\t\t\t\tsquare.removeClass('open');\n\t\t\t\tsquare.addClass('closed');\n\t\t\t\tsquare.addClass(self.turn.avatar);\n\t\t\t\tsquare.text(self.turn.avatar);\n\t\t\t\tvar index = square.attr('id');\n\t\t\t\tself.board[index] = self.turn.avatar;\n\t\t\t\tself.turnCounter++;\n\t\t\t} else {\n\t\t\t\t// [Note] Call switchTurn on illegal move as double negative will handle this quite well.\n\t\t\t\tswitchTurn();\n\t\t\t\tstatus('Invalid move! \\n<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar); \n\t\t\t}\n\t\t}\n\n\t\t// Check for win condition\n\t\tfunction checkWin(avatar) {\n\t\t\t// First condition checks for null via max turn count\n\t\t\tif(self.board[0] == avatar && self.board[1] == avatar && self.board[2] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[3] == avatar && self.board[4] == avatar && self.board[5] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[6] == avatar && self.board[7] == avatar && self.board[8] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[0] == avatar && self.board[3] == avatar && self.board[6] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[1] == avatar && self.board[4] == avatar && self.board[7] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[2] == avatar && self.board[5] == avatar && self.board[8] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[0] == avatar && self.board[4] == avatar && self.board[8] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else if (self.board[2] == avatar && self.board[4] == avatar && self.board[6] == avatar) {\n\t\t\t\tself.gameOver = true;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfunction switchTurn() {\n\t\t\tif(self.turn == self.playerX && self.gameOver === false) {\n\t\t\t\tself.turn = self.playerO;\n\t\t\t\tstatus('<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar);\n\t\t\t} else if(self.turn == self.playerO && self.gameOver === false) {\n\t\t\t\tself.turn = self.playerX;\n\t\t\t\tstatus('<strong>Current Move: </strong>' + self.turn.player.name + ' is ' + self.turn.avatar);\n\t\t\t}\n\t\t}\n\n\t\tfunction endGame() {\n\t\t\tupdateScoreBoard();\n\t\t\t// Disable boxes to prevent score hacking\n\t\t\t$(\"#box *\").attr(\"disabled\", \"disabled\").off('click');\n\n\t\t\tif(confirm(\"Rematch?\")) {\n\t\t\t\tcurrentGame = null;\n\t\t\t\tdelete currentGame;\n\t\t\t\tcurrentGame = new pvpGame(globalPlayer1, globalPlayer2);\n\t\t\t}\n\t\t}\n\n\t\tfunction updateScoreForWin() {\n\t\t\tself.turn.player.wins++;\n\t\t\t_.without(self.players, self.turn.player)[0].losses++;\n\t\t}\n\n\t\tfunction updateScoreForDraw() {\n\t\t\tself.player1.draws++;\n\t\t\tself.player2.draws++;\n\t\t}\n\n\t\tfunction updateScoreBoard(){\n\t\t\t$('#player1-wins').text(player1.wins);\n\t\t\t$('#player1-losses').text(player1.losses);\n\t\t\t$('#player1-draws').text(player1.draws);\n\n\t\t\t$('#player2-wins').text(player2.wins);\n\t\t\t$('#player2-losses').text(player2.losses);\n\t\t\t$('#player2-draws').text(player2.draws);\n\t\t}\n\n\t} // <--- End of pvpGame \n\n\n\n\n} // <---- End of Global Container", "function GameObj(name) {\n\t\t_classCallCheck(this, GameObj);\n\n\t\tconsole.log('in GameObj');\n\n\t\tthis.name = name;\n\n\t\tthis.id = this.setId();\n\t}", "constructor() {\n this._gameData = GameData;\n this._interface = new Interface();\n this._map;\n this._virtualMap;\n this._environnement;\n this._players = [null, null];\n this._pattern = null;\n this._composition = null;\n this._turn = new Turn();\n this._fightMode = false;\n this._activePlayerMovementCounter = -1;\n this._fightStatus = -1;\n this._fightPlayerAction = [null, null];\n document.getElementById('homemenu-interface-validation').addEventListener('click', () => {\n this.startGame();\n });\n document.getElementById('gameend-newgame').addEventListener('click', () => {\n this.restartGame();\n });\n }", "function Game() {\n}", "function gameObject(type, name, texture, value, size)\n{\n\tthis.type=type; //ex: fruit, hand, powerup\n\tthis.name=name; //ex: apple, orange, watermelon\n\tthis.texture = texture;\n\tthis.hasJoint=false; // check to see if this is attached to anything\n\tthis.joint=null;\n\tthis.value = value;\n\tthis.size = size;\n\tthis.collide = false; //Need this for the fruit merging. When 2 fruits collide they call the MergeFruit function more than once, causing too many new fruits to spawn.\n}", "function resetGame() {\n game = new Game();\n}", "constructor(game, parent) {\n super(game,parent);\n }", "constructor(game, parent) {\n super(game,parent);\n }", "function MyGame() {\n // audio clips: supports both mp3 and wav formats\n this.kBgClip = \"assets/sounds/BGTest.wav\";\n this.kCue1 = \"assets/sounds/snow_step_wet-02.flac\";\n\n // scene file name\n this.kSceneFile = \"assets/scene.json\";\n // all squares in the JSON file\n this.mSqSet = [];\n\n // The camera to view the scene\n this.mCamera = null;\n this.mSmallCamera = null;\n this.mSmallVP = gEngine.ResourceMap.loadSmallVP();\n\n // For redirect rotation update\n this.mRedirectFlag = false;\n}", "function GameWorld() {\n _classCallCheck(this, GameWorld);\n\n this.stepCount = 0;\n this.objects = {};\n this.playerCount = 0;\n this.idCount = 0;\n this.groups = new Map();\n }", "function Game() {\n\n\tvar self = this;\n\n\t//First check to see if canvas is supported and if so get everything, if not stop the script\n\tthis.init = function() {\n\t\t//Get the background canvas\n\t\tthis.bgCanvas = document.getElementById('background');\n\t\tthis.shipCanvas = document.getElementById('ship');\n\t\tthis.mainCanvas = document.getElementById('main');\n\t\tthis.scoreElement = document.getElementById('score');\n\t\tthis.scoreBoardUl = document.getElementById('score-board');\n\t\t// Test if it can get the context\n\t\tif (this.bgCanvas.getContext) {\n\t\t\tthis.bgCtx = this.bgCanvas.getContext('2d');\n\t\t\tthis.shipCtx = this.shipCanvas.getContext('2d');\n\t\t\tthis.mainCtx = this.mainCanvas.getContext('2d');\n\t\t\t//Intialise all the objects we shall need\n\t\t\tBackground.prototype.ctx = this.bgCtx;\n\t\t\tBackground.prototype.canvasWidth = this.bgCanvas.width;\n\t\t\tBackground.prototype.canvasHeight = this.bgCanvas.height;\n\n\t\t\tShip.prototype.ctx = this.shipCtx;\n\t\t\tShip.prototype.canvasWidth = this.shipCanvas.width;\n\t\t\tShip.prototype.canvasHeight = this.shipCanvas.height;\n\n\t\t\tBullet.prototype.ctx = this.mainCtx;\n\t\t\tBullet.prototype.canvasWidth = this.mainCanvas.width;\n\t\t\tBullet.prototype.canvasHeight = this.mainCanvas.height;\n\n\t\t\tEnemy.prototype.ctx = this.mainCtx;\n\t\t\tEnemy.prototype.canavsWidth = this.mainCanvas.width;\n\t\t\tEnemy.prototype.canvasHeight = this.mainCanvas.height;\n\n\t\t\t//Initilise the new background objects\n\t\t\tthis.background1 = new Background(imgRepo.background1,1);\n\t\t\tthis.background1.init(0,0);\n\n\t\t\tthis.background2 = new Background(imgRepo.background2,10);\n\t\t\tthis.background2.init(0,0);\n\t\t\t//Initilise the ship object\n\t\t\tthis.ship = new Ship();\n\n\t\t\tthis.shipStartX = this.shipCanvas.width/2 - imgRepo.ship.width;\n\t\t\tthis.shipStartY = (this.shipCanvas.height/4*3) + imgRepo.ship.height/2;\n\t\t\tthis.ship.init(this.shipStartX,this.shipStartY,imgRepo.ship.width,imgRepo.ship.height);\n\n\t\t\t//set the player score to 0\n\t\t\tthis.playerScore = 0;\n\n\t\t\t//Game settings\n\t\t\tthis.isPaused = false;\n\t\t\tthis.isMuted = false;\n\n\t\t\t//Add all of the sounds for the game\n\t\t\tthis.laser = new SoundPool(10);\n\t\t\tthis.laser.init(\"laser\");\n\t\t\tthis.explosion = new SoundPool(20);\n\t\t\tthis.explosion.init(\"explosion\");\n\t\t\tthis.backgroundAudio = new Audio(\"sounds/pumpin.mp3\");\n\t\t\tthis.backgroundAudio.loop = true;\n\t\t\tthis.backgroundAudio.volume = .25;\n\t\t\tthis.backgroundAudio.load();\n\t\t\tthis.ambientAudio = new Audio(\"sounds/ambient.wav\");\n\t\t\tthis.ambientAudio.loop = true;\n\t\t\tthis.volume = .25;\n\t\t\tthis.ambientAudio.load();\n\n\t\t\tthis.checkAudio = window.setInterval(function(){checkReadyState()},1000);\n\n\t\t\t//Make an enemy object pool\n\t\t\tthis.flockSpeed = 1.5;\n\t\t\tthis.enemyPool = new Pool(30);\n\t\t\tthis.enemyPool.init(\"enemy\");\n\t\t\tthis.enemyBulletPool = new Pool(50);\n\t\t\tthis.enemyBulletPool.init(\"enemyBullet\");\n\t\t\tthis.spawnWave();\n\n\t\t\t//Make a new quadtree to start using\n\t\t\tthis.quadTree = new QuadTree({\n\t\t\t\tx:0,\n\t\t\t\ty:0,\n\t\t\t\twidth: this.mainCanvas.width,\n\t\t\t\theight: this.mainCanvas.height\n\t\t\t});\n\n\t\t\t//Get the scores\n\t\t\tthis.getScores(\"http://www.paulbird.co/galaxian/scores.json\", function(data){\n\t\t\t\tself.scores = data;\n\n\t\t\t\tfor (var i = 0; i < data.scores.length; i++) {\n\t\t\t\t\tvar li = document.createElement('li');\n\t\t\t\t\tvar spanName = document.createElement('span');\n\t\t\t\t\tvar spanScore = document.createElement('span');\n\t\t\t\t\tvar spanNameText = document.createTextNode(data.scores[i].name);\n\t\t\t\t\tvar spanScoreText = document.createTextNode(data.scores[i].score);\n\n\t\t\t\t\t//append them into the elements\n\t\t\t\t\tspanName.appendChild(spanNameText);\n\t\t\t\t\tspanScore.appendChild(spanScoreText);\n\n\t\t\t\t\t//set their classes\n\t\t\t\t\tspanName.setAttribute('class','score-board__name');\n\t\t\t\t\tspanScore.setAttribute('class','score-board__score');\n\n\t\t\t\t\t//Append them to the li\n\t\t\t\t\tli.appendChild(spanName);\n\t\t\t\t\tli.appendChild(spanScore);\n\n\t\t\t\t\t//Append it the the ul of teh scoreboard\n\t\t\t\t\tself.scoreBoardUl.appendChild(li);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tthis.start = function() {\n\t\tthis.ship.draw();\n\t\tthis.backgroundAudio.play();\n\t\tanimate();\n\t};\n\n\tthis.spawnWave = function() {\n\t\tvar height = imgRepo.enemy.height;\n\t\tvar width = imgRepo.enemy.width;\n\t\tvar x = 200;\n\t\tvar y = -height;\n\t\tvar spacer = y -10;\n\t\tfor (i = 1; i <= 30; i++) {\n\t\t\tthis.enemyPool.get(x,y,this.flockSpeed);\n\t\t\tx += width + 10;\n\t\t\tif (i % 10 == 0) {\n\t\t\t\tx = 200;\n\t\t\t\ty += spacer;\n\t\t\t}\n\t\t}\n\t};\n\n\tthis.gameOver = function() {\n\t\tthis.backgroundAudio.pause();\n\t\tthis.ambientAudio.play();\n\t\tdocument.getElementById('gameover').style.display = \"block\";\n\t}\n\n\tthis.restart = function() {\n\t\tdocument.getElementById('gameover').style.display = \"none\";\n\t\tthis.bgCtx.clearRect(0,0,this.bgCanvas.width,this.bgCanvas.height);\n\t\tthis.shipCtx.clearRect(0,0,this.shipCanvas.width,this.shipCanvas.height);\n\t\tthis.mainCtx.clearRect(0,0,this.mainCanvas.width,this.mainCanvas.height);\n\t\tthis.quadTree.clear();\n\t\tthis.background1.init(0,0);\n\t\tthis.background2.init(0,0);\n\t\tthis.ship.init(this.shipStartX,this.shipStartY,imgRepo.ship.width,imgRepo.ship.height);\n\t\tthis.enemyPool.init(\"enemy\");\n\t\tthis.flockSpeed = 1.5;\n\t\tthis.spawnWave();\n\t\tthis.enemyBulletPool.init(\"enemyBullet\");\n\t\tthis.playerScore = 0;\n\t\tthis.backgroundAudio.currentTime = 0;\n\t\tthis.ambientAudio.pause();\n\t\tthis.ambientAudio.currentTime = 0;\n\n\t\tthis.start();\n\t}\n\n\tthis.pause = function() {\n\t\tthis.isPaused = true;\n\t\tthis.backgroundAudio.pause();\n\t\tthis.ambientAudio.play();\n\t\tdocument.getElementById('pause').style.display = \"block\";\n\t}\n\n\tthis.continue = function() {\n\t\tthis.isPaused = false;\n\t\tthis.backgroundAudio.play();\n\t\tthis.ambientAudio.pause();\n\t\tthis.ambientAudio.currentTime = 0;\n\t\tdocument.getElementById('pause').style.display = \"none\";\n\t}\n\n\tthis.muteBg = function() {\n\t\tthis.ambientAudio.pause();\n\t\tthis.backgroundAudio.pause();\n\t}\n\n\tthis.getScores = function(url,callback) {\n\t\treq = new XMLHttpRequest();\n\t\treq.responseType = 'json';\n\n\t\treq.onreadystatechange = function(e) {\n\t\t\tif (this.readyState == 4) { //Done\n\t\t\t\tif (this.status == 200) { //Okay we got it\n\t\t\t\t\tcallback(this.response);\n\t\t\t\t} else if ( this.status == 404) { //We couldn't find it\n\t\t\t\t\tcallback(\"We couldn't find the page, make sure the page exists or you spelt it correctly\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treq.open(\"GET\",url, true);\n\t\treq.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n\t\treq.send(null);\n\t}\n}", "newGame() {\n this.initMap();\n this.addMapEnvironnement();\n this.addMapPattern();\n this.addMapItems(4);\n this.players.forEach((player) => {\n this.addPlayer(player[0], player[1])\n });\n this.placePlayers(); \n this.interface.displayPlayersStatus(this.players);\n this.initializePlayerControlEvents(); \n this.roundManager(); \n }", "constructor() {\n\t\tthis.selectedGameElto = META_GAME_ELTO;\n\t\tthis.selectedActionElto = \"\";\n\t\tthis.gameData = {};\n\t\tthis.gameData.globalResources = {};\n\t\tthis.gameData.meta = {\n\t\t\tgameName: \"new game\",\n\t\t\tauthor: \"put your name here\",\n\t\t\tdescription: \"an awesome game\"\n\t\t};\n\t\tthis.gameData.verbs = [\"give\", \"pick up\", \"use\", \"open\", \"look at\", \"push\", \"close\", \"talk to\", \"pull\", \"go\", \"inventory\"];\n\t\tthis.gameData.globalResources.actions = {\n\t\t\ttentacleDance: {\n\t\t\t\tdescription: \"The tentacle is happy now and he starts dancing\",\n\t\t\t\timage: \"https://cdn.weasyl.com/static/media/5c/5b/cd/5c5bcd54c73d0e2aa76e89108e0a9740b02dcadc8b1006cc5dafebfe75b38665.gif\"\n\t\t\t}\n\t\t};\n\t}", "function Groups(game) {\r\n this.game = game;\r\n this.enemies = game.add.group();\r\n this.bosses = game.add.group();\r\n}", "function Game()\r\n\t{\r\n\r\n\t\tthis.debugId = Math.random() * 100;\r\n\r\n\t\tthis.stage = $('.game-stage')[0];\r\n\r\n\t\t// The total width of the game screen. Since our grid takes up the entire screen\r\n\t\t// this is just the width of a tile times the width of the grid\r\n\t\tthis.width = function() {\r\n\t\t\treturn $(this.stage).parent().width();\r\n\t\t\t//return this.map_grid.width * this.map_grid.tile.width;\r\n\t\t};\r\n\r\n\t\t// The total height of the game screen. Since our grid takes up the entire screen\r\n\t\t// this is just the height of a tile times the height of the grid\r\n\t\tthis.height = function() {\r\n\t\t\treturn $(this.stage).parent().height();\r\n\t\t\t//return this.map_grid.height * this.map_grid.tile.height;\r\n\t\t};\r\n\r\n\t\tthis.zIndex = {\r\n\t\t\tworldLayerGround: 100,\r\n\t\t\tworldLayerBelowCharacter: 200,\r\n\t\t\tworldLayerCharacter: 300,\r\n\t\t\tworldLayerAboveCharacter: 400,\r\n\t\t\tworldLayerTop: 800\r\n\t\t};\r\n\r\n\t\t// Separate the numbers by 100 in case someone wants to add a state in between without having to increment the subsequent\r\n\t\tthis.statusEnum = {\r\n\t\t\t'not-started': 0,\r\n\t\t\t'started': 100,\r\n\t\t\t'complete': 200\r\n\t\t};\r\n\r\n\t\tthis.status = this.statusEnum['not-started'];\r\n\r\n\r\n\t\tthis.popRestartGameDialogue = function(message, showPlayAgain) {\r\n\t\t\t// Make the default true if they don't provide it explicitly\r\n\t\t\tshowPlayAgain = showPlayAgain == null ? true : showPlayAgain;\r\n\r\n\t\t\tvar $statusBox = $('.game-ui').find('.game-status-box');\r\n\t\t\t\r\n\t\t\tvar content = '<h1 class=\"game-status-box-message\">' + message + '</h1>';\r\n\t\t\tif(showPlayAgain) {\r\n\t\t\t\tcontent += '<button class=\"play-again\">Play Again?</button>';\r\n\r\n\t\t\t\tcontent += '<div class=\"credits-box\">';\r\n\t\t\t\t\tcontent += '<div>Developed by <a href=\"http://ericeastwood.com/\">Eric Eastwood</a></div>';\r\n\t\t\t\t\tcontent += '<hr />';\r\n\t\t\t\t\tcontent += '<div><strong>Assets:</strong></div>';\r\n\t\t\t\t\tcontent += '<ul class=\"credits-box-attribution\">';\r\n\t\t\t\t\t\tcontent += '<li><strong><a href=\"http://opengameart.org/users/remaxim\">remaxim:</strong> <a href=\"http://opengameart.org/content/win-sound-2\">Sound Effects</a></li>';\r\n\t\t\t\t\t\tcontent += '<li><strong><a href=\"http://opengameart.org/users/prinsu-kun\">Prinsu-Kun:</strong> <a href=\"http://opengameart.org/content/retro-deaddestroyeddamaged-sound\">Sound Effects</a></li>';\r\n\t\t\t\t\t\tcontent += '<li><strong><a href=\"http://opengameart.org/users/caeles\">caeles:</strong> <a href=\"http://opengameart.org/content/shadowless-lpc-food\">Sprites</a></li>';\r\n\t\t\t\t\tcontent += '</ul>';\r\n\t\t\t\tcontent += '</div>';\r\n\t\t\t}\r\n\r\n\t\t\tvar $statusContents = $(content).appendTo($statusBox);\r\n\t\t\t$statusContents.filterFind('.play-again').on('click', function() {\r\n\t\t\t\t// Restart the game\r\n\t\t\t\tCrafty.scene('Game');\r\n\r\n\t\t\t\t// Get these out of the way since they restarted the game\r\n\t\t\t\t$statusContents.remove();\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tthis.clearGameDialogue = function() {\r\n\t\t\tvar $statusBox = $('.game-ui').find('.game-status-box');\r\n\r\n\t\t\t// Clear it out\r\n\t\t\t$statusBox.html('');\r\n\t\t};\r\n\r\n\r\n\t\t// Initialize and start our game\r\n\t\tthis.start = function() {\r\n\t\t\tvar self = this;\r\n\r\n\t\t\t// Start crafty and set a background color so that we can see it's working\r\n\t\t\t// Passing `null, null` as the first paramaters causes fullscreen (see crafty source)\r\n\t\t\t// Instead of passing in a stage element as the last parameter of `init`,\r\n\t\t\t// you can add a element with the id of `cr-stage ` or even leave it out to have it auto-generated\r\n\t\t\tCrafty.init(null, null, this.stage);\r\n\t\t\tCrafty.background('#fff7b5');\r\n\r\n\t\t\t// Add the right click context menu back\r\n\t\t\tCrafty.settings.modify(\"stageContextMenu\", true);\r\n\r\n\t\t\t// Simply start the \"Loading\" scene to get things going\r\n\t\t\tCrafty.scene('Loading');\r\n\t\t};\r\n\t}", "function Game(){\n\n var self = this;\n\n // Main deck of cards\n this.cards = {};\n this.setCards = function (deck){\n\n self.cards.deck = [];\n for (key in deck){\n if (deck.hasOwnProperty(key)){\n self.cards.deck.push(deck[key]);\n }\n }\n\n self.cards.len = self.cards.deck.length;\n\n return this;\n };\n\n // Returns a random card from the main deck\n this.getRandomCard = function(deck){\n\n var random = Math.floor(Math.random() * (deck.length - 0)) + 0;\n return deck[random];\n };\n\n // Deck of 10 cards belonging to the user\n this.userCards = {};\n this.setUserCards = function(deck){\n\n for (key in deck){\n if (deck.hasOwnProperty(key)){\n self.userCards[key] = deck[key];\n }\n }\n };\n\n // Gives 10 cards to the user from her deck of cards\n this.giveCardsToUser = function(deck){\n\n for (key in deck){\n if (deck.hasOwnProperty(key)){\n self.player.user.deck.push(deck[key]);\n }\n }\n\n return this;\n };\n\n // Gives 10 unique random cards to the opponents\n this.giveCardsToOpponents = function(){\n\n var self = this;\n\n var oppLength = self.player.opponent.length;\n while (oppLength--){\n\n // Reset the deck because players can have the same cards but every card of one player must be unique\n var deck = self.cards.deck;\n\n for (var i=0; i<10; i++){\n\n var random = Math.floor(Math.random() * (self.cards.deck.length - 0)) + 0;\n var randomCard = deck[random];\n\n self.player.opponent[oppLength].deck.push(randomCard);\n\n deck.slice(random, 1);\n }\n }\n };\n\n // Preloads the main deck of cards with a given function executed when done\n this.preloadImages = function(callback){\n\n if (typeof callback === \"undefined\") callback = function(){};\n var arr = [];\n for (var i=0; i<self.cards.len;i++){\n arr.push(setting.imgFolder + self.cards.deck[i].image);\n }\n preloadImages(arr).done(callback);\n };\n\n var uiContainer = {}; // Contains those DOM elements which might change during a game\n this.previousActiveRows = []; // Contains those DOM divs whose colour has been affected in a round\n\n // The host is always the previous winner in the Classic game\n this.player = {\n user:null,\n host:null,\n opponent:[]\n };\n\n // States of the game\n this.hasRoundEnded = false; // Normally changed after each select\n this.hasGameEnded = true; // Normally changed when losing or restarting\n this.usersTurn = true; // Normally changed after determining if the user won/lost\n\n // Methods that are meant to be overridden in different versions of the game\n\n // Determines what happens when the user has lost the round\n this.loseRoundAction = function(){\n\n self.hasGameEnded = true;\n self.RoundControls.newGame(); // Creates a New Game button\n };\n\n // Determines what happens when the user has won the round\n this.winRoundAction = function(){\n\n self.RoundControls.nextRound(); // Creates a Next button\n };\n\n // Sets up the game ready for user interaction\n this.start = function(){\n\n self.createUI();\n\n self.hasGameEnded = false;\n self.hasRoundEnded = false;\n\n // Host already picks the first card\n self.player.host.setCard(self.getRandomCard(self.cards.deck)).showCard();\n\n return this;\n };\n\n // Determines what happens when the user clicks the New Game Button\n this.restart = function(){\n\n if (self.hasGameEnded && self.hasRoundEnded){\n\n self.hasGameEnded = false;\n self.hasRoundEnded = false;\n\n AnimateModule.createStreakCount(uiContainer.streakText, \"new\", \"0\");\n\n self.newRound();\n }\n };\n\n // Called at the beginning of each round\n this.beginningOfRoundAction = function(){\n\n // This is only needed to prevent the players from accidentally selecting a field again\n self.hasRoundEnded = true;\n };\n\n // Called at the end of each round\n this.endOfRoundAction = function(){\n\n // Data to post to the server\n var data = {\n score: self.player.user.score,\n streak: self.player.user.streak,\n roundResult: self.player.user.roundResult\n };\n\n var success = function(response){\n\n self.TopPanelModule.update(response.levelChange, response.userLevelInfo, response.gold);\n };\n\n // Ajax call\n postToServer(setting.ajaxPostScore, data, success);\n };\n\n // Determines what happens when the user clicks the Next button\n this.nextRound = function(){\n\n if (self.hasRoundEnded){\n\n self.hasRoundEnded = false;\n\n self.newRound();\n }\n };\n\n // Prepares the UI for a new round ready for user interaction\n this.newRound = function(){\n\n // Hide the host's card and Generate new card for host\n self.player.host.hideCard(function(){\n self.player.host.setCard(self.getRandomCard(self.cards.deck)).showCard();\n });\n\n // Hide cards of all players\n for (var i=0;i<self.player.opponent.length;i++){\n self.player.opponent[i].hideCard();\n }\n\n // Set the row colours back to normal\n for (var i=0;i<self.previousActiveRows.length;i++){\n self.previousActiveRows[i].className = \"card_row\";\n }\n\n self.previousActiveRows = [];\n\n self.RoundControls.reset();\n };\n\n // Reorganises the role references to player objects. Takes the winner as an argument. She'll become the host.\n this.reorganisePlayers = function(player){\n // No need to change the host in the default version of the game\n // This function is called after determining which player won\n };\n\n // Takes all cards from the losers and gives them to the winner.\n this.reorganiseCards = function(){\n // No need to mix the player's cards as they only have one at a time in Classic\n };\n\n // Picks a random card for each opponent\n this.assignCardsToOpponents = function(){\n\n for (var i=0;i<self.player.opponent.length;i++){\n self.player.opponent[i].setCard(self.getRandomCard(self.cards.deck)).showCard();\n }\n };\n\n // Long method called when the host picks a field.\n this.selectField = function(field){\n\n if (!self.hasRoundEnded && self.usersTurn){\n\n // Prevent player from selecting multiple times in one round\n self.beginningOfRoundAction();\n\n // Detect clicked property\n var property = field.getAttribute(\"name\");\n\n self.assignCardsToOpponents();\n\n var playerQueue = Object.create(self.player.opponent);\n playerQueue.push(self.player.host);\n\n // Make a copy of the players array\n var newPlayerQueue = playerQueue.slice();\n\n // Compare each player with everyone exactly once and record their scores\n for (var i=0;i<playerQueue.length;i++){\n\n var currentPlayer = newPlayerQueue.shift();\n\n for (key in newPlayerQueue){\n if (newPlayerQueue.hasOwnProperty(key)){\n var subscore = calculateSubscore(property, currentPlayer.getCardProperty(property), newPlayerQueue[key].getCardProperty(property));\n\n currentPlayer.roundScore -= subscore;\n newPlayerQueue[key].roundScore += subscore;\n }\n }\n }\n\n // Sort players in terms of score\n playerQueue.sort(compare);\n\n // Count draws on the first place. If there is a draw between two players, '2' will be stored.\n var drawCounter = 0;\n for (var i=0;i<playerQueue.length;i++){\n\n if (typeof playerQueue[i+1] !== 'undefined'){\n if (playerQueue[i].roundScore === playerQueue[i+1].roundScore){\n drawCounter++;\n }else{\n if (drawCounter > 0) drawCounter++;\n break;\n }\n }else{\n if (drawCounter > 0) drawCounter++;\n break;\n }\n }\n\n // Add the round score to the players' overall score and find the winner unless there's a draw\n var foundWinner = false;\n for (var i=0;i<playerQueue.length;i++){\n\n // Avoid negative score\n if (playerQueue[i].roundScore > 0) playerQueue[i].score += playerQueue[i].roundScore;\n\n var newClass = (playerQueue[i].roundScore > 0 ? \" score_green\" : \" score_red\");\n\n AnimateModule.createFloatingText(playerQueue[i].viewHolder[property], playerQueue[i].roundScore, newClass);\n self.previousActiveRows.push(playerQueue[i].viewHolder[property]);\n\n if (foundWinner){\n // Lose\n playerQueue[i].viewHolder[property].className = \"card_row row_red\";\n playerQueue[i].roundResult = \"lose\";\n playerQueue[i].streak = 0;\n }else if (drawCounter > 0){\n // Draw\n drawCounter--;\n playerQueue[i].viewHolder[property].className = \"card_row row_draw\";\n playerQueue[i].roundResult = \"draw\";\n if (drawCounter === 0){\n\n foundWinner = true;\n // If the user was the host before the draw, let him be the host again. Otherwise let one of the players.\n if (self.player.user.roundResult === \"draw\"){\n self.reorganisePlayers(self.player.user);\n self.reorganiseCards();\n }else{\n self.reorganisePlayers(playerQueue[i]);\n self.reorganiseCards();\n }\n }\n }else{\n // Win\n playerQueue[i].viewHolder[property].className = \"card_row row_green\";\n playerQueue[i].roundResult = \"win\";\n foundWinner = true;\n playerQueue[i].streak += setting.players-1;\n\n // Make sure that roles and cards are assigned according to who won the round.\n self.reorganisePlayers(playerQueue[i]);\n self.reorganiseCards();\n }\n\n playerQueue[i].roundScore = 0;\n }\n\n // Update the user's streak counter\n AnimateModule.createStreakCount(uiContainer.streakText, self.player.user.roundResult, self.player.user.streak);\n\n // Deciding game state: WIN/DRAW or LOSE and acting accordingly\n if (self.player.user.roundResult === \"lose\"){\n\n self.loseRoundAction();\n }else{\n\n self.winRoundAction();\n }\n\n self.endOfRoundAction();\n }\n };\n\n // Helper function to calculate the score of players after one round\n var calculateSubscore = function(property, p1val, p2val){\n\n var subscore = 0;\n\n if (property === defaultField.acceleration.columnName){\n\n subscore = Math.round(500*(p1val - p2val));\n\n } else if (property === defaultField.weight.columnName){\n\n subscore = p1val - p2val;\n\n }else{\n\n subscore = p2val - p1val;\n }\n\n return subscore;\n };\n\n // Helper function to sort players\n var compare = function(p1,p2){\n\n if (p1.roundScore < p2.roundScore)\n return 1;\n if (p1.roundScore > p2.roundScore)\n return -1;\n return 0;\n };\n\n // Creates the user interface as well as the player objects of the game\n this.createUI = function(){\n\n // Start by allocating the container of the game\n uiContainer.container = gameContainer;\n\n // Create top panel\n self.TopPanelModule.init();\n\n // Create elements that don't belong to anyone\n var battlefield = new Battlefield();\n uiContainer.battlefield = battlefield.create();\n\n // Main player\n var host = new Player();\n var card = new Card();\n var elements = card.create(defaultField);\n uiContainer.battlefield.appendChild(elements.cardFragment);\n\n // Control Panel\n self.RoundControls.init(uiContainer.battlefield);\n uiContainer.streakText = self.RoundControls.getStreakText();\n\n host.viewField = elements.fieldHolder;\n host.viewHolder = elements.viewHolder;\n self.player.host = host;\n self.player.user = self.player.host;\n\n // Opponents\n self.player.opponent = [];\n for (var i=0;i<setting.players-1;i++){\n\n var opponent = new Player();\n card = new Card();\n elements = card.create(defaultField);\n opponent.viewField = elements.fieldHolder;\n opponent.viewHolder = elements.viewHolder;\n uiContainer.battlefield.appendChild(elements.cardFragment);\n self.player.opponent.push(opponent);\n }\n\n return this;\n };\n\n // Removes the user interface\n this.removeUI = function(){\n\n while (uiContainer.container.firstChild) {\n uiContainer.container.removeChild(uiContainer.container.firstChild);\n }\n };\n\n // Module responsible for re-appearing buttons after each round.\n this.RoundControls = (function(){\n\n var container, streakContainer, streakText, buttonContainer;\n\n var init = function(view){\n container = makeContainer(view);\n return this;\n };\n\n function makeContainer(view){\n\n var controlPanel = document.createElement(\"div\");\n controlPanel.className = \"player_controls\";\n controlPanel.id = \"control_panel\";\n view.appendChild(controlPanel);\n\n streakContainer = document.createElement(\"div\");\n streakContainer.className = \"streak_container\";\n streakText = document.createElement(\"p\");\n streakText.innerHTML = \"0\";\n streakContainer.appendChild(streakText);\n controlPanel.appendChild(streakContainer);\n\n buttonContainer = document.createElement(\"div\");\n buttonContainer.className = \"button_container\";\n controlPanel.appendChild(buttonContainer);\n\n return controlPanel;\n }\n\n function makeNextButton(){\n\n var button = document.createElement(\"div\");\n button.className = \"bt_nextRound bt\";\n button.addEventListener(\"click\",self.nextRound);\n buttonContainer.appendChild(button);\n var t = document.createTextNode(\"Next\");\n button.appendChild(t);\n $(button).fadeIn(100);\n }\n\n function makeNewGameButton(){\n\n var button = document.createElement(\"div\");\n button.className = \"bt_new_game bt\";\n button.addEventListener(\"click\",self.restart);\n buttonContainer.appendChild(button);\n var t = document.createTextNode(\"Restart\");\n button.appendChild(t);\n $(button).fadeIn(100);\n }\n\n function removeAllButtons(){\n while (buttonContainer.firstChild) {\n buttonContainer.removeChild(buttonContainer.firstChild);\n }\n }\n\n return {\n init: init,\n nextRound: makeNextButton,\n newGame: makeNewGameButton,\n reset: removeAllButtons,\n getStreakText: function(){\n return streakText;\n }\n }\n })();\n\n // Creates and Updates mini cards indicating the stand of the game (Classic Game)\n this.ProgressModule = function(){\n\n function createCardIndicator(container){\n\n var box = document.createElement(\"div\");\n box.className = \"indicator-box\";\n container.insertBefore(box, container.firstChild);\n return box;\n }\n\n function updateCardIndicator(noOfCards, box){\n\n // First remove all mini-cards\n\n while (box.firstChild) {\n box.removeChild(box.firstChild);\n }\n\n // Because of the lack of space, do not print every mini-card individually above 5\n if (noOfCards > 15){\n\n drawMiniCard(box, noOfCards);\n\n }else{\n\n\n for (var i=0; i<noOfCards; i++){\n\n drawMiniCard(box, i+1);\n }\n }\n }\n\n function drawMiniCard(box, number){\n\n var miniCard = document.createElement(\"span\");\n miniCard.innerHTML = number;\n box.appendChild(miniCard);\n }\n\n function updateDeckIndicator(imagePath, box){\n\n while (box.firstChild){\n box.removeChild(box.firstChild);\n }\n\n var miniImg, miniImageDiv, miniImageCounter;\n\n var count = 1;\n\n for (key in imagePath){\n if (imagePath.hasOwnProperty(key)){\n\n miniImageDiv = document.createElement(\"div\");\n miniImageDiv.className = \"mini-image-div\";\n box.appendChild(miniImageDiv);\n\n miniImageCounter = document.createElement(\"div\");\n miniImageCounter.className = \"mini-image-counter\";\n miniImageCounter.innerHTML = count;\n miniImageDiv.appendChild(miniImageCounter);\n\n miniImg = document.createElement(\"img\");\n miniImg.src = imagePath[key];\n miniImg.className = \"mini-image\";\n miniImg.width = \"60\";\n miniImg.height = \"40\";\n miniImageDiv.appendChild(miniImg);\n\n count ++;\n }\n }\n }\n\n return {\n createCardIndicator: createCardIndicator,\n updateCardIndicator: updateCardIndicator,\n updateDeckIndicator: updateDeckIndicator\n }\n }();\n\n // Module responsible for handling the panel which displays the user's score and level.\n this.TopPanelModule = (function(){\n\n var fillBar, scoreText, levelText, goldText, popupLevelUp, popupGoldText;\n\n var attribute = {\n score: 0,\n lowScoreLimit: 0,\n highScoreLimit: 0,\n level: 0,\n gold: 0\n };\n\n function init(){\n\n // Filled bar of Score\n fillBar = document.getElementById(\"s_fill\");\n // Text of Score\n scoreText = document.getElementById(\"s_score\");\n levelText = document.getElementById(\"user-level\");\n goldText = document.getElementById(\"user-gold\");\n popupGoldText = document.getElementById(\"level-gold\");\n popupLevelUp = document.getElementById(\"level-up-block\");\n }\n\n function update(levelChange, userLevelInfo, gold){\n\n // userLevelInfo is an object with attributes: \"low_score_limit\", \"high_score_limit\", \"level\", \"score\"\n\n var previousScore = attribute.score;\n\n switch (levelChange){\n case \"up\":\n\n // Animation till the top\n AnimateModule.animateIncrement(previousScore, attribute.highScoreLimit, scoreText);\n AnimateModule.animateFill(fillBar, previousScore, attribute.highScoreLimit, attribute.lowScoreLimit, attribute.highScoreLimit, function(){\n\n // TODO: level up graphics\n popupGoldText.innerHTML = gold-attribute.gold;\n AnimateModule.animateIncrement(undefined, gold, goldText);\n setAttributes(userLevelInfo, gold);\n\n var callback = function(){\n\n setUI();\n levelText.innerHTML = userLevelInfo.level;\n\n // Animation till new score\n AnimateModule.animateIncrement(attribute.lowScoreLimit, attribute.score, scoreText);\n AnimateModule.animateFill(fillBar, attribute.lowScoreLimit, attribute.score, attribute.lowScoreLimit, attribute.highScoreLimit);\n };\n\n PopupModule.init(callback).show(popupLevelUp, \"Level up!\");\n });\n\n break;\n\n case \"down\":\n\n // Animation till the bottom\n AnimateModule.animateIncrement(previousScore, attribute.lowScoreLimit, scoreText);\n AnimateModule.animateFill(fillBar, previousScore, attribute.lowScoreLimit, attribute.lowScoreLimit, attribute.highScoreLimit, function(){\n\n // TODO: level up graphics\n setAttributes(userLevelInfo, gold);\n\n setUI();\n\n // Animation till new score\n AnimateModule.animateIncrement(attribute.highScoreLimit, attribute.score, scoreText);\n AnimateModule.animateFill(fillBar, attribute.highScoreLimit, attribute.score, attribute.lowScoreLimit, attribute.highScoreLimit);\n\n });\n\n break;\n\n default:\n\n setAttributes(userLevelInfo, gold);\n setUI();\n\n AnimateModule.animateIncrement(previousScore, attribute.score, scoreText);\n AnimateModule.animateFill(fillBar, previousScore, attribute.score, attribute.lowScoreLimit, attribute.highScoreLimit);\n\n break;\n }\n\n return this;\n }\n\n // This method is meant to print the limits of the current level\n function setUI(){\n\n //ui.lowScoreLimit.innerHTML = attribute.score - attribute.lowScoreLimit;\n //ui.highScoreLimit.innerHTML = attribute.highScoreLimit - attribute.score + \" until next level\";\n }\n\n function setAttributes(userLevelInfo, gold){\n\n attribute.lowScoreLimit = userLevelInfo.low_score_limit;\n attribute.score = userLevelInfo.score;\n attribute.highScoreLimit = userLevelInfo.high_score_limit;\n attribute.level = userLevelInfo.level;\n attribute.gold = gold;\n }\n\n return{\n init:init,\n update:update\n }\n\n })();\n\n // Classes\n\n function Card(){}\n\n Card.prototype = {\n\n constructor: Card,\n create: function(defaultField){\n\n var fieldHolder = {};\n var viewHolder = {};\n\n var cardFragment = document.createElement(\"div\");\n cardFragment.className = \"card_fragment\";\n viewHolder.fragment = cardFragment;\n\n // Card\n var cardBlock = document.createElement(\"div\");\n cardBlock.className = \"card_block\";\n cardFragment.appendChild(cardBlock);\n\n var playerCard = document.createElement(\"div\");\n playerCard.className = \"player_card\";\n cardBlock.appendChild(playerCard);\n viewHolder.card = playerCard;\n\n // Card Name\n var cardName = document.createElement(\"div\");\n cardName.className = \"card_name\";\n playerCard.appendChild(cardName);\n\n fieldHolder.model = cardName;\n viewHolder.model = cardName;\n\n // Card Image\n var cardImage = document.createElement(\"div\");\n cardImage.className = \"card_image\";\n playerCard.appendChild(cardImage);\n\n var img = document.createElement(\"img\");\n img.width = \"230\";\n img.height = \"153\";\n cardImage.appendChild(img);\n\n fieldHolder.image = img;\n viewHolder.image = cardImage;\n\n\n // Rest of the card elements\n var cardRow, rowLabel, t;\n\n for(key in defaultField){\n if(defaultField.hasOwnProperty(key)){\n cardRow = document.createElement(\"div\");\n cardRow.className = \"card_row\";\n cardRow.setAttribute(\"name\",key);\n cardRow.addEventListener(\"click\",function(){\n self.selectField(this);\n });\n playerCard.appendChild(cardRow);\n viewHolder[key] = cardRow;\n\n rowLabel = document.createElement(\"span\");\n rowLabel.className = \"row_label\";\n cardRow.appendChild(rowLabel);\n\n t = document.createTextNode(defaultField[key].label);\n rowLabel.appendChild(t);\n\n // Changing field\n rowLabel = document.createElement(\"span\");\n cardRow.appendChild(rowLabel);\n fieldHolder[key] = rowLabel;\n\n rowLabel = document.createElement(\"span\");\n rowLabel.className = \"row_unit\";\n cardRow.appendChild(rowLabel);\n\n t = document.createTextNode(defaultField[key].unit);\n rowLabel.appendChild(t);\n }\n }\n\n return {\n fieldHolder: fieldHolder,\n viewHolder: viewHolder,\n cardFragment: cardFragment\n };\n }\n };\n\n function Player(){\n\n // DOM Fields\n this.viewField = {};\n\n // DOM Rows and Elements\n this.viewHolder = {};\n\n // Values\n this.card = {};\n\n // Deck\n this.deck = [];\n\n this.roundScore = 0;\n this.roundResult = 0;\n\n this.score = 0;\n\n this.streak = 0;\n }\n\n Player.prototype = {\n\n constructor: Player,\n getCardProperty: function(property){\n\n var self = this;\n\n return self.card[property];\n },\n setCard: function(newCard){\n\n var self = this;\n\n self.card = newCard;\n\n for(key in self.card){\n if(self.card.hasOwnProperty(key) && key != \"id\" && key != \"price\"){\n if (key !== \"image\"){\n self.viewField[key].innerHTML = self.card[key];\n }else{\n self.viewField[key].src = setting.imgFolder + self.card[key];\n }\n }\n }\n\n return this;\n },\n showCard: function(callback){\n\n var self = this;\n\n if (typeof callback === 'undefined') callback = function(){};\n $(self.viewHolder.card).fadeIn(150, callback);\n return this;\n },\n hideCard: function(callback){\n\n var self = this;\n\n if (typeof callback === 'undefined') callback = function(){};\n $(self.viewHolder.card).fadeOut(150, callback);\n return this;\n }\n };\n\n function Battlefield(){\n\n this.create = function(){\n\n var battlefield = document.getElementById(\"battlefield\");\n return battlefield;\n }\n }\n }", "loaded() {\n me.pool.register('player', game.Player);\n me.pool.register('enemy', game.Enemy);\n me.pool.register('laser', game.Laser);\n\n me.state.WIN = me.state.USER + 1;\n me.state.LOSE = me.state.USER + 2;\n me.state.LEVEL_1 = me.state.USER + 3;\n me.state.LEVEL_2 = me.state.USER + 4;\n me.state.LEVEL_3 = me.state.USER + 5;\n me.state.LEVEL_4 = me.state.USER + 6;\n\n // set the \"Play/Ingame\" Screen Object\n this.level1 = new game.PlayScreen();\n this.level2 = new game.PlayScreen(2, 'teal');\n this.level3 = new game.PlayScreen(3, 'orange');\n this.level4 = new game.PlayScreen(4, '#49B');\n\n this.winScreen = new game.WinScreen();\n this.loseScreen = new game.LoseScreen();\n\n me.state.set(me.state.LEVEL_1, this.level1);\n me.state.set(me.state.LEVEL_2, this.level2);\n me.state.set(me.state.LEVEL_3, this.level3);\n me.state.set(me.state.LEVEL_4, this.level4);\n\n me.state.set(me.state.WIN, this.winScreen);\n me.state.set(me.state.LOSE, this.loseScreen);\n\n // start the game\n me.state.change(me.state[`LEVEL_${store.getState().level}`]);\n }", "generateGame() {\n\n this.generateGrounds();\n this.setPlayers();\n this.setPlayerStartArea();\n this.generateUnbreakableWalls();\n this.generateBreakableWalls();\n this.generateItems();\n GameElements.bombs.splice(0,GameElements.bombs.length);\n GameElements.explosions.splice(0,GameElements.explosions.length);\n \n }", "init (game) {\n this.game = game;\n this.anim = this.getComponent('Move').anim;\n this.inputEnabled = false;\n this.isAttacking = false;\n this.isAlive = true;\n this.nextPoseSF = null;\n this.registerInput();\n this.spArrow.active = false;\n this.atkTargetPos = cc.p(0,0);\n this.isAtkGoingOut = false;\n this.validAtkRect = cc.rect(25, 25, (cc.director.getVisibleSize().width - 50), (cc.director.getVisibleSize().height - 120));\n cc.log(\"valid rect, width: %s, height: %s\", cc.director.getVisibleSize().width, cc.director.getVisibleSize().height);\n this.oneSlashKills = 0;\n this.totalScore = 0;\n\n this.node.setScale(0.85);\n this.playStand();\n }", "updateGame(){\n //Update state of objectives\n this.isObjectiveTaken();\n //Update if game is over \n this.isOver();\n\n //check whether game is over\n if(!this.gameOver){\n //updates all players data\n this.updatePlayers();\n }\n }", "constructor() {\n if (Game.exists) {\n return Game.instance;\n }\n this.board = new Board();\n this.snake = new Snake();\n this.food = new Food();\n this.currentScore = 0;\n this.highScore = 0;\n this.storage = window.localStorage;\n Game.instance = this;\n Game.exists = true;\n return this;\n }", "newGame () {}", "function initGame() {\n players = [];\n teams = [];\n orbs = [];\n bases = [];\n createOrbs(defaultOrbs);\n createBases(defaultBases);\n}", "setupNewGame() {\n let newGame = new Game(this.size);\n this.gameState = {\n board: newGame.gameState.board,\n score: 0,\n won: false,\n over: false\n }\n }", "initGame() {\n\n //--setup user input--//\n this._player.initControl();\n\n //--add players to array--//\n this._players.push(this._player, this._opponent);\n\n //--position both players--//\n this._player.x = -Game.view.width * 0.5 + this._player.width;\n this._opponent.x = Game.view.width * 0.5 - this._opponent.width;\n }", "function PlayerManager() {\n this.opponents_ = new Array();\n this.seats_ = new Array(false,false,false,false,false,false,false);\n \n this.AddOpponent = function(name,id) {\n console.log(\"-c:adding opponent\");\n var opponent = new Opponent(name, id);\n opponent.SetPosition(this.FindSeat());\n this.opponents_.push(opponent);\n }\n \n this.FindSeat = function() {\n for(var i=0;i<7;i++)\n {\n if(!this.seats_[i])\n {\n this.seats_[i] = true;\n return i;\n }\n }\n }\n\n this.RemoveOpponent = function(id) {\n for(var i=this.opponent.length;i>=0;i--) {\n if(this.opponents_[i].id == id) {\n this.seats_[i] = false;\n this.opponents_.splice(i,1);\n }\n }\n }\n\n this.DrawOpponentCard = function() {\n\tvar len = this.opponents_.length;\n for(var i=0;i<len;i++) {\n this.opponents_[i].Draw();\n }\n } \n\n}", "load() {\n Logger.info(`The game(${this._id}) is loading...`)\n this.event_manager.trigger('game_load', [this])\n Logger.info('Loading the game mode')\n _.forEach(this._games, (game) => game._load())\n }", "function MyGame(htmlCanvasID) {\n // Initialize the webGL Context\n gEngine.Core.initializeEngineCore(htmlCanvasID);\n\n // variables of the constant color shader for SQUARE\n this.mConstSquareColorShader = null;\n\n // variables of the constant color shader for TRIANGLE\n this.mConstTriangleColorShader = null;\n\n // variables of the constant color shader for POLYGON\n this.mConstPolygonColorShader = null;\n\n // variables of the constant color shader for STAR\n this.mConstStarColorShader = null;\n\n\n // variables to save all drawable objects and its types\n this.mAllObjects = [];\n this.mAllObjectsType = [];\n\n // variables for the squares\n this.mRedSq = null;\n\n // variables for the triangles\n this.mTriangle = null;\n\n // variables for the polygons\n this.mPolygon = null;\n\n // variables for the stars\n this.mStar = null;\n\n // The camera to view the scene\n this.mCamera = null;\n\n // Initialize the game\n this.initialize();\n}", "function game (){\n render();\n // also need the game to update scores and refresh\n update();\n}", "function GameEngine(playerCount) {\n this.players = [];\n for (var i = 0; i < playerCount; i++) {\n var playerName = 'Player ' + (i + 1);\n this.players.push(new Player(playerName));\n }\n\n this.lane = new Lane(this.players);\n this.lane.onroll = this.roll.bind(this);\n this.scorecard = new Scorecard(this.players);\n }", "draw() {\n // Limpa a tela antes de desenhar\n Game.Drawing.clearCanvas();\n Game.Drawing.drawImage(Game.ImageManager.image('background'), 190, 130);\n Game.gameObjectList.forEach(gameObject => gameObject.draw());\n\n }", "function GameObject(data, parent)\n {\n CoreObject.call(this, parent);\n data = data || {};\n this.name = data.name;\n this.type = data.type;\n this.data = data;\n this._scene = this.getScene();\n this._game = this.getGame();\n this._gameModel = this.getGameModel();\n }", "function MyGame() {\n //this.kUIButton = \"assets/UI/button.png\";\n this.kUIButton = \"assets/Game/play.png\";\n this.kBG = \"assets/Game/forest.png\";\n this.kSky = \"assets/Game/sky.png\";\n \n // The camera to view the scene\n this.mCamera = null;\n this.mSmallCamera = null;\n this.ParticleButton = null;\n this.PhysicsButton = null;\n this.UIButton = null;\n this.UIText = null;\n this.LevelSelect = null;\n \n this.bg = null;\n this.sky = null;\n}", "function Object_Base() {\n\n /**\n * @property subObjects\n * @type gs.Object_Base[]\n * @default []\n * A list of game-objects grouped under this game object.\n */\n var ref;\n this.subObjects = [];\n\n /**\n * @property components\n * @type gs.Component[]\n * @default []\n * A list of components defining the logic/behavior and appearance of the game object.\n */\n this.components = [];\n\n /**\n * @property componentsById\n * @type Object\n * @default []\n * All associated components by their ID.\n */\n this.componentsById = {};\n\n /**\n * @property disposed\n * @type boolean\n * @default false\n * Indicates if the game object id disposed. A disposed game object cannot be used anymore.\n */\n this.disposed = false;\n\n /**\n * @property active\n * @default true\n * Indicates if the game object is active. An inactive game object will not be updated.\n */\n this.active = true;\n this.input = false;\n\n /**\n * @property id\n * @type string\n * @default null\n * The game object's UID (Unique ID)\n */\n this.id = null;\n\n /**\n * @property group\n * @default null\n * @type string\n * The game object's group. To get all object's of a specific group the gs.ObjectManager.objectsByGroup property can be used.\n */\n this.group = null;\n\n /**\n * @property parent\n * @type gs.Object_Base\n * @default null\n * The parent object if the game object is a sub-object of another game object.\n */\n this.parent = null;\n\n /**\n * @property order\n * @type number\n * @default 0\n * Controls the update-order. The smaller the value the earlier the game object is updated before other game objects are updated.\n */\n this.order = 0;\n\n /**\n * @property rIndex\n * @type number\n * @default 0\n * Holds the render-index if the game object has a graphical representation on screen. The render-index is the\n * index of the game object's graphic-object(gs.GraphicObject) in the current list of graphic-objects. The render-index\n * is read-only. Setting the render-index to a certain value has no effect.\n */\n this.rIndex = 0;\n\n /**\n * @property needsSort\n * @type boolean\n * @default true\n * Indicates if the list of sub-objects needs to be sorted by order because of a change.\n */\n this.needsSort = true;\n\n /**\n * @property needsSort\n * @type boolean\n * @default true\n * Indicates if the UI object needs to be updated.\n */\n this.needsUpdate = true;\n\n /**\n * @property initialized\n * @type boolean\n * @default true\n * Indicates if the game object and its components have been initialized.\n */\n this.initialized = false;\n\n /**\n * @property customData\n * @type Object\n * @default {}\n * A custom data object which can be used to add any custom data/fields to the game\n * object. It is an empty object by default.\n */\n this.customData = {};\n if ((ref = gs.ObjectManager.current) != null) {\n ref.registerObject(this);\n }\n }", "constructor(game) {\n\t\tthis.game = game\n this.data = null\n this.coord = new Phaser.Point(0, 0)\n this.status = 0\n\t\tthis.name = '0_0'\n\t\tthis.back = null\n\t\tthis.items = null\n\t\tthis.front = null\n }", "function game_model(){\n\tthis.game = true;\n\tthis.directionRight = true;\n\tthis.moveDownLevel = false;\n\tthis.invaders=[];\n\tthis.airballs=[];\n\tthis.running=false;\n\tthis.startTime = 0;\n\tthis.theStraw = new straw();\n\tthis.update = function(){\n\t\t// Change Bubble direction if one runs into an edge!\n\t\tfor(var i = 0; i < this.invaders.length; i++){\n\t\t\tvar bubb = this.invaders[i];\n\t\t\tif (bubb.x<bubb.r && bubb.active) {\n\t\t\t\tthis.directionRight = true;\n\t\t\t\tthis.moveDownLevel = true;\n\t\t\t} else if (bubb.x>100-bubb.r && bubb.active) {\n\t\t\t\tthis.directionRight = false;\n\t\t\t\tthis.moveDownLevel = true;\n\t\t\t}\n\t\t}\n\t\tfor(var i = 0; i < this.invaders.length; i++){\n\t\t\tvar bubb = this.invaders[i];\n\t\t\tif(bubb.y<=0 && bubb.active && gm.game){\n\t\t\t\talert(\"You lose the game silly, press restart game to try again, ya dunce\");\n\t\t\t\tgm.game = !gm.game;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// to update the model just update all of the bubbles\n\t\tfor(var i=0; i<this.invaders.length; i++){\n\t\t\tthis.invaders[i].update();\n\t\t}\n\t\tthis.moveDownLevel = false;\n\t\t/*\n\t\tif (this.moveDownLevel) {\n\t\t\tthis.moveDownLevel = false;\n\t\t\tfor(var i=0; i<this.bubbles.length; i++){\n\t\t\t\tthis.bubbles[i].update();\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t// check for collisions\n\t\tvar airballList = this.airballs;\n\t\tfor(var i=airballList.length-1; i>=0; i--){\n\t\t\tvar a = this.airballs[i];\n\t\t\ta.update();\n\t\t\tfor(var j=0; j<this.invaders.length; j++){\n\t\t\t\tvar b = this.invaders[j];\n\t\t\t\t//console.log(\"test intersection \"+[a,b])\n\t\t\t\tif (a.intersects(b)){\n\t\t\t\t\tb.active=false;\n\t\t\t\t\t//console.log(\"intersect!!! \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a.y > 95 || a.x<5 || a.x > 95) {\n\t\t\t\tthis.airballs = this.airballs.slice(0,i).concat(this.airballs.slice(i+1));\n\t\t\t\t// remove element a from airballList\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tkills=0;\n\t\t\n\t\tfor(var i=0;i<gm.invaders.length;i++){\n\t\t\tif(!gm.invaders[i].active){\n\t\t\t\tkills++;\n\t\t\t\twindow.localStorage.setItem(\"kills\", kills);\n\t\t\t\tvar score = window.localStorage.getItem(\"kills\");//just to see if it worked without having to win the game\n\t\t\t\tconsole.log(score);\n\n\t\t\t}\n\t\t\tif(kills==gm.invaders.length && gm.game){\n\t\t\t\talert(\"You are winner! Press the Restart Game button to enjoy the experience again!!!!\");\n\t\t\t\tgm.game = !gm.game;\n\t\t\t\tvar score = window.localStorage.getItem(\"kills\");\n\t\t\t\tconsole.log(score);\n\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(var i=0;i<6;i++){\n\t\tvar bx= 10 + (i*15);\n\t\tvar by=100;\n\t\tthis.invaders.push(new invader(bx,by,4) );\n\t}\n\tfor(var i=0;i<6;i++){\n\t\tvar bx= 10 + (i*15);\n\t\tvar by=90;\n\t\tthis.invaders.push(new invader(bx,by,4) );\n\t}\n\tfor(var i=0;i<6;i++){\n\t\tvar bx= 10 + (i*15);\n\t\tvar by=80;\n\t\tthis.invaders.push(new invader(bx,by,4) );\n\t}\n\tfor(var i=0;i<6;i++){\n\t\tvar bx= 10 + (i*15);\n\t\tvar by=70;\n\t\tthis.invaders.push(new invader(bx,by,4) );\n\t}\n\t/*\t\n\tfor(var i=0; i<4;i++){\n\t\tvar bx=Math.round(Math.random()*100);\n\t\tvar by=35;\n\t\tvar b = new bubble(bx,by,1);\n\t\t//b.vx *= 4; b.vy*=4;\n\t\tthis.airballs.push(b);\n\t}\n\t*/\n}", "function GAME () {\n\tthis.turnNumber = 0;\n\tthis.gamewindow = document.getElementById(\"game\");\n\t\tthis.canvas \t\t= document.createElement(\"canvas\");\n\t\tthis.context \t\t= this.canvas.getContext(\"2d\");\n\t\tthis.canvas.width \t= 512;\n\t\tthis.canvas.height\t= 334;\n\tthis.tileList = [];\n\tthis.countryList = [];\n\tthis.playerList = [];\n\n\t\t//this.canvas.onmousemove = function (e) { mouseMove(e);};\n\t\tthis.gamewindow.appendChild(this.canvas);\n\t\t\n}", "function Game () {\n\n /**\n * THREEjs WebGL renderer\n * @type {THREE.WebGLRenderer}\n */\n this.renderer = null;\n\n /**\n * THREEjs camera object\n * @type {THREE.PerspectiveCamera}\n */\n this.camera = null;\n\n /**\n * Physijs scene\n * @type {Physjs.Scene}\n */\n this.scene = null;\n\n /**\n * The environment that we'll play the game in. Will be an instance of a class that extends EnvironmentBase.\n * @type {EnvironmentBase}\n */\n this.environment = null;\n\n /**\n * The thing you use to load assets\n * @type {Loader}\n */\n this.loader = new Loader();\n\n this.animate = this.animate.bind(this);\n this._onResize = this._onResize.bind(this);\n\n _init.call(this);\n }", "function GameView(canvas) {\n this.game = new Game(canvas);\n this.canvas = canvas;\n}", "function game() {\n dessinerSerpent();\n dessinerPomme();\n detectionCollision();\n verifMangerPomme();\n gestionVieSerpent();\n gestionBonus();\n }", "function Game() {\n\t\tthis.boardSize = $scope.boardSize;\n\t\tthis.board = createBoard($scope.boardSize);\n\t\tthis.playerOne = $scope.user;\n\t\tthis.playerTwo = '';\n\t\tthis.needPlayerTwo = true;\n\t\tthis.playerOneTurn = true;\n\t\tthis.playerOneStarts = true;\n\t\tthis.gameOver = false;\n\t\tthis.winner = '';\n\t\tthis.playerOneWins = 0;\n\t\tthis.playerTwoWins = 0;\n\t}", "function Model(canvas)\r\n {\r\n var me=this;\r\n this.objects=new Array();\r\n \r\n this.num_of_objects=100;\r\n canvas.style.width =800+\"px\";\r\n canvas.style.height=600+\"px\";\r\n \r\n canvas.style.backgroundRepeat=\"repeat\";\r\n canvas.style.backgroundImage=\"url(gamelets/sampleGamelet/img/background.bmp)\";\r\n //canvas.style.backgroundImage=\"url(gamelets/sampleGamelet/img/GreenStone.jpg)\";\r\n //canvas.style.backgroundImage=\"url(gamelets/sampleGamelet/img/grass.jpg)\";\r\n\r\n //creatting some obejcts\r\n \r\n var i=0;\r\n var x;//object x position\r\n var y;//object y position\r\n var ang;//object angle\r\n var vel;//object velocity\r\n //var dummy=document.createElement(\"div\");\r\n //canvas.innerHTML=\"loading...\";\r\n for(i=0;i<this.num_of_objects;i++)\r\n {\r\n x=Math.floor(Math.random()*400);\r\n y=Math.floor(Math.random()*400);\r\n ang=Math.floor(Math.random()*2*3.14);\r\n vel=Math.floor(Math.random()*4);\r\n\r\n this.objects[i]=new GameObject(x,y,vel,ang,canvas,me); //(10,10,0.1,2,canvas);\r\n }\r\n //canvas.innerHTML=\"\";\r\n this.currentToUpdate=0;\r\n this.currentToDraw=0;\r\n this.canvas=canvas;\r\n this.userKey=null;\r\n this.UpdateServer=function()\r\n {\r\n var userKey=\"\";\r\n var result=\"\";\r\n if (me.userKey!=null)\r\n {\r\n userKey=me.userKey;\r\n me.userKey=null;\r\n result+=\"userKey>\"+userKey+\"\";\r\n }\r\n return result;\r\n }\r\n this.handleControls=function(key)\r\n {\r\n me.userKey=key;\r\n }\r\n this.setModel=function(newModel)\r\n {\r\n var num_of_objects=newModel.objects.length;\r\n var i=0;\r\n //update existing object\r\n for (i=0;i<num_of_objects;i++)\r\n {\r\n me.objects[i].setObject(newModel.objects[i]);\r\n }\r\n //book keep added objects\r\n for (i=me.num_of_objects;i<num_of_objects;i++)\r\n {\r\n me.objects[i]=new GameObject(0,0,0,0,me.canvas,me);\r\n me.objects[i].setObject(newModel.objects[i]);\r\n }\r\n \r\n for (i=num_of_objects;i<me.num_of_objects;i++)\r\n {\r\n me.objects[i].destroyMe();\r\n }\r\n if (me.num_of_objects!=num_of_objects)\r\n {\r\n //alert(\"me.num_of_objects!=num_of_objects => updated num_of objects from \"+me.num_of_objects+\" to \"+num_of_objects);\r\n me.num_of_objects=num_of_objects;\r\n }\r\n \r\n }\r\n this.updateModel=function()\r\n {\r\n \r\n //update the Model\r\n if (me.currentToUpdate>=me.num_of_objects)\r\n me.currentToUpdate=0;\r\n me.objects[me.currentToUpdate].move();\r\n me.currentToUpdate++;\r\n \r\n }\r\n this.drawModel=function()\r\n {\r\n if (me.currentToDraw>=me.num_of_objects)\r\n me.currentToDraw=0;\r\n me.objects[me.currentToDraw].draw();\r\n me.currentToDraw++;\r\n \r\n }\r\n this.selectedObject=0;\r\n\r\n this.getSelectedObject=function()\r\n {\r\n if (me.selectedObject)\r\n return me.selectedObject.id;\r\n else\r\n return \"\";\r\n\r\n }\r\n this.setSelectedObject=function(obj)\r\n {\r\n if (me.selectedObject)\r\n {\r\n me.selectedObject.unSelectSelf();\r\n }\r\n me.selectedObject=obj;\r\n }\r\n this.handleClick=function(x,y)\r\n {\r\n\r\n }\r\n }", "function createGame () {}", "function GameObjectHandler (pGivenApp)\r\n{\r\n\tvar _this = this;\r\n\tthis.objectTypes = new Array();\r\n\tvar app = pGivenApp;\r\n\t\r\n\tvar gameObjectsArray = new Array();\r\n\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t{\r\n\t\tgameObjectsArray[i] = new GameObject(i, _this, app);\r\n\t}\r\n\t\r\n\tvar objectCount = 0;\r\n\tvar lastNewPosition = 0;\t// Tracks where the last new object was created. Used to decrease time in finding an empty space.\r\n\t\r\n\t// Called to add a new object type.\r\n\tthis.addType = function (pType, pModule)\r\n\t{\r\n\t\t_this.objectTypes.push({type: pType, module: pModule});\r\n\t\treturn _this.objectTypes.length - 1;\r\n\t}\r\n\t\r\n\t// Called to retrieve an object type index.\r\n\tfunction getType(pType)\r\n\t{\r\n\t\t// Loops through the array until it finds a type that matches by name.\r\n\t\tfor (var i = 0; i < _this.objectTypes.length; i++)\r\n\t\t{\r\n\t\t\tif (_this.objectTypes[i].type == pType) break;\r\n\t\t}\r\n\t\tif (i >= 0 && i < _this.objectTypes.length) return _this.objectTypes[i];\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\t// Called to instantiate a new object.\r\n\tthis.create = function (pType, pPosition)\r\n\t{\r\n\t\t// Get the type.\r\n\t\ttype = getType(pType);\r\n\t\tif (type == null) return;\r\n\t\tvar index = lastNewPosition;\r\n\t\t// If the index is invalid, reset it.\r\n\t\tif (index < 0 || index >= GameObjectHandlerConstants.maxObjects || gameObjectsArray[index].active)\r\n\t\t{\r\n\t\t\tindex = -1;\r\n\t\t}\r\n\t\t// If the index is -1, go ahead and find the first empty space after that.\r\n\t\tif (index <= -1)\r\n\t\t{\r\n\t\t\tfor (index = 0; index < GameObjectHandlerConstants.maxObjects; index++)\r\n\t\t\t{\r\n\t\t\t\tif (!gameObjectsArray[index].active)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we didn't find any empty spaces, return null.\r\n\t\tif (index >= GameObjectHandlerConstants.maxObjects) return null;\r\n\t\t// Otherwise, create and return the object.\r\n\t\tlastNewPosition = index + 1;\r\n\t\tvar module = new type.module(gameObjectsArray[index]);\r\n\t\tgameObjectsArray[index].init(pType, module, pPosition);\r\n\t\tobjectCount++;\r\n\t\treturn gameObjectsArray[index];\r\n\t}\r\n\t\r\n\t// Called to destroy an object.\r\n\tthis.destroy = function (pIndex)\r\n\t{\r\n\t\tif (pIndex < 0 || pIndex >= GameObjectHandlerConstants.maxObjects) return;\r\n\t\tif (!gameObjectsArray[pIndex].active) return;\r\n\t\tgameObjectsArray[pIndex].destroy(false);\r\n\t\tlastNewPosition = pIndex;\r\n\t\tobjectCount--;\r\n\t}\r\n\t\r\n\t// Called to retrieve an object with a given index.\r\n\tthis.get = function (pIndex)\r\n\t{\r\n\t\tif (pIndex < 0 || pIndex >= GameObjectHandlerConstants.maxObjects) return null;\r\n\t\treturn gameObjectsArray[pIndex];\r\n\t}\r\n\t\r\n\t// Called to retrieve the number of active objects.\r\n\tthis.countAll = function()\r\n\t{\r\n\t\treturn objectCount;\r\n\t}\r\n\t\r\n\t// Called to update all objects.\r\n\tthis.updateAll = function()\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tgameObjectsArray[i].update();\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Called to check collisions for all objects.\r\n\tthis.collideAll = function()\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tfor (var j = 0; j < GameObjectHandlerConstants.maxObjects; j++)\r\n\t\t\t{\r\n\t\t\t\t// Don't collide an object with itself...\r\n\t\t\t\tif (i == j) continue;\r\n\t\t\t\tgameObjectsArray[i].collide(gameObjectsArray[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Called to draw all objects.\r\n\tthis.drawAll = function(pPaused, spriteList, drawQueue, showHitBoxes)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tgameObjectsArray[i].draw(pPaused, spriteList, drawQueue, showHitBoxes);\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Called to destroy all objects.\r\n\tthis.destroyAll = function(pIsStarting)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tgameObjectsArray[i].destroy(pIsStarting);\r\n\t\t}\r\n\t\tobjectCount = 0;\r\n\t}\r\n\t\r\n\t// Called to run a custom loop. If the rule executes to true on any object, the function returns true; false otherwise.\r\n\tthis.customBooleanLoop = function(pRule)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tif (pRule(gameObjectsArray[i])) return true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// Called to run a custom loop. If the rule executes to true on an object, the function returns that object; null otherwise.\r\n\tthis.customObjectLoop = function(pRule)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tif (pRule(gameObjectsArray[i])) return false;\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n}", "function GameModel()\r\n{\r\n\t//Constants\r\n\tthis.timeIncrementor = 1;\r\n\tthis.minimumViewDistance = 10;\r\n\tthis.maximumViewDistance = 100;\r\n\tthis.stateNormal = 0;\r\n\tthis.stateFellInWater = 1;\r\n\tthis.refreshTime = 30;\r\n\tthis.firstSegmentTopPosition = 640;\r\n\tthis.isSpeedAdjust = true;\r\n\tthis.parentDomElementName = \"chatPage\";\r\n\tthis.topSpeed = this.timeIncrementor*3.05;\r\n\r\n\t//Fields\r\n\tthis.maxRefreshTime = this.refreshTime;\r\n\tthis.minRefreshTime = Math.round(this.refreshTime - (this.refreshTime / 10));\r\n\tthis.currentState = this.stateNormal;\r\n\tthis.desiredViewDistance = this.maximumViewDistance;\r\n\tthis.speed = 0;\r\n\tthis.absoluteTime = 0;\r\n\tthis.turnSpeed = 0;\r\n\tthis.otherCarTime = 0;\r\n\tthis.otherCarFreq = 77;\r\n\tthis.otherCarXImpactOffset = 0;\r\n\tthis.currentTime = 0;\r\n\tthis.carPositionX = 0;\r\n\t\r\n\t//Cache variables\r\n\tthis.segmentMinusOneTopPosition;\r\n\t\r\n\t//Parts\r\n\tif (getValue(\"scenery\") == \"Miami\")\r\n\t\tthis.scenery = new SceneryMiami(this.parentDomElementName);\r\n\telse if (getValue(\"scenery\") == \"Hell\")\r\n\t\tthis.scenery = new SceneryHell(this.parentDomElementName);\r\n\telse if (getValue(\"scenery\") == \"Sky\")\r\n\t\tthis.scenery = new ScenerySky(this.parentDomElementName);\r\n\telse\r\n\t\tthis.scenery = new SceneryEstrie(this.parentDomElementName);\r\n\t\t\r\n\tthis.track = this.scenery.buildTrack();//this.trackGenerator.buildTrack();\r\n\tthis.graphicsCommon = new GraphicsCommon(this.parentDomElementName, this.maximumViewDistance);\r\n}", "function Game(){\n this.scene = new THREE.Scene();\n this.camera = new THREE.OrthographicCamera( -8, 8, -5, 5 , -500, 1000);\n this.camera.position.z = 100;\n this.camera.lookAt( this.scene.position );\n\n this.cameraMin = new THREE.Vector2(7.5, 4.5);\n this.camPos = this.cameraMin.clone();\n\n this.camera.position.x = this.camPos.x;\n this.camera.position.y = this.camPos.y;\n this.renderer = new THREE.WebGLRenderer();\n this.resize();\n document.body.appendChild( this.renderer.domElement );\n this.renderer.domElement.style.zIndex = \"-1\";\n this.renderer.domElement.style.position = \"absolute\";\n this.renderer.domElement.style.top = \"0\";\n this.renderer.domElement.style.left = \"0\";\n\n this.bullets = [];\n this.zones = [];\n this.collectibles = [];\n\n this.map = new Map(this);\n this.map.load(\"1\");\n this.scene.add(this.map.object);\n\n this.cameraMax = this.map.dimensions.clone().sub(this.cameraMin).subScalar(1);\n\n var self = this;\n window.addEventListener(\"resize\", function(){\n self.resize();\n });\n\n this.maxBullets = 0;\n this.availableBullets = 0;\n this.ui = document.createElement(\"div\");\n this.ui.style.textAlign = \"center\";\n this.ui.style.positon = \"absolute\";\n this.ui.style.width = \"100%\";\n this.ui.style.height = \"100%\";\n this.ui.style.zIndex = \"10\";\n document.body.appendChild( this.ui );\n\n this.bulletUI = document.createElement(\"div\");\n this.bulletUI.style.width = \"100%\";\n this.ui.appendChild(this.bulletUI);\n\n this.messageUI = document.createElement(\"div\");\n this.messageUI.style.width = \"100%\";\n this.messageUI.style.opacity = \"1\";\n this.messageUI.style.transition = \"opacity 0.2s\";\n this.messageUI.style.webkitTransition = \"opacity 0.2s\";\n\n this.messageUI.style.marginTop = \"20px\";\n this.messageUI.style.padding = \"5px\";\n this.messageUI.style.fontSize = \"24pt\";\n this.messageUI.style.color = \"white\";\n this.messageUI.style.backgroundColor = \"rgba(0,0,0,0.5)\";\n\n this.messageUI.innerHTML = \"<br/><br/><br/>Press any Key to start<br/><br/><br/><br/>\";\n\n this.ui.appendChild(this.messageUI);\n\n this.bulletDivs = [];\n\n this.muted = false;\n\n this.messages = [\n { msg:\"Welcome!\", trigger: \"time\", t:1000, length:2000},\n { msg:\"You can Play via Keyboard, but I optimized for Gamepads.\", trigger: \"time\", t:500, length:5000},\n { msg:\"Use left Stick, WASD or Arrow Keys to move.\", trigger: \"time\", t:500, length:5000},\n { msg:\"Toggle Sound with M.\", trigger: \"time\", t:500, length:3000},\n { msg:\"(You can change the key bindings anytime by pressing Escape)\", trigger: \"time\", t:500, length:5000},\n { msg:\"Jump with Space, X, E, H or Green (A) on your Gamepad.\", trigger: \"location\", location: new THREE.Vector2(3.5, 5.9), length:9000},\n { msg:\"You collected your first GraviGone Cartridge.\", trigger: \"collection\", count: 1, length:5000},\n { msg:\"It allows you to fire a GraviGone Seed.\", trigger: \"time\", t: 500, length:5000},\n { msg:\"Fire with C, F, J, L or Blue (X) on your Gamepad.\", trigger: \"time\", t: 500, length:9000},\n { msg:\"The Seed creates a GraviGone field on Impact.\", trigger: \"time\", t: 500, length:5000},\n { msg:\"Gravity is reduced inside GraviGone fields.\", trigger: \"time\", t: 500, length:5000},\n { msg:\"You can shoot again once the GraviGone field decayed after 5 seconds.\", trigger: \"time\", t: 500, length:5000},\n { msg:\"You can collect the GraviGone field early with K, R, V, Num0 or Red (B) on your Gamepad.\", trigger: \"time\", t: 500, length:10000},\n { msg:\"Congratulations, you found your second GraviGone Cartridge.\", trigger: \"collection\", count: 2, length:5000},\n { msg:\"You can now place two GraviGone fields to jump higher and farther.\", trigger: \"time\", t:500, length:5000},\n { msg:\"Where two or more GraviGone fields overlap, the gravity is even more reduced.\", trigger: \"time\", t:500, length:5000},\n { msg:\"Hooray!, You found the remaining GraviGone Cartridges.\", trigger: \"collection\", count: 8, length:5000},\n { msg:\"With that many fields, you could climb any wall!\", trigger: \"time\", t:500, length:10000},\n { msg:\"<br/><br/><br/>Well done!<br/>You reached the end of the game!<br/>I hope you liked it.<br/><br/><br/>\", trigger: \"location\", location: new THREE.Vector2(36, 35.9), length:60000}\n ];\n this.nextMessage = 0;\n\n var starter = function(){\n self.start();\n window.removeEventListener(\"keydown\", starter)\n };\n window.addEventListener(\"keydown\", starter);\n }", "function GameObject() {\n\tthis.transform = new Transform();\n\n\tthis.Start = function(scene) {\n\n\n\t}\n\n\tthis.Update = function(scene) {\n\n\n\n\t}\n\n\tthis.Draw = function(scene) {\n\n\n\t}\n\n}", "launchGame() {\n this.grid.generate()\n this.grid.generateWalls()\n this.grid.generateWeapon('axe', this.grid.giveRandomCase())\n this.grid.generateWeapon('pickaxe', this.grid.giveRandomCase())\n this.grid.generateWeapon('sword', this.grid.giveRandomCase())\n this.grid.generateWeapon('rod', this.grid.giveRandomCase())\n \n this.shears = new Weapon('shears', 10)\n this.sword = new Weapon('sword', 20)\n this.axe = new Weapon('axe', 30)\n this.pickaxe = new Weapon('pickaxe', 40)\n this.rod = new Weapon('rod', 50)\n\n var position_player1 = -1\n var position_player2 = -1\n\n do {\n position_player1 = this.grid.generatePlayer('1')\n this.player1.setPosition(position_player1)\n } while (position_player1 == -1)\n\n do {\n position_player2 = this.grid.generatePlayer('2')\n this.player2.setPosition(position_player2)\n } while (position_player2 == -1 || this.grid.isNextToPlayer(position_player2))\n\n this.game_status = $('#game_status')\n this.game_status.html('Recherche d\\'armes pour les deux joueurs...')\n }", "function main() {\n var game;\n var splashScreen;\n var gameOverScreen;\n\n // SPLASH SCREEN\n function createSplashScreen() {\n splashScreen = buildDom(`\n <main>\n <h1>Eternal Enemies</h1>\n <button>Start</button>\n </main>`);\n\n document.body.appendChild(splashScreen);\n\n var startButton = splashScreen.querySelector(\"button\");\n\n startButton.addEventListener(\"click\", function() {\n startGame();\n });\n }\n\n function removeSplashScreen() {\n splashScreen.remove(); // remove() is an HTML method that removes the element entirely\n }\n\n //\n // GAME SCREEN\n function createGameScreen() {\n var gameScreen = buildDom(`\n <main class=\"game container\">\n <header>\n <div class=\"lives\">\n <span class=\"label\">Lives:</span>\n <span class=\"value\"></span>\n </div>\n <div class=\"score\">\n <span class=\"label\">Score:</span>\n <span class=\"value\"></span>\n </div>\n </header>\n <div class=\"canvas-container\">\n <canvas></canvas>\n </div>\n </main>\n `);\n\n document.body.appendChild(gameScreen);\n\n return gameScreen;\n }\n\n function removeGameScreen() {\n game.gameScreen.remove(); // We will implement it in the game object\n }\n\n //\n // GAME OVER SCREEN\n function createGameOverScreen(score) {\n gameOverScreen = buildDom(`\n <main>\n <h1>Game over</h1>\n <p>Your score: <span>${score}</span></p>\n <button>Restart</button>\n </main>\n `);\n\n document.body.appendChild(gameOverScreen);\n\n var button = gameOverScreen.querySelector(\"button\");\n\n button.addEventListener(\"click\", startGame);\n }\n\n function removeGameOverScreen() {\n if (gameOverScreen !== undefined) {\n // if it exists saved in a variable\n gameOverScreen.remove();\n }\n }\n\n //\n // SETTING GAME STATE\n function startGame() {\n removeSplashScreen();\n removeGameOverScreen();\n\n game = new Game();\n game.gameScreen = createGameScreen();\n\n // Start the game\n game.start();\n game.passGameOverCallback(gameOver);\n\n // End the game\n }\n\n function gameOver() {\n removeGameScreen();\n createGameOverScreen(); // <--\n\n console.log(\"GAME OVER IN MAIN\");\n }\n\n // Initialize the start screen\n createSplashScreen();\n}", "function main() {\n //add field object to stage\n field = new objects.Field(assets.getResult(\"field\"));\n stage.addChild(field);\n //add ball object to stage\n ball = new objects.Ball(assets.getResult(\"ball\"));\n stage.addChild(ball);\n // add player object to stage\n player = new objects.Player(assets.getResult(\"player\"));\n stage.addChild(player);\n // add 3 opposition objects to stage\n for (var cloud = 0; cloud < 3; cloud++) {\n clouds[cloud] = new objects.Cloud(assets.getResult(\"cloud\"));\n stage.addChild(clouds[cloud]);\n }\n //add scoreboard\n scoreboard = new objects.ScoreBoard();\n //add collision manager\n collision = new managers.Collision();\n}", "function loadGameData()\n\t\t\t{\n\t\t\t\tif(gameName == \"fatcat7\")\n\t\t\t\t{\n\t\t\t\t\tgame = new FatCat7Game();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"bounty\")\n\t\t\t\t{\n\t\t\t\t\tgame = new BountyGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"gummibar\")\n\t\t\t\t{\n\t\t\t\t\tgame = new GummiBarGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"aprilmadness\")\n\t\t\t\t{\n\t\t\t\t\tgame = new AprilMadnessGame();\n\t\t\t\t\tisFreeSpinGame = true;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"moneybooth\")\n\t\t\t\t{\n\t\t\t\t\tgame = new MoneyBoothGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t}\n\t\t\t\telse if(gameName == \"astrologyanswers\")\n\t\t\t\t{\n\t\t\t\t\tgame = new AstrologyAnswersGame();\n\t\t\t\t\tisFreeSpinGame = false;\n\t\t\t\t\tisBothFreeSpinAndOtherBonus = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgame.importGame(xmlData);\n\t\t\t}", "constructor(props) {\n super(props);\n\n this.game = this.props.game;\n }", "function Game(ctx) {\r\n this.asteroids = [];\r\n\r\n this.DIM_X = 500;\r\n this.DIM_Y = 500;\r\n this.NUM_ASTEROIDS = 5;\r\n\r\n this.addAsteroids();\r\n\r\n this.draw(ctx);\r\n\r\n}", "setUpGameObjects() {\n\t\tthis.treesSmall = [];\n\t\tthis.treesLarge = [];\n\t\tthis.treesBare = [];\n\t\tthis.bumpsGroup = [];\n\t\tthis.bumpsSmall = [];\n\t\tthis.bumpsLarge = [];\n\t\tthis.rocks = [];\n\t\tthis.jumps = [];\n\t\tthis.stumps = [];\n\n\t\tthis.calculateGameObjectCount();\n\t\tfor (let n = 0; n < this.gameObjectCount; n++) {\n\t\t\tlet type = this.getRandomGameObjectType();\n\t\t\tthis.spawnNewGameObjectAtStart(type);\n\t\t}\n\t}" ]
[ "0.745845", "0.72712886", "0.7238855", "0.7233056", "0.7232898", "0.7181698", "0.71454996", "0.70372117", "0.6987593", "0.6903052", "0.68156165", "0.68089944", "0.6805704", "0.6788981", "0.6786048", "0.67797405", "0.67785555", "0.67785555", "0.67785555", "0.67785555", "0.67537045", "0.66580963", "0.66500217", "0.6638161", "0.663557", "0.66211337", "0.66167474", "0.66049105", "0.6603541", "0.6599302", "0.65931344", "0.6554162", "0.65504247", "0.6531992", "0.64965975", "0.6496252", "0.6472351", "0.6467063", "0.6461155", "0.64260197", "0.64256525", "0.6422557", "0.6416441", "0.6390771", "0.63889885", "0.637335", "0.6368836", "0.6355674", "0.633348", "0.6326357", "0.63240236", "0.6318495", "0.63158923", "0.63135034", "0.63135034", "0.63060623", "0.6301691", "0.62957686", "0.62906134", "0.62905794", "0.6289497", "0.6271733", "0.6270516", "0.6266361", "0.6265933", "0.62655014", "0.6235914", "0.62325406", "0.6231594", "0.62221897", "0.6222059", "0.62180835", "0.62176603", "0.621325", "0.62123215", "0.6194828", "0.6189618", "0.61866033", "0.6168203", "0.6168134", "0.6162008", "0.6154559", "0.6151768", "0.6151602", "0.6148798", "0.61471844", "0.61465526", "0.6144873", "0.6143423", "0.6140949", "0.6140507", "0.6139377", "0.6138897", "0.613104", "0.61309105", "0.6128003", "0.6123755", "0.61224264", "0.6120733", "0.6115213", "0.6109968" ]
0.0
-1
Snake object, holds position of the snake, speed and every pixel of it
function Snake() { this.x = 0; this.y = 0; this.xspeed = 1; this.yspeed = 0; this.tail = []; this.dir = function (xdir, ydir) { if(this.xspeed!=-xdir) { this.xspeed = xdir; } if(this.yspeed != -ydir){ //Can turn this.yspeed = ydir; } } this.eat = function (pos) { var d = dist(this.x, this.y, pos.x, pos.y); if (d < 1) { console.log('I am fed') this.tail.push(this.tail[this.tail.length-1]) return true; } else { return false; } } this.checkSelfCollision = function(){ let same = this.tail.slice(1).find((v)=>this.tail[0].x==v.x && this.tail[0].y==v.y) return same!=undefined; } this.update = function () { //Move every point forward for (var i = this.tail.length-1; i > 0; i--) { this.tail[i] = this.tail[i - 1]; } this.tail[0] = createVector(this.x, this.y) // New head point this.x = this.x + this.xspeed * ITEMS_SCALE; this.y = this.y + this.yspeed * ITEMS_SCALE; this.x = constrain(this.x, 0, width - ITEMS_SCALE) this.y = constrain(this.y, 0, height - ITEMS_SCALE) } this.show = function () { fill(255) for (let i = 0; i < this.tail.length ; i++) rect(this.tail[i].x, this.tail[i].y, ITEMS_SCALE, ITEMS_SCALE) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snake() {\n this.headXY = [15, 75];\n\n //custom placed snake\n this.body = [this.headXY, [30, 75], [45, 75], [45, 60], [45, 45], [30, 45], [15, 45], [15, 30], [15, 15], [30, 15], [45, 15], [60, 15], [75, 15], [75, 30], [75, 45], [75, 60], [75, 75], [75, 60], [90, 15], [105, 15], [120, 15], [120, 30], [120, 45], [120, 60], [120, 75], [135, 75], [150, 75], [150, 60], [150, 45], [150, 30], [150, 15], [165, 15], [180, 15], [195, 15], [195, 30], [195, 45], [180, 45], [165, 45], [180, 45], [195, 45], [195, 60], [195, 75], [210, 75], [225, 75], [225, 60], [225, 45], [225, 30], [225, 15], [240, 45], [255, 60], [270, 75], [255, 30], [270, 15], [285, 15], [300, 15], [315, 15], [330, 15], [345, 15], [300, 30], [300, 45], [315, 45], [330, 45], [345, 45] , [300, 60], [300, 75], [315, 75], [330, 75], [345, 75], [360, 75], [375, 75], [375, 90], [375, 105]];\n\n this.segment = function(segX, segY) {\n this.segmentXY = [segX, segY];\n rect(segX, segY, 15, 15);\n }\n\n this.display = function() {\n let length = this.body.length - 1;\n frameRate(30);\n fill(0, 255, 0, alpha);\n\n //the snakes head\n rect(this.headXY[0], this.headXY[1], 15, 15);\n\n //displaying the snake for every segment in the body array\n for (let i = 0; i <= length; i++) {\n new this.segment(this.body[i][0], this.body[i][1]);\n }\n noFill();\n }\n\n this.move = function() {\n if (dir1 === 0) {\n this.headXY[1] -= 15;\n }\n if (dir1 === 1) {\n this.headXY[1] += 15;\n }\n if (dir1 === 2) {\n this.headXY[0] -= 15;\n }\n if (dir1 === 3) {\n this.headXY[0] += 15;\n }\n\n //checking if the snake collided with the walls or body\n endGame(this.headXY, this.body);\n }\n\n this.eat = function() {\n if (this.headXY[0] === foodX && this.headXY[1] === foodY) {\n\n //new fruit location\n //new spot for food off of screen\n foodX = 500;\n foodY = 500;\n\n this.grow();\n }\n }\n\n this.grow = function() {\n this.body.push(new this.segment().segmentXY);\n }\n\n this.snakeUpdate = function() { \n for (let i = this.body.length - 1; i > 0; i--) {\n if (i > 0) {\n //updating the snakes x and y cord to the cords from the segment //before it\n this.body[i][0] = this.body[i - 1][0];\n this.body[i][1] = this.body[i - 1][1];\n\n }\n }\n }\n}", "function Snake () {\n // Initial coordinates are (0, 0) for (x, y)\n this.x = 0;\n this.y = 0;\n\n // Initially, the snake starts moving to the right\n this.xDirection = 1 * scale;\n this.yDirection = 0 * scale;\n}", "function Snake() {\n this.x = 0;\n this.y = 0;\n this.xSpeed = pixel + 1;\n // sets movement speed by x... using pixel variable\n this.ySpeed = 0;\n // sets movement by y\n\n this.draw = function() {\n ctx.fillStyle = \"#03fc6f\";\n ctx.fillRect(this.x, this.y, pixel, pixel);\n // replacing x and y with pixel\n ctx.strokeStyle = \"yellow\";\n ctx.strokeRect(this.x, this.y, pixel, pixel);\n };\n\n this.update = function() {\n this.x += this.xSpeed;\n this.y += this.ySpeed;\n\n // when snakes hits the limits of the canvas\n\n if (this.x > canvas.width) {\n this.x = 0;\n }\n\n if (this.y > canvas.height) {\n this.y = 0;\n }\n\n if (this.x < 0) {\n this.x = canvas.width;\n }\n\n if (this.y < 0) {\n this.y = canvas.height;\n }\n };\n\n this.changeDirection = function(direction) {\n switch (direction) {\n case \"Up\":\n this.xSpeed = 0;\n this.ySpeed = -pixel + 1;\n break;\n case \"Down\":\n this.xSpeed = 0;\n this.ySpeed = pixel + 1;\n break;\n case \"Left\":\n this.xSpeed = -pixel + 1;\n this.ySpeed = 0;\n break;\n case \"Right\":\n this.xSpeed = pixel + 1;\n this.ySpeed = 0;\n break;\n }\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch\n };\n\n this.eat = function(food) {\n if (this.x === food.x && this.y === food.y) {\n return true;\n } else {\n return false;\n }\n };\n}", "function Snake() {\r\n\r\n this.x = 0;\r\n this.y = 0;\r\n this.xSpeed = scale* 1;\r\n this.ySpeed = 0;\r\n this.totalFruit = 0;\r\n this.tail = [];\r\n \r\n // design of snake \r\n this.draw = function() {\r\n\r\n for (let i = 0; i < this.tail.length; i++) {\r\n ctx.fillRect(this.tail[i].x, this.tail[i].y, scale, scale);\r\n };\r\n\r\n ctx.fillRect(this.x, this.y, scale, scale); /*creates square*/\r\n ctx.fillStyle = \"#5300E2\";\r\n\r\n };\r\n\r\n // increments snake position \r\n this.update = function() {\r\n for(let i = 0; i < this.tail.length - 1; i++) {\r\n this.tail[i] = this.tail[i+1];\r\n }\r\n this.tail[this.totalFruit - 1] = { x: this.x, y: this.y }; \r\n\r\n // SETTING BORDER BOUNDARIES \r\n this.x += this.xSpeed;\r\n this.y += this.ySpeed;\r\n \r\n if(this.x > cvs.width) {\r\n setState(\"gameover\")\r\n }\r\n if(this.x < 0) {\r\n setState(\"gameover\")\r\n }\r\n if(this.y > cvs.height) {\r\n setState(\"gameover\")\r\n }\r\n if(this.y < 0) {\r\n setState(\"gameover\")\r\n }\r\n }\r\n \r\n // ASSIGNING KEY DIRECTION \r\n this.changeDirection = function(direction) {\r\n switch(direction) {\r\n case \"Up\":\r\n if(!this.ySpeed >0) {\r\n this.xSpeed = 0;\r\n this.ySpeed = -scale * 1;\r\n }\r\n break;\r\n case \"Down\":\r\n if (!this.ySpeed >0) {\r\n this.xSpeed = 0;\r\n this.ySpeed = scale * 1;\r\n }\r\n break;\r\n case \"Left\":\r\n if (!this.xSpeed >0) {\r\n this.xSpeed = -scale * 1;\r\n this.ySpeed = 0;\r\n }\r\n break;\r\n case \"Right\":\r\n if (!this.xSpeed >0) {\r\n this.xSpeed = scale * 1;\r\n this.ySpeed = 0;\r\n }\r\n break;\r\n }\r\n };\r\n\r\n // SNAKE EATING THE FRUIT \r\n this.eat = function(fruit) {\r\n if (this.x === fruit.x && this.y === fruit.y) {\r\n this.totalFruit++;\r\n return true;\r\n }\r\n return false;\r\n };\r\n \r\n // IF SNAKE COLLIDES WITH ITSELF\r\n this.checkForCollision = function() {\r\n for (var i=0; i < this.tail.length; i++) {\r\n if(this.x === this.tail[i].x && this.y === this.tail[i].y) {\r\n this.totalFruit = 0;\r\n this.tail = [];\r\n setState(\"gameover\"); \r\n }\r\n }\r\n }\r\n}", "function snakeStart() {\n locationX = Math.floor(backWidth / 2);\n locationY = Math.floor(backHeight / 2);\n var snakeLength = 3;\n\n Loop();\n }", "function placeSnake() {\n snake = {\n x: Math.round((Math.random() * (width - cw)) / cw),\n y: Math.round((Math.random() * (height - cw)) / cw),\n };\n }", "function makeSnake() {\n\tsnake = new Snake(WIDTH/2, HEIGHT/2, DIRS.LEFT);\n}", "function snake(x, y, r, color) {\n this.x = x;\n this.y = y;\n this.r = r;\n this.color = color;\n this.speedX = 0;\n this.speedY = 0;\n\n // draw component in the canvas\n this.update = function () {\n ctx = myGameArea.context;\n ctx.beginPath();\n ctx.fillStyle = color;\n ctx.arc(this.x, this.y, this.r, 0, 2 * Math.PI);\n ctx.fill();\n }\n}", "function Snake() {\n this.x = 0;\n this.y = 0;\n this.xspeed = 1;\n this.yspeed = 0;\n this.total = 0;\n this.seg = [];\n this.score = 0;\n this.death = false;\n\n// this checks if the food has been eaten and counts score\n\n this.eat = function(pos) {\n var d = dist(this.x, this.y, pos.x, pos.y);\n if (d < 1) {\n this.total++;\n this.score++;\n return true;\n } else {\n return false;\n }\n }\n\n this.run = function(){\n this.update();\n this.show();\n }\n\n\n//this is the direction function for the snake\n\n this.dir = function(x, y) {\n this.xspeed = x;\n this.yspeed = y;\n }\n\n//this updates the segments of the rect\n\n this.update = function() {\n for (var i = 0; i < this.seg.length - 1; i++) {\n this.seg[i] = this.seg[i + 1];\n }\n if (this.total >= 1) {\n this.seg[this.total - 1] = createVector(this.x, this.y);\n }\n\n// multiplied by scale so will move on a grid\n\n this.x = this.x + this.xspeed * scl;\n this.y = this.y + this.yspeed * scl;\n\n this.x = constrain(this.x, 0, width - scl);\n this.y = constrain(this.y, 0, height - scl);\n }\n\n// adds the other segments\n//and renders the not head segments\n\n this.show = function() {\n fill(0,255,0);\n for (var i = 0; i < this.seg.length; i++) {\n rect(this.seg[i].x, this.seg[i].y, scl, scl);\n }\n\n image(img, this.x, this.y, scl, scl);\n\n\n }\n\n// this checks for death\n\n this.die = function() {\n for (var i = 0; i < this.seg.length; i++) {\n var pos = this.seg[i];\n var d = dist(this.x, this.y, pos.x, pos.y);\n if (d < 1) {\n fill(11, 226, 119);\n textSize(100);\n text(\"Game Over\",150,350);\n this.death = true;\n //causes error in program and freezes interval\n //asjdfkl;asjdf;jas\n\n }\n }\n }\n\n}", "function Snake() {\n this.x = 100;\n this.y = 260;\n this.xspeed = 1;\n this.yspeed = 0;\n\n this.total = 0;\n this.tail = [];\n\n this.dir = function(x, y) {\n this.xspeed = x;\n this.yspeed = y;\n }\n\n\t//Checks to see if snake collides with tail\n\t//Tail movement continues even if snake is stuck in wall, so death check still works\n\t//If there is a collision, reset snake and score\n this.death = function() {\n for(var i = 0; i < this.tail.length; i++){\n var pos = this.tail[i];\n var d = dist(this.x, this.y, pos.x, pos.y);\n\n if(d < 1){\n dead.play();\n this.total = 0;\n document.querySelector('#score').innerHTML = 0;\n this.tail = [];\n this.x = 100;\n this.y = 260;\n this.xspeed = 1;\n this.yspeed = 0;\n }\n }\n }\n\n\t//Tail takes position of previous tail segment's location when moving\n\t//If a food object is eaten, create a new vector at that food's location\n this.update = function() {\n if(this.total === this.tail.length) {\n for(var i = 0; i < this.tail.length - 1; i++){\n this.tail[i] = this.tail[i+1];\n }\n }\n this.tail[this.total-1] = createVector(this.x, this.y);\n\n\t\t//Every frame, move snake to next tile depending on xspeed/yspeed\n this.x = this.x + this.xspeed*scl;\n this.y = this.y + this.yspeed*scl;\n\n\t\t//Restrict snake's movement within game board\n this.x = constrain(this.x, 0, width-scl);\n this.y = constrain(this.y, 0, height-scl);\n }\n\n this.show = function() {\n fill('#80D8FF');\n\n for(var i = 0; i < this.tail.length; i++) {\n rect(this.tail[i].x, this.tail[i].y, scl, scl);\n }\n rect(this.x, this.y, scl, scl);\n }\n\n\t//Checks if food object is eaten. If so, increase score.\n this.eat = function(pos) {\n var d = dist(this.x, this.y, pos.x, pos.y);\n if(d < 1){\n munch.play();\n this.total++;\n document.querySelector('#score').innerHTML = (this.total)*100;\n if(highscore < (this.total)*100){\n highscore = (this.total)*100;\n document.querySelector('#highscore').innerHTML = highscore;\n }\n return true;\n }\n else\n return false;\n\n }\n}", "function draw_snake() {\n draw_square(snake.x, snake.y, snake.color)\n draw_snake_body(snake.body, snake.lenght, snake.body_color)\n}", "function paintSnake() {\n // FIXME I can and should abstract away the details of painting to \n // a particular index\n ctx.fillStyle = snakeColor;\n for (j = 0; j < snakeState.length; j++) {\n roundRect(ctx, snakeState[j][0] * squareSize, snakeState[j][1] * squareSize,\n squareSize ,squareSize, squareRadius, true, true);\n }\n}", "function Snake() {\n\tthis.speed = STARTSPEED; // time between updates in miliseconds\n\n\tthis.direction = DirectionEnum.RIGHT;\n\tthis.segments = [];\n\n\tthis.lastMoved = Date.now();\n\n\tthis.update = function (){\n\t\tif (Date.now() > this.lastMoved + this.speed){\n\t\t\tthis.lastMoved = Date.now();\n\t\t\tthis.move();\n\t\t} \n\t};\n\n\tthis.move = function (){\n\t\tswitch (this.direction){ // Move the 'head' (IE, this class)\n\t\t\tcase DirectionEnum.LEFT:\n\t\t\t\tthis.x--;\n\t\t\t\tif (this.x < 0) this.x = game.grid.width - 1;\n\t\t\t\tbreak;\n\t\t\tcase DirectionEnum.UP:\n\t\t\t\tthis.y--;\n\t\t\t\tif (this.y < 0) this.y = game.grid.height - 1;\n\t\t\t\tbreak;\n\t\t\tcase DirectionEnum.RIGHT:\n\t\t\t\tthis.x++;\n\t\t\t\tif (this.x > game.grid.width - 1) this.x = 0;\n\t\t\t\tbreak;\n\t\t\tcase DirectionEnum.DOWN:\n\t\t\t\tthis.y++;\n\t\t\t\tif (this.y > game.grid.height - 1) this.y = 0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t} // end switch\n\t\t\n\t\t\n\t\t\n\t\t// Check if we are colliding with any segment (and thus should die).\n\t\tthis.segments.forEach(function(segment) {\n\t\t\tif (segment.x == this.x && segment.y == this.y){\n\t\t\t\twindow.alert(\"You have died!\");\n\t\t\t}\n\t\t}, this);\n\t\t\n\t\t\n\t\t// when we touch the food\n\t\tif (this.x == game.food.x && this.y == game.food.y) {\n\t\t\tgame.food = new Food();\n\t\t\tgame.food.init();\n\t\t\t\n\t\t\tthis.speed *= ACCELERATION;\n\t\t\t\n\t\t\tfor(var counter = 0; counter < GROWTH; counter++){\n\t\t\t\tvar segment = new SnakeSegment();\n\t\t\t\tsegment.init(this.x, this.y);\n\t\t\t\tthis.segments.unshift(segment);\n\t\t\t}\n\t\t\t\n\t\t\t//this.draw();\n\t\t}\n\t\t\n\t\t// Start by clearing the last of the tail\n\t\tvar tail = this.segments.shift();\n\t\ttail.clear();\n\n\t\t// Create a new head segment.\n\t\tvar segment = new SnakeSegment();\n\t\t\n\t\tsegment.init(this.x, this.y);\n\n\t\tthis.segments[this.segments.length - 1].draw(false); // draw the 'neck'\n\t\tsegment.draw(true); // draw the head\n\t\tthis.segments.push(segment); //insert the new head.\n\t};\n\n\tthis.draw = function (){ // redraw the whole snake.\n\t\tfor(var counter = 0; counter < this.segments.length; counter++){\n\t\t\tthis.segments[counter].draw();\n\t\t}\n\t};\n\n\tthis.init = function(x, y){\n\t\tthis.x = x; this.y = y;\n\t\t//this.prototype.init.call(x, y);\n\t\t//Drawable.init.call(this, x, y);\n\n\t\t// create three segments on spawn\n\t\tfor(var temp = 0; temp < 3; temp++){\n\t\t\tvar segment = new SnakeSegment();\n\t\t\tsegment.init(1, 1 + temp);\n\t\t\tthis.segments.push(segment);\n\t\t}\n\t\tfor(var temp = 0; temp < 3; temp++){\n\t\t\tthis.move();\n\t\t}\n\t}\n}", "function Snake(bodySnake,direction){\n this.bodySnake = bodySnake;\n this.direction = direction;\n this.ateApple = false;\n //----------------------\n this.draw = function(){\n ctx.save();\n ctx.fillStyle = \"#000000\";\n for(let i = 0 ; i < this.bodySnake.length; i++)\n {\n drawBlock(ctx, this.bodySnake[i]);\n }\n ctx.restore();\n }\n //-------------------------\n this.advance = function(){\n let nextPos = this.bodySnake[0].slice();\n switch(this.direction)\n {\n // case \"right\":\n // nextPos[0] = ++nextPos[0] % (canvasWidth / blockSize);\n // break;\n // case \"left\":\n // nextPos[0] = (nextPos[0] == 0) ?\n // (canvasWidth / blockSize) : --nextPos[0];\n // break;\n // case \"up\":\n // nextPos[1] = (nextPos[1] == 0) ?\n // (canvasHeight / blockSize) : --nextPos[1];\n // break;\n // case \"down\":\n // nextPos[1] = ++nextPos[1] % (canvasHeight / blockSize);\n // break;\n case \"right\":\n ++nextPos[0];\n break;\n case \"left\":\n --nextPos[0];\n break;\n case \"up\":\n --nextPos[1];\n break;\n case \"down\":\n ++nextPos[1];\n break;\n default:\n throw (\"invalid direction\");\n }\n this.bodySnake.unshift([nextPos[0], nextPos[1]]);\n if(!this.ateApple)\n this.bodySnake.pop();\n else\n this.ateApple = false;\n }\n //------------------------------------------\n this.setDirection = function(newDirection){\n let allowedDirection;\n switch(this.direction)\n {\n case \"right\":\n case \"left\":\n allowedDirection = [\"up\", \"down\"];\n break;\n case \"up\":\n case \"down\":\n allowedDirection = [\"left\", \"right\"];\n break;\n default:\n return;\n }\n if (allowedDirection.indexOf(newDirection) > -1)\n {\n this.direction = newDirection;\n }\n }\n //-------------------------\n this.checkCollision = function(){\n let wallCollision = false;\n let snakeCollision = false;\n let head = this.bodySnake[0];\n let rest = this.bodySnake.slice(1);\n let xCoordSnake = head[0];\n let yCoordSnake = head[1];\n let xCoordMin = 0;\n let yCoordMin = 0;\n let xCoordMax = nbWidthBlock - 1;\n let yCoordMax = nbHeightBlock-1;\n let isNotBetweenHorizontalWalls = xCoordSnake < xCoordMin || xCoordSnake > xCoordMax;\n let isNotBetweenVerticalWalls = yCoordSnake < yCoordMin || yCoordSnake > yCoordMax;\n if(isNotBetweenHorizontalWalls || isNotBetweenVerticalWalls){\n wallCollision = true;\n }\n for(let i=2; i<rest.length;i++){\n if (xCoordSnake === rest[i][0] && yCoordSnake === rest[i][1])\n snakeCollision = true;\n }\n return wallCollision || snakeCollision;\n }\n //------------------------------------------\n this.isEatingApple = function(appleToEat){\n let head = this.bodySnake[0];\n if(head[0] === appleToEat.position[0] && head[1] === appleToEat.position[1]) return true;\n else false;\n }\n //------------------------------------------\n }", "function Snake() {\n\n\t\tthis.direction = RIGHT;\n\t\tthis.snakePieces = new Array();\n\n\t\t// End of Array, is actually beginning of snake\n\t\tthis.snakePieces.push(new SnakePiece(STARTING_CENTER - 2,STARTING_CENTER));\n\t\tthis.snakePieces.push(new SnakePiece(STARTING_CENTER - 1,STARTING_CENTER));\n\t\tvar head = new SnakePiece(STARTING_CENTER,STARTING_CENTER);\n\t\thead.color = SNAKE_HEAD_COLOR;\n\t\tthis.snakePieces.push(head);\n\n\t\t// Draws the snake to the board\n\t\tthis.draw = function(){\n\t\t\t\n\t\t\tfor (var i = 0; i < this.snakePieces.length; i++) {\n\t\t\t\tthis.snakePieces[i].draw();\n\t\t\t}\n\t\t}\n\n\t\tthis.move = function(){\n\n\t\t\t// Get the piece at the beginning, push it on the front of the array\n\t\t\t// Change its position based on direction\n\t\t\tvar back = new SnakePiece(this.snakePieces[0].position.x, this.snakePieces[0].position.y);\n\t\t\tback.position.x = this.snakePieces[this.snakePieces.length - 1].position.x;\n\t\t\tback.position.y = this.snakePieces[this.snakePieces.length - 1].position.y;\n\t\t\tback.position.x += this.direction.x;\n\t\t\tback.position.y += this.direction.y;\n\n\t\t\tif (canGoThroughWalls) {\n\t\t\t\tcanGoThroughWalls = false;\n\t\t\t\tif (this.hitsWall(back.position.x,back.position.y)) {\n\t\t\t\t\tif (back.position.x > BOARD_SIZE - 1) { // Hit right side\n\t\t\t\t\t\tback.position.x = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (back.position.x < 0) { // Hit left side\n\t\t\t\t\t\tback.position.x = BOARD_SIZE - 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (back.position.y > BOARD_SIZE - 1) { // Hit bottom\n\t\t\t\t\t\tback.position.y = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (back.position.y < 0) {\n\t\t\t\t\t\tback.position.y = BOARD_SIZE - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcanGoThroughWalls = true;\n\t\t\t}\n\n\t\t\tresetColor(this.snakePieces);\n\t\t\tback.color = SNAKE_HEAD_COLOR;\n\t\t\tthis.snakePieces.push(back);\n\n\t\t\t// Check if I eat a food\n\t\t\tif (CUR_FOOD.position.x == back.position.x && CUR_FOOD.position.y == back.position.y) {\n\n\t\t\t\t// We need to create a new food\n\t\t\t\t// We don't remove first piece, so snake grows longer\n\t\t\t\tvisible_pieces.splice(visible_pieces.indexOf(CUR_FOOD));\n\t\t\t\tCUR_FOOD = generateRandomFood();\n\t\t\t\tvisible_pieces.push(CUR_FOOD);\n\t\t\t\t$scope.score++;\n\t\t\t\t$scope.$apply();\n\n\t\t\t\t// Speed up\n\t\t\t\tif (GAME_SPEED > MAX_SPEED)\n\t\t\t\t\tGAME_SPEED -= SPEED_CHANGE_INTERVAL;\n\n\t\t\t} else {\n\n\t\t\t\t// Remove first piece\n\t\t\t\tthis.snakePieces.shift();\n\t\t\t}\n\n\t\t\t// Check if hits wall or hits itself\n\t\t\tvar newx = back.position.x;\n\t\t\tvar newy = back.position.y;\n\t\t\tif (this.hitsWall(newx,newy) || this.hitsSelf(newx,newy)) {\n\n\t\t\t\t$scope.gameover = true;\n\t\t\t\t$scope.$apply();\n\t\t\t\t// POSSIBLE MORE CODE FOR GAMEOVER\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tthis.hitsWall = function(x,y) {\n\n\t\t\tif (canGoThroughWalls)\n\t\t\t\treturn false;\n\n\t\t\treturn (x < 0 || x > BOARD_SIZE - 1 || y > BOARD_SIZE - 1 || y < 0);\n\t\t}\n\n\t\tthis.hitsSelf = function(x,y) {\n\n\t\t\tfor (var i = this.snakePieces.length - 2; i >= 0; i--) {\n\n\t\t\t\tif (this.snakePieces[i].position.x == x && this.snakePieces[i].position.y == y)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}", "function Snake(pos) {\r\n\t\tthis.pos = pos;\r\n\t\tthis.basePos = new Vector(pos.x, pos.y);\r\n\t\t--this.pos.y;\r\n\t\tthis.size = new Vector(1, 1);\r\n\t\tthis.pieces = new Array(2);\r\n\t\tthis.pieceInx = 0;\r\n\t\tthis.isEmpty = true;\r\n\t\tthis.newElem = false;\r\n\t\tthis.direction = new Vector(0, -1);\r\n\t\tthis.lastPressed = 'top';\r\n\t}", "function changeSnakePosition() {\r\n console.log(ySpeed);\r\n headX = headX + xSpeed;\r\n headY = headY + ySpeed;\r\n}", "function drawSnake() {\n // Loops through the snake parts drawing each part on the canvas\n snake.forEach(drawSnakePart)\n}", "function drawSnake() {\r\n for (let i = 0; i < snake.length; i++) {\r\n ctx.fillStyle = \"mediumvioletred\";\r\n ctx.strokeStyle = \"white\";\r\n ctx.lineWidth = 1.5;\r\n ctx.fillRect(snake[i].x, snake[i].y, moveUnit, moveUnit);\r\n ctx.strokeRect(snake[i].x, snake[i].y, moveUnit, moveUnit);\r\n }\r\n }", "function drawSnake() {\n // loop through the snake parts drawing each part on the canvas\n snake.forEach(drawSnakePart)\n}", "function drawSnake() {\n\t// loop through the snake parts drawing each part on the canvas\n\tsnake.forEach(drawSnakePart);\n}", "function updateSnakeCoordinates() {\n\n for (var i = 0; i < numSegments - 1; i++) {\n xCor[i] = xCor[i + 1];\n yCor[i] = yCor[i + 1];\n }\n switch (direction) {\n case 'right':\n xCor[numSegments - 1] = xCor[numSegments - 2] + diff;\n yCor[numSegments - 1] = yCor[numSegments - 2];\n break;\n case 'up':\n xCor[numSegments - 1] = xCor[numSegments - 2];\n yCor[numSegments - 1] = yCor[numSegments - 2] - diff;\n break;\n case 'left':\n xCor[numSegments - 1] = xCor[numSegments - 2] - diff;\n yCor[numSegments - 1] = yCor[numSegments - 2];\n break;\n case 'down':\n xCor[numSegments - 1] = xCor[numSegments - 2];\n yCor[numSegments - 1] = yCor[numSegments - 2] + diff;\n break;\n }\n}", "function Snake() {\n\t\tthis.direction = constants.DEFAULT_DIRECTION;\n\t\tthis.points = [];\n\t\tthis.growthLeft = 0;\n\t\tthis.alive = true;\n\n\t\t// Check if any of this objects points collides with an external point\n\t\t// Returns true if any collision occurs, false otherwise\n\t\t// @param simulateMovement boolean Simulates the removal of the end point\n\t\t// This addresses a bug where the snake couldn't move to a point which\n\t\t// is not currently free, but will be in the next frame\n\t\tthis.collidesWith = function(point, simulateMovement){\n\t\t\tif (simulateMovement && this.growthLeft === 0)\n\t\t\t\t// Now th\n\t\t\t\trange = this.points.length - 1;\n\t\t\telse\n\t\t\t\trange = this.points.length;\n\t\t\tfor (var i = 0; i < range; i++) {\n\t\t\t\tif (point.collidesWith(this.points[i]))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}", "function Snake() {\n this.x = 0;\n this.y = 0;\n this.xspeed = 0;\n this.yspeed = 0;\n this.total = 0;\n this.tail = [];\n \n \n this.death = function() {\n // If the snake runs into itself, it resets the game\n \n // so we loop through every spot in the tail\n for (var i = 0; i < this.tail.length; i++) {\n var pos = this.tail[i]; // we look at each position\n var d = dist(this.x, this.y, pos.x, pos.y); \n if (d < 1) {\n this.total = 0;\n this.tail = [];\n this.x = 0;\n this.y = 0;\n this.xspeed = 0;\n this.yspeed = 0;\n }\n }\n }\n \n this.eat = function(pos) {\n var d = dist(this.x, this.y, pos.x, pos.y);\n if (d < 1) {\n this.total++;\n return true;\n } else {\n return false;\n }\n }\n \n // object can have input of x and y and they are assigned direction\n this.dir = function(x, y) {\n this.xspeed = x;\n this.yspeed = y;\n }\n \n this.update = function () {\n \n \n // adding the tail of the snake\n // two possibilities:\n // 1. adding food to the front and not shifting\n // 2. not adding food, so everything has to shift over\n \n // 2. no food eaten\n if (this.total === this.tail.length) {\n // no food, so shift the tail down\n for (var i = 0; i < this.tail.length-1; i++) {\n this.tail[i] = this.tail[i+1];\n }\n \n }\n // 1. food is eaten, just add new spot\n this.tail[this.total-1] = createVector(this.x, this.y);\n \n this.x = this.x + this.xspeed * scl;\n this.y = this.y + this.yspeed * scl;\n \n // that object can be constrained to certain areas\n // value is constrained between 0 and width\n this.x = constrain(this.x, 0, width - scl);\n this.y = constrain(this.y, 0, height - scl);\n \n }\n \n this.show = function() {\n // draw the rectangle where the tail is\n fill(255); // white in color\n for (var i = 0; i < this.tail.length; i++) {\n rect(this.tail[i].x, this.tail[i].y, scl, scl);\n } \n rect(this.x, this.y, scl, scl);\n \n \n \n }\n}", "function addSnake() {\n snake.push(createSprite(-60, -60, diameter, diameter));\n snake[snake.length - 1].shadowColor = color(255);\n fill(255);\n}", "function moveSnake() {\n $.each(snake, function (index, value) {\n snake[index].oldX = value.x;\n snake[index].oldY = value.y;\n\n // head\n if (index == 0) {\n if (keyPressed === down) {\n snake[index].y = value.y + blockSize;\n } else if (keyPressed === up) {\n snake[index].y = value.y - blockSize;\n } else if (keyPressed === right) {\n snake[index].x = value.x + blockSize;\n } else if (keyPressed === left) {\n snake[index].x = value.x - blockSize;\n }\n } \n // body\n else {\n snake[index].x = snake[index - 1].oldX;\n snake[index].y = snake[index - 1].oldY;\n }\n });\n }", "function renderSnake() {\n for (var i=0; i<snake.position.length; i++) {\n boxes[snake.position[i][0] + snake.position[i][1] * table.rowsCols].classList.add(\"snake\");\n }\n}", "function createSnake(){\r\nvar length = 5;\r\nsnakeArray =[];\r\n\r\nfor (var i = length-1; i >= 0; i--) //\r\n{\r\n\tsnakeArray.push({x:i,y:0}); //creates the snake at the top of the canvas at the 5th postion and decrements it\r\n}//for loop ends\r\n}//createSnake ends", "function SnakeGame()\n{\n\tthis.context = $(\".snake__body\")[0].getContext(\"2d\");\n\tthis.width = $(\".snake__body\").width();\n\tthis.height = $(\".snake__body\").height();\n\t\n\tthis.settings = new Settings();\n\t\n\tthis.boardColor = this.settings.boardColor;\n\tthis.score = 0;\n\tthis.gameSpeed = 60;\n\t\n\tthis.snake = new Snake(this.settings.snakeColor);\n\tthis.showBoard();\n\tthis.food = null;\n\tthis.generateFood();\n}", "function updateAll()\n{\n // move the snake\n var sl = snake.length - 1; \n snake.push({x: snake[sl].x + dx, y: snake[sl].y + dy});\n snake.shift(); \n}", "function SnakeSegment() {\n\tthis.draw = function(bIsHead) { // implement the earlier absctract function\n\t\t//this.context.rect(this.x, this.y, 25, 25);\n\t\tif (bIsHead == true){\n\t\t\tthis.context.fillStyle=HEADCOLOUR;\n\t\t} else {\n\t\t\tthis.context.fillStyle=BODYCOLOUR;\n\t\t}\n\t\t\n\t\tthis.context.fillRect((this.x * game.grid.blockSize) + 1 , (this.y * game.grid.blockSize) + 1, game.grid.blockSize - 2, game.grid.blockSize - 2);\n\t}\n\n\tthis.clear = function () {\n\t\tthis.context.clearRect(this.x * game.grid.blockSize, this.y * game.grid.blockSize, game.grid.blockSize, game.grid.blockSize);\n\t}\n}", "startMovingSnake() {\n this.snakeInterval = setInterval(\n this.moveSnake,\n SNAKE_MOVING_SPEED,\n )\n }", "function Snake(snakeColor) {\n\tvar START_SNAKE_LENGTH = 5;\n\n\tthis.color = snakeColor;\n\n\tthis.direction = DIRECTION_RIGHT;\n\tthis.positionArray = [];\n\tfor(var i = START_SNAKE_LENGTH-1; i>=0; i--)\n\t{\n\t\tthis.positionArray.push({x: i, y:0});\n\t}\n\tthis.turnQueue = [];\n}", "function drawSnake() {\n // loop through the snake parts drawing each part on the canvas\n snakeOne.snake.forEach(drawSnakeOnePart)\n snakeTwo.snake.forEach(drawSnakeTwoPart)\n }", "function changeSnakePosition(){\n headX = headX + xVelocity;\n headY = headY + yVelocity;\n}", "function createSnake() {\n //starting x and y position of left snake (4, 4)\n snake1 = new Snake(bit(4,6), RIGHT, \"brown\", \"gray\", \"black\", \"blue\");\n if(no_of_players == 2) {\n snake2 = new Snake(bit(64,6), LEFT, \"orange\", \"yellow\", \"green\", \"purple\")\n }\n }", "function drawSnake(){ \n for(let segment of snakeBody){\n drawRect(segment.x, segment.y, rectSide, rectSide, \"red\");\n }\n}", "function create_snake() {\n\t\tlet length = 1;\n\t\tsnake_length = [];\n\t\tfor (let i = length - 1; i >= 0; i--) {\n\t\t\tsnake_length.push({ x: i, y: height / cellWidth / 2 });\n\t\t}\n\t}", "createSnake(snakeLength) {\n for (let i=snakeLength-1;i>=0;i--) {\n this.snakeArr.push({\n x:20*i,\n y:0\n });\n }\n }", "function createSnake(){\n\n\t\tvar length = 5; // default size\n\t\tsnake = [];\n\n\t\tfor(var i = length -1; i >= 0; i--){\n\t\t\tsnake.push({ x: i, y: 0 });\n\t\t}\n\t}", "function snakeDraw() {\n\n // this is necessary to avoid the width of the green score line to affect the width of the black borders of the snake\n ctx.lineWidth = 1;\n\n // this function is being called here to set the new coordinates of the snake before drawing it on canvas\n snakeDirection(direction);\n\n // this for loop goes through the set coordinates of the snake and draws it\n for (let i = 0; i < snake.length; i++) {\n\n // fill style is set to random between the 3 variable numbers in the rgb\n ctx.fillStyle = \"rgb(\" + Math.random()*256 + \",\" + Math.random()*256 + \",\" + Math.random()*256 + \")\";\n\n // goes through the i value in the loop and draws the x and y coordinates with the set unit for width and height\n ctx.fillRect(snake[i].x,snake[i].y, unit, unit);\n\n // black border gives a nicer look to the snake\n ctx.strokeStyle = \"black\";\n ctx.strokeRect(snake[i].x,snake[i].y, unit, unit);\n \n }\n}", "function drawSnake() {\n context.fillStyle = 'white';\n context.fillRect(0, 0, width, height);\n context.strokeStyle = 'black';\n context.strokeRect(0, 0, width, height);\n\n var headX = snake[0].x;\n var headY = snake[0].y;\n\n if(direction == 'right') {\n headX++;\n } else if(direction == 'left') {\n headX--;\n } else if(direction == 'up') {\n headY--;\n } else if(direction == 'down') {\n headY++;\n }\n\n if(headX == -1 || headX == width/cellSize || headY == -1 || headY == height/cellSize || collisionCheck(headX, headY, snake)) {\n init();\n return;\n }\n\n //function left() {\n // if(snake[0].x == 0) {\n // snake.forEach(function(segment) {\n // segment.draw();\n // });\n // } else {\n // snake.forEach(function(segment) {\n // segment.draw().moveLeft();\n // })\n // }\n //}\n //\n //function up() {\n // if(snake[0].y == 0){\n // snake.forEach(function(segment) {\n // segment.draw();\n // });\n // } else {\n // snake.forEach(function(segment) {\n // segment.draw().moveUp();\n // });\n // }\n //}\n //\n //function right() {\n // if(snake[0].x == canvas.width - snake[0].w) {\n // snake.forEach(function(segment) {\n // segment.draw();\n // })\n // } else {\n // snake.forEach(function(segment) {\n // segment.draw().moveRight();\n // })\n // }\n //}\n //\n //\n //function down() {\n // if(snake[0].y == canvas.height - snake[0].h) {\n // snake.forEach(function(segment) {\n // segment.draw();\n // });\n // } else {\n // snake.forEach(function(segment) {\n // segment.draw().moveDown();\n // });\n // }\n //}\n\n\n if(headX == target.x && headY == target.y) {\n var snakeBody = { x: headX, y: headY };\n score = score + 100;\n createTarget();\n } else {\n var snakeBody = snake.pop();\n snakeBody.x = headX;\n snakeBody.y = headY;\n }\n\n snake.unshift(snakeBody);\n\n for(var i = 0; i < snake.length; i++) {\n var c = snake[i];\n\n drawCell(c.x, c.y);\n }\n\n // Draw New Target\n drawCell(target.x, target.y);\n\n var scoreText = \"Score: \" + score;\n context.fillText(scoreText, 5, height-5);\n\n function drawCell(x, y) {\n context.fillStyle = 'white';\n context.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);\n context.strokeStyle = 'black';\n context.strokeRect(x * cellSize, y * cellSize, cellSize, cellSize);\n }\n\n //Collision Check with Self\n function collisionCheck(x, y, array) {\n for(var i = 0; i < array.length; i++)\n {\n if(array[i].x == x && array[i].y == y)\n return true;\n }\n return false;\n }\n\n // KeyBoard Controls\n //function headPosition(e) {\n // key = e.keyCode;\n //\n // switch(key) {\n // case 37:\n // leftKey = 37;\n // break;\n // case 38:\n // upKey = 38;\n // break;\n // case 39:\n // rightKey = 39;\n // break;\n // case 40:\n // downKey = 40;\n // break;\n // }\n //}\n //\n //var direction;\n //\n //function moveSnake(direction) {\n // switch (direction) {\n // case leftKey:\n // console.log(\"Left\", head);\n // left();\n // break;\n // case upKey:\n // console.log(\"Up\", head);\n // up();\n // break;\n // case rightKey:\n // console.log(\"Right\", head);\n // right();\n // break;\n // case downKey:\n // console.log(\"Down\", head);\n // down();\n // break;\n // }\n //}\n //\n\n document.addEventListener('keydown', function(e) {\n var key = e.keyCode;\n\n if(key == 37 && direction != 'right') {\n direction = 'left';\n // Debugging Verify Head Locaiton\n console.log({ x: snake[0].x, y: snake[0].y });\n } else if (key == 38 && direction != 'down') {\n direction = \"up\";\n // Debugging Verify Head Locaiton\n console.log({ x: snake[0].x, y: snake[0].y });\n } else if(key == 39 && direction != 'left') {\n direction = 'right';\n // Debugging Verify Head Locaiton\n console.log({ x: snake[0].x, y: snake[0].y });\n } else if(key == 40 && direction != 'up') {\n direction = 'down';\n // Debugging Verify Head Locaiton\n console.log({ x: snake[0].x, y: snake[0].y });\n }\n })\n\n\n\n\n\n //\n //\n //window.requestAnimationFrame(function loop() {\n // context.clearRect(0, 0, canvas.width, canvas.height);\n //\n // document.addEventListener('keydown', function(e) {\n // if(e.keyCode === 37) {\n // direction = leftKey;\n // } else if(e.keyCode === 38) {\n // direction = upKey;\n // } else if(e.keyCode === 39) {\n // direction = rightKey;\n // } else if (e.keyCode === 40) {\n // direction = downKey;\n // }\n // });\n //\n // moveSnake(direction);\n // requestAnimationFrame(loop);\n //});\n\n\n\n}", "function drawSnake() {\n // Menggambar setiap ruas\n snake.forEach(drawSnakePart)\n}", "init() {\n\n const x = Math.floor(Math.random() * (SnakeGame.NUM_COLS - Snake.STARTING_EDGE_OFFSET)) + (Snake.STARTING_EDGE_OFFSET / 2);\n const y = Math.floor(Math.random() * (SnakeGame.NUM_ROWS - Snake.STARTING_EDGE_OFFSET)) + (Snake.STARTING_EDGE_OFFSET / 2);\n this.position = { x, y };\n\n // Make the snake as long as the tailLength specifies\n for(let i = 0; i < Snake.TAIL_LENGTH; i++) {\n const startCell = this.game.boardCells[y + i][x];\n startCell.classList.add('snake');\n \n this.tail.unshift(startCell);\n }\n\n }", "function createSnake() {\n var length = 1;\n snake = [];\n\n for(var i = length - 1; i >= 0; i--) {\n snake.push({ x: i, y: 0 })\n }\n}", "function drawSnake() {\n // Draw each part\n snake.forEach(drawSnakePart)\n }", "function snakeInitialize() {\n snake = [];\n snakeLength = 3;\n snakeSize = 20;\n snakeDir = \"right\";\n for (var index = snakeLength - 1; index >= 0; index--) {\n snake.push({\n x: index,\n y: 0\n });\n }\n}", "function drawSnake() {\n ctx.fillStyle = \"orange\";\n ctx.fillRect(snake[0].x, snake[0].y, 20, 20);\n ctx.strokeStyle = \"#764100\";\n ctx.strokeRect(snake[0].x, snake[0].y, 20, 20);\n\n for (let i = 1; i < snake.length; i++) {\n drawSnakePart(snake[i]);\n }\n\n // return snake.forEach(drawSnakePart);\n}", "function drawSnake() {\r\n // Draw each part\r\n snake.forEach(drawSnakePart)\r\n}", "function oneMove() {\n for (var i = snake.length - 1; i >= 0; i--) {\n if (i === 0) {\n snake[0].position = createVector(offsetX, offsetY);\n } else {\n snake[i].position = createVector(snake[i - 1].position.x, snake[i - 1].position.y)\n }\n }\n}", "function Snake(x, y, dir) {\n\tthis.head = new Cell(x, y);\n\tthis.body = []; // array of Cell\n\tthis.dir = dir;\n\tthis.nextdir = dir;\n\tthis.belly = 0; // the amount of food currently eaten\n\tthis.score = 0;\n\n\t// Return length of this snake\n\tthis.len = function() {\n\t\treturn 1 + this.body.length;\n\t};\n\n\t// Increase snake length by 1 by stretching head in set dir\n\tthis.grow = function() {\n\t\tthis.body.push(this.head);\n\t\tthis.head = cell(this.head.getX(), this.head.getY());\n\t};\n\n\t// Removes all the divs of this snake from the game\n\tthis.del = function() {\n\t\tthis.head.div.remove();\n\t\tthis.body.forEach(function(cell) {\n\t\t\tcell.div.remove();\n\t\t});\n\t}\n}", "function start(){\n /*Set your global variable rectangle to new rectangle\n us the width and height variable for snake as width and height*/\n \n //Set rectangle color to green\n \n /*Set position to\n x - half the width of screen minus half the width of snake\n y - half the height of the screen minus half height of snake\n */\n \n //Add your rectangle\n \n /*Set a timer calling your move function\n set delay to 40 ms*/\n \n /*Call your key down method with\n changeDir as an argument*/\n}", "function drawSnake() {\n snake.forEach(drawSnakePart);\n}", "function drawSnake() {\n snake.forEach(drawSnakePart);\n}", "function drawSnake() {\n // Draw each part\n snake.forEach(drawSnakePart);\n}", "init() {\r\n\r\n const x = Math.floor(Math.random() * (SnakeGame.NUM_COLS - Snake.STARTING_EDGE_OFFSET)) + (Snake.STARTING_EDGE_OFFSET / 2);\r\n const y = Math.floor(Math.random() * (SnakeGame.NUM_ROWS - Snake.STARTING_EDGE_OFFSET)) + (Snake.STARTING_EDGE_OFFSET / 2);\r\n this.position = { x, y };\r\n const startCell = this.game.boardCells[y][x];\r\n console.log(\"startCell:\"+startCell);\r\n startCell.classList.add('snake');\r\n this.start = startCell;\r\n this.tail.push(this.position);\r\n\r\n }", "function drawSnake() {\n // Draw each part\n snake.forEach(drawSnakePart)\n}", "function tick() {\r\n buildSnake();\r\n}", "move(){\n for(let i = this.snake.length - 1; i > 0; i--){\n this.snake[i].style.left = `${this.snake[i - 1].offsetLeft}px`;\n this.snake[i].style.top = `${this.snake[i - 1].offsetTop}px`;\n }\n switch(this.direction){\n case LEFT:\n this.snakeHead.style.left = `${this.snakeHead.offsetLeft - this.cellWidth}px`;\n break;\n case UP:\n this.snakeHead.style.top = `${this.snakeHead.offsetTop - this.cellWidth}px`;\n break;\n case RIGHT:\n this.snakeHead.style.left = `${this.snakeHead.offsetLeft + this.cellWidth}px`;\n break;\n case DOWN:\n this.snakeHead.style.top = `${this.snakeHead.offsetTop + this.cellWidth}px`;\n break;\n }\n this.lastDirection = this.direction;\n }", "function paintSnake(){\n\n\t\t// set the canvas\n\t\tctx.fillStyle = background;\n\t\tctx.fillRect(0, 0, canvasWidth, canvasWidth);\n\t\tctx.strokeStyle = border;\n\t\tctx.strokeRect(0,0, canvasWidth, canvasWidth);\n\n\t\t// new cell\n\t\tvar nx = snake[0].x;\n\t\tvar ny = snake[0].y;\n\n\t\tif(d == \"right\"){\n\t\t\tnx++;\n\t\t} else if( d == \"left\") {\n\t\t\tnx--;\n\t\t} else if( d == \"up\"){\n\t\t\tny--;\n\t\t} else if( d == \"down\") {\n\t\t\tny++;\n\t\t}\n\n\t\t// if lose\n\t\tif(nx == -1 || nx == Math.round(canvasWidth / cellWidth) || ny == -1 || ny == Math.round(canvasWidth / cellWidth) || collision(nx, ny, snake)){\n\t\t\talert(\"You lose :(\");\n\t\t\tinit();\n\t\t\treturn;\n\t\t}\n\n\t\t// if eat\n\t\tif(nx == food.x && ny == food.y) {\n\t\t\tvar tail = {\n\t\t\t\tx: nx, \n\t\t\t\ty: ny\n\t\t\t};\n\t\t\t\n\t\t\tif(snake.length >= Math.round(totalSize *0.70)){\n\t\t\t\talert(\"You win!! :)\");\n\t\t\t\tinit();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tscore = score + (10 * level);\n\n\t\t\tswitch(snake.length){\n\t\t\t\tcase 6:\n\t\t\t\t\tlevel = 2;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tlevel = 3;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\tlevel = 4;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 15:\n\t\t\t\t\tlevel = 5;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 25:\n\t\t\t\t\tlevel = 6;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 50:\n\t\t\t\t\tlevel = 7;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 100:\n\t\t\t\t\tlevel = 8;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 200:\n\t\t\t\t\tlevel = 9;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 400:\n\t\t\t\t\tlevel = 10;\n\t\t\t\t\tclearInterval(gameLoop);\n\t\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / (level * 1.5)));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/*\n\t\t\tif (score >= (10 * level)){\n\t\t\t\tlevel++;\n\t\t\t\tclearInterval(gameLoop);\n\t\t\t\tgameLoop = setInterval(paintSnake, (1000 / level));\n\t\t\t}*/\n\n\t\t\tcreateFood();\n\n\t\t}else {\n\t\t\tvar tail = snake.pop();\n\n\t\t\ttail.x = nx;\n\t\t\ttail.y = ny;\n\t\t\t\n\t\t}\n\n\t\tsnake.unshift(tail);\n\n\t\t// paint snake\n\t\tfor(var i =0; i < snake.length; i++){\n\t\t\t\n\t\t\tvar c = snake[i]\n\n\t\t\tpaintCell(c.x, c.y, snakeColor);\n\t\t}\n\t\t\n\n\t\t// paint food\n\t\tpaintCell(food.x, food.y, foodColor);\n\n\t\t// display score & level \n\t\t$('#score').text(score);\n\t\t$('#level').text(level);\n\t}", "function snakeMove(snakeArray) {\n switch (direction) {\n case \"right\":\n tail = bodyShape.shift();\n tail.x = bodyShape[bodyShape.length - 1].x + 1;\n tail.y = bodyShape[bodyShape.length - 1].y;\n bodyShape.push(tail);\n break;\n case \"left\":\n tail = bodyShape.shift();\n tail.x = bodyShape[bodyShape.length - 1].x - 1;\n tail.y = bodyShape[bodyShape.length - 1].y;\n bodyShape.push(tail);\n break;\n case \"down\":\n tail = bodyShape.shift();\n tail.x = bodyShape[bodyShape.length - 1].x;\n tail.y = bodyShape[bodyShape.length - 1].y + 1;\n bodyShape.push(tail);\n break;\n case \"up\":\n tail = bodyShape.shift();\n tail.x = bodyShape[bodyShape.length - 1].x;\n tail.y = bodyShape[bodyShape.length - 1].y - 1;\n bodyShape.push(tail);\n break;\n }\n\n for (var i = 0; i < snakeArray.length; i++) {\n ctx.fillStyle = \"blue\";\n ctx.fillRect(snakeArray[i].x * snake_seg, snakeArray[i].y * snake_seg, snake_seg + 1, snake_seg + 1);\n };\n\n for (var i = 0; i < snakeArray.length; i++) {\n ctx.fillStyle = \"#7FFF00\";\n ctx.fillRect(snakeArray[i].x * snake_seg, snakeArray[i].y * snake_seg, snake_seg - 1, snake_seg - 1);\n };\n\n}", "function movementSnake() {\n //cuando se choca contra si misma\n if(squares[currentSnake[0] + direction] &&\n squares[currentSnake[0] + direction].classList.contains('snake')){\n return clearInterval(interval)\n }\n\n const tail = currentSnake.pop()\n squares[tail].classList.remove('snake')\n let newSquare;\n\n //decide donde se agrega el proximo cuadrado: la cabeza del array\n if(//cuando choca contra la pared derecha\n ((currentSnake[0]+1) % width === 0) && (direction === 1)\n ){\n newSquare = ((currentSnake[0] - width +1))\n }else if(//cuando choca contra la izquierda\n (currentSnake[0] % (width) === 0) && (direction === -1) &&\n currentSnake[0] === 0\n ) { \n newSquare = ((currentSnake[0] + width-1))\n }else if(//cuando choca contra el tope\n (currentSnake[0] + direction < 0) &&\n (direction === -width)\n ){\n newSquare = (currentSnake[0] + squares.length - width)\n }else if(//cuando choca contra abajo\n (currentSnake[0] + direction >= squares.length)&&\n (direction === width) \n ){\n newSquare = (currentSnake[0] - squares.length + width)\n }else{//si no choca...\n newSquare = (currentSnake[0] + direction)\n } \n \n currentSnake.unshift(newSquare)\n \n \n //deals with snake getting apple\n if(squares[currentSnake[0]].classList.contains('apple')) {\n squares[currentSnake[0]].classList.remove('apple')\n squares[tail].classList.add('snake')\n currentSnake.push(tail)\n randomApple()\n score++\n scoreDisplay.textContent = score * 100\n clearInterval(interval)\n intervalTime = intervalTime * speed\n interval = setInterval(moveOutcomes, intervalTime)\n }\n squares[currentSnake[0]].classList.add('snake')\n\n}", "function drawSnake()\n{\n snake.forEach(drawSnakePart);\n}", "function Snake(initial_bit, initial_direction, head_color, body_color1, body_color2, tail_color) {\n this.bits = [];\n this.addBit(initial_bit);\n this.heading = initial_direction;\n this.bitsToGrow = INITIAL_SNAKE_LENGTH;\n this.head_color = head_color;\n this.body_color1 = body_color1;\n this.body_color2 = body_color2;\n this.tail_color = tail_color;\n this.score = 0;\n }", "function initSnake()\n{\n snake = new Snake();\n\n for(var i = 0; i < snake.length; i++){\n bodyPart = new snakeBodyPart(initPosX - i * snake.bodyPartEdge, initPosY, snake.bodyPartEdge, i);\n snake.bodyParts.push(bodyPart);\n }\n snake.head = snake.bodyParts[0];\n snake.tail = snake.bodyParts[snake.length - 1];\n snake.currentDirection = snake.initialDirection;\n snake.initial = true;\n initialSnakeMove = setInterval(function(){moveSnake(snake.initialDirection)}, snake.initialSpeed);\n}", "function newSnake(){\n var length = 5;\n snake = [];\n for (var i = 0; i < length; i++){\n snake.push({x:i, y:0});\n }\n return snake;\n}", "function move(){\n\t\t\tvar head={x:snakeArr[snakeArr.length-1].x+dx,y:snakeArr[snakeArr.length-1].y+dy};\n\t\t\tsnakeArr.push(head);\n\t\t\tsnakeArr.shift();\n\t\t\tsnakeArr.forEach(function(e,i){paint(e.x,e.y,'white','black',cellW);});\n\t\t}", "step() {\n /**\n * Move\n */\n if (Snake.state.state === 'start level') {\n /**\n * Snake crash with itself\n */\n if (this.isInTrace(this.actualPosition)) {\n this.crash()\n }\n\n /**\n * Snake Crash\n */\n if (this.actualPosition[0] === 0 && this.direction === 'left' ||\n this.actualPosition[1] === 0 && this.direction === 'up' ||\n this.actualPosition[0] > Snake.canvasBounds[0] && this.direction === 'right' ||\n this.actualPosition[1] > Snake.canvasBounds[1] && this.direction === 'down') {\n this.crash()\n }\n\n /**\n * Snake is full\n */\n if (this.length === (Snake.canvasBounds[0] * Snake.canvasBounds[1])) {\n this.full()\n }\n\n /**\n * Snake Detects a fruit\n */\n let target = Snake.match.target\n if (target[0] === this.actualPosition[0] && target[1] === this.actualPosition[1]) {\n this.eat()\n }\n if(this.direction !== 'stop') {\n this.move()\n }\n }\n }", "constructor(numWide, numHigh, startx, starty, endx, endy) {\r\n this.numSqWide = numWide;\r\n this.numSqHigh = numHigh;\r\n this.width = endx - startx;\r\n this.height = endy - starty;\r\n this.squarewidth = this.width / this.squares_wide;\r\n this.squareheight = this.width / this.squares_high;\r\n\r\n this.objects = []; // to hold all objects that are playing on this board\r\n //this.settings = this will hold the settings for the various games, Snake will hold speed, controls? , wa\r\n }", "function drawSnake(x,y){\r\n\tctx.fillStyle=\"green\";\r\n\tctx.fillRect(x*snakew,y*snakeh,snakew,snakeh);\r\n ctx.fillStyle=\"white\";\r\n ctx.strokeRect(x*snakew,y*snakeh,snakew,snakeh);\r\n}", "function core() {\n snakeX = (snakeDirection[direction].x)*snakeGrid + snakeX;\n snakeY = (snakeDirection[direction].y)*snakeGrid + snakeY;\n \n ctx.fillStyle = \"#000\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n \n for (var i = 0; i < snakeTrail.length; i++) {\n drawSnake(snakeTrail[i].x, snakeTrail[i].y);\n }\n\n snakeTrail.push({x: snakeX, y:snakeY});\n \n while(snakeTrail.length>snakeTail) {\n snakeTrail.shift();\n }\n \n debug();\n }", "function initSnake(x,y){\n\tsnake=[[x,y]];\n\tplot (x, y, 2);\n\tdx=0;\n\tdy=1;\n}", "function SnakePart(props) {\n return (\n <div\n className={props.bodyPart}\n style={{\n left: props.x,\n top: props.y,\n }}>\n </div>\n );\n}", "resetSnake() {\n this.snake = [{\n x: this.getMiddleCell(),\n y: this.getMiddleCell()\n }\n ];\n //Start snake in random direction and store inside this.direction\n let randomDirectionIndex = Math.floor(Math.random() * 4);\n this.direction = directions[randomDirectionIndex];\n }", "_moveSnakeOneStep(){\n \n let newCol,newRow;\n newRow=this._snake[0].row;\n newCol=this._snake[0].col;\n switch(this._direction){\n case \"left\" : newCol-=1; break;\n case \"right\": newCol+=1;break;\n case \"up\": newRow-=1;break;\n case \"down\" : newRow+=1;break;\n default :break;\n }\n \n if(this._checkBounds(newRow,newCol) ==-1)return;\n \n this._snake.unshift({\n row:newRow,\n col:newCol\n });\n\n let isFruit = false;\n if(newRow==this._fruit[0].row && newCol == this._fruit[0].col){\n const fruit = document.getElementById(\"fruit-id\");\n this._screen.removeChild(fruit);\n this._addFruit();\n this._score++;\n this._scoreBoard.innerHTML=\"SCORE:\"+this._score;\n isFruit=true;\n }\n if(!isFruit){\n this._snake.pop();\n const toDelet=this._snakeBodyElems.pop();\n toDelet.parentNode.removeChild(toDelet);\n }\n const newHead = document.createElement(\"div\");\n newHead.className=\"box\";\n newHead.id = \"box-id\";\n newHead.style.top=this._snake[0].row*this._boxSize+\"px\";\n newHead.style.left=this._snake[0].col*this._boxSize+\"px\";\n this._screen.append(newHead);\n this._snakeBodyElems.unshift(newHead);\n \n }", "function drawSnake()\r\n{\r\n snake.forEach(drawSnakeParts);\r\n}", "pickLocation(snake) {\n var x, y;\n do {\n // the number of columns according to the scale factor\n var cols = floor(width / scl);\n // the number of rows according to the scale factor\n var rows = floor(height / scl);\n // random column\n x = floor(random(cols));\n // random row\n y = floor(random(rows));\n // Check if the new position collides the snake\n // If yes repeat the above process again\n } while (this.checkIntersection(snake,\n x * scl,\n y * scl));\n // If no fix the new position \n this.pos = createVector(x * scl, y * scl);\n }", "constructor(x, y, size, speed) {\r\n this.x = x;\r\n this.y = y;\r\n this.size = size;\r\n this.speed = 10 * speed;\r\n }", "function calcSnakeStartLocation(game_field_size){\n const height = Math.round((game_field_size.height-1)/2);\n const width = Math.round((game_field_size.width-1)/2);\n const snake = [createBlock(height, width),\n createBlock(height, width-1),\n createBlock(height, width-2)]\n return snake\n}", "function calcSnakeStartLocation(game_field_size){\n const height = Math.round((game_field_size.height-1)/2);\n const width = Math.round((game_field_size.width-1)/2);\n const snake = [createBlock(height, width),\n createBlock(height, width-1),\n createBlock(height, width-2)]\n return snake\n}", "constructor() {\n this.snakeHead = document.createElement(`div`);//shall I write these with backtics?\n this.snakeHead.classList.add(`snake-cell`);\n board.appendChild(this.snakeHead);\n this.initialize();\n this.startingCellsNumber = 5;\n this.cellWidth = 10;\n this.snake = [this.snakeHead];\n for(let i = 1; i < this.startingCellsNumber; i++){\n const cell = document.createElement(`div`);\n cell.style.left = `${this.snakeHead.offsetLeft - (this.cellWidth * i)}px`;\n cell.classList.add(`snake-cell`);\n board.appendChild(cell);\n this.snake.push(cell);\n }\n }", "function Snake() {\n this.x = 0;\n this.y = 0;\n this.xspeed = spd;\n this.yspeed = 0;\n this.total = 0;\n this.tail = [];\n this.lives = 1;\n highscore = 0;\n message = 'go snek!';\n score = 0;\n\n\n $('#score').html('<i class=\"fa fa-circle\" aria-hidden=\"true\"></i>' + score);\n $('#highscore').html('<i class=\"fa fa-trophy\" aria-hidden=\"true\"></i>' + highscore);\n\n\n\n function sendMessage(state) {\n parent = $('#message');\n function run() {\n parent.append(\"<p>\" + message + \"</p>\");\n function animate() {\n $('p').addClass('raise');\n }\n setTimeout(animate, 1);\n }\n if (state === 'dead') {\n message = 'you died!';\n run();\n } else if (state === 'eat') {\n var eatChance;\n setEatChance = function(min, max) {\n eatChance = Math.random();\n }\n setEatChance();\n if (eatChance < 0.25) {\n message = 'ssss';\n } else if (eatChance > 0.25 && eatChance < 0.5) {\n message = 'snek snek';\n } else if (eatChance > 0.5 && eatChance < 0.75) {\n message = 'yesss';\n } else {\n message = 'tasssty';\n }\n run();\n } else if (state === 'restart') {\n message = 'go snek!';\n run();\n } else if (state === 'lostLife') {\n message = 'we lost a snek...';\n run();\n }\n };\n\n function updateHighscore() {\n console.log(highscore);\n if (score > highscore) {\n highscore = score;\n $('#highscore').html('<i class=\"fa fa-trophy\" aria-hidden=\"true\"></i>' + highscore);\n };\n };\n\n this.drawLives = function() {\n this.livesHolder = this.lives;\n $('#lives').html('<i class=\"fa fa-heart\" aria-hidden=\"true\"></i>' + this.lives);\n // for(this.livesHolder; this.livesHolder > 0; this.livesHolder--){\n // $('#lives').append('+');\n // };\n }\n this.drawLives();\n\n this.addLife = function() {\n console.log('lives:' + this.lives + ' ' + 'score' + this.total);\n if (this.total % 50 == 0) {\n this.lives++;\n this.drawLives();\n return true;\n } else {\n return false;\n }\n };\n\n this.eat = function(pos) {\n var d = dist(this.x, this.y, pos.x, pos.y);\n if (d < scl) {\n this.total++;\n score++;\n this.addLife();\n $('#score').html('<i class=\"fa fa-circle\" aria-hidden=\"true\"></i>' + score);\n spd = spd + 0.003;\n sendMessage('eat');\n updateHighscore();\n return true;\n } else {\n return false;\n }\n }\n\n this.dir = function(x, y) {\n this.xspeed = x;\n this.yspeed = y;\n }\n\n this.death = function() {\n for (var i = 0; i < this.tail.length; i++) {\n var pos = this.tail[i];\n var d = dist(this.x, this.y, pos.x, pos.y);\n if (d < 1) {\n\n if (this.lives > 1) {\n sendMessage('dead');\n this.total = 0;\n this.tail = [];\n s.dir(spd, 0);\n this.x = scl*4;\n this.y = scl*4;\n this.lives = (this.lives - 1);\n this.drawLives();\n pickLocation();\n } else {\n sendMessage('dead');\n updateHighscore();\n this.total = 0;\n this.tail = [];\n s.dir(spd, 0);\n this.x = scl*4;\n this.y = scl*4;\n this.drawLives();\n spd = 0.25;\n score = 0;\n pickLocation();\n }\n $(function() {\n $('#score').html('<i class=\"fa fa-circle\" aria-hidden=\"true\"></i>' + score);\n });\n }\n }\n }\n\n this.update = function() {\n for (var i = 0; i < this.tail.length - 1; i++) {\n this.tail[i] = this.tail[i + 1];\n }\n if (this.total >= 1) {\n this.tail[this.total - 1] = createVector(this.x, this.y);\n }\n\n this.x = this.x + this.xspeed * scl;\n this.y = this.y + this.yspeed * scl;\n\n this.x = constrain(this.x, 0, width - scl);\n this.y = constrain(this.y, 0, height - scl);\n }\n\n this.show = function() {\n fill(0, 0, 0);\n for (var i = 0; i < this.tail.length; i++) {\n rect(this.tail[i].x, this.tail[i].y, scl, scl);\n }\n rect(this.x, this.y, scl, scl);\n\n }\n}", "function snake_eat(foodObject) {\n if (foodObject.x == bodyShape[bodyShape.length - 1].x * snake_seg &&\n foodObject.y == bodyShape[bodyShape.length - 1].y * snake_seg) {\n noms.x = randomize15();\n noms.y = randomize15();\n score += 1;\n switch (direction) {\n case \"right\":\n tail = Object.assign({}, bodyShape[bodyShape.length - 1]);\n tail.x = tail.x + 1;\n tail.y = tail.y;\n bodyShape.push(tail); //adds to the head of the snake\n break;\n case \"left\":\n tail = Object.assign({}, bodyShape[bodyShape.length - 1]);\n tail.x = tail.x - 1;\n tail.y = tail.y;\n bodyShape.push(tail);\n break;\n case \"up\":\n tail = Object.assign({}, bodyShape[bodyShape.length - 1]);\n tail.x = tail.x;\n tail.y = tail.y - 1;\n bodyShape.push(tail);\n break;\n case \"down\":\n tail = Object.assign({}, bodyShape[bodyShape.length - 1]);\n tail.x = tail.x;\n tail.y = tail.y + 1;\n bodyShape.push(tail);\n break;\n default:\n break;\n };\n };\n}", "function repositionAndRedrawSnakeHead(){\n snakeHead.x += snakeHead.speedX;\n snakeHead.y += snakeHead.speedY;\n drawObject(snakeHead);\n }", "function startGame() {\r\n // let snake = document.getElementsByClassName('box')[Math.floor(Math.random()*100)];\r\n let box = document.getElementsByClassName('box');\r\n // let init = 0;\r\n // box[init].style.background=\"pink url('./Lapinpin.png') no-repeat center center / contain\";\r\n box[0].classList.toggle('image'); // NE MARCHE PAS\r\n // //let image = \"pink url('./Lapinpin.png') no-repeat center center / contain\";\r\n box[0].style.backgroundColor = \"pink\";\r\n\r\n // let snakeX = box.style.gridColumn[snakeXY[1]];\r\n // let snakeY = box.style.gridRow[snakeXY[2]];\r\n\r\n let snakeXY = [ { alive: true }, { x:1 }, {y:1} ];\r\n let container = document.getElementById('grid-container');\r\nconsole.log(container.style.gridColumn = snakeXY[1].x) // 1\r\n\r\n // box[0].style.gridColumn = snakeXY[1].x\r\n // let imageX = `${box[0]}.style.gridColumn = ${snakeXY[1].x}`; // Position selon x\r\n // console.log(imageX)\r\n // let imageY = `${box}.style.gridRow = ${snakeXY[2].y}`; // Position selon y\r\n\r\n // snakeXY[1].x += 1; // Si on incrémente x\r\n // imageX.classList.toggle('image'); // Ajoute classe avec image\r\n // snakeXY[2].y += 1; // Si on incrémente y\r\n // imageY.classList.toggle('image'); // Ajoute classe avec image\r\n\r\n\r\n function gameLoop () {\r\n let snakeAlive = snakeXY[0].alive;\r\n\r\n window.onkeydown = function(event) {\r\n\r\n setInterval(function () {\r\n// or setInterval (gameLoop, 2000) at the end of the gameLoop() function;\r\n while (snakeAlive && !event.code) {\r\n snakeXY[1].x += 1;\r\n imageX.classList.toggle('image');\r\n }\r\n\r\n if (snakeAlive && event.code) {\r\n\r\n if (event.code === \"ArrowDown\") {\r\n while(!event.code) {\r\n snakeXY[2].y += 1;\r\n imageY.classList.toggle('image');\r\n }\r\n } else if (event.code === \"ArrowUp\") {\r\n while(!event.code) {\r\n snakeXY[2].y -= 1;\r\n imageY.classList.toggle('image');\r\n }\r\n } else if (event.code === \"ArrowLeft\") {\r\n while(!event.code) {\r\n snakeXY[1].x -= 1;\r\n imageX.classList.toggle('image');\r\n }\r\n } else if (event.code === \"ArrowRight\") {\r\n while(!event.code) {\r\n snakeXY[1].x += 1;\r\n imageX.classList.toggle('image');\r\n }\r\n }\r\n\r\n } else if (!snakeAlive) {\r\n console.log(\"You lost\");\r\n }\r\n }, 2000);\r\n\r\n event.preventDefault(); // Prevents the arrow keys from scrolling the window\r\n }\r\n}\r\n gameLoop();\r\n}", "function initSnake(x, y){\n var snake = new Snake(x, y);\n snake.addNode(x+size, y);\n snake.addNode(x + (size * 2), y);\n return snake;\n }", "function update() {\n var speed = document.getElementById(\"speed\").value;\n Game.frames = Game.frames + Number(speed);\n\n // changing direction of the snake depending on which keys\n // that are pressed\n if (Game.keystate[Game.key.left] && Game.snake.direction !== Game.direction.right) {\n Game.snake.direction = Game.direction.left;\n }\n if (Game.keystate[Game.key.up] && Game.snake.direction !== Game.direction.down) {\n Game.snake.direction = Game.direction.up;\n }\n if (Game.keystate[Game.key.right] && Game.snake.direction !== Game.direction.left) {\n Game.snake.direction = Game.direction.right;\n }\n if (Game.keystate[Game.key.down] && Game.snake.direction !== Game.direction.up) {\n Game.snake.direction = Game.direction.down;\n }\n\n // each five frames update the game state.\n if (Game.frames % 8 === 0) {\n // pop the last element from the snake queue i.e. the\n // head\n var nx = Game.snake.head.x;\n var ny = Game.snake.head.y;\n\n // updates the position depending on the snake direction\n switch (Game.snake.direction) {\n case Game.direction.left:\n nx--;\n break;\n case Game.direction.up:\n ny--;\n break;\n case Game.direction.right:\n nx++;\n break;\n case Game.direction.down:\n ny++;\n break;\n }\n\n // checks all gameover conditions\n if (0 > nx || nx > Game.grid.cols - 1 ||\n 0 > ny || ny > Game.grid.rows - 1 ||\n Game.grid.get(nx, ny) === Game.gridObject.snake\n ) {\n swal(\"GAME OVER\", \"RESTART\", \"error\");\n document.getElementById(\"speed\").value = '';\n init()\n }\n\n // check wheter the new position are on the fruit item\n if (Game.grid.get(nx, ny) === Game.gridObject.food) {\n // increment the score and sets a new fruit position\n Game.score = Game.score + 4;\n Game.grid.setFood();\n } else {\n // take out the first item from the snake queue i.e\n // the tail and remove id from grid\n var tail = Game.snake.remove();\n Game.grid.set(Game.gridObject.grass, tail.x, tail.y);\n }\n\n // add a snake id at the new position and append it to\n // the snake queue\n Game.grid.set(Game.gridObject.snake, nx, ny);\n Game.snake.insert(nx, ny);\n }\n}", "function drawSnake() {\n\t// calculate tile-width and -height\n\tvar tw = canvas.width/grid.width;\n\tvar th = canvas.height/grid.height;\n\t// iterate through the grid and draw all cells\n\tfor (var x=0; x < grid.width; x++) {\n\t\tfor (var y=0; y < grid.height; y++) {\n\t\t\t// sets the fillstyle depending on the id of\n\t\t\t// each cell\n\t\t\tswitch (grid.get(x, y)) {\n\t\t\t\tcase EMPTY:\n\t\t\t\t\tctx.fillStyle = \"#fff\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase SNAKE:\n\t\t\t\t\tctx.fillStyle = \"#0ff\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase FRUIT:\n\t\t\t\t\tctx.fillStyle = \"#f00\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tctx.fillRect(x*tw, y*th, tw, th);\n\t\t}\n\t}\n\t// changes the fillstyle once more and draws the score\n\t// message to the canvas\n\tctx.fillStyle = \"#000\";\n\tctx.fillText(\"SCORE: \" + score, 10, canvas.height-10);\n}", "function drawMySnake(mySnakeBody, board) {\n mySnakeBody.forEach(element => {\n board[element.y][element.x] = 1;\n });\n }", "function update() {\n\tframes++;\n\n\t// changing direction of the snake depending on which keys\n\t// that are pressed\n\tif (keystate[KEY_LEFT] && snake.direction !== RIGHT) {\n\t\tsnake.direction = LEFT;\n\t}\n\tif (keystate[KEY_UP] && snake.direction !== DOWN) {\n\t\tsnake.direction = UP;\n\t}\n\tif (keystate[KEY_RIGHT] && snake.direction !== LEFT) {\n\t\tsnake.direction = RIGHT;\n\t}\n\tif (keystate[KEY_DOWN] && snake.direction !== UP) {\n\t\tsnake.direction = DOWN;\n\t}\n\n\t// each five frames update the game state.\n\tif (frames%5 === 0) {\n\t\t// pop the last element from the snake queue i.e. the\n\t\t// head\n\t\tvar nx = snake.last.x;\n\t\tvar ny = snake.last.y;\n\n\t\t// updates the position depending on the snake direction\n\t\tswitch (snake.direction) {\n\t\t\tcase LEFT:\n\t\t\t\tnx--;\n\t\t\t\tbreak;\n\t\t\tcase UP:\n\t\t\t\tny--;\n\t\t\t\tbreak;\n\t\t\tcase RIGHT:\n\t\t\t\tnx++;\n\t\t\t\tbreak;\n\t\t\tcase DOWN:\n\t\t\t\tny++;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// checks all gameover conditions\n\t\tif (0 > nx || nx > grid.width-1 ||\n\t\t\t0 > ny || ny > grid.height-1 ||\n\t\t\tgrid.get(nx, ny) === SNAKE\n\t\t) {\n\t\t\treturn init();\n\t\t}\n\n\t\t// check wheter the new position are on the fruit item\n\t\tif (grid.get(nx, ny) === FRUIT) {\n\t\t\t// increment the score and sets a new fruit position\n\t\t\tscore++;\n\t\t\tsetFood();\n\t\t} else {\n\t\t\t// take out the first item from the snake queue i.e\n\t\t\t// the tail and remove id from grid\n\t\t\tvar tail = snake.remove();\n\t\t\tgrid.set(EMPTY, tail.x, tail.y);\n\t\t}\n\n\t\t// add a snake id at the new position and append it to \n\t\t// the snake queue\n\t\tgrid.set(SNAKE, nx, ny);\n\t\tsnake.insert(nx, ny);\n\t}\n}", "function moveSnake(){\n\t\n\t// update the movement history of the snake so the snakeBody can follow\n\tsnakeBody[0].prevX = snakeBody[0].x;\n\tsnakeBody[0].prevY = snakeBody[0].y;\n\t\n\tif(direction == \"left\"){\t// left arrow key was pressed\t\t\n\t\tsnakeBody[0].x -= snakeSpeed;\t\t\n\t}\n\telse if(direction == \"up\"){\t// up key\t\t\n\t\tsnakeBody[0].y -= snakeSpeed;\n\t}\n\telse if(direction == \"right\"){\t// right key\t\t\n\t\tsnakeBody[0].x += snakeSpeed;\n\t}\t\t\n\telse if(direction == \"down\"){\t// down\t\t\n\t\tsnakeBody[0].y += snakeSpeed;\t\t\n\t}\t\n\t\n\tif(snakeBody.length > 1){\n\t\tmoveSnakeBody();\t\t\n\t}\n\tconsole.log(\"snakeBody[0] X: \" + snakeBody[0].x);\n\tconsole.log(\"snakeBody[0] Y: \" + snakeBody[0].y);\n}", "function addSnake() {\n playerIndex.map(index => squares[index].classList.add('snake'))\n collision()\n }", "function initSnake() {\n // This function creates a snake array of length 5\n // Note that the \"head\" of the snake is the beginning of the array, and the \"tail\" is at the end of the array\n var length = 5;\n snake_array = [];\n for (var i = length-1; i >= 0; i--) {\n var cell = {x:i, y:0};\n snake_array.push(cell);\n }\n }", "function drawSnakeHand(event){\n\t\tsnakeDrawn = true;\n\t\tlet point = canvas.getBoundingClientRect();\n\t\tlet x = event.clientX - point.left;\n\t let y = event.clientY - point.top;\n\t let ctx = canvas.getContext('2d');\n\t \tctx.fillStyle = \"gold\";\n\t ctx.beginPath();\n\t ctx.arc(x, y, pointSize, 0, Math.PI * 2, false);\n\t ctx.fill();\n\t}", "function RenderSnake(props) {\n let parts = props.body.map((part, index) => {\n return part = <SnakePart \n key = {index}\n x={props.body[index][0] + (!index ? 0 : 1)} \n y={props.body[index][1] + (!index ? 0 : 1)} \n bodyPart={!index ? \"head\" : \"body\"}/>\n });\n return(\n parts\n );\n}", "function loop() {\n requestAnimationFrame(loop);\n /*Diminuir a velocidade do Jogo*/\n if (++count < 4) {\n return;\n };\n count = 0;\n ctx.clearRect(0, 0, can.width, can.height);\n //Fundo\n ctx.fillStyle = '#363636'\n ctx.fillRect(0, 0, can.width, can.height)\n //Movendo a Cobra:\n snake.x += snake.sx;\n snake.y += snake.sy;\n //Bordas Reset\n if (snake.x < 0) {\n snake.x = can.width - grid;\n }else if (snake.x >= can.width) {\n snake.x = 0;\n };\n if (snake.y < 0) {\n snake.y = can.height;\n }else if (snake.y >= can.height) {\n snake.y = 0;\n };\n //Manter o Rastro da Cobra, Onde vai ficar a cabeça:\n snake.cells.unshift({x: snake.x, y: snake.y});\n //Apagando rastro:\n if (snake.cells.length > snake.maxCells) {\n snake.cells.pop();\n }\n //Desenhando a maçã:\n ctx.fillStyle =\"red\"\n ctx.fillRect(apple.x, apple.y, grid-1, grid-1)\n //Desenhando a bendita:\n ctx.fillStyle = \"green\"\n snake.cells.forEach(function(cell, index){\n ctx.fillRect(cell.x, cell.y, grid-1, grid-1)\n //Comeu a maçã:\n if (cell.x === apple.x && cell.y === apple.y ){\n snake.maxCells++;\n //Nova coord. Maçã:\n apple.x = randint(30, 0)*grid;\n apple.y = randint(30, 0)*grid;\n }\n //Checagem de colisão:\n for (var i = index + 1; i < snake.cells.length; i++){\n if (cell.x == snake.cells[i].x && cell.y == snake.cells[i].y){\n snake.x = 20;\n snake.y = 20;\n snake.cells = [];\n snake.maxCells = 3;\n snake.sx = grid;\n snake.sy = 0;\n\n apple.x = randint(30, 0)*grid;\n apple.y = randint(30, 0)*grid;\n //Tentativa atual\n tent ++\n //Checagem Recorde\n if (tent >= 1){\n if (rec < pont){\n rec = pont\n } \n }\n \n }\n }\n //console.log(tent)\n });\n //SCOREBOARD:\n pont = (snake.maxCells-3)\n escrever(450, 580, \"20px\", \"arial\", \"#008080\", `Pontuação: ${pont}`)\n //Recorde\n if (tent > 0) {\n escrever(450, 540, \"20px\", \"arial\", \"#F0E68C\", `Recorde: ${rec}`);\n }\n}", "moveSnake(){\r\n switch (this.snakeDirection) {\r\n case this.left:\r\n --this.snakeHeadPosition;\r\n const snakeOnLeft = this.snakeHeadPosition % this.row === this.row - 1 || this.snakeHeadPosition < 0;\r\n if (snakeOnLeft) {\r\n this.snakeHeadPosition = this.snakeHeadPosition + this.row;\r\n }\r\n break;\r\n case this.up:\r\n this.snakeHeadPosition = this.snakeHeadPosition - this.row;\r\n const snakeOnUp = this.snakeHeadPosition < 0;\r\n if (snakeOnUp) {\r\n this.snakeHeadPosition = this.snakeHeadPosition + this.containerRow;\r\n }\r\n break;\r\n case this.right:\r\n ++this.snakeHeadPosition;\r\n const snakeOnRight = this.snakeHeadPosition % this.row === 0;\r\n if (snakeOnRight) {\r\n this.snakeHeadPosition = this.snakeHeadPosition - this.row;\r\n }\r\n break;\r\n case this.down:\r\n this.snakeHeadPosition = this.snakeHeadPosition + this.row;\r\n const snakeOnDown = this.snakeHeadPosition > this.containerRow - 1;\r\n if (snakeOnDown) {\r\n this.snakeHeadPosition = this.snakeHeadPosition - this.containerRow;\r\n }\r\n break;\r\n default: break;\r\n }\r\n\r\n let nextSnakeHeadPixel = gameBoard[this.snakeHeadPosition];\r\n\r\n // if snake it bites itself:\r\n if (nextSnakeHeadPixel.classList.contains(\"snakeBodyPixel\")) {\r\n clearInterval(this.moveSnakeInterval);\r\n window.location.reload();\r\n }\r\n\r\n nextSnakeHeadPixel.classList.add(\"snakeBodyPixel\");\r\n\r\n setTimeout(() => {\r\n nextSnakeHeadPixel.classList.remove(\"snakeBodyPixel\");\r\n }, this.snakeLength);\r\n\r\n // Eat food.\r\n if (this.snakeHeadPosition === this.foodPosition) {\r\n this.snakeLength = this.snakeLength + 100;\r\n this.createFood();\r\n }\r\n }", "function init() {\n d = \"down\"; //default direction\n var wspolzedne = $(\".wspozednie2Gracza1\").html();\n\n var TablicaJsonPunktow = $(jQuery.parseJSON($(\".wspozednie2Gracza1\").html())).each(function () {\n var x = this.x;\n var y = this.y;\n });\n\n\n// if (wspolzedne==\"\" || wspolzedne==\" \")\n// {\n//\n// }\n// else\n// {\n snake_array=[];\n for (var i = TablicaJsonPunktow.length; i >= 0; i--) {\n //This will create a horizontal snake starting from the top left\n// //--------------------------------------\n\n //tu jest zero a czemu to nie wiem\n\n\n ////////------------------------\n snake_array.push(TablicaJsonPunktow[0]);\n }\n// snake_array=TablicaJsonPunktow;\n// }\n\n //create_food(); //Now we can see the food particle\n //finally lets display the score\n// score = 0;\n\n //Lets move the snake now using a timer which will trigger the paint function\n //every 60ms\n if (typeof game_loop != \"undefined\") clearInterval(game_loop);\n game_loop = setInterval(paint, 300);\n }", "function setup(){\n var cnv = createCanvas(800, 800);\n // creates columbs and rows for the snake to go in vv\n collide = false;\n score = 0\n rageMode = false;\n keyCode = 0;\n // this is for the reset of the game\n cols = width/w;\n rows = height/w;\n // There are 40 cols and 40 rows in this screen\n cnv.position((windowWidth-width)/2, 30);\n frameRate(10)\n // decreases the frameRate to slow down snake (so its not speeding around)\n background(226, 206, 231);\n snake = new Snake(createVector(width/2, height/2), createVector(20,0));\n // creation of the snake head ^^\n segments.push(createVector(width/2, height/2))\n // adding the first piece of the body to the array ^^\n food = new createFood(createVector(round(random(40))*20,round(random(40))*20));\n // creates the food ^^\n}", "function updateSnakeBoard() {\n\tfor (let r=0; r<NUM_ROWS; r++) {\n\t\tfor (let c=0; c<NUM_COLS; c++) {\n\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].classList = []; //Clear out any styling from before.\n\t\t\tif (SNAKE_BOARD_VISUAL.rows[r].cells[c].childElementCount) {\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].removeChild(SNAKE_BOARD_VISUAL.rows[r].cells[c].children[0]); //Remove the square's contents.\n\t\t\t}\n\t\t\t\n\t\t\tlet square = SNAKE_BOARD_LOGICAL[r][c];\n\t\t\t//Draw a snake body part.\n\t\t\tif (square == SNAKE_BODY) {\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].classList.add(\"snakeBody\");\n\t\t\t\tlet snakeBodyPart = document.createElement(\"div\");\n\t\t\t\tsnakeBodyPart.classList.add(\"blockCenter\");\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].appendChild(snakeBodyPart);\n\t\t\t}\n\t\t\t//Draw the snake head.\n\t\t\telse if (square == SNAKE_HEAD) {\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].classList.add(\"snakeHead\");\n\t\t\t\tlet snakeHead = document.createElement(\"div\");\n\t\t\t\tsnakeHead.classList.add(\"blockCenter\");\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].appendChild(snakeHead);\n\t\t\t}\n\t\t\t//Draw a fruit piece.\n\t\t\telse if (square == FRUIT) {\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].classList.add(\"fruit\");\n\t\t\t\tlet fruit = document.createElement(\"div\");\n\t\t\t\tfruit.classList.add(\"blockCenter\");\n\t\t\t\tSNAKE_BOARD_VISUAL.rows[r].cells[c].appendChild(fruit);\n\t\t\t}\n\t\t}\n\t}\n}" ]
[ "0.7857603", "0.7851682", "0.7689841", "0.7521107", "0.7364544", "0.7353366", "0.7319839", "0.7312836", "0.7311782", "0.72752696", "0.7188141", "0.7171225", "0.71525437", "0.71394527", "0.7114595", "0.70774966", "0.7072531", "0.70521295", "0.7047322", "0.7039275", "0.6998846", "0.6984345", "0.69826716", "0.69195855", "0.68886983", "0.6866496", "0.6843844", "0.68193823", "0.6818785", "0.6817569", "0.68086225", "0.680313", "0.67944294", "0.6788379", "0.67714995", "0.6767202", "0.6756231", "0.6750013", "0.6734836", "0.6725227", "0.6724653", "0.67177606", "0.6712742", "0.67023605", "0.6697053", "0.66916037", "0.6677136", "0.6659313", "0.663757", "0.66320884", "0.6618423", "0.65984875", "0.65953505", "0.65953505", "0.6592676", "0.6584296", "0.6566305", "0.65550214", "0.65524304", "0.6547954", "0.65413976", "0.6539438", "0.6530171", "0.65201944", "0.65198684", "0.65191036", "0.65078676", "0.65070164", "0.65000963", "0.6479729", "0.6478433", "0.64647645", "0.64586747", "0.64563984", "0.6452796", "0.64506674", "0.6450105", "0.64358294", "0.6423007", "0.6423007", "0.6416771", "0.6396203", "0.63812065", "0.63725", "0.637076", "0.6363361", "0.63614434", "0.635283", "0.6347096", "0.63467366", "0.63419324", "0.63394886", "0.63379604", "0.632512", "0.6322454", "0.6321277", "0.63194215", "0.6310706", "0.6310443", "0.6293632" ]
0.7040351
19
Load ideas and sort via date
loadedIdeas (state) { return state.loadedIdeas.sort((ideaA, ideaB) => { return ideaA.date > ideaB.date }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\treturn new Date(`${a.date} ${a.time}`) - new Date(`${b.date} ${b.time}`);\r\n\t\t});\r\n\t}", "function sortDate()\n{\n\tevents.sort( function(a,b) { if (a.startDate < b.startDate) return -1; else return 1; } );\n\tclearTable();\n\tfillEventsTable();\n}", "function sortByDate() {\n return articles.sort(function(a, b) {\n let x = new Date(a.published_at).getTime();\n let y = new Date(b.published_at).getTime();\n if (x < y){\n return -1; \n } else if (y > x){\n return 1;\n } else {\n return 0\n }\n });\n}", "sortByDueDate(){\n this.list.sort(function(a,b){\n return a.duedate - b.duedate;\n });\n $(\"#theTasks\").empty();\n this.list.forEach(function(item){\n item.addToDom();\n });\n }", "function sortDates(){\n\n\n function swap(x,y){\n let tx=dates[x];\n dates[x]=dates[y];\n dates[y]=tx;\n }\n\n for (let i=0;i<dates.length;i++){\n let m1=parseInt(dates[i].date.slice(0,dates[i].date.indexOf('.')));\n let d1=parseInt(dates[i].date.slice(dates[i].date.indexOf('.')+1,dates[i].date.indexOf('.',dates[i].date.indexOf('.')+1)));\n for (let j=i;j<dates.length;j++){\n let m2=parseInt(dates[j].date.slice(0,dates[j].date.indexOf('.')));\n let d2=parseInt(dates[j].date.slice(dates[j].date.indexOf('.')+1,dates[j].date.indexOf('.',dates[j].date.indexOf('.')+1)));\n if ((m2<m1)||m1==m2&&d2<d1){\n swap(i,j);\n m1=parseInt(dates[i].date.slice(0,dates[i].date.indexOf('.')));\n d1=parseInt(dates[i].date.slice(dates[i].date.indexOf('.')+1,dates[i].date.indexOf('.',dates[i].date.indexOf('.')+1)));\n }\n }\n }\n injectData();\n\n }", "function sortEntries() {\n entries.sort((a, b) => (new Date(a.date).getTime() - new Date(b.date).getTime()));\n}", "loadedTalks(state) {\n return state.loadedTalks.sort((talkA, talkB) => {\n return talkA.date > talkB.date\n })\n }", "sortByDate(selection = \"timed\"){\n return this.dataFromSelectionName(selection).sort((a, b) => a.date - b.date);\n }", "function sortByDate(){\n\t\t holiday.sort(function(a,b){\n\t if( parseInt(a[\"month\"],10) > parseInt(b[\"month\"],10)){\n\t return 1;\n\t }\n\t\t\t\telse if( parseInt(a[\"month\"],10) < parseInt(b[\"month\"],10) ){\n\t return -1;\n\t }\n\t\t\t\telse if( parseInt(a[\"month\"],10) == parseInt(b[\"month\"],10)){\n\t\t\t\t\t\tif( parseInt(a[\"day\"],10) > parseInt(b[\"day\"],10)){\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( parseInt(a[\"day\"],10) < parseInt(b[\"day\"],10) ){\n\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t return 0;\n\t });\n\t}", "function sortByTime() {\n onLoadFunctionForForumPosts();\n}", "function SortByDate(array) {\n return _.sortBy(array, function (item) {\n return moment(item.endDate, 'YYYY-MM-DD HH:mm:ss').format('x');\n });\n }", "filterByDate(type) {\n if (this.order === \"ASC\" && type === \"DESC\") {\n this.list = this.list.sort(this._dateDifDESC.bind(this));\n } else if (this.order === \"DESC\" && type === \"ASC\") {\n this.list = this.list.sort(this._dateDifASC.bind(this));\n }\n }", "function sort_by_date(a, b) {\n return new Date(b.date_published).getTime() - new Date(a.date_published).getTime();\n}", "function sortExercisesByDateNameRepTime(itemsFromAPI) {\n itemsFromAPI = orderArrayByObjectKey(itemsFromAPI, 'datetime', 'asc');\n var objectWithDateKey = createObjectWithDateKeyNameKeyAndArray(itemsFromAPI);\n\n // We want the exercises performed on that day to be from first to last based on\n // the first set's time so if we started the workout with pushups, but finished up\n // with a final set of pushups, pushups will still be at the top because we did them first.\n itemsFromAPI = Object.keys(objectWithDateKey).map(date => {\n /*\n * Object of exercises and sets on that day\n *\n * {\n * pushups: [1,2,3,4],\n * squats: [1,2,3],\n * pullups: [1,2]\n * }\n */\n var objectWithNameAsKey = objectWithDateKey[date];\n\n var arrayOfObjects = Object.keys(objectWithNameAsKey).map(name => {\n return {\n datetime: objectWithNameAsKey[name][0]['datetime'], // first exericse in set\n name: name,\n sets: objectWithNameAsKey[name]\n }\n });\n \n return {\n date: date,\n exercises: orderArrayByObjectKey(arrayOfObjects, 'datetime', 'asc')\n }\n });\n\n return SortingHelper.orderArrayByObjectKey(itemsFromAPI, 'date', 'desc');\n}", "function dateSort(arr) {\n return arr.sort(function(a, b) {\n return moment(b.date.published).unix() - moment(a.date.published).unix();\n })\n}", "function sortByDate(a, b){\nvar aDate = a.date;\nvar bDate = b.date; \nreturn ((aDate > bDate) ? -1 : ((aDate < bDate) ? 1 : 0));\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 sortDate(data) {\r\n const sortedDate = data.sort((a, b) => {\r\n if (sortBool)\r\n return a.date < b.date ? -1 : 1;\r\n else\r\n return a.date > b.date ? -1 : 1;\r\n });\r\n swapBool();\r\n createStockTable(sortedDate);\r\n }", "sort(events, urls, sortBy, isAscending) {\n if (sortBy === \"date\") {\n this.sortArrays(events, urls, \"startDate\", isAscending);\n } else if (sortBy === \"title\") {\n this.sortArrays(events, urls, \"name\", isAscending);\n } else if (sortBy === \"organization\") {\n this.sortArrays(events, urls, \"organization\", isAscending);\n } \n }", "sortByDate(todoList){\n let todosWithDate = [];\n let todosWithoutDate = [];\n\n todoList.map((item) => {\n if(item.todoDate !== \"\"){\n todosWithDate.push(item);\n }\n else{\n todosWithoutDate.push(item);\n }\n });\n\n todosWithDate.sort(function(a,b){\n if(a.todoDate !== \"\" && b.todoDate !== \"\"){\n let c = new Date(a.todoDate);\n let d = new Date(b.todoDate);\n return c-d;\n }\n });\n return todosWithDate.concat(todosWithoutDate);\n }", "sortData(data) {\n return data.sort((a, b) => {\n let aa = typeof a.date === \"string\" ? Date.parse(a.date) : a.date,\n bb = typeof b.date === \"string\" ? Date.parse(b.date) : b.date;\n return this.latest ? bb - aa : aa - bb;\n });\n }", "function sortByDate(tid) {\n kiddos = []\n var t = document.getElementById(\"thread_\" + tid)\n var h = document.getElementById(\"helper_\" + tid)\n if (t) {\n // fetch all elements called 'thread*' inside t\n traverseThread(t, 'thread')\n \n // sort the node array:\n // forward\n if (prefs.sortOrder == 'forward') {\n kiddos.sort(function(a, b) {\n return parseInt(b.getAttribute('epoch') - a.getAttribute('epoch'));\n })\n // backward\n } else {\n kiddos.sort(function(a, b) {\n return parseInt(a.getAttribute('epoch') - b.getAttribute('epoch'));\n })\n }\n \n // do some DOM magic, repositioning according to sort order\n for (var i in kiddos) {\n t.insertBefore(kiddos[i], t.firstChild)\n }\n }\n}", "_sortDataByDate() {\n this.data.sort(function(a, b) {\n let aa = a.Year * 12 + a.Month;\n let bb = b.Year * 12 + b.Month;\n return aa - bb;\n });\n }", "function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAccessed);\n\t\tvar date2 = Date.parse(entry2.dateAccessed);\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n console.log(\"sort mru\");\n\tentries.sort(date_sort_desc);\n}", "function sort_features(features){\n return features\n // all the newer dates, first\n .sort(function(a, b){ return b.attributes.acquisitionDate - a.attributes.acquisitionDate })\n}", "function sortByTime()\n {\n newsItems.sort(function(a,b) {return a.created_at<b.created_at});\n console.log(newsItems);\n\n addNewsListItems(); \n }", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "function sortAnnouncement() {\n\tlet numVisible = dates.length;\n\n\t// If the date is part of the current month then set as visible, if not then invisible\n\tfor\t(let j = 0; j < dates.length; j++) {\n\t\tif (dates[j].classList.contains('month_' + curMonth)) {\n\t\t\t$(dates[j]).show('slow');\n\t\t\tdates[j].classList.add('visible');\n\t\t\tnumVisible++;\n\t\t} else {\n\t\t\t$(dates[j]).hide('slow');\n\t\t\tdates[j].classList.remove('visible');\n\t\t\tnumVisible--;\n\t\t}\n\t}\n\n\t// Display note if no announcements for corresponding month\n\tif (numVisible <= 0 && (curFilter[0] == 'None' && curFilter[1] == 'None')) {\n\t\t$('#no-content').show('slow');\n\t} else {\n\t\t$('#no-content').hide('slow');\n\t}\n}", "sortTwitsByDate( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (this.dateCompare(a,b)) {\n return 1;\n }\n if (!this.dateCompare(a,b)) {\n return -1;\n }\n if (this.switchPosition == \"reversed\"){\n if (!this.dateCompare(a,b)) {\n return 1;\n }\n if (this.dateCompare(a,b)) {\n return -1;\n }\n }\n return 0;\n });\n }", "sortTasksByDate(tasks) {\n let tasksByDate = {};\n for ( let i=0; i < tasks.length; i++ ) {\n let task = tasks[i];\n let dateKey = this.date.toMysqlDate(new Date(task.start_time));\n \n if ( ! tasksByDate.hasOwnProperty(dateKey) ) {\n tasksByDate[dateKey] = [];\n }\n \n tasksByDate[dateKey].push(task);\n }\n\n return tasksByDate;\n }", "function sortByDateAscending(a, b) {\n // Dates will be cast to numbers automagically:\n return a.date - b.date;\n }", "sortFitness(response, dates) {\n let startJ = 1;\n for (var i = 0; i < response.data.length; i++) {\n let currentRide = response.data[i];\n let currentKj = response.data[i].kilojoules;\n let d = response.data[i].start_date_local.slice(0,10)+'T07:00:00Z';\n let currentRideDate = new Date(d).toString().slice(4,15);\n\n for (var j = startJ-1; j < dates.length; j++) {\n let currentDate = dates[j].formattedDate;\n if (currentRideDate === currentDate) {\n currentRide.formattedDate = currentRideDate;\n dates[j] = currentRide;\n dates[j].kilojoules = currentKj;\n break;\n }\n ++startJ;\n }\n }\n return dates;\n }", "function sortEntriesOldest(entries){\n\t// Comparison function for sort\n\tvar date_sort = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAdded);\n\t\tvar date2 = Date.parse(entry2.dateAdded);\n\t\tif (date1 > date2) return 1;\n\t\tif (date1 < date2) return -1;\n\t\treturn 0;\n\t};\n console.log(\"sort oldest!\");\n\tentries.sort(date_sort);\n}", "function sortDates() {\n sortUsingNestedDate($('#projectIndexBig'), \"span\", $(\"button.btnSortDate\").data(\"sortKey\"));\n\n //ADDING UNDERLINE CLASSES\n if ($(\"#name\").hasClass(\"underline\")) {\n $(\"#name\").removeClass(\"underline\");\n $(\"#date\").addClass(\"underline\");\n } else {\n $(\"#date\").addClass(\"underline\");\n }\n }", "function Bloglist() {\n\n let newArray = [];\n newArray = blog.sort((a, b) => b.date - a.date)\n\n\n\n return (\n <div className=\"flex flex-wrap\">\n\n {newArray.map(place => (<Blogpreview key={place.id} id={place.id} image={place.image.src} alt={place.image.alt} title={place.title} author={place.author} date={place.date}></Blogpreview>))}\n </div>\n );\n}", "filterAndSortDataByYear () {\n }", "function sortByDateAsc(a,b)\n{\n return new Date(a.createdAt) - new Date(b.createdAt)\n}", "function sortlist(ToDoArray) {\n\t\n\temptyList();\n\t\n\t//Sort the list by date\n\tToDoArray.sort(function(a, b) {\n\t\tvar temp1 = a.dueDate.split(\"-\")\n\t\tvar temp2 = b.dueDate.split(\"-\")\n\t\ta = temp1[2] + temp1[1] + temp1[0];\n \tb = temp2[2] + temp2[1] + temp2[0];\n \treturn a>b ? -1 : a<b ? 1 : 0;\n\t});\n\t\n\tToDoArray.reverse(); //reverse the order\n\n\t//Get current date:\n\tvar today = new Date();\n\tvar dd = today.getDate();\n\tvar mm = today.getMonth() + 1;\n\tvar yy = today.getFullYear();\n\n\t//Sort the list by date:\n\tfor (var i = 0; i < ToDoArray.length; i++) {\n\t\tvar temp = ToDoArray[i].dueDate.split(\"-\");\n\t\t\n\t\t//mark overdue todo's\n\t\tif (temp[2] < yy) {\n\t\t\tToDoArray[i].overDue = 1; //(true)\n\t\t} else if (temp[1] < mm && temp[2] == yy) {\n\t\t\tToDoArray[i].overDue = 1;\n\t\t} else if (temp[0] < dd && temp[1] == mm && temp[2] == yy) {\n\t\t\tToDoArray[i].overDue = 1;\n\t\t}\n\t\n\t\t//Fill the all-list\n\t\tvar allTemp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\t\t$(\"#AllList\").append(allTemp);\n\n\t\t//Fill the today-list\n\t\tif (temp[0] == dd && temp[1] == mm && temp[2] == yy) //if day, month and year matches add to the todaylist\n\t\t{\n\t\t\tvar temp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\n\t\t\t$(\"#TodayList\").append(temp);\n\t\t}\n\t\t//Fill the week-list\n\t\tif (temp[0] > dd && temp[0] < dd + 7 && temp[1] == mm && temp[2] == yy) \n\t\t{\n\t\t\tvar temp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\t\t\t\n\t\t\t$(\"#WeekList\").append(temp);\n\t\t}\n\t\t//Fill the month-list\n\t\tif (temp[1] == mm && temp[2] == yy)//if month and year matches add to the monthlist\n\t\t{\n\t\t\tvar temp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\t\t\t\n\t\t\t$(\"#MonthList\").append(temp);\n\t\t}\n\t\t\n\t\t//Dynamically add the onclick event functions for the remove buttons\n\t\tvar tempRemove = \".todoNO\" + i;\n\t\t$(tempRemove).on(\"click\", \"button\", function () {\n\t\t\tvar clickedBtnID = $(this).attr('id').replace(\"todoNO\", \"\"); //get the buttonID clicked so the correct todo can be deleted\n\t\t\tremoveTodo(ToDoArray[clickedBtnID]); //remove todo from server\n\t\t\tToDoArray.splice(clickedBtnID, 1); //remove todo from array\n\t\t\tsortlist(ToDoArray); //sort the list again\n\t\t});\n\t\t\n\t\t//Dynamically add the onclick event functions for the done buttons\n\t\tvar tempDone = \".todoDoneNO\" + i;\n\t\t$(tempDone).on(\"click\", \"button\", function () {\n\t\t\tvar clickedBtnID = $(this).attr('id').replace(\"todoDoneNO\", \"\"); //get the buttonID clicked\n\t\t\tToDoArray[clickedBtnID].done = 1; //set done field true\n\t\t\tsendTodo(ToDoArray[clickedBtnID]); //send updated todo to the server\n\t\t\tsortlist(ToDoArray); //sort the list again\n\t\t});\n\t\t\n\t\t//Dynamically add the onclick event functions for the edit buttons\n\t\tvar tempEdit = \".todoEditNO\" + i;\n\t\t$(tempEdit).on(\"click\", \"button\", function () {\n\t\t\tvar clickedBtnID = $(this).attr('id').replace(\"todoEditNO\", \"\"); //get the buttonID clicked\n\t\t\t\n\t\t\t//Fill the forms with the data of the to be edited todo\n\t\t\tvar desc = $(\"#TaskDescIn input\").val(ToDoArray[clickedBtnID].subject);\n\t\t\tvar ExInfo = $(\"#ExtraInfoIn input\").val(ToDoArray[clickedBtnID].extraInfo);\n\n\t\t\tvar da = $(\"#DateIn input\").val(ToDoArray[clickedBtnID].dueDate);\n\t\t\tvar remD = $(\"#ReminderIn input\").val(ToDoArray[clickedBtnID].reminderDate);\n\t\t\t\n\t\t\t//Set the correct priority button\n\t\t\tif(ToDoArray[clickedBtnID].priority==\"1\")\n\t\t\t{\n\t\t\t\t$(\"#Rood\").removeClass(\"down\");\n\t\t\t\t$(\"#Geel\").removeClass(\"down\");\n\t\t\t\t$(\"#Groen\").addClass(\"down\");\n\t\t\t\tprio = 1;\n\t\t\t}else if(ToDoArray[clickedBtnID].priority==\"2\")\n\t\t\t{\n\t\t\t\t$(\"#Groen\").removeClass(\"down\");\n\t\t\t\t$(\"#Rood\").removeClass(\"down\");\n\t\t\t\t$(\"#Geel\").addClass(\"down\");\n\t\t\t\tprio = 2;\t\t\t\n\t\t\t}else if(ToDoArray[clickedBtnID].priority==\"3\")\n\t\t\t{\n\t\t\t\t$(\"#Groen\").removeClass(\"down\");\n\t\t\t\t$(\"#Geel\").removeClass(\"down\");\n\t\t\t\t$(\"#Rood\").addClass(\"down\");\n\t\t\t\tprio = 3;\n\t\t\t}\n\t\t\t\n\t\t\ttempid = ToDoArray[clickedBtnID].id; //store the id of the to be edited todo\n\t\t\teditId=true; //indicates that editmode is enabled (used to keep track of right ID number)\n\t\t\t\n\t\t\tToDoArray.splice(clickedBtnID, 1); //remove todo from array\n\t\t});\n\t}\n}", "function sortEntriesNewest(entries){\n\t// Comparison function for sort\n\tvar date_sort = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAdded);\n\t\tvar date2 = Date.parse(entry2.dateAdded);\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n console.log(\"sort newest\");\n\tentries.sort(date_sort);\n}", "function sort_li(a, b) {\n console.log('in');\n an = Date.parse($(a).find('.col1').text());\n bn = Date.parse($(b).find('.col1').text());\n\n return bn < an ? 1 : -1;\n }", "function sortMapByDate(){\n let aMap1 = sortedGames;\n aMap1.sort( compareReleaseDate );\n}", "function resort(events){\n //Iterate over the events to fix Javscript Time objecs and such (also removing past events)\n for(var i = 0; i < events.length; i++){\n //Time type event\n if(events[i].type == \"time\"){\n //If the event end time is less than the current time\n if(events[i].startTime < Date.now()){\n //Remove the event\n events.splice(i,1);\n i--;\n }\n }\n //Day type event\n else if(events[i].type == \"day\"){\n //If the event's time is less than the current time and the event isn't today\n if(events[i].time < Date.now() && dateToDayString(parseStringForDate(events[i].time)) != dateToDayString(new Date())){\n //Remove the event\n events.splice(i,1);\n i--;\n }\n else{\n //Set the start time to be the time (makes for easier sorting and display)\n events[i].startTime = events[i].time;\n }\n }\n }\n\n //Add descriptions for each event and fix titles\n for(var i = 0; i < events.length; i++){\n if(events[i].desc == undefined){\n var title = events[i].title;\n var desc = title.substring(title.indexOf(\" - \")+3);\n var title = title.substring(0, title.indexOf(\" - \"));\n events[i].title = title;\n events[i].desc = desc;\n }\n }\n\n //Sorts the event by time, then by title, then by description\n events.sort(\n function(a,b){\n if(a.startTime==b.startTime){\n if(a.title == b.title){\n return a.desc.localeCompare(b.desc);\n }else{\n return a.title.localeCompare(b.title);\n }\n }\n else{\n return a.startTime>b.startTime?1:-1;\n }\n }\n );\n\n //Only take the first 15 events\n if(events.length > 25){\n events = events.slice(0,25);\n }\n //Update local storage\n localStorage.setItem(\"athleticEvents\", JSON.stringify(events));\n localStorage.setItem(\"athleticEventsRefreshTime\", Date.now());\n $scope.events = events;\n $ionicLoading.hide();\n $scope.$broadcast('scroll.refreshComplete');\n }", "componentWillMount(){\n const id = `${JSON.parse(localStorage.getItem('user'))._id}`;\n getEvidencesByUser(id)\n .then(evidencias=>{\n for(let i = 0; i < evidencias.length; i++){\n evidencias[i].created = evidencias[i].created_at.slice(0,10)\n evidencias[i].dinamica = evidencias[i].dinamica.nombreDinamica\n }\n evidencias.sort((a, b) => new Date(b.created) - new Date(a.created))\n this.setState({evidencias})\n })\n .catch(e=>console.log(e))\n }", "function orderTasks() {\n var tasks = getTasks();\n var definedDates = [];\n var undefinedDates = [];\n\n //Stores dates in defined and undefined arrays\n for (var i = 0; i < tasks.length; i++) {\n var tempArray = JSON.parse(tasks[i]);\n var tempDate = tempArray[2];\n //Stores defined dates\n if (tempDate !== \"\") {\n definedDates.push(tempArray);\n }\n //Stores undefined dates\n else {\n undefinedDates.push(tempArray);\n }\n }\n\n //Iterates through an unordered array of dated tasks\n //Finds the earliest date, pushes it to an array, then removes it and repeats\n orderedTasks = [];\n while (definedDates.length > 0) {\n var earliest = definedDates[0];\n for (i = 0; i < definedDates.length; i++) {\n tempArray = definedDates[i];\n if ((moment(tempArray[2])).isBefore(moment(earliest[2]))) {\n earliest = tempArray;\n }\n }\n orderedTasks.push(earliest);\n var index = definedDates.indexOf(earliest);\n definedDates.splice(index, 1);\n }\n\n //Adds undefined dates to the end of the array\n for (i = 0; i < undefinedDates.length; i++) {\n orderedTasks.push(undefinedDates[i]);\n }\n\n //Replaces the data in localStorage with the ordered list of tasks\n localStorage.clear();\n for (i = 0; i < orderedTasks.length; i++) {\n var task = orderedTasks[i];\n localStorage.setItem(i, JSON.stringify(task));\n }\n //Returns the array of ordered tasks\n return orderedTasks;\n }", "processSortItemsByDueDate() {\n // IF WE ARE CURRENTLY INCREASING BY STATUS SWITCH TO DECREASING\n if (window.todo.model.isCurrentItemSortCriteria(ItemSortCriteria.SORT_BY_DUE_DATE_INCREASING)) {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_DUE_DATE_DECREASING);\n } \n // ALL OTHER CASES SORT BY INCREASING\n else {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_DUE_DATE_INCREASING);\n }\n }", "function sort_li(a, b) {\n an = Date.parse($(a).find('.col2').text());\n bn = Date.parse($(b).find('.col2').text());\n\n return bn < an ? 1 : -1;\n }", "function sortTable(num){\r\n var astro = JSON.parse(localStorage.getItem('astro'));\r\n if(num === 0){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].name.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].name.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].name.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n else if(num === 1){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].surname.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].surname.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].surname.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n\r\n else if(num===2){\r\n for(var i=0; i<astro.length; i++){\r\n var dob = astro[i].dob.split('-');\r\n var index = i;\r\n for(var j=i+1; j<astro.length; j++){\r\n var bod = astro[j].dob.split('-');\r\n if(bod[0]<dob[0]){\r\n index = j;\r\n dob = bod;\r\n } else if(bod[0]==dob[0] && bod[1]<dob[1]){\r\n index = j;\r\n dob = bod;\r\n } else if(bod[0]==dob[0] && bod[1]==dob[1] && bod[2]<dob[2]){\r\n index = j;\r\n dob = bod;\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n\r\n else if(num === 3){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].power.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].power.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].power.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n console.log(astro);\r\n localStorage.setItem('astro', JSON.stringify(astro));\r\n addAstronaut();\r\n}", "function resort(events){\n //Iterate over the events to fix Javscript Time objecs and such (also removing past events)\n for(var i = 0; i < events.length; i++){\n //Time type event\n if(events[i].type == \"time\"){\n //If the event end time is less than the current time\n if(events[i].startTime < Date.now()){\n //Remove the event\n events.splice(i,1);\n i--;\n }\n }\n //Day type event\n else if(events[i].type == \"day\"){\n //If the event's time is less than the current time and the event isn't today\n if(events[i].time < Date.now() && dateToDayString(parseStringForDate(events[i].time)) != dateToDayString(new Date())){\n //Remove the event\n events.splice(i,1);\n i--;\n }\n else{\n //Set the start time to be the time (makes for easier sorting and display)\n events[i].startTime = events[i].time;\n }\n }\n }\n\n //Sorts the event by time, then by title, then by description\n events.sort(\n function(a,b){\n if(a.startTime==b.startTime){\n if(a.title == b.title){\n return a.location.localeCompare(b.location);\n }else{\n return a.title.localeCompare(b.title);\n }\n }\n else{\n return a.startTime>b.startTime?1:-1;\n }\n }\n );\n\n //Only take the first 15 events\n if(events.length > 25){\n events = events.slice(0,25);\n }\n //Update local storage\n localStorage.setItem(\"clubEvents\", JSON.stringify(events));\n localStorage.setItem(\"clubEventsRefreshTime\", Date.now());\n $scope.events = events;\n $ionicLoading.hide();\n $scope.$broadcast('scroll.refreshComplete');\n }", "function sortByReleaseDateUp() {\n arrayLivros.sort((a, b) => Date.parse(a._releaseDate) - Date.parse(b._releaseDate));\n}", "function sortByDonationDateUp() {\n arrayLivros.sort((a, b) => Date.parse(a._releaseDate) - Date.parse(b._releaseDate));\n}", "function sortingDataByDate() {\n var sortSelectValue = document.getElementById(\"sortSelect\").value;\n if (sortSelectValue ==\"newestDate\"){\n sortedByDate= allData.sort(function (a,z) { // function sort the data by date from newest to oldest \n var dateA = new Date(a.createdAt), dateZ = new Date(z.createdAt)\n return dateZ - dateA\n });\n console.log(sortedByDate)\n displayData();\n }\n else{\n sortedByDate= allData.sort(function (a,z) { // function sort the data by date from oldest to newest\n var dateA = new Date(a.createdAt), dateZ = new Date(z.createdAt)\n return dateA - dateZ\n });\n console.log(sortedByDate)\n displayData();\n }\n \n}", "function sortByReleaseDateDown() {\n arrayLivros.sort((a, b) => Date.parse(b._releaseDate) - Date.parse(a._releaseDate));\n}", "function loadByDate(sortcol) {\r\nvar sort_by = sortcol;\r\nfor (var i=0; i < data_array.length; i+=1) {\r\nvar j_var = [];\r\nfor (var j=0; j <= total_col_count; j+=1) {\r\n\r\n\r\nif (sort_by === 9) { // If sorting by date stamp\r\nif (j === sort_by) {\r\nj_var.unshift(data_array[i][j]);\r\n} else {\r\nj_var.push(data_array[i][j]);\r\n}\r\n} else { // If not sorting by date stamp\r\nj_var.push(data_array[i][j]);\r\n}\r\n\r\n} // end for j\r\nworking_array.push(j_var);\r\n} // end for i\r\nworking_array.sort();\r\nworking_array.reverse();\r\n\r\nvar tableHTML = '<table class=\"table table-hover\"><thead><tr>';\r\n\r\nvar tableHTML = '<table class=\"table table-hover table-bordered\"><thead><tr>';\r\nfor (var i=0; i < cell_title_array.length; i+=1) { // Populate table headers\r\ntableHTML += '<th>' + cell_title_array[i] + '</th>';\r\n}\r\ntableHTML += '</tr></thead><tbody>';\r\n\r\nfor (var i=0; i < working_array.length; i+=1) { // Populate default table body\r\ntableHTML += '<tr>';\r\nfor (var j=0; j < 10; j+=1) {\r\n\r\nif (sort_by === 9) { // If sorting by date stamp\r\nif (j > 0) { // excludes the time stamp from the table\r\ntableHTML += '<td>';\r\ntableHTML += working_array[i][j];\r\ntableHTML += '</td>';\r\n}\r\n} else { // If not sorting by date stamp\r\ntableHTML += '<td>';\r\ntableHTML += working_array[i][j];\r\ntableHTML += '</td>';\r\n}\r\n\r\n\r\n} // end for j\r\ntableHTML += '</tr>';\r\n}\r\ntableHTML += '</tbody></table>';\r\n\r\ndocument.getElementById('infoDiv').innerHTML = tableHTML;\r\ndocument.getElementById('description_jumbotron').style.display = 'none';\r\n\r\n\r\n} // end load by date function", "function sortNewOld()\n{\n document.getElementById(\"incomplete-tasks\").innerText = \"\";\n\n taskArr.sort(function(a,b) {return b.MDate - a.MDate});\n\n for(var i = 0; i < taskArr.length; i++) \n {\n listItem = createNewTaskElement(taskArr[i], i);\n incompletetaskList.appendChild(listItem);\n bindTaskEvents(listItem);\n }\n console.log(taskArr);\n}", "function sortByDonationDateDown() {\n arrayLivros.sort((a, b) => Date.parse(b._releaseDate) - Date.parse(a._releaseDate));\n}", "function sortByDate(filesArray) {\n filesArray.forEach(function(elem, index) {\n var months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];\n var splitt = elem.date.split('');\n elem.numDate = {\n \"day\": parseInt(splitt.slice(0,2).join('')),\n \"month\": months.indexOf(splitt.slice(2,5).join('')) + 1,\n \"year\": parseInt(splitt.slice(-4).join(''))\n\n }\n });\n filesArray.sort(function(a,b){\n var listOfCriteria = ['year', 'month', 'day'];\n var index = 0;\n return comparisonWrapper(a.numDate,b.numDate,listOfCriteria, index)\n });\n return filesArray\n}", "function sortOldNew() \n{\n document.getElementById(\"incomplete-tasks\").innerText = \"\";\n\n taskArr.sort(function(a,b) {return a.MDate - b.MDate});\n\n for(var i = 0; i < taskArr.length; i++) \n {\n //once the task list is cleared, we need to rebind the elements.\n listItem = createNewTaskElement(taskArr[i], i);\n incompletetaskList.appendChild(listItem);\n bindTaskEvents(listItem);\n }\n console.log(taskArr);\n}", "function orderEventsByDate(ev)\n{\n if (!ev)\n ev = window.event;\n ev.stopPropagation();\n\n let button = this;\n button.disabled = true; // only permit one sort\n let form = button.form;\n let idir = form.idir.value;\n\n // construct array of event rows\n let eventBody = document.getElementById('EventBody');\n let eventRows = eventBody.children;\n let birthSD = -100000000;\n let sdElement = null;\n let eventSD = -99999999;\n let idetElement = null;\n let idet = null;\n\n // some events may have a sorted date of -99999999, patch them to\n // one day after the birth, so they will not be sorted before birth\n for (let ir = 1; ir <= eventRows.length; ir++)\n {\n let orderElt = document.getElementById('EventOrder' + ir);\n orderElt.value = ir - 1;\n let changedElt = document.getElementById('EventChanged' + ir);\n changedElt.value = 1;\n }\n}", "function init(schedules){\n if(!schedules.length){\n document.getElementById(\"kiela\").innerHTML = (\"<p>Aucun horaire disponible.(</p>\")\n return false;\n }\n\n // sort by time.\n // I.e. [['start_time': 2017-01-01 10:00:00, ...], ['start_time': 2017-01-02 10:00:00, ...], ['start_time': 2017-01-03 10:00:00, ...], ...]\n schedules.sort(function(a,b){\n return new Date(a[\"start_time\"]).getTime() - new Date(b[\"start_time\"]).getTime();\n });\n\n // group by day\n let sortedByHour = _.groupBy(schedules, function(d){\n return new Date(d[\"start_time\"]);\n });\n\n // and group by hour\n let sortedByHourAndByDay = _.groupBy(sortedByHour, function(d){\n return new Date(d[0][\"start_time\"].split(\" \")[0])\n });\n /*\n Now you have something like\n [Fri Jan 11 2017 02:00:00 GMT+0200: [\n [ [0:entry_data], [1:entry_data], [2:entry_data], [3:entry_data], ... ], <= GROUP SET\n [ [0:entry_data], [1:entry_data], [2:entry_data], [3:entry_data], ... ], <= GROUP SET\n ...\n ]],\n [Stat Jan 22 2017 03:00:00 GMT+0200 : [...]],\n ...\n */\n\n // only keep the entries if we have a new group set\n // also rearrange the 'end_time' to refer to the last schedule entry\n var finalSort = []; finalSort[0] = [];\n let index = 0;\n let bigO = 0;\n for(let property in sortedByHourAndByDay){ // foreach day\n if(sortedByHourAndByDay.hasOwnProperty(property)){\n let currentGroup = [];\n let lastGroup = [];\n finalSort[bigO] = [];\n let last_group_ref = sortedByHourAndByDay[property][0]; // first element\n let ref = false;\n for(var times in sortedByHourAndByDay[property]){\n for(var grp in sortedByHourAndByDay[property][times]){\n currentGroup.push(sortedByHourAndByDay[property][times][grp][\"group_id\"]);\n }\n // \"Talk is cheap. Show me the code.\" - Linus Torvalds\n if(!currentGroup.sort().equals(lastGroup.sort())){ // do we have a different group set\n if(ref){\n for(grp in ref){\n ref[grp]['end_time'] = last_group_ref[0]['end_time']\n }\n }\n // we only keep the first element of the shift (when the shift begins)\n finalSort[bigO][index] = sortedByHourAndByDay[property][times];\n ref = finalSort[bigO][index];\n }\n index += 1;\n lastGroup = currentGroup;\n currentGroup = []; //reset current\n last_group_ref = sortedByHourAndByDay[property][times];\n }\n for(let grp in ref){\n ref[grp][\"end_time\"] = last_group_ref[0][\"end_time\"];\n }\n }\n bigO += 1;\n }\n\n /*\n So finally we have something like\n [\n [\n [0:entry_data, 1:entry_data, 2:entry_data]\n ],\n [\n [0:entry_data, 1:entry_data, 2:entry_data]\n ],\n [\n [0:entry_data,1:entry_data, 2:entry_data]\n ]\n ]\n */\n display(finalSort, document.getElementById(\"kiela\"));\n}", "function initDataTables() {\n $.extend($.fn.dataTableExt.oSort['date-de-asc'] = function(a, b) {\n a = parseDate(a);\n b = parseDate(b);\n return ((a < b) ? -1 : ((a > b) ? 1 : 0));\n },\n\n $.fn.dataTableExt.oSort['date-de-desc'] = function(a, b) {\n a = parseDate(a);\n b = parseDate(b);\n return ((a < b) ? 1 : ((a > b) ? -1 : 0));\n });\n }", "function allArticles() {\n return fs.readdirSync(articlesDir) // read directory synchronously\n .filter(file => file.endsWith('.json')) // filter for files ending in .json\n .map(file => {\n const data = fs.readFileSync($path.join(articlesDir, file));\n return JSON.parse(data);\n }) // map each file to the parsed json\n .sort((a, b) => (a.id - b.id)); // sort based on article id\n}", "function renderInOrder(currTask, dateToSort) {\n var theDate = new Date(dateToSort);\n var dateConverter = new helpers.dateNameConverter();\n var currDate = dateConverter.dayName(theDate.getDay()) + \" \" + helpers.getOrdinal(theDate.getDate()) + \" \";\n var today = new Date();\n var yesterday = new Date(today);\n yesterday.setDate(yesterday.getDate() - 1);\n currDate += dateConverter.monthName(theDate.getMonth()) + \", \" + theDate.getFullYear();\n\n today.setHours(0,0,0,0);\n theDate.setHours(0,0,0,0);\n if ( theDate.toDateString() === today.toDateString() ) {\n currDate = \"Today\";\n } else if ( theDate.toDateString() === yesterday.toDateString() ) {\n currDate = \"Yesterday\";\n }\n\n if ( !document.getElementById(currDate) ) {\n var newDateCollection = document.createElement('DIV');\n newDateCollection.className = \"container\";\n newDateCollection.id = currDate;\n newDateCollection.innerHTML += \"<h2 class=\\\"date-heading\\\">\" + currDate + \"</h1>\";\n newDateCollection.innerHTML += Handlebars.templates['batch_controller.hbs']();\n newDateCollection.innerHTML += Handlebars.templates['task.hbs'](currTask) + \"<br>\";\n document.getElementById('task-holder').appendChild(newDateCollection);\n } else if (currTask.isNew) {\n //Insert into top of current date container\n var heading = document.getElementById(currDate).getElementsByClassName('date-heading')[0].outerHTML;\n document.getElementById(currDate).innerHTML = heading + Handlebars.templates['task.hbs'](currTask) + \"<br>\" + document.getElementById(currDate).innerHTML.replace(heading, '');\n } else {\n document.getElementById(currDate).innerHTML += Handlebars.templates['task.hbs'](currTask) + \"<br>\";\n }\n}", "function compareSortDates(first, second)\n{\n return first.eventSD - second.eventSD;\n}", "async function TopologicalSort(){}", "function loadContent(date) {\n\n readAllData()\n .then(function () {\n loadGuideAreas((date === \"1\") ? guide1411 : guide1912);\n startNavigation((date === \"1\") ? bike1411 : bike1912);\n });\n}", "function parseArticles(files) {\n return files.compact().map( function(file) {\n if (!file) {\n console.error(\"parseArticles got an empty file\");\n return;\n }\n var article = processArticle(file.content);\n if (article) {\n article.path = path.join('articles',path.basename(file.filename, path.extname(file.filename)));\n return article;\n } else {\n console.error(`Couldn't parse file \"${file.filename}\"`);\n return;\n }\n }).sort(compareDates, true);\n}", "function sortSiteData( what ) {\n // sort by date\n jQuery.each(jQuery('#completeness > div'), function(index,value) {\n\t// now we can sort each site seperately\n\n\tif (what == \"similarity\") {\n\t jQuery(value).find('.part-row').sort(function(a,b) {\n\t\tvar da = 0\n\t\tjQuery.each(jQuery(a).find(\".box\"), function(index, value) {\n\t\t if ( jQuery(value).hasClass(\"ncomplete\") )\n\t\t\tda = da + 1;\n\t\t});\n\t\tvar db = 0;\n\t\tjQuery.each(jQuery(b).find(\".box\"), function(index, value) {\n\t\t if ( jQuery(value).hasClass(\"ncomplete\") )\n\t\t\tdb = db + 1;\n\t\t});\n\t\tif (da == db) {\n\t\t return 0;\n\t\t} else if (da < db) {\n\t\t return 1;\n\t\t}\n\t\treturn -1;\t\t\n\t }).appendTo(value);\t\n\t} else { // default is by date\n\t jQuery(value).find('.part-row').sort(function(a,b) {\n\t\tvar da = jQuery(a).attr('date').split(\" \")[0].split(\"-\");\n\t\tvar adate = new Date(da[0], da[1], da[2]);\n\t\tvar db = jQuery(b).attr('date').split(\" \")[0].split(\"-\");\n\t\tvar bdate = new Date(db[0], db[1], db[2]);\n\t\tif (adate.getTime() == bdate.getTime())\n\t\t return 0;\n\t\telse if (adate.getTime() < bdate.getTime()) {\n\t\t return 1;\n\t\t}\n\t\treturn -1;\n\t }).appendTo(value);\n\t}\n });\n}", "function alphabetique(){\n entrepreneurs.sort.year\n }", "function sortHelper(a, b){\n // Compare the 2 dates\n return a.start < b.start ? -1 : 1;\n}", "function sortJSON() {\n filteredObjects.sort(function(a, b) {\n var valueA, valueB;\n\n switch (sortParam) {\n // ascending by project name\n case 'asc':\n valueA = a.title.toLowerCase();\n valueB = b.title.toLowerCase();\n break;\n // newest by creation date (b and a is changed on purpose)\n case 'newest':\n valueA = new Date(b.updatedAt);\n valueB = new Date(a.updatedAt);\n break;\n }\n\n if (valueA < valueB) {\n return -1;\n } else if (valueA > valueB) {\n return 1;\n } else {\n return 0;\n }\n });\n\n //set the URL accordingly\n setURLParameter();\n}", "function sortByDateDesc(a,b)\n{\n return new Date(b.createdAt) - new Date(a.createdAt)\n}", "observe(props, state) {\n var items = new Parse.Query('Posts').ascending('date');\n return {\n items: items\n };\n }", "function sortThings( order,asc ){\r\n var things = $('#siteTable .thing').sort(function(a,b){\r\n (asc)?(A=a,B=b):(A=b,B=a);\r\n\r\n switch( order )\r\n {\r\n case 'age':\r\n var timeA = new Date( $(A).find('time:first').attr('datetime') ).getTime(),\r\n timeB = new Date( $(B).find('time:first').attr('datetime') ).getTime();\r\n return timeA - timeB;\r\n case 'score':\r\n var scoreA = $(A).find('.score:visible' ).text().match( numberRX ),\r\n scoreB = $(B).find('.score:visible' ).text().match( numberRX );\r\n return scoreA - scoreB;\r\n case 'reports':\r\n var reportsA = $(A).find('.reported-stamp').text().match( numberRX ),\r\n reportsB = $(B).find('.reported-stamp').text().match( numberRX );\r\n return reportsA - reportsB;\r\n };\r\n });\r\n $('#siteTable').empty().append( things );\r\n }", "function sorted(sheet){\n sheet.sort(masterCols.end_time+1).sort(masterCols.start_time+1).sort(masterCols.date+1);\n}", "renderTasks() {\n const { activeId, tasks } = this.props;\n\n const filteredTasks = tasks\n .filter(el => this.matchSearchTerm(el))\n .sort((a, b) => new Date(b.deadline) - new Date(a.deadline));\n\n return filteredTasks.map(task => (\n <li key={task.id}>\n <Link\n to={`/tasks/${task.id}`}\n className={activeId === task.id ? \"active\" : \"\"}\n >\n {task.deadline} {\":\"} {task.title}{\" \"}\n </Link>{\" \"}\n </li>\n ));\n }", "function sortByDueDate(list) {\n return list.sort(function(a,b) {\n return new Date(a.dueDate) - new Date(b.dueDate);\n });\n}", "function removeComingSoon() {\n sortedGames = []; \n let todayDate = new Date();\n let parseTodaysDate = Date.parse(todayDate);\n for (let i of gameList) {\n let itemDate = (i.releaseDate);\n let parseItemDate = Date.parse(i.releaseDate);\n if (!itemDate.includes(\"t.b.d\") && parseTodaysDate > parseItemDate) {\n sortedGames.push(i);\n }\n }\n sortedGamesImmutable = sortedGames;\n sortMapByScore();\n}", "function candidateSort(searchPara){\n\t$(\"#overView\").empty();\n\n\tnumberSort(searchPara);\n\n\tfor(let person of members){\n\t\toverviewCardBuilder(person);\n\t};\n\t$(\".dateBtn\").on(\"click\", function(e){\n\t\tvar tempId = Number((e.target.id).slice(6));\n\t\thearting(tempId);\n\t});\n\n\t$(\"#favorites\").empty();\n\tfor(let person of members){\n\t\tif(person.loveStatus == 1){\n\t\t\tfavCardBuilder(person);\n\t\t};\n\t};\n}", "sortedTasks(state){\n //criar uma variavel para ordernar nossas tarefas sem alterar o estado original(state)\n let sorted = state.tasks\n return sorted.sort((a,b) => {\n //se o a for menor então ele retorna para corrigir a ordenação\n if(a.name.toLowerCase() < b.name.toLowerCase()) return -1\n //mesma inversa se for o inverso da primeira situação\n if(a.name.toLowerCase() > b.name.toLowerCase()) return 1\n\n return 0\n }) \n }", "function dateSorting(column) {\n\n column.sortingAlgorithm = function(a, b) {\n var dt1 = new Date(a).getTime(),\n dt2 = new Date(b).getTime();\n return dt1 === dt2 ? 0 : (dt1 < dt2 ? -1 : 1);\n };\n }", "function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = entry1.dateAccessed;\n\t\tvar date2 = entry2.dateAccessed;\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n\n\tentries.sort(date_sort_desc);\t\n}", "sortByTag(){\n this.list.sort(function(a,b){\n return a.tag.localeCompare(b.tag);\n });\n $(\"#theTasks\").empty();\n this.list.forEach(function(item){\n item.addToDom();\n });\n }", "function sortby(picked) {\n // Based on what we picked, style spans and trigger sorting functions \n if (picked==1){$('#by-date').removeClass('sort-selected');$('#by-cat').addClass('sort-selected');catsort();}\n if (picked==0){$('#by-cat').removeClass('sort-selected');$('#by-date').addClass('sort-selected');datesort();}\n}", "function sortby(picked) {\n // Based on what we picked, style spans and trigger sorting functions \n if (picked==1){$('#by-date').removeClass('sort-selected');$('#by-cat').addClass('sort-selected');catsort();}\n if (picked==0){$('#by-cat').removeClass('sort-selected');$('#by-date').addClass('sort-selected');datesort();}\n}", "function sortByDate(caseArray){\n for (var i = 1; i < caseArray.length; i++)\n {\n for (var j = 0; j < i; j++)\n {\n if (caseArray[i].dateOfCase > caseArray[j].dateOfCase)\n {\n var temp = caseArray[i];\n caseArray[i] = caseArray[j];\n caseArray[j] = temp;\n }\n }\n }\n}", "function SP_SortDates()\n{\n Sign = new Array();\n\tSign[\"ASC\"] = \">\";\n\tSign[\"DESC\"] = \"<\";\n\t\n\tvar How = arguments[0];\n\tvar datesArry = arguments[1];\n\t\n\tfor (z=0;z<datesArry.length-1;z++) \n\t{\n\t\tfor (y=0;y<(datesArry.length-(z+1));y++) \n\t\t{\n\t\t\t\n\t\t\tif ( eval(SP_ConvertDate(datesArry[y+1])+ Sign[How] +SP_ConvertDate(datesArry[y])) ) \n\t\t\t{\n\t\t\t\ttemp=datesArry[y+1]; \n\t\t\t\tdatesArry[y+1] = datesArry[y]; \n\t\t\t\tdatesArry[y] = temp;\n\t\t\t}\n\t\t}\n\t}\n\tvar latestDate = SP_ConvertToDMY(datesArry[0]);\n\treturn latestDate;\n}", "function dates() {\n let nodes = document.getElementById('solsortEntries').children;\n for(let i = 0; i < nodes.length; ++i) {\n let node = nodes[i].children[0];\n if(node) {\n let html = node.innerHTML;\n html = html.replace(/^(20[0-9]+ [0-9]+ [0-9]+)?/, \n o => `<div class=date>${o.replace(/ /g, '-')} <br></div>`);\n node.innerHTML = html;\n }\n }\n}", "getSortedCommentsList(commentsList){\n commentsList.sort((a, b) => {\n a = new Date(a.posted);\n b = new Date(b.posted);\n return a > b ? -1 : a < b ? 1 : 0\n })\n return commentsList;\n }", "function datesort() {\n $('.categories').css('display','none');\n $('.recent').css('display','block')\n}", "static renderEntries(){\n entriesList().innerHTML = \"\"\n\n this.all = this.all.sort((a,b) => b.date.getTime() - a.date.getTime())\n\n this.all.forEach(entry => {\n entry.render()\n })\n }", "function loadPosts(all_posts, the_start, the_finish) {\n $.get(\"posts/posts.xml\", function(posts){\n $(posts).find('post').each(function() {\n all_posts.push( buildPostObj( $(this) ) );\n });\n }).complete(function() {\n // remove loading icons\n $('.fa-stack').remove();\n // build posts from start to finish\n all_posts.sort(date_sort_desc);\n buildPosts(all_posts, the_start, the_finish);\n });\n}", "getRecentPosts() {\n const path = \"/itemPostings/allPosts\";\n const apiName = \"itemPostingsCRUD\";\n const headers = {\n headers: {},\n response: true\n };\n API.get(apiName, path, headers)\n .then(response => {\n const sorted = response.data.sort((a, b) => {\n return new Date(b.timeAdded) - new Date(a.timeAdded);\n });\n this.setState({\n postsToRender: sorted.filter(post => {\n return !post.isSold && !post.isRemoved;\n })\n });\n })\n .catch(() => Alert.alert(\"error getting recent posts\"));\n }", "function sortByDateDesc(unsortedList, datePublished) {\n return unsortedList.sort(function (a, b) {\n var x = a.datePublished; var y = b.datePublished;\n return ((x > y) ? -1 : ((x < y) ? 1 : 0));\n });\n }", "componentDidMount() {\n this.setState({ isLoadingMovies: true }, () =>\n this.getMovies()\n .then(movies =>\n movies.sort(\n (a, b) => new Date(a.release_date) - new Date(b.release_date) // Sort movies by release date\n )\n )\n .then(movies => this.setState({ movies, isLoadingMovies: false }))\n .catch(error => this.setState({ error: \"Couldn't load movies\" }))\n )\n }", "function sortEntriesLRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_asc = function (entry1, entry2) {\n\t\tvar date1 = entry1.dateAccessed;\n\t\tvar date2 = entry2.dateAccessed;\n\t\tif (date1 > date2) return 1;\n\t\tif (date1 < date2) return -1;\n\t\treturn 0;\n\t};\n\n\tentries.sort(date_sort_asc);\t\n}", "function sortJson() {\r\n\t \r\n}", "componentWillMount(){\n const id = `${JSON.parse(localStorage.getItem('user'))._id}`;\n getEvidencesDesapByUser(id)\n .then(evidencias=>{\n for(let i = 0; i < evidencias.length; i++){\n evidencias[i].din = evidencias[i].dinamica.nombreDinamica\n evidencias[i].pic = evidencias[i].dinamica.imagenPremio\n evidencias[i].pic2 = evidencias[i].archivo\n evidencias[i].idd = evidencias[i].dinamica._id\n evidencias[i].created = evidencias[i].created_at.slice(0,10) \n }\n evidencias.sort((a, b) => new Date(b.created) - new Date(a.created))\n this.setState({evidencias})\n })\n .catch(e=>console.log(e))\n }", "function sorter(requests){\n return requests.sort(function(a,b){\n var c = new Date(a.updated_at);\n var d = new Date(b.updated_at);\n return d - c;\n });\n}", "function sortTable()\n{\n // snippet of code from https://stackoverflow.com/questions/8231310/convert-table-to-an-array\n // store table data into array\n var array = [];\n var headers = [];\n var i;\n \n // get table headers into array\n $('#activityTable th').each(function(index, item) {\n headers[index] = $(item).html();\n });\n\n // store table body by correct column\n $('#activityTable tr').has('td').each(function() {\n var arrayItem = {};\n $('td', $(this)).each(function(index, item) {\n arrayItem[headers[index]] = $(item).html();\n });\n array.push(arrayItem);\n });\n\n // sort array by date desc\n array.sort(function(a,b){\n return new Date(b.date) - new Date(a.date);\n });\n\n // console.log(array);\n \n // display array as table sorted by date if entries exist\n if (array[0] != null)\n {\n // only show the 10 latest activities\n if (array.length > 10)\n {\n var activityArray = [];\n for (i = 0; i < 10; i++)\n {\n activityArray[i] = array[i];\n }\n\n document.getElementById(\"sortedActivities\").style.display = \"block\";\n var sortedTable = document.getElementById(\"sortedTable\");\n generateTable(sortedTable, activityArray);\n }\n else\n {\n document.getElementById(\"sortedActivities\").style.display = \"block\";\n var sortedTable = document.getElementById(\"sortedTable\");\n generateTable(sortedTable, array);\n }\n }\n}", "function loadAgenda() {\n\n fetch('/agenda.json')\n .then(function(resp) {\n return resp.json();\n })\n .then(function(j) {\n\n agenda = j\n agendaLoaded(j)\n\n })\n}" ]
[ "0.6832631", "0.6650636", "0.66433585", "0.6356837", "0.63192093", "0.6253279", "0.6160526", "0.6139909", "0.6132411", "0.60504615", "0.59718543", "0.5956251", "0.5951221", "0.5942606", "0.59028506", "0.58874226", "0.5866099", "0.583476", "0.58347356", "0.58243227", "0.5821144", "0.5810527", "0.5783461", "0.57649964", "0.5756449", "0.5753056", "0.57520735", "0.57491463", "0.5734242", "0.5731749", "0.5704077", "0.569966", "0.5692564", "0.56892115", "0.56857914", "0.5670592", "0.56668776", "0.5663844", "0.565869", "0.56393546", "0.5631204", "0.56298554", "0.56178886", "0.5605342", "0.5597173", "0.5594673", "0.559173", "0.55587536", "0.5557129", "0.55433077", "0.5533186", "0.55313075", "0.55114466", "0.54843366", "0.5482732", "0.54634434", "0.545303", "0.54436487", "0.5420718", "0.54156756", "0.54150754", "0.54086035", "0.53979397", "0.5395", "0.53938675", "0.53883916", "0.53868115", "0.5384685", "0.53763604", "0.53704965", "0.5369334", "0.5360704", "0.5355146", "0.53540695", "0.5351782", "0.5350578", "0.53343153", "0.5313522", "0.5302682", "0.5295105", "0.5287087", "0.5285163", "0.5280406", "0.5280406", "0.52669847", "0.5262689", "0.52621835", "0.52597994", "0.5243262", "0.52344036", "0.5232512", "0.5223735", "0.52231866", "0.5207108", "0.5204576", "0.5200054", "0.5192086", "0.51905006", "0.5190333", "0.5183445" ]
0.70789427
0
Load a single Idea
loadedIdea (state) { return (ideaId) => { return state.loadedIdeas.find((idea) => { return idea.id === ideaId }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadLesson(code, explain, lessonName) {\n editorContent = code;\n name = lessonName;\n aceEditor.session.setValue(editorContent);\n\n if (explain == 'MC') {\n hasFR = false;\n hasMC = true;\n }\n else if (explain == 'Text'){\n hasFR = true;\n hasMC = false;\n }\n else {\n hasFR = true;\n hasMC = true;\n }\n}", "function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}", "function loadCode(clickedLink) {\n\n\tvar Element \t\t= document.getElementById('presentationCode');\n\n\t//console.log(\"clicked : \" + clickedLink)\n\t$(\"#presentationCode\").hide()\n\tif (( index = codeFiles.findIndex(x => x.includes(clickedLink))) != -1) {\n\t\t// randomize the query to never get the cached version of the file\n\t\t//fetch(\"/resources/code/\" + \"arrayExamples.java\" + \"?\" + performance.now())\n\t\tfetch(\"/resources/code/\" + codeFiles[index] + \"?\" + performance.now())\n\t\t\t.then(res => res.text())\n\t\t\t.then(res => escapeXml(res))\n\t\t\t.then(res => \"<pre><code>\\n\" + res + \"</pre></code>\")\n\t\t\t.then(res =>\n\t\t\t\t{\n\t\t\t\t\tElement.innerHTML \t= res\n\t\t\t\t\treturn res\n\t\t\t\t})\n\t\t\t\t.then(res => {\n\t\t\t\t\thljs.initHighlighting.called = false;\n\t\t\t\t\thljs.initHighlighting();\n\t\t\t\t\t$(\"#presentationCode\").fadeIn(1500)\n\t\t\t\t})\n\t}\n}", "function getStory(passedIdea){\n getAnIdea(passedIdea._id)\n setTravel(true)\n }", "function loadQuestion(difficulty) {\n $.getJSON('src/questions.json', function(data) { // for file location, use location relative to position of blockedSite.html\n var dataObj = JSON.parse(JSON.stringify(data));\n var question;\n var idx = getRandomIntInclusive(0, dataObj.questions_basic.length - 1);\n // maintain invariant in questions.json that each difficulty set has same # of questions\n if (difficulty == \"Basic\") {\n question = dataObj.questions_basic[idx].question;\n answer = dataObj.questions_basic[idx].answer;\n } else if (difficulty == \"Intermediate\") {\n question = dataObj.questions_intermediate[idx].question;\n answer = dataObj.questions_intermediate[idx].answer;\n } else {\n question = dataObj.questions_advanced[idx].question;\n answer = dataObj.questions_advanced[idx].answer;\n }\n $('.question').append(question);\n });\n }", "function newIdea(title, contents) {\n\tideas.doc(title)\n\t\t.set(contents)\n\t\t.catch(err => {\n\t\t\tconsole.error('ADD', err)\n\t\t});\n}", "function loadArticle(which) {\n location = whereAmI + '/article' + which;\n}", "function loadTutorial(index) {\n return $scope.tutorials[index];\n }", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "async function getIdea(req, res, next) {\n let idea;\n try {\n idea = await Idea.findById(req.params.id)\n if (idea == null) {\n return res.status(404).json({ message: 'Cannot find Idea' });\n }\n } catch (err) {\n console.log(err.message);\n return res.status(500).json({ message: err.message });\n }\n\n res.idea = idea;\n next();\n}", "load() {}", "load() {}", "function loadTask() {\n $this = $(this);\n\n // determine the type of the task\n switch ($this.attr(\"type\")) {\n case \"info\" : $(\"#INFO\").html(jsonData[0].sequences[$this.attr(\"seq\")].tasks[$this.attr(\"task\")].lines);\n break;\n case \"code\" : lines = jsonData[0].sequences[$this.attr(\"seq\")].tasks[$this.attr(\"task\")].lines;\n lineNum = 0;\n $(\"#INFO\").html(\"<div class='unmatched'>\"+lines[0] +\"</div>\");\n editor.setValue(\"\");\n break;\n\n }\n }", "function loadEditor(code) {\n\t\tvar curPos = P3_EDITOR.getCursorPosition();\n\t\tP3_EDITOR.setValue(code);\n\t\tP3_EDITOR.gotoLine(curPos.row);\n\t\tP3_EDITOR.moveCursorTo(curPos.row, curPos.column);\n\t}", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "static async getIdea(uuid){\n return read('ideas',uuid,1).then(async res => {\n const idea = firstOnly(format(res, Idea));\n if(idea) await Promise.all(idea.teamids.map(async teamid => {\n const user = await this.getTeam('', teamid).catch(() => null);\n if(user) idea.teams.push(user);\n return teamid;\n }));\n return idea;\n });\n }", "function loadByID(id){var iconConfig=config[id];return loadByURL(iconConfig.url).then(function(icon){return new Icon(icon,iconConfig);});}", "function quickLoad(articleName) {\n quickLoad_ext(articleName, function() {});\n}", "function loadAgenda() {\n\n fetch('/agenda.json')\n .then(function(resp) {\n return resp.json();\n })\n .then(function(j) {\n\n agenda = j\n agendaLoaded(j)\n\n })\n}", "function AmandaLoad() {\n\n\t// If we must show the intro scene\n\tif (!AmandaIntroDone) {\n\t\tif (CurrentCharacter != null) DialogLeave();\n\t\tSarahIntroType = \"AmandaExplore\";\n\t\tCommonSetScreen(\"Cutscene\", \"SarahIntro\");\n\t\tAmandaInside = true;\n\t\tAmandaIntroDone = true;\n\t}\n\n}", "function loadReadme() {\n if (curPage === 0) return;\n curPage = 0;\n $(\".content\").load('html/README.html');\n $(\"#title\").html(\"<b>📜 README.md</b>\");\n}", "async load () {}", "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "function loadStories() {\n require(\"../index.stories\");\n}", "load() {\r\n\r\n }", "function load()\n {\n populateMap(gameInfo.jediList);\n init();\n gameInfo.gameState = \"pickChar\";\n }", "function gLyphsLoadObjectInfo(id) {\n if(current_feature && (current_feature.id == id)) {\n gLyphsDisplayFeatureInfo(current_feature);\n return false;\n }\n\n var object = eedbGetObject(id);\n if(!object) { return false; }\n\n if(object.classname == \"Feature\") {\n gLyphsProcessFeatureSelect(object);\n }\n if(object.classname == \"Experiment\") {\n eedbDisplaySourceInfo(object);\n }\n if(object.classname == \"FeatureSource\") {\n eedbDisplaySourceInfo(object);\n }\n if(object.classname == \"Configuration\") {\n eedbDisplaySourceInfo(object);\n }\n if(object.classname == \"Assembly\") {\n eedbDisplaySourceInfo(object);\n }\n \n}", "function load_principle(){\r\n\t\tvar id = parseInt($('#triz_recommendations').val());\r\n\t\t$('#pictures').html(\"<img src='\"+url+\"app/webroot/img/triz_data/\" + id + \".JPG'></img>\");\r\n\t\t\r\n\t\t$.get(url+'app/webroot/img/triz_data/' + id + \".txt\", function(data) {\r\n\t\t $('#description').html(data);\r\n\t\t});\r\n\t\t\r\n\t\t$.get(url+'app/webroot/img/triz_data/bio_' + id + \".txt\", function(data) {\r\n\t\t $('#biological_solution').html(data);\r\n\t\t});\r\n\t\t\r\n\t\t/* Auto-Populate Solution in Morph Chart */\r\n\t\tif($(\".add_solution_form\").length){\r\n\t\t\t$(\"#MorphChartSolutionSOI\").val($(\"#triz_recommendations option:selected\").text());\r\n\t\t}\r\n\t}", "function loadArticle(){\n\tlet xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t let result = JSON.parse(this.responseText);\n\t\t document.getElementById('article').innerHTML = result.description;\n\t \t\tdocument.getElementById('article-title').innerHTML = result.title;\n\t\t}\n\t};\n\txmlhttp.open('GET', './backend/data-' + findGetParameter('id') + '.json', true);\n\txmlhttp.send();\n}", "load() {\n\n }", "function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }", "function SophieLoad() {\n\n\t// If we must show the intro scene\n\tif (!SophieIntroDone) {\n\t\tif (CurrentCharacter != null) DialogLeave();\n\t\tSarahIntroType = \"Sophie\";\n\t\tCommonSetScreen(\"Cutscene\", \"SarahIntro\");\n\t\tSophieInside = true;\n\t\tSophieIntroDone = true;\n\t}\n\n}", "load() {\n\n let _this = this;\n\n return _this.project.load()\n .then(function() {\n return _this.meta.load();\n });\n }", "getProject(projectId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/index.json\";\n console.log(\"Loading project manifest: \" + url);\n utils.loadJSON(url, done, error);\n }", "function choice1() {\r\n\tplayerStoryCode += 1;\r\n\tloadStory(storyStorageArray, playerStoryCode);\r\n}", "function readJSONFile() {\r\n return JSON.parse(fs.readFileSync(\"db.json\"))[\"ideas\"];\r\n}", "@action\n load(){\n this.book = this.service.getBook(this.id);\n this.totalPages = this.book.getTotalPages();\n this.pageNumber = 1;\n this.chapters = this.book.chapters;\n this.currentChapter = this.chapters[0];\n this.currentPage = this.currentChapter.getPageByNumber(1);\n this.isHardWordFocused = false; \n }", "function badIdea(){\n this.idea = \"bad\";\n}", "loadStory(file) {\n // if we are already loading something\n // set the desired thing to load as the new thing\n // for use when load completes.\n if (this._pending) {\n this._pending= file;\n } else {\n const { path } = file;\n let story= this.store.getStory(path);\n if (story) {\n file.story= story;\n } else {\n this._pending= file;\n this._get(path, (storyData)=>{\n if (storyData) {\n story= this.store.storeStory(path, storyData);\n file.story= story;\n const reload= this._pending;\n this._pending= false;\n this.loadStory(reload);\n }\n });\n }\n }\n }", "getIdeas() { this.props.fetchIdeas() }", "function fetchAndLoadExistingIllustration( backend, docID ) {\n /* Load the JS (or JSON?) data provided, and keep track of its original ID/slot.\n */\n storage[ backend ].loadIllustration(docID, function(response) {\n if ('data' in response) {\n var data = response.data;\n loadIllustrationData( data, {}, 'EXISTING' );\n // update last-saved info\n updateLastSavedInfo(backend, docID);\n } else {\n console.error(response.error || \"No data returned (unspecified error)!\");\n }\n });\n}", "details(context) {\r\n let {\r\n id\r\n } = context.params\r\n\r\n models.Ideas.getSingle(id)\r\n .then((res) => {\r\n let currentIdea = docModifier(res)\r\n context.idea = currentIdea\r\n console.log(context.idea)\r\n //Check for author of cause! \r\n if (currentIdea.uid !== localStorage.getItem('userId')) {\r\n context.isAuthor = false;\r\n } else {\r\n context.isAuthor = true;\r\n }\r\n\r\n extend(context).then(function () {\r\n this.partial('../templates/cause/details.hbs')\r\n })\r\n })\r\n .catch((err) => console.error(err))\r\n }", "function load_about() {\n\t\tvar about_card = new UI.Card({\n\t\t\tbody: 'WMATA With You\\n' +\n\t\t\t\t'version 2.5\\n' +\n\t\t\t\t'by Alex Lindeman\\n\\n' +\n\t\t\t\t'Built with Pebble.js and the WMATA API.',\n\t\t\tscrollable: true\n\t\t});\n\t\tabout_card.show();\n\t}", "function loadForPath(path, id, onComplete, args){\r\n function loadForId(id, Path){\r\n var url = args.getUrl(Path?Path:path, id);\r\n if(loadedUrls[url]){\r\n onComplete(Path?Path:path, id);\r\n }else{\r\n loadScript(url, function(err){\r\n if(err){\r\n var newPath = replacePath(Path?Path:path);\r\n if(newPath !== (Path?Path:path)){\r\n loadForId(id, newPath);\r\n }else{\r\n if(args.degrade){\r\n id = args.degrade(id);\r\n if(id){\r\n loadForId(id);\r\n return;\r\n }\r\n }\r\n onComplete(path, id, err); \r\n }\r\n\r\n }else{\r\n loadedUrls[url] = 1;\r\n //FIXME (by eddy.zeng) temporary change, since we're using require.js in jsonp, \r\n //delay call callback to make sure jsonp content evaluated before trying to get language content from setting map.\r\n setTimeout(function() {\r\n onComplete(Path?Path:path, id);\r\n }, 4);\r\n }\r\n });\r\n }\r\n }\r\n loadForId(id);\r\n }", "async load( path ) {\n return false;\n }", "function load_teams(){ //Load the Teams list to the teams object\n\tvar teams = require(\"./prof_walnut/teams.json\");\n}", "function loadAboutMe() {\n _D(\"Load about me file...\");\n\n /* Load About.md into HTML */\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n var src = xhr.responseText;\n \n var converter = new Showdown.converter();\n var cvt = converter.makeHtml(src);\n $(\".markdown-body\").append(cvt);\n $(\".markdown-body a\").each(function(i,v){\n $(v).attr('target', '_blank');\n });\n }\n }\n xhr.open(\"GET\", \"/About.md\", false);\n xhr.send();\n}", "function load()\n{\n dashcode.setupParts();\n loadVersionString();\n loadUserAppKey();\n}", "function IDE(name) {\n this.name = name;\n}", "loadProject(projectId) {\n this.models._loadProject(projectId);\n }", "function LoadInteractions() {\n\tReadCSV(\"CurrentIntro\", CurrentChapter, CurrentScreen, \"Intro\", GetWorkingLanguage());\n\tReadCSV(\"CurrentStage\", CurrentChapter, CurrentScreen, \"Stage\", GetWorkingLanguage());\n\tLoadText();\n}", "function load(index) {\n return loadInternal(getLView(), index);\n}", "function load(index) {\n return loadInternal(getLView(), index);\n}", "function findById(id) {\n\n id = parseInt(id)\n\n if (!exercises.has(id))\n throw new Error(`No entity by id: ${id}`)\n\n return exercises.get(id)\n}", "async function fetch() {\n const html = await getValue(\"introductionHtml\");\n setIntroHtml(html);\n }", "function load(index){return loadInternal(getLView(),index);}", "function loadStories() {\n require('../app/components/avatars/avatars.stories');\n require('../app/components/loading.stories');\n}", "static loadDocs() {\n try {\n HelpGenerator.docs = yaml.load(fs.readFileSync('./help.yaml', 'utf8'));\n } catch (e) {\n console.error(`[HelpGenerator] ${e}`);\n }\n }", "async function get(req, res, next) {\n try {\n // gather data\n const { id } = req.params;\n\n // read the idea from database\n const idea = await models.idea.read(id);\n\n if (!idea) return res.status(404).json({ });\n\n // serialize the idea (JSON API)\n const serializedIdea = serialize.idea(idea);\n\n // respond\n return res.status(200).json(serializedIdea);\n\n } catch (e) {\n return next(e);\n }\n}", "function loadExercise(concept_id,exercise_id) {\n if(fireworks){\n stopFireWorks();\n }\n currentExerciseId = parseInt(exercise_id);\n currentConceptId = parseInt(concept_id);\n for(var i=0; i<exercises.length;i++){\n if (exercises[i].concept_id == currentConceptId && exercises[i].exercise_id == currentExerciseId) {\n document.getElementById(\"Exercise\").innerHTML = exercises[i].exerciseDetails;\n if(gameLoaded){\n updateGame(exercises[i].array_length);\n } else {\n initGame(exercises[i].array_length);\n }\n }\n }\n if(coordinates){\n toggleCoordinates(0);\n }\n}", "function addAside() {\r\n const contentsSrc = 'MasterPage/aside_contents.txt';\r\n if (document.getElementById) {\r\n let aside = document.getElementById('aside');\r\n if (aside) {\r\n let pathPrefix = relativePath();\r\n let asideContents = readContents(pathPrefix + contentsSrc);\r\n if (asideContents) {\r\n asideContents = asideContents.replace('{{imageUrlPrefix}}'\r\n\t\t , pathPrefix);\t \r\n placeInOuterHtml(aside, asideContents);\r\n }\r\n }\r\n } \r\n}", "findQuiz(quizDetails){\r\n try{\r\n let data = fs.readFileSync(`quizzes/${quizDetails.cat}/${quizDetails.title}.json`);\r\n let quizObj = JSON.parse(data);\r\n let newQuizObj = this.initQuizObj(quizObj);\r\n newQuizObj.showQuizMenu();\r\n }catch(err){\r\n if(err.code == \"ENOENT\"){\r\n misc.output(\"Sorry, something went wrong, file can't be found. Please try again\");\r\n this.toMainPage();\r\n }\r\n }\r\n }", "function loadLesson(req, res){\n let jsonLocation = `client/topics/${req.query.id}/lesson.json`;\n let jsonFile = JSON.parse(fs.readFileSync(jsonLocation, 'utf8'));\n res.json(jsonFile);\n}", "function getAnyIdea() {\n return new Promise((res, rej) => {\n getIdeas().then((ideas) => {\n //stop being lazy...\n res(shuffle(ideas)[0]);\n })\n })\n}", "function load() {\r\n\r\n\r\n fetch('zooland.json')\r\n .then(function(result){\r\n return result.json();\r\n })\r\n .then(function(data){\r\n createZooland(data);\r\n });\r\n}", "function load()\n{\n setupParts();\n\tbgn();\n}", "function loadChaplainImage() {\n\tgetWikiImage($(\"#chaplain-name\").text());\n}", "async load(id, options) {\n\t\t\tconst entity = await this.sceneDynamicLoader.load(id, options);\n\t\t\tthis.loadedEntities.push(entity);\n\t\t\treturn entity;\n\t\t}", "create (context, ideaPersistenceData) {\n return ideaAdapter.createIdea(ideaPersistenceData)\n }", "function load (req, res, next, id) {\n Project.findOne({ id })\n .then((Project) => {\n req.Project = Project; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}", "function loadProject(ProjectTypeId) {\n // finding the projectType needed\n let projectType = null;\n for (let index = 0; index < projects.length; index++) {\n //if found save it\n if (projects[index][0] == ProjectTypeId) {\n projectType = projects[index];\n }\n\n }\n //if not found return error\n if (projectType == null) {\n console.log(\"Error: Project type not found\");\n return 1;\n }\n\n //check if there is no other project of this type then return an error (funny one)\n if (projectType.length <= 1) {\n //special entry in the project array for such cases\n showProject(projects[0][1]);\n projectContent.setAttribute(\"project\", projects[0][0]);\n projectContent.setAttribute(\"index\", 1);\n } else {\n\n projectContent.setAttribute(\"project\", projectType[0]);\n projectContent.setAttribute(\"index\", 1);\n showProject(projectType[1]);\n }\n\n}", "function loadGithub(GH, UI) {\n var data = GH.parse(UI);\n loadGithubtoScript(UI, data,\n function(result){\n data = GH.parseurl(result['path']);\n $(UI.URL_INPUT).val(GH.createurl(data))\n UI.showshareurl(data);\n UI.seteditor(maincontent);\n UI.clearselect();\n });\n \n }", "loadEntity(itemId) {\n\n }", "function loadConfEditor(e) {\n readSingleFile(e, (contents) => {\n editor.session.setValue(contents);\n })\n}", "function load(req, res, next, id) {\r\n keystone.list('Home').model.findById(id).populate('slides')\r\n .then((home) => {\r\n req.home = home;\r\n return next();\r\n })\r\n .catch(e => next(e));\r\n}", "loadProject({ commit }, data) {\n return new Promise((resolve, reject) => {\n ProjectsAPI.getProject(data.split(\"+\")[0], data.split(\"+\")[1])\n .then(response => {\n commit(\"setProject\", response.data);\n commit(\"setProjectBlocks\", response.data.blocks);\n resolve();\n })\n .catch(err => {\n commit(\"setProject\", {});\n reject(err);\n });\n });\n }", "function loadGithub(GH, UI) {\n var data = GH.parse(UI);\n loadGithubtoScript(UI, data,\n function(result) {\n data = GH.parseurl(result['path']);\n $(UI.URL_INPUT).val(GH.createurl(data));\n UI.showshareurl(data);\n UI.seteditor(maincontent);\n UI.clearselect();\n });\n\n }", "function loadGithub(GH, UI) {\n var data = GH.parse(UI);\n loadGithubtoScript(UI, data,\n function(result) {\n data = GH.parseurl(result['path']);\n $(UI.URL_INPUT).val(GH.createurl(data));\n UI.showshareurl(data);\n UI.seteditor(maincontent);\n UI.clearselect();\n });\n\n }", "async function loadReadme(url) {\n\turl = url || `./README.md`;\n\tconst res = await fetch(url);\n\tconst data = await res.text();\n\treturn data;\n}", "fetch() {\n let editor\n // to check get the reference of active editor in atom\n if (editor = atom.workspace.getActiveTextEditor()) {\n // static url to call\n let selection = \"https://acadstaging.com/py/api/student/projects/objectives?projectStudentId=1522\";\n // call to download function to get the objectives from api\n this.download(selection).then( apiResponse => {\n console.log(\"api call successful\");\n // call the method to display the result\n this.showResult(apiResponse).then( viewResponse => {\n console.log(\"back to functionality\");\n });\n }).catch( error => {\n // if error in response display the error message on the modal\n atom.notifications.addWarning(error.reason);\n });\n // call the function to track user movement\n this.trackUser();\n /////////////////////////////////////////TESTING CODE//////////////////////////////////////////////////////////\n // on add new file and delete a file or change a file\n this.trackProject();\n }\n }", "function uLoad(inp)\n{\n // init browser information\n uInitBrowser();\n // indicate applet use\n uUseApplets = true;\n if (!uJavaEnabled(\"syntax\"))\n {\n uUseApplets = false;\n uLastClick = true;\n }\n}", "function load() {\n m_data.load(APP_ASSETS_PATH + \"ded_moroz_06.json\", load_cb, preloader_cb);\n}", "loadIdeasCreatedBy(userURI) {\n\t\treturn (params) => {\n\t \t\tconsole.log(\"loading ideas created by user=\"+userURI)\n\t\t var url = conf.url.base + conf.url.findCreatedBy + \"?status=IDEA&user=\" + userURI\n\t\t return sendAjaxRequest(url, params)\n\t\t}\n\t}", "function loadBible(path) {\n \t\t$$invalidate(4, loadingBible = true);\n \t\tconsole.log('Loading Bible', path);\n \t\tlet request = new XMLHttpRequest();\n \t\trequest.open('GET', path);\n \t\trequest.responseType = 'json';\n \t\trequest.send();\n\n \t\trequest.onload = function () {\n \t\t\t$$invalidate(26, books = request.response.books || []);\n\n \t\t\tfor (let i = 0; i < books.length; i++) {\n \t\t\t\t$$invalidate(26, books[i].index = i, books);\n \t\t\t\t$$invalidate(27, booksByAbbr[books[i].abbreviation] = books[i], booksByAbbr);\n \t\t\t}\n\n \t\t\t/* Redraw */\n \t\t\t$$invalidate(1, lastAddresses);\n\n \t\t\t$$invalidate(4, loadingBible = false);\n \t\t};\n \t}", "static load(gameInstance) {}", "function load() {\n var p_cb = PRELOADING ? preloader_callback : null;\n m_data.load(\"dalena_web.json\", load_cb, p_cb, !true);\n}", "function preload(){\r\n poop = loadJSON(\"hi.json\");\r\n}", "function load_extension() {\n Jupyter.notebook.config.loaded.then(initialize); // trigger loading config parameters\n\n //$.getJSON(\"https://single-cell-codesnippets.firebaseio.com/.json\", function(data) {\n //$.getJSON(Jupyter.notebook.base_url+\"nbextensions/snippets/snippets.json\", function(data) {\n $.getJSON(Jupyter.notebook.base_url+\"nbextensions/snippets/snippets.json\", function(data) {\n // Add the header as the top option, does nothing on click\n var option = $(\"<option></option>\")\n .attr(\"id\", \"snippet_header\")\n .text(\"Snippets\");\n $(\"select#snippet_picker\").append(option);\n\n // Add options for each code snippet in the snippets.json file\n $.each(data['snippets'], function(key, snippet) {\n var option = $(\"<option></option>\")\n .attr(\"value\", snippet['name'])\n .text(snippet['name'])\n .attr(\"code\", snippet['code']);//.join('\\n'));\n $(\"select#snippet_picker\").append(option);\n });\n })\n .error(function(jqXHR, textStatus, errorThrown) {\n // Add an error message if the JSON fails to load\n var option = $(\"<option></option>\")\n .attr(\"value\", 'ERROR')\n .text('Error: failed to load snippets!')\n .attr(\"code\", \"\");\n $(\"select#snippet_picker\").append(option);\n });\n\n }", "function load(type) {\n // dna location\n var source = \"turtles/\" + type + \"/dna.js\";\n log.info(\"TURTLES - Load DNA (\"+ source+ \")\");\n\n $.ajax({\n url : source,\n dataType : \"script\",\n async : false, // prevent duplicate javascript file loading\n error : function() {\n log.error(\"TURTLES - Unable to load DNA: \" + type);\n }\n });\n }", "function reference(index){var contextLView=getContextLView();return loadInternal(contextLView,index);}", "function loadExample(element) {\n // var url = element.getAttribute('data-source');\n // var request = new XMLHttpRequest();\n // request.open('GET', url);\n // request.responseType = 'text';\n //\n // request.onload = function () {\n // txtCodeInput.value = request.response;\n // txtCodeInput.disabled = false;\n // btnRunProgram.disabled = false;\n // };\n //\n // txtCodeInput.value = 'Loading from ' + url;\n // txtCodeInput.disabled = true;\n // btnRunProgram.disabled = true;\n // request.send();\n}", "function load_description(_description, _cuisine, menu_src) {\n cuisines.innerHTML = _cuisine;\n description.innerHTML = '';\n let p = document.createElement('p');\n p.innerHTML = _description;\n\n let iframe;\n if (menu_src) {\n iframe = document.createElement('iframe');\n iframe.src = menu_src;\n } else {\n iframe = document.createElement('h1');\n iframe.innerHTML = \"No menu available for this eatery\";\n }\n \n let menu_link = document.createElement('a');\n menu_link.innerHTML = 'view menu';\n menu_link.className = 'menu-link';\n menu_link.onclick = () => {\n menu_section.innerHTML = ''\n menu_section.appendChild(iframe)\n menu_section.style.display = 'inline';\n }\n description.appendChild(p)\n description.appendChild(menu_link)\n}", "function loadData() {\n $.getJSON(\"../Mini-project-2-data.json\", function(json) {\n console.log(json); // this will show the info it in firebug console\n });\n}", "showEditor(path, selection) {\n if (!path) path = store.file?.path\n // TODO: selection!!!!\n try {\n navigate(new SpellLocation(path).editorUrl)\n store.compileApp()\n } catch (e) {\n store.showError(`Path '${path}' is invalid!`)\n }\n }", "static loadPlaygroundSelector() {\n if (this._isLoaded(\"playground_selector\"))\n return\n\n let game = this.game\n let manager = new PlaygroundManager(this.game)\n let types = manager.getTypes()\n\n for (let type of types)\n game.load.spritesheet(\"menu_playground_\" + type, \"./assets/menu/images/playground_\" + type + \".png?__version__\", 200, 125);\n\n game.load.image('menu_playground_left', './assets/menu/images/left.png?__version__')\n game.load.image('menu_playground_right', './assets/menu/images/right.png?__version__')\n game.load.audio(\"menu_playground_change\", \"./assets/menu/sounds/change.mp3?__version__\");\n }", "async showRunner(path) {\n if (!path) path = store.file?.path\n try {\n await navigate(new SpellLocation(path).runnerUrl)\n store.compileApp()\n } catch (e) {\n store.showError(`Path '${path}' is invalid!`)\n }\n }", "async loadDocument(uri) {\n let languageId = path.extname(uri).slice(1).toLowerCase();\n let document = null;\n try {\n let text = (await fs.readFile(vscode_uri_1.URI.parse(uri).fsPath)).toString('utf8');\n // Very low resource usage for creating one document.\n document = vscode_languageserver_textdocument_1.TextDocument.create(uri, languageId, 1, text);\n }\n catch (err) {\n console.error(err);\n }\n return document;\n }" ]
[ "0.598769", "0.5798676", "0.5605602", "0.5581258", "0.54764676", "0.5437277", "0.5412659", "0.54113364", "0.54056776", "0.54056776", "0.54056776", "0.53901833", "0.537309", "0.537309", "0.5370729", "0.53534114", "0.53517485", "0.5341711", "0.53172183", "0.531273", "0.5217019", "0.5212832", "0.5167256", "0.51592916", "0.5158157", "0.5158157", "0.51256603", "0.51205677", "0.5119495", "0.5110643", "0.5087086", "0.50346404", "0.50295115", "0.5029376", "0.5001023", "0.49970913", "0.4991929", "0.49708754", "0.49525216", "0.49504203", "0.4936437", "0.49260277", "0.49223503", "0.49202558", "0.49187794", "0.4915662", "0.49090505", "0.49028262", "0.48914212", "0.4880065", "0.48767257", "0.48552948", "0.4846542", "0.48422647", "0.48411107", "0.48411107", "0.4833937", "0.48324406", "0.4815218", "0.481141", "0.48103443", "0.4803761", "0.4797013", "0.47880906", "0.47848934", "0.4780584", "0.47785297", "0.47758636", "0.4774657", "0.47665933", "0.47635314", "0.4757936", "0.47566867", "0.47557214", "0.475439", "0.4741238", "0.47399673", "0.47368467", "0.4734329", "0.47286353", "0.47286353", "0.47254077", "0.47222444", "0.47128278", "0.47114837", "0.47029057", "0.47007102", "0.4699408", "0.46965793", "0.46949747", "0.469387", "0.46900713", "0.46852863", "0.46838018", "0.4677589", "0.46774006", "0.46743816", "0.46730018", "0.46695068", "0.46689025" ]
0.62003535
0
Check an overlap between a sprite object & a physics group Temporary hack will need reimplementing
function checkOverlap(spriteA, spriteB) { var overlapping = 0; try { for (var i = 0; i < spriteB.children.entries.length; i++) { var boundsA = spriteA.getBounds(); var boundsB = spriteB.children.entries[i].getBounds(); if (Phaser.Geom.Rectangle.Intersection(boundsA, boundsB).width > 0) { overlapping = 1; break; } } return overlapping; } catch (e) { console.log(e); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "function checkOverlap(spriteA, spriteB) {\r\n var boundsA = spriteA.getBounds();\r\n var boundsB = spriteB.getBounds();\r\n return Phaser.Geom.Intersects.RectangleToRectangle(boundsA, boundsB);\r\n}", "function overlap(actor1,actor2){\n return actor1.pos.x+actor1.size.x > actor2.pos.x &&\n actor1.pos.x < actor2.pos.x + actor2.size.x &&\n actor1.pos.y + actor1.size.y > actor2.pos.y &&\n actor1.pos.y<actor2.pos.y + actor2.size.y;\n }", "function collidesWith( a, b )\n{\n return a.bottom > b.top && a.top < b.bottom;\n}", "function checkOverlap(spriteA, spriteB) {\n var boundsA = spriteA.getBounds();\n var boundsB = spriteB.getBounds();\n return Phaser.Rectangle.intersects(boundsA, boundsB);\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 checkOverlap(spriteA, spriteB) {\n\tvar boundsA = spriteA.getBounds();\n \tvar boundsB = spriteB.getBounds();\n\treturn Phaser.Rectangle.intersects(boundsA, boundsB);\n}", "intersects(bounds) {\n // Some size & offset adjustments to allow passage with bigger icon\n return this.sprite.offsetLeft + this.sprite.clientWidth - 20 > bounds.x\n && this.sprite.offsetLeft + 10 < bounds.x + bounds.width\n && this.sprite.offsetTop + this.sprite.clientHeight - 20 > bounds.y\n && this.sprite.offsetTop + 10 < bounds.y + bounds.height;\n }", "function collideGroup(obj,group) {\n for (var i in gbox._objects[group])\n if ((!gbox._objects[group][i].initialize)&&gbox.collides(obj,gbox._objects[group][i]))\n if (gbox._objects[group][i] != obj) return gbox._objects[group][i];\n return false;\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 overlap(obj1, obj2) {\n var right1 = obj1.x + obj1.width;\n var right2 = obj2.x + obj2.width;\n var left1 = obj1.x;\n var left2 = obj2.x;\n var top1 = obj1.y;\n var top2 = obj2.y;\n var bottom1 = obj1.y + obj1.height;\n var bottom2 = obj2.y + obj2.height;\n\n if (left1 < right2 && left2 < right1 && top1 < bottom2 && top2 < bottom1) {\n return true;\n }\n return false;\n }", "function checkOverlap(spriteA, spriteB) {\n\t\t\n\t\tvar boundsA = spriteA.getBounds();\n\t\tvar boundsB = spriteB.getBounds();\n\t\n\t\treturn Phaser.Rectangle.intersects(boundsA, boundsB);\n\t\n\t}", "overlap (ob) {\n\t\treturn (dist(this.position, ob.position) < 50);\n\t}", "function update() {\n game.physics.arcade.overlap(player, pipes, game_over);\n}", "checkPlayersOverlapping() {\n // if no power-up is on the screen, abort\n if (this.powerup == null)\n return;\n\n for (let player of this.players)\n this.game.physics.arcade.overlap(player, this.powerup, this._take, null, this)\n }", "collides(obj) {\n const isColliding = super.collides(obj);\n if (isColliding === true) {\n // if it collides\n game.obstacleSound.play(); // play the sound\n }\n return isColliding;\n }", "collides(obj) {\n const isColliding = super.collides(obj);\n if (isColliding === true) {\n // if it collides\n game.obstacleSound.play(); // play the sound\n }\n return isColliding;\n }", "collide(oth) {\n return this.right > oth.left && this.left < oth.right && this.top < oth.bottom && this.bottom > oth.top\n }", "function objectsOverlap(obj1, obj2){\n let obj1_b = obj1['boundingBox'];\n let obj2_b = obj2['boundingBox'];\n\n if(!obj1_b || !obj2_b)//one of the two objs has no bounding box\n return 0;\n\n //first consider the case in which the overlap is not possible, so the result is 0\n if(obj1_b['br']['x'] < obj2_b['bl']['x'] || obj1_b['bl']['x'] > obj2_b['br']['x'])//considering x\n // when the gFaceRect finished before the start of azure one (or the opposite)\n return 0;\n\n else if(obj1_b['bl']['y'] < obj2_b['tl']['y'] || obj1_b['tl']['y'] > obj2_b['bl']['y'])//considering y\n // when the gFaceRect finished before the start of azure one (or the opposite)\n return 0;\n\n else{ //there is an overlap\n\n // remind that\n // - x goes from 0 -> N (left -> right)\n // - y goes from 0 -> N (top -> bottom)\n let xc1 = Math.max(obj1_b['bl']['x'], obj2_b['bl']['x']);\n let xc2 = Math.min(obj1_b['br']['x'], obj2_b['br']['x']);\n let yc1 = Math.max(obj1_b['bl']['y'], obj2_b['bl']['y']);\n let yc2 = Math.min(obj1_b['tl']['y'], obj2_b['tl']['y']);\n let xg1 = obj1_b['bl']['x'];\n let xg2 = obj1_b['br']['x'];\n let yg1 = obj1_b['bl']['y'];\n let yg2 = obj1_b['tl']['y'];\n\n let areaO = (xc2-xc1) * (yc2 - yc1); //area covered by the overlapping\n let areaI = (xg2-xg1) * (yg2 - yg1); //area covered by the first bounding box\n\n return areaO/areaI;\n }\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 }", "collision() {\n return this.sprite.overlap(player.sprite) && this.colour == player.colour;\n }", "checkCollisions(position) {\n\n // AABB collision\n function checkCollision(obj1, obj2) {\n // TODO: remove these magic numbers\n // obj1 is the player and obj2 are the blocks\n let w1 = 32;\n let h1 = 40;\n let w2 = 32;\n let h2 = 32;\n let collideX = obj1.x < obj2.x + w2 && obj1.x + w1 > obj2.x;\n let collideY = obj1.y < obj2.y + h2 && obj1.y + h1 > obj2.y;\n return collideX && collideY;\n }\n\n // some fancy ES6 to get the objects that aren't the player\n let notPlayer = objects.filter(o => o.sprite !== \"player\");\n for(let o of notPlayer) {\n if(checkCollision(position, o.location)) {\n // if we collide return what we collided with\n return o;\n }\n }\n\n // otherwise return null\n return null;\n }", "function update() {\n // Call gameOver function when player overlaps with any pipe\n game.physics.arcade.overlap(player, pipes, gameOver);\n }", "function update() {\n game.physics.arcade.overlap(\n player,\n pipes,\n gameOver);\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 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 }", "collision(ptl, pbr) {//player dimensions\n //add the x first\n if(this.taken){ return false;}\n if ((ptl.x <this.bottomRight.x && pbr.x > this.pos.x) &&( ptl.y < this.bottomRight.y && pbr.y > this.pos.y)) {\n this.taken = true;\n return true;\n }\n return false;\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}", "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}", "isGameObjectCollidingWithSkier(object) {\n\t\tif (!this.collisionsEnabled) return false;\n\t\tlet rect1 = this.skier.hitbox;\n\t\tlet rect2 = { x: object.x + object.hbXOffset, y: object.y + object.hbYOffset, width: object.hbWidth, height: object.hbHeight };\n\t\treturn this.util.areRectanglesColliding(rect1, rect2);\n\t}", "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}", "collides(objectId, rect) {\n for (const id of Object.keys(this.objects)) {\n if (id === objectId) {\n continue;\n }\n const other = this.object(id);\n if (other.rect.collides(rect)) {\n return id;\n }\n }\n\n if (this.bg.collides(rect.coords, rect.bounds)) {\n return 'bg';\n }\n\n return false;\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}", "AABBops(type, target, callback) {\n\t\t\t\tif (callback !== undefined && typeof callback != 'function') {\n\t\t\t\t\tthrow new TypeError('The callback that runs if sprites ' + type + ' must be a function');\n\t\t\t\t}\n\n\t\t\t\t// don't check this sprite if it was removed\n\t\t\t\t// fixes issue #146\n\t\t\t\tif (this.removed) return;\n\n\t\t\t\t// overlap/collisions/tunneling occurred between this sprite\n\t\t\t\t// and at least one other\n\t\t\t\tlet endResult = false;\n\n\t\t\t\tlet others = [];\n\n\t\t\t\tif (target instanceof Sprite) {\n\t\t\t\t\tothers.push(target);\n\t\t\t\t} else if (target instanceof Array) {\n\t\t\t\t\tif (this.p.quadTree !== undefined && this.p.quadTree.active) {\n\t\t\t\t\t\tothers = this.p.quadTree.retrieveFromGroup(this, target);\n\t\t\t\t\t}\n\t\t\t\t\tif (others.length === 0) others = target;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error('overlap can only be checked between sprites or groups');\n\t\t\t\t}\n\n\t\t\t\tlet displacement = this.p.createVector(0, 0);\n\n\t\t\t\tfor (let other of others) {\n\t\t\t\t\t// don't check if sprite is the same as the other sprite\n\t\t\t\t\t// don't check for collisions on removed sprites\n\t\t\t\t\tif (this == other || other.removed) continue;\n\n\t\t\t\t\tif (this.collider === undefined) this.setDefaultCollider();\n\n\t\t\t\t\tif (other.collider === undefined) other.setDefaultCollider();\n\n\t\t\t\t\t// some sprites do not have colliders, skip them\n\t\t\t\t\tif (this.collider === undefined || other.collider === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (type == 'overlap') {\n\t\t\t\t\t\tlet overlapping;\n\t\t\t\t\t\t//if the other is a circle I calculate the displacement from here\n\t\t\t\t\t\tif (this.collider instanceof CircleCollider) {\n\t\t\t\t\t\t\toverlapping = other.collider.overlap(this.collider);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toverlapping = this.collider.overlap(other.collider);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (overlapping) {\n\t\t\t\t\t\t\tendResult = true;\n\t\t\t\t\t\t\tif (this.onOverlap) this.onOverlap.call(this, other);\n\t\t\t\t\t\t\tif (callback) callback.call(this, this, other);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet disp = this.p.createVector(0, 0);\n\n\t\t\t\t\tlet prev = {\n\t\t\t\t\t\tx: this.previousPosition.x,\n\t\t\t\t\t\ty: this.previousPosition.y\n\t\t\t\t\t};\n\n\t\t\t\t\t// next position if not displaced\n\t\t\t\t\tlet next = {\n\t\t\t\t\t\tx: this.position.x,\n\t\t\t\t\t\ty: this.position.y\n\t\t\t\t\t};\n\n\t\t\t\t\t// check if it's necessary to do a tunneling correction\n\t\t\t\t\tlet tunnelX = this.velocity.x != 0 && abs(this.velocity.x - other.velocity.x) >= other.collider.extents.x / 2;\n\n\t\t\t\t\tlet tunnelY = this.velocity.y != 0 && abs(this.velocity.y - other.velocity.y) >= other.collider.extents.y / 2;\n\n\t\t\t\t\tlet tunnelTop, tunnelBottom, tunnelLeft, tunnelRight;\n\t\t\t\t\tif (tunnelX) {\n\t\t\t\t\t\ttunnelLeft = this.velocity.x > 0 && prev.x < other.previousPosition.x && next.x >= other.position.x;\n\t\t\t\t\t\ttunnelRight = this.velocity.x < 0 && prev.x > other.previousPosition.x && next.x <= other.position.x;\n\t\t\t\t\t}\n\t\t\t\t\tif (tunnelY) {\n\t\t\t\t\t\ttunnelTop = this.velocity.y > 0 && prev.y < other.previousPosition.y && next.y >= other.position.y;\n\t\t\t\t\t\ttunnelBottom = this.velocity.y < 0 && prev.y > other.previousPosition.y && next.y <= other.position.y;\n\t\t\t\t\t}\n\n\t\t\t\t\t// tunneling correction routine\n\t\t\t\t\tif (tunnelTop || tunnelBottom || tunnelLeft || tunnelRight) {\n\t\t\t\t\t\t// Make a bounding box/circle around the previous position\n\t\t\t\t\t\t// and current position, its position should be the midpoint\n\t\t\t\t\t\t// between these points\n\t\t\t\t\t\tlet c = this.p.createVector((prev.x + next.x) / 2, (prev.y + next.y) / 2);\n\t\t\t\t\t\t// extents\n\t\t\t\t\t\tlet e = this.p.createVector(\n\t\t\t\t\t\t\tabs(next.x - prev.x) + this.collider.extents.x,\n\t\t\t\t\t\t\tabs(next.y - prev.y) + this.collider.extents.y\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet bbox;\n\t\t\t\t\t\tlet overlapping;\n\t\t\t\t\t\tif (this.collider instanceof CircleCollider) {\n\t\t\t\t\t\t\tbbox = new CircleCollider(c, Math.max(e.x, e.y) / 2);\n\t\t\t\t\t\t\t// displacement = other.collider.collide(bbox).mult(-1);\n\t\t\t\t\t\t\toverlapping = other.collider.overlap(bbox);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbbox = new AABB(c, e, this.collider.offset);\n\t\t\t\t\t\t\t// displacement = bbox.collide(other.collider);\n\t\t\t\t\t\t\toverlapping = bbox.overlap(other.collider);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (overlapping) {\n\t\t\t\t\t\t\t// bbox.draw();\n\n\t\t\t\t\t\t\tif (tunnelTop) {\n\t\t\t\t\t\t\t\t// coming from the top\n\t\t\t\t\t\t\t\tdisp.y = other.collider.top() - this.collider.bottom();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (tunnelBottom) {\n\t\t\t\t\t\t\t\t// coming from the bottom\n\t\t\t\t\t\t\t\tdisp.y = other.collider.bottom() - this.collider.top();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (tunnelLeft) {\n\t\t\t\t\t\t\t\t// coming from the left\n\t\t\t\t\t\t\t\tdisp.x = other.collider.left() - this.collider.right();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (tunnelRight) {\n\t\t\t\t\t\t\t\t// coming from the right\n\t\t\t\t\t\t\t\tdisp.x = other.collider.right() - this.collider.left();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (disp.x == 0 && disp.y == 0) {\n\t\t\t\t\t\t// if the other is a circle I calculate the displacement from here\n\t\t\t\t\t\t// and reverse it\n\t\t\t\t\t\tif (this.collider instanceof CircleCollider) {\n\t\t\t\t\t\t\tdisp = other.collider.collide(this.collider).mult(-1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdisp = this.collider.collide(other.collider);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (disp.x == 0 && disp.y == 0) continue;\n\n\t\t\t\t\tdisplacement.x += disp.x;\n\t\t\t\t\tdisplacement.y += disp.y;\n\n\t\t\t\t\tlet tp = this.p.createVector(this.position.x, this.position.y);\n\n\t\t\t\t\tif (type === 'displace' && !other.immovable) {\n\t\t\t\t\t\tother.position.sub(disp);\n\t\t\t\t\t} else if ((type === 'collide' || type === 'bounce') && !this.immovable) {\n\t\t\t\t\t\ttp.add(disp);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet op = this.p.createVector(other.position.x, other.position.y);\n\n\t\t\t\t\t// should bounce\n\t\t\t\t\tif (type === 'bounce') {\n\t\t\t\t\t\tif (this.collider instanceof CircleCollider && other.collider instanceof CircleCollider) {\n\t\t\t\t\t\t\tvar dx1 = p5.Vector.sub(tp, op);\n\t\t\t\t\t\t\tvar dx2 = p5.Vector.sub(op, tp);\n\t\t\t\t\t\t\tvar magnitude = dx1.magSq();\n\t\t\t\t\t\t\tvar totalMass = this.mass + other.mass;\n\t\t\t\t\t\t\tvar m1 = 0,\n\t\t\t\t\t\t\t\tm2 = 0;\n\t\t\t\t\t\t\tif (this.immovable) {\n\t\t\t\t\t\t\t\tm2 = 2;\n\t\t\t\t\t\t\t} else if (other.immovable) {\n\t\t\t\t\t\t\t\tm1 = 2;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tm1 = (2 * other.mass) / totalMass;\n\t\t\t\t\t\t\t\tm2 = (2 * this.mass) / totalMass;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar newVel1 = dx1.mult((m1 * p5.Vector.sub(this.velocity, other.velocity).dot(dx1)) / magnitude);\n\t\t\t\t\t\t\tvar newVel2 = dx2.mult((m2 * p5.Vector.sub(other.velocity, this.velocity).dot(dx2)) / magnitude);\n\n\t\t\t\t\t\t\tthis.velocity.sub(newVel1.mult(this.restitution));\n\t\t\t\t\t\t\tother.velocity.sub(newVel2.mult(other.restitution));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlet newVelX1, newVelY1, newVelX2, newVelY2;\n\t\t\t\t\t\t\tif (other.immovable) {\n\t\t\t\t\t\t\t\tnewVelX1 = -this.velocity.x + other.velocity.x;\n\t\t\t\t\t\t\t\tnewVelY1 = -this.velocity.y + other.velocity.y;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewVelX1 =\n\t\t\t\t\t\t\t\t\t(this.velocity.x * (this.mass - other.mass) + 2 * other.mass * other.velocity.x) /\n\t\t\t\t\t\t\t\t\t(this.mass + other.mass);\n\t\t\t\t\t\t\t\tnewVelY1 =\n\t\t\t\t\t\t\t\t\t(this.velocity.y * (this.mass - other.mass) + 2 * other.mass * other.velocity.y) /\n\t\t\t\t\t\t\t\t\t(this.mass + other.mass);\n\t\t\t\t\t\t\t\tnewVelX2 =\n\t\t\t\t\t\t\t\t\t(other.velocity.x * (other.mass - this.mass) + 2 * this.mass * this.velocity.x) /\n\t\t\t\t\t\t\t\t\t(this.mass + other.mass);\n\t\t\t\t\t\t\t\tnewVelY2 =\n\t\t\t\t\t\t\t\t\t(other.velocity.y * (other.mass - this.mass) + 2 * this.mass * this.velocity.y) /\n\t\t\t\t\t\t\t\t\t(this.mass + other.mass);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//var bothCircles = (this.collider instanceof CircleCollider &&\n\t\t\t\t\t\t\t// other.collider instanceof CircleCollider);\n\n\t\t\t\t\t\t\t//if(this.touching.left || this.touching.right || this.collider instanceof CircleCollider)\n\n\t\t\t\t\t\t\t//print(displacement);\n\n\t\t\t\t\t\t\tif (abs(displacement.x) > abs(displacement.y)) {\n\t\t\t\t\t\t\t\tif (!this.immovable) {\n\t\t\t\t\t\t\t\t\tthis.velocity.x = newVelX1 * this.restitution;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!other.immovable) other.velocity.x = newVelX2 * other.restitution;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if(this.touching.top || this.touching.bottom || this.collider instanceof CircleCollider)\n\t\t\t\t\t\t\tif (abs(displacement.x) < abs(displacement.y)) {\n\t\t\t\t\t\t\t\tif (!this.immovable) this.velocity.y = newVelY1 * this.restitution;\n\n\t\t\t\t\t\t\t\tif (!other.immovable) other.velocity.y = newVelY2 * other.restitution;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tendResult = true;\n\t\t\t\t\tlet spriteCB = this['on' + type[0].toUpperCase() + type.slice(1)];\n\t\t\t\t\tif (spriteCB) spriteCB.call(this, other);\n\t\t\t\t\tif (callback) callback.call(this, this, other);\n\t\t\t\t}\n\n\t\t\t\t// if right next to another sprite do not\n\t\t\t\t// let the sprite move inside it\n\t\t\t\tif (this.touching.left && displacement.x < 0) displacement.x = 0;\n\t\t\t\tif (this.touching.right && displacement.x > 0) displacement.x = 0;\n\t\t\t\tif (this.touching.top && displacement.x < 0) displacement.y = 0;\n\t\t\t\tif (this.touching.bottom && displacement.x > 0) displacement.y = 0;\n\n\t\t\t\tif ((type === 'collide' || type === 'bounce') && !this.immovable) {\n\t\t\t\t\tthis.position.add(displacement);\n\t\t\t\t\tthis.previousPosition = this.p.createVector(this.position.x, this.position.y);\n\t\t\t\t\tthis.newPosition = this.p.createVector(this.position.x, this.position.y);\n\t\t\t\t}\n\n\t\t\t\tif (displacement.x > 0) this.touching.left = true;\n\t\t\t\tif (displacement.x < 0) this.touching.right = true;\n\t\t\t\tif (displacement.y < 0) this.touching.bottom = true;\n\t\t\t\tif (displacement.y > 0) this.touching.top = true;\n\n\t\t\t\treturn endResult;\n\t\t\t}", "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 }", "intersects_rect(rect) {\n var shield_t, shield_b;\n if (this.stance == 1) {\n shield_t = hb_rect(this,1) + 64;\n shield_b = hb_rect(this,3);\n }\n if (this.stance == 0) {\n shield_t = hb_rect(this,1);\n shield_b = hb_rect(this,3) - 64;\n }\n hb_rect(this,1)\n if ((hb_rect(rect,0) >= hb_rect(this,0) && hb_rect(rect,0) <= hb_rect(this,2))\n || (hb_rect(rect,2) >= hb_rect(this,0) && hb_rect(rect,2) <= hb_rect(this,2))) {\n if (this.dir != rect.dir) {\n if ((hb_rect(rect,1) >= shield_t && hb_rect(rect,1) <= shield_b)\n || (hb_rect(rect,3)-1 >= shield_t && hb_rect(rect,3)-1 <= shield_b)) {\n console.log(\"s-hit\");\n return 2;\n }\n }\n if ((hb_rect(rect,1) >= hb_rect(this,1) && hb_rect(rect,1) <= hb_rect(this,3))\n || (hb_rect(rect,3)-1 >= hb_rect(this,1) && hb_rect(rect,3)-1 <= hb_rect(this,3))) {\n console.log(\"hit\");\n return true;\n }\n else {console.log(\"xhit\")}\n }\n else {console.log(\"nohit\")}\n return false;\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 }", "collidesWith (OtherEntity) {\n if (this.x < OtherEntity.x + OtherEntity.width &&\n this.x + this.width > OtherEntity.x &&\n this.y < OtherEntity.y + OtherEntity.height &&\n this.y + this.height > OtherEntity.y) {\n // collision detected!\n return true\n }\n // no collision\n return false\n }", "checkPlayer(oGroup,targetPosition, objectId){\n var targetnegate = new THREE.Vector3().copy(targetPosition);\n var direction = new THREE.Vector3().copy(this.positionvar);\n direction.add(targetnegate.negate());\n direction.negate();\n direction.normalize();\n this.raycaster.set(this.positionvar,direction);\n var intersections = this.raycaster.intersectObjects(oGroup.children);\n if(intersections.length > 0) {\n var intersection = intersections[0].object;\n if(intersection.name == \"player\"){\n return true;\n }\n else if(parseInt(intersection.userData.ID) != objectId){\n return true;\n }\n else {\n return false;\n }\n }\n else{\n return false;\n }\n }", "update() {\n var isCollided = this.physics.overlap(this.platformGroup, this.ball, this.collision, null, this);\n this.checkGameOver();\n }", "collidesWith(bird) {\n //this function returns true if the the rectangles overlap\n const _overlap = (rect1, rect2) => {\n //check that they don't overlap in the x axis\n if (rect1.left > rect2.right || rect1.right < rect2.left) {\n return false;\n }\n //check that they don't overlap in the y axis\n if (rect1.top > rect2.bottom || rect1.bottom < rect2.top) {\n return false;\n }\n return true;\n };\n let collision = false;\n this.eachPipe((pipe) => {\n if ( \n //check if the bird is overlapping (colliding) with either pipe\n _overlap(pipe.topPipe, bird) || \n _overlap(pipe.bottomPipe, bird)\n ) { collision = true; }\n });\n return collision;\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}", "function SpriteCollision(offset, sprite1, sprite2)\n{\n\tfor (var x = 0; x < sprite1.width; ++x)\n\t{\n\t\tvar xx = +x + +offset[0];\n\t\tif (xx < 0 || xx >= sprite2.width) continue;\n\t\tfor (var y = 0; y < sprite1.height; ++y)\n\t\t{\n\t\t\tvar yy = +y + +offset[1];\n\t\t\tif (yy < 0 || yy >= sprite2.height) continue;\n\t\t\tvar pix1 = sprite1.rgba[x][y];\n\t\t\tvar pix2 = sprite2.rgba[xx][yy];\n\t\t\tif (pix1[3] > 10 && pix2[3] > 10) return true;\n\t\t}\n\t}\n\treturn false;\n}", "function checkOverlap() {\n let d = dist(circle1.x, circle1.y, circle2.x, circle2.y);\n if (d < circle1.size/3 + circle2.size/3) {\n state = `love`;\n }\n }", "intersectsShape(shape2, graphics) {\n // Walk through shape2's line segments and see if they intersect with \n // our line segments.\n // This is O(n^2) so won't scale.\n //. first should check if the point is within the bounding box of this sprite - \n // (x - bounds, y - bounds) to (x + bounds, y + bounds).\n for (let i = 0; i < shape2.nLines - 1; i++) {\n // Get line segment\n const seg2 = shape2.getLineSegment(i)\n if (seg2) {\n // seg2.drawSegment(graphics, 'orange')\n // seg2.drawBoundingBox(graphics, 'orange')\n for (let j = 0; j < this.nLines - 1; j++) {\n const seg1 = this.getLineSegment(j)\n if (seg1) {\n // seg1.drawSegment(graphics, 'red')\n // seg1.drawBoundingBox(graphics, 'red')\n const pointIntersect = seg1.getIntersection(seg2)\n if (pointIntersect) {\n return pointIntersect\n }\n }\n } \n }\n }\n return null\n }", "function update() {\n for (var index = 0; index < pipes.length; index++) {\n game.physics.arcade\n .overlap(player,\n pipes[index],\n gameOver);\n\n }\n\n if (player.body.y < 0) {\n gameOver();\n }\n\n if (player.body.y> 400) {\n gameOver();\n }\n\n\n}", "function check_collision(obj1, obj2) {\n let hit = false;\n obj1 = obj1.getBounds();\n obj2 = obj2.getBounds();\n if(obj1.bottom > obj2.top\n && obj1.top < obj2.bottom\n && obj1.left < obj2.right\n && obj1.right > obj2.left) {\n hit = true;\n }\n return hit;\n }", "collidesWithPlayer (playertwo) {\n const collidesTop = playertwo.y <= this.y + this.size;\n const collidesBottom = playertwo.y + playertwo.size >= this.y;\n const collidesRight = playertwo.x <= this.x + this.size;\n const collidesLeft = playertwo.x + this.size >= this.x;\n\n return collidesRight && collidesBottom && collidesTop && collidesLeft;\n }", "isInside(pos, rect){\n return pos.x > rect.x && pos.x < rect.x+rect.width && pos.y < rect.y+rect.height && pos.y > rect.y && (this.lives==0 || this.level == this.levels.length)\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(smlRect, bgRect){\r\n //small box values\r\n let smlRectX = smlRect.offset().left;\r\n let smlRectY = smlRect.offset().top;\r\n let smlRectW = smlRect.width();\r\n let smlRectH = smlRect.height();\r\n \r\n //big box values\r\n let bgRectX = bgRect.offset().left;\r\n let bgRectY = bgRect.offset().top;\r\n let bgRectW = bgRect.width();\r\n let bgRectH = bgRect.height();\r\n\r\n \r\n // left side of small red box\r\n let sbLeft = smlRectX;\r\n //right side of small red box\r\n let sbRight = smlRectX + smlRectW;\r\n //top of small red box\r\n let sbTop = smlRectY;\r\n //bottom of small red box\r\n let sbBottom = smlRectY + smlRectH;\r\n\r\n // left side of big gold box\r\n let bbLeft = bgRectX;\r\n //right side of big gold box\r\n let bbRight = bgRectX + bgRectW;\r\n //top of big gold box\r\n let bbTop = bgRectY;\r\n //bottom of big gold box\r\n let bbBottom = bgRectY + bgRectH;\r\n\r\n \r\n if(sbRight >= bbLeft && sbBottom >= bbTop && sbLeft <= bbRight && sbTop <= bbBottom){\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\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 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}", "collide(){\n return this.groupLab;\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 }", "function interstectRect(rect1, rect2) {\n \n //are we in x range\n if (rect2.left < (rect1.right - rect1.width / 4) && \n rect2.right > (rect1.left + rect1.width / 4)) { \n \n //if feet on block bound the y to the block level\n var thr = (player.velY/200 | 0 )*5 + 3;\n\n if ((rect2.top <= (rect1.bottom)) && !((rect2.top + thr) <= rect1.bottom)) {\n \n player.sprite.y = rect2.top - rect1.height / 2 | 0;\n onGround = true;\n player.velY = 0;\n }\n else {\n\n onGround = false;\n }\n }\n \n else onGround = false;\n \n \n return (rect2.left < rect1.right ||\n rect2.right > rect1.left ||\n rect2.top < rect1.bottom ||\n rect2.bottom > rect1.top);\n \n}", "intersects(that) {\n\t\treturn !(that.pos.x > this.pos.x + this.size.x\n\t\t\t\t|| that.pos.x + that.size.x < this.pos.x\n\t\t\t\t|| that.pos.y > this.pos.y + this.size.y\n\t\t\t\t|| that.pos.y + that.size.y < this.pos.y);\n\t}", "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}", "function update() {\n for(var index=0; index<pipes.length; index++){\n game.physics.arcade\n .overlap(player,\n pipes[index],\n gameOver);\n player.rotation = Math.atan(player.body.velocity.y / 750);\nif(player.body.y < 0 || player.body.y > 400){\n gameOver();\n}\n}\n}", "collidesWith(rocket) {\n return _.some(rocket.getPoints(), (point) => {\n let px = point.x + rocket.x;\n let py = point.y + rocket.y;\n return distance(px, py, this.x, this.y) <= (this.size / 2);\n });\n }", "outsideBounds(s, bounds, extra) {\n let x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;\n //The `collision` object is used to store which\n //side of the containing rectangle the sprite hits\n let collision = new Set();\n //Left\n if (s.x < x - s.width) {\n collision.add(\"left\");\n }\n //Top\n if (s.y < y - s.height) {\n collision.add(\"top\");\n }\n //Right\n if (s.x > width + s.width) {\n collision.add(\"right\");\n }\n //Bottom\n if (s.y > height + s.height) {\n collision.add(\"bottom\");\n }\n //If there were no collisions, set `collision` to `undefined`\n if (collision.size === 0)\n collision = undefined;\n //The `extra` function runs if there was a collision\n //and `extra` has been defined\n if (collision && extra)\n extra(collision);\n //Return the `collision` object\n return collision;\n }", "function check_collision( objects_to_check )\n\t{\n\t\treturn false;\n\t}", "contactedOnWith(otherGP) {\n let selfBounds = this.getSpriteBoundaries();\n let otherBounds = otherGP.getSpriteBoundaries();\n return {\n up: (selfBounds.bottom === otherBounds.top && selfBounds.left < otherBounds.right && selfBounds.right > otherBounds.left),\n down: (selfBounds.top === otherBounds.bottom && selfBounds.left < otherBounds.right && selfBounds.right > otherBounds.left),\n left: (selfBounds.right === otherBounds.left && selfBounds.top < otherBounds.bottom && selfBounds.bottom > otherBounds.top),\n right: (selfBounds.left === otherBounds.right && selfBounds.top < otherBounds.bottom && selfBounds.bottom > otherBounds.top),\n };\n }", "function overlapsAtOffset(obj, offsetX, offsetY) {\n\t\treturn !(\n\t\t\tthis.x + offsetX + this.boundingBox.left >= obj.x + obj.boundingBox.right ||\n\t\t\tthis.x + offsetX + this.boundingBox.right <= obj.x + obj.boundingBox.left ||\n\t\t\tthis.y + offsetY + this.boundingBox.top >= obj.y + obj.boundingBox.bottom ||\n\t\t\tthis.y + offsetY + this.boundingBox.bottom <= obj.y + obj.boundingBox.top\n\t\t);\n\t}", "function hitTestRectangle(r1, r2) { \n //Define the variables we'll need to calculate\n let hit, combinedHalfWidths, combinedHalfHeights, vx, vy; \n //hit will determine whether there's a collision\n hit = false; \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 //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 //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY; \n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight; \n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) { \n //A collision might be occurring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) { \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 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}", "function checkObjectOverlap(object) {\n //Check to see if object with object is overlapping any other object that it can be grouped with.\n var manipulationObjects = document.getElementsByClassName('manipulationObject');\n var overlapArray = new Array();\n \n for(var i = 0; i < manipulationObjects.length; i++) { //go through all manipulationObjects, checking for overlap.\n if(object.id != manipulationObjects[i].id) { //Don't check the object you're moving against itself.\n //check to see if objects overlap. If they do, add the object to the array.\n if((object.offsetLeft + object.offsetWidth > manipulationObjects[i].offsetLeft) && (object.offsetLeft < manipulationObjects[i].offsetLeft + manipulationObjects[i].offsetWidth) && (object.offsetTop + object.offsetHeight > manipulationObjects[i].offsetTop) && (object.offsetTop < manipulationObjects[i].offsetTop + manipulationObjects[i].offsetHeight)) {\n \n //check to see if the 2 are already grouped together\n var areGrouped = areObjectsGrouped(object, manipulationObjects[i]);\n \n //This check may need to be moved over to the checkObjectOverlap function.\n //if they're not grouped, group them.\n if(areGrouped == -1) {\n var overlappedObjs = new Array();\n overlappedObjs[0] = object;\n overlappedObjs[1] = manipulationObjects[i];\n overlapArray[overlapArray.length] = overlappedObjs;\n }\n }\n }\n }\n \n return overlapArray;\n}", "onCollision(otherObjects) {}", "function collides(a, b) {\n if(a.x == b.x && a.y == b.y) return true;\n return false;\n }", "function elementsOverlap(pos) {\n if (snake.x == pos.x && snake.y == pos.y)\n return true;\n if(food){\n if(food.x == pos.x && food.y == pos.y)\n return true;\n }\n if(barriers && barriers.length>0 && food){\n for(var i = 0; i < barriers.length; i++){\n for(var j = 0; j < barriers[i].positions.length; j++){\n if(barriers[i].positions[j].pos.x == pos.x && barriers[i].positions[j].pos.y == pos.y){\n return true;\n }\n if(barriers[i].positions[j].pos.x == food.x && barriers[i].positions[j].pos.y == food.y){\n return true;\n }\n }\n }\n }\n for (var i = 0; i < snake.tail.length; i++) {\n if (snake.tail[i].x == pos.x && snake.tail[i].y == pos.y)\n return true;\n }\n return false;\n}", "function goodThingCollides(position) {\n var platforms = document.getElementById(\"platforms\");\n\n for (var i = 0; i < platforms.childNodes.length; ++i) {\n var node = platforms.childNodes.item(i);\n\n if (node.nodeName != \"rect\")\n continue;\n\n if (collides(node, position, GOOD_THING_SIZE))\n return true;\n }\n\n var goodThings = document.getElementById(\"goodthings\");\n\n for (var i = 0; i < goodThings.childNodes.length; ++i) {\n var goodThing = goodThings.childNodes.item(i);\n var x = parseInt(goodThing.getAttribute(\"x\"));\n var y = parseInt(goodThing.getAttribute(\"y\"));\n\n if (intersect(position, GOOD_THING_SIZE, new Point(x, y), GOOD_THING_SIZE))\n return true;\n }\n\n if (intersect(position, GOOD_THING_SIZE, player.position, PLAYER_SIZE))\n return true;\n\n if (intersect(position, GOOD_THING_SIZE, EXIT_POSITION, EXIT_SIZE))\n return true;\n\n if (intersect(position, GOOD_THING_SIZE, PORTAL1_POSITION, PORTAL1_SIZE))\n return true;\n\n if (intersect(position, GOOD_THING_SIZE, PORTAL2_POSITION, PORTAL2_SIZE))\n return true;\n\n return false;\n}", "inBounds() {\n if (this.pos.x <= -50 || this.pos.x > 690 || this.pos.y <= -50 || this.pos.y > 690) {\n this.active = false;\n }\n }", "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 }", "isOverlap(other) {\n var rects = [this, other];\n for (var r in rects) {\n var rect = rects[r];\n for (var i = 0; i < 4; i++) {\n var _i = (i + 1) % 4;\n var p1 = rect.points[i];\n var p2 = rect.points[_i];\n var norm = new Vector2D(p2.y - p1.y, p1.x - p2.x);\n var minA = 0, maxA = 0;\n for (var j in this.points) {\n var p = this.points[j];\n var proj = norm.x * p.x + norm.y * p.y;\n if (minA == 0 || proj < minA)\n minA = proj;\n if (maxA == 0 || proj > maxA)\n maxA = proj;\n }\n var minB = 0, maxB = 0;\n for (var j in other.points) {\n var p = other.points[j];\n var proj = norm.x * p.x + norm.y * p.y;\n if (minB == 0 || proj < minB)\n minB = proj;\n if (maxB == 0 || proj > maxB)\n maxB = proj;\n }\n if (maxA < minB || maxB < minA)\n return false;\n }\n }\n return true;\n }", "function collisionDetection(first, second) {\n var firstBounds = first.getBounds();\n var secondBounds = second.getBounds();\n\n return firstBounds.x + firstBounds.width > secondBounds.x\n && firstBounds.x < secondBounds.x + secondBounds.width \n && firstBounds.y + firstBounds.height > secondBounds.y\n && firstBounds.y < secondBounds.y + secondBounds.height;\n}", "function update() {\n if(player.y > 350){\n gameOver()\n }\n if(player.y< 0){\n gameOver()\n }\n for (var index = 0; index < pipes.length; index++) {\n game.physics.arcade\n .overlap(player,\n\n\n pipes[index],\n gameOver);\n }\n\n}", "static didCollide(obj1, obj2){\n // since we have getBoundingBox it should be easy\n if (!obj1.getBoundingBox && !obj2.getBoundingBox) return false;\n\n // get boxes\n const box1 = obj1.getBoundingBox();\n const box2 = obj2.getBoundingBox();\n\n // check for intersections based on the vertices from bounding box\n return (box1.topLeft.x < (box2.bottomRight.x) && \n (box1.bottomRight.x) > box2.topLeft.x) && \n (box1.topLeft.y < (box2.bottomRight.y) && \n (box1.bottomRight.y) > box2.topLeft.y);\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 }", "function contain(sprite, container) {\n\n var collision = undefined;\n\n //Left\n if (sprite.x - sprite.width * sprite.anchor.x < container.x) {\n sprite.x = container.x + sprite.width * sprite.anchor.x;\n collision = \"left\";\n }\n\n //Top\n if (sprite.y - sprite.height * sprite.anchor.y < container.y) {\n sprite.y = container.y + sprite.height * sprite.anchor.y;\n collision = \"top\";\n }\n\n //Right\n if (sprite.x + sprite.width * sprite.anchor.x > container.width) {\n sprite.x = container.width - sprite.width * sprite.anchor.x;\n collision = \"right\";\n }\n\n //Bottom\n if (sprite.y + sprite.height * sprite.anchor.y > container.height) {\n sprite.y = container.height - sprite.height * sprite.anchor.y;\n collision = \"bottom\";\n }\n\n //Return the `collision` value\n return collision;\n}", "function checkOverlap(location, length, orientation, genFleet) {\n\t var loc = location;\n\t // Player 2 Overlap Horizontal Check //\n \tif (orientation == \"horz\") {\n \t\tvar end = location + length;\n\t \tfor (; location < end; location++) {\n\t \t\tfor (var i = 0; i < genFleet.currentShip; i++) {\n\t \t\t\tif (genFleet.ships[i].locationCheck(location)) {\n\t \t\t\t\tif (genFleet == player1Fleet) randomSetupMultiP2(genFleet);\n\t \t\t\t\telse return true;\n\t \t\t\t}\n\t \t\t} \n\t \t} \n\t } else {\n\t\t var end = location + (10 * length);\n\t\t // Player 2 Overlap Vertical Check //\n\t \tfor (; location < end; location += 10) {\n\t \t\tfor (var i = 0; i < genFleet.currentShip; i++) {\n\t \t\t\tif (genFleet.ships[i].locationCheck(location)) {\n\t \t\t\t\tif (genFleet == player1Fleet) randomSetupMultiP2(genFleet);\n\t \t\t\t\telse return true;\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t } \n\t // If Player 2 Ships Do not Overlap Then All Is Good & Create Hits //\n\tif (genFleet == player1Fleet && genFleet.currentShip < genFleet.numOfShips) {\n\t\tif (orientation == \"horz\") genFleet.ships[genFleet.currentShip++].populateHorzHits(loc);\n\t \telse genFleet.ships[genFleet.currentShip++].populateVertHits(loc);\n\t \tif (genFleet.currentShip == genFleet.numOfShips) {\n\t \t\t// Delay For Smoother User Experience //\n\t \t\tsetTimeout(500);\n\t \t} else randomSetupMultiP2(genFleet);\n\t }\n\treturn false;\n }", "function collides(l1\n/*: LayoutItem*/\n, l2\n/*: LayoutItem*/\n)\n/*: boolean*/\n{\n if (l1.i === l2.i) return false; // same element\n\n if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2\n\n if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2\n\n if (l1.y + l1.h <= l2.y) return false; // l1 is above l2\n\n if (l1.y >= l2.y + l2.h) return false; // l1 is below l2\n\n return true; // boxes overlap\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 addCollision(el){\n var events = Array.prototype.slice.call(document.getElementsByClassName('event'));\n var eventsLength = events.length;\n var elementBottom = pixelToInt(el.style.top) + pixelToInt(el.style.height);\n var elementTop = pixelToInt(el.style.top);\n\n for(var j=0; j < eventsLength; j++){\n var eventBottom = pixelToInt(events[j].style.top) + pixelToInt(events[j].style.height);\n var eventTop = pixelToInt(events[j].style.top);\n\n if ((elementTop >= eventTop && elementTop < eventBottom) ||\n (elementBottom > eventTop && elementBottom <= eventBottom) ||\n (elementTop <= eventTop && elementBottom >= eventBottom) ) {\n if(el.id !== events[j].id) {\n addOverlap(events[j], el);\n }\n }\n }\n }", "function doCollide(obj1, obj2) {\n var left1 = { \"x\": obj1.x, \"y\": obj1.y };\n var right1 = { \"x\": obj1.x + obj1.width, \"y\": obj1.y + obj1.height};\n var left2 = { \"x\": obj2.x, \"y\": obj2.y };\n var right2 = { \"x\": obj2.x + obj2.width, \"y\": obj2.y + obj2.height};\n \n // If one rectangle is on left side of other they do not overlap\n if (left2.x > right1.x || left1.x > right2.x) {\n return false; \n }\n \n // If one rectangle is above other they do not overlap\n if (right2.y < left1.y || right1.y < left2.y) {\n return false; \n }\n \n return true;\n }", "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 }", "hits(b){\n\n //check if sprite (b) is in between the zone from top of gap to top of screeen and bottom of gap to bot of screen (Y axis)\n if (b.y < this.top || b.y > height-this.bottom){\n\n //check if sprite (b) is ALSO in between the width of the pipe (X axis)\n if(b.x > this.x && b.x < this.x + this.w){\n \n return true;\n \n }\n }\n }", "_isOverlappingExisting(x, y, w, h) {\n if(!this._positions.length) return false;\n let over = false;\n this._positions.forEach((item) => {\n if (!(item.x > x + w ||\n item.x + item.width < x ||\n item.y > y + h ||\n item.y + item.height < y)) over = true;\n });\n\n return over;\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 hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy, globalZero;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n globalZero = new PIXI.Point(0, 0);\n r1.centerX = r1.toGlobal(globalZero).x;\n r1.centerY = r1.toGlobal(globalZero).y;\n r2.centerX = r2.toGlobal(globalZero).x;\n r2.centerY = r2.toGlobal(globalZero).y;\n\n // Find the half-widths and half-heights of each sprite\n // note: modiified the width and height by a descale factor found in globals.js\n r1.halfWidth = r1.width*HITBOX_SIZE_FACTOR / 2;\n r1.halfHeight = r1.height*HITBOX_SIZE_FACTOR / 2;\n r2.halfWidth = r2.width*HITBOX_SIZE_FACTOR / 2;\n r2.halfHeight = r2.height*HITBOX_SIZE_FACTOR / 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 legalmpos(x,y){\r\n\tif (x >= 0 && x <= 120 && y>=320) return false;\r\n var monsters = svgdoc.getElementById(\"monsters\");\r\n for (var i = 0; i < monsters.childNodes.length; i++) {\r\n\t\tpos1 = new Point(x,y);\r\n\t\tpos2 = new Point(monsters.childNodes[i].getAttribute(\"x\"), monsters.childNodes[i].getAttribute(\"y\"));\r\n\t\tif(intersect( pos1,OBJECT_DISTANCE,pos2,OBJECT_DISTANCE) )return false;\r\n\t}\r\n\treturn true;\r\n}", "function checkForCollision(element, nextElement) {\n //return true if collison found\n\n var overlapFlag = false;\n if (element.start >= nextElement.start && element.start <= nextElement.end || nextElement.start >= element.start && nextElement.start <= element.end) {\n overlapFlag = true;\n }\n if (element.end >= nextElement.start && element.end <= nextElement.end || nextElement.end >= element.start && nextElement.end <= element.end) {\n overlapFlag = true;\n }\n return overlapFlag;\n\n\n}", "function OnCollisionEnter(other : Collision) \n{ \n if (other.gameObject.tag == \"Ground\") \n {\n \t\tcollideGround=true; \n \t}\n \telse\n \t{\n \tcollideGround=false;\n \t}\n \tif (other.gameObject.tag == \"Target\")\n\t{\n\tGameObject.Find(\"launcher\").GetComponent(LauncherDrivingRange).increaseScore();\n\t}\n\t\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 }", "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 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 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}", "addCollisions() {\n //platform collider\n this.physics.add.collider(this.player, this.blockedLayer);\n //enemies platform collider\n this.physics.add.collider(this.enemiesGroup, this.blockedLayer);\n //player enemies overlap\n this.physics.add.overlap(this.player, this.enemiesGroup, this.player.enemyCollision.bind(this.player)); //adding new method to player class and binding the player object context to it.\n //player portal overlap\n this.physics.add.overlap(this.player, this.portal, this.loadNextLevel.bind(this, false)); //binding context AND a value of false for the newGame parameter, so Phaser knows we're moving to next level and NOT ending or restarting game\n //player coin overlap\n this.physics.add.overlap(this.coinsGroup, this.player, this.coinsGroup.collectCoin.bind(this.coinsGroup));\n //enemy bullet overlap\n this.physics.add.overlap(this.bullets, this.enemiesGroup, this.bullets.enemyCollision);\n }", "function checkOverlapMulti(location, length, orientation, genFleet) {\n\tvar loc = location;\n\t// Player 1 Overlap Horizontal Check //\n\tif (orientation == \"horz\") {\n\t\tvar end = location + length;\n\t\tfor (; location < end; location++) {\n\t\t\tfor (var i = 0; i < genFleet.currentShip; i++) {\n\t\t\t\tif (genFleet.ships[i].locationCheck(location)) {\n\t\t\t\t\tif (genFleet == player2Fleet) randomSetupMulti(genFleet);\n\t\t\t\t\telse return true;\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t} else {\n\t\tvar end = location + (10 * length);\n\t\t// Player 1 Overlap Vertical Check //\n\t\tfor (; location < end; location += 10) {\n\t\t\tfor (var i = 0; i < genFleet.currentShip; i++) {\n\t\t\t\tif (genFleet.ships[i].locationCheck(location)) {\n\t\t\t\t\tif (genFleet == player2Fleet) randomSetupMulti(genFleet);\n\t\t\t\t\telse return true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} \n\t// If Player 1 Ships Do not Overlap Then All Is Good & Create Hits //\n if (genFleet == player2Fleet && genFleet.currentShip < genFleet.numOfShips) {\n\t if (orientation == \"horz\") genFleet.ships[genFleet.currentShip++].populateHorzHits(loc);\n\t\telse genFleet.ships[genFleet.currentShip++].populateVertHits(loc);\n\t\tif (genFleet.currentShip == genFleet.numOfShips) {\n\t\t\t// Delay For Smoother User Experience //\n\t\t\tsetTimeout(500);\n\t\t} else randomSetupMulti(genFleet);\n\t}\n return false;\n}", "isOverlapRaycast(other, force) {\n return !this.gameObject.noClip && this._getRect(this.gameObject.position.x + force.x, this.gameObject.position.y + force.y).isOverlap(other.getRect());\n }" ]
[ "0.7715595", "0.7715595", "0.7144119", "0.7041379", "0.70258904", "0.70130485", "0.699923", "0.69791967", "0.69563794", "0.6928495", "0.6837545", "0.68181556", "0.68103105", "0.68017983", "0.677629", "0.6755911", "0.6718396", "0.6718396", "0.6658142", "0.6654095", "0.66502345", "0.6647292", "0.66421586", "0.6641611", "0.6630478", "0.6605753", "0.65991974", "0.6548929", "0.65210503", "0.65198785", "0.65183806", "0.6516994", "0.65117913", "0.6508223", "0.64945364", "0.64865345", "0.64731634", "0.6471046", "0.6469353", "0.64480954", "0.64472944", "0.6438778", "0.6435207", "0.6418144", "0.64175916", "0.63868123", "0.63790256", "0.6378721", "0.63775724", "0.6371386", "0.63660157", "0.6365999", "0.63599837", "0.6354781", "0.6349636", "0.634207", "0.63410306", "0.63406056", "0.6340272", "0.63371754", "0.6336588", "0.63292474", "0.6325296", "0.6322785", "0.63216436", "0.6317605", "0.63110316", "0.6303648", "0.6300545", "0.62997776", "0.62911844", "0.6289407", "0.6282303", "0.62808764", "0.62756914", "0.6261323", "0.62551045", "0.62413335", "0.6237817", "0.62372714", "0.62347865", "0.6225903", "0.62198156", "0.62146574", "0.620889", "0.6202655", "0.619815", "0.61905557", "0.61836714", "0.6174188", "0.61740345", "0.61673045", "0.61668116", "0.61663514", "0.61641955", "0.61623544", "0.6157711", "0.61531395", "0.6152744", "0.6145902" ]
0.7444075
2
var Gpio = require('/usr/local/lib/node_modules/onoff').Gpio;
function toggle(state, pin) { var Relay = new Gpio(pin, 'out'); if (state = 1) { Relay.writeSync(1); } else if (state = 0) { Relay.writeSync(0); } else { console.error(new error("invalid argument")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectHardware () {\n let Gpio = require('onoff').Gpio\n this._actuator = new Gpio(this._model.values['1'].customFields.gpio, 'out')\n\n console.info('Hardware %s actuator started!', this._model.name)\n }", "_setup () {\n // Setup pins\n this._dialPin = new Gpio(GpioManager.DIAL_PIN, 'in', 'both', { debounceTimeout: 10 })\n this._pulsePin = new Gpio(GpioManager.PULSE_PIN, 'in', 'falling', { debounceTimeout: 10 })\n\n this._cradlePin = new Gpio(GpioManager.CRADLE_PIN, 'in', 'both', { debounceTimeout: 20 })\n this._mutePin = new Gpio(GpioManager.MUTE_PIN, 'in', 'both', { debounceTimeout: 20 })\n this._ledPin = new Gpio(GpioManager.LED_PIN, 'out')\n this._ampEnablePin = new Gpio(GpioManager.AMP_ENABLE_PIN, 'out')\n\n // Ensure Pins are properly unexported when the module is unloaded\n process.on('SIGINT', _ => {\n this._dialPin.unexport()\n this._pulsePin.unexport()\n this._cradlePin.unexport()\n this._mutePin.unexport()\n this._ledPin.unexport()\n this._ampEnablePin.unexport()\n })\n\n this._startWatchingDial()\n this._startWatchingCradle()\n this._startWatchingMute()\n\n // Initialize the LED as LOW\n this._ledPin.write(Gpio.LOW).catch(() => {})\n this._ampEnablePin.write(Gpio.LOW).catch(() => {})\n }", "function on() {\n gpio.write(pin, 1, (err) => {\n console.log('LED is ON');\n state = 'on';\n });\n}", "function initIO() {\n // Make sure gpios 7 and 20 are available.\n b.pinMode('P9_42', b.INPUT);\n b.pinMode('P9_41', b.INPUT);\n \n // Initialize pwm\n}", "function gpioInit() {\r\n return ({\r\n comment: \"%l /* SPI Flash Chip Select GPIO Instance */\",\r\n mode: \"Output\",\r\n outputType: \"Standard\",\r\n outputState: \"High\"\r\n });\r\n}", "static get LED_PIN () { return 12 }", "function turnOnLed()\n{\n system(\"sh ./onLed.sh\");\n ledstatus = \"on\";\n}", "function gotOpen() {\n println(\"Serial Port is Open\");\n}", "function check(){ // reading the signal at P8_19 pin and calling function checkButton\nb.digitalRead('P8_19', checkButton);\n}", "function gotOpen() {\n print(\"Serial Port is open!\");\n}", "function blinkLED() { //function to start blinking\n if (LED.readSync() === 0) { //check the pin state, if the state is 0 (or off)\n LED.writeSync(1); //set pin state to 1 (turn LED on)\n } else {\n LED.writeSync(0); //set pin state to 0 (turn LED off)\n }\n}", "function blinkLED() { //function to start blinking\n if (LED.readSync() === 0) { //check the pin state, if the state is 0 (or off)\n LED.writeSync(1); //set pin state to 1 (turn LED on)\n } else {\n LED.writeSync(0); //set pin state to 0 (turn LED off)\n }\n}", "function toggleGreenLed() {\n let val = gpioGreenLed.readSync() ^ 1;\n gpioGreenLed.writeSync(val);\n return val;\n}", "function turnOffLed()\n{\n system(\"sh ./offLed.sh\");\n ledstatus = \"off\";\n}", "function GPIO_ALL_OFF() {\r\n var msg = \"GPIO_ALL_OFF\";\r\n socket.emit(\"GPIO_ALL_OFF\");\r\n console.log(msg);\r\n return false;\r\n}", "function gotOpen() {\n print(\"Serial Port is Open\");\n}", "function blinkLED() { //function to start blinking\n\t\t\t\t\t\t\t\t\t\tif (greenLED.readSync() === 0) { //check the pin state, if the state is 0 (or off)\n\t\t\t\t\t\t\t\t\t\t\tgreenLED.writeSync(1); //set pin state to 1 (turn LED on)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tgreenLED.writeSync(0); //set pin state to 0 (turn LED off)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}", "function yFirstLed()\n{\n return YLed.FirstLed();\n}", "function gotOpen() {\n print(\"Serial Port is Open\");\n}", "function toggleYellowLed() {\n let val = gpioYellowLed.readSync() ^ 1;\n gpioYellowLed.writeSync(val);\n return val;\n}", "function off() {\n gpio.write(pin, 0, (err) => {\n if (err) throw err;\n console.log('LED is OFF');\n state = 'off';\n });\n}", "function ledON() {\n socket.emit('ledON');\n}", "function lightSwitch(state) {\n lightPort.digitalWrite(state);\n}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function Module(func){\n\t\tfunc(Tone);\n\t}", "function blinkLED() { //function to start blinking\n if (LED.readSync() === 0) { //check the pin state, if the state is 0 (or off)\n LED.writeSync(1); //set pin state to 1 (turn LED on)\n } else {\n LED.writeSync(0); //set pin state to 0 (turn LED off)\n }\n }", "function GPIO_WRITE(pin) {\r\n var msg = \"GPIO_WRITE\";\r\n socket.emit(\"GPIO_WRITE\", pin);\r\n console.log(msg + \" \" + pin);\r\n return false;\r\n}", "function changeGPIOValue(){\n var hl = $('#gpio_value').val();\n $('#gpio_not_value').html((hl == 0) ? \"HIGH\" : \"LOW\");\n}", "function testGPIO() {\r\n var msg = \"Testing GPIO (WiringPi) 0 - 7\";\r\n socket.emit(\"test-gpio\", msg);\r\n console.log(msg); // browser console logging\r\n return false;\r\n}", "function gotOpen() {\n console.log(\"Serial Port is Open\");\n}", "function NRF24 () {\n\tconsole.log('==inited fake nrf');\n\tevents.EventEmitter.call(this);\n}", "function gotOpen() {\n console.log(\"Serial Port is Open\");\n}", "function onConnect() {\r\n onMotor(output = 0);\r\n onServo(output2 = 90)\r\n}", "function start(){\n console.log('starting');\n board = new Board({\n debug: true,\n onError: function (err) {\n console.log('TEST ERROR');\n console.log(err);\n },\n onInit: function (res) {\n if (res) {\n console.log('GrovePi Version :: ' + board.version());\n if (testOptions.digitalButton) {\n //Digital Port 3\n // Button sensor\n buttonSensor = new DigitalButtonSensor(3);\n console.log('Digital Button Sensor (start watch)');\n buttonSensor.watch();\n }\n } else\n {\n console.log('TEST CANNOT START');\n }\n }\n })\n board.init();\n }", "bindArduino() {\n return new Promise(async (resolve) => {\n let dir = fs.readdirSync('/dev').filter(dir => dir.indexOf('ttyUSB') > -1)\n let promises = []\n for (var i = 0; i < dir.length; i++) {\n let arduino = new ArduinoInterface('/dev/' + dir[i])\n this.instances.push(arduino)\n promises.push(arduino.init())\n }\n\n await Promise.all(promises)\n\n this.instances.forEach(instance => console.log(`> ARDUINO: detected ${instance.getLabel()} on port ${instance.getPath()}`))\n\n resolve()\n })\n }", "onSwitch() {}", "onSwitch() {}", "onSwitch() {}", "function startWebControl () {\n /* GPIO output control function */\n module.exports.Control = function (data){\n\n if(validOutputPin.length>1){\n for (let x in output){\n if(gpCode.out.on[x] === data){\n output[x].on();\n return data;\n }\n else if(gpCode.out.off[x] === data){\n output[x].off();\n return data;\n }\n\telse if(gpCode.out.stat[x] === data){\n if(output[x].isOn){\n\t return gpCode.out.on[x];\n }\n else if(output[x].isOff){\n\t return gpCode.out.off[x];\n }\n }\n }\n }\n else {\n if(gpCode.out.on[0] === data){\n output.on();\n return data;\n }\n else if(gpCode.out.off[0] === data){\n output.off();\n return data;\n }\n }\n };\n}", "function arduinoReady(err) {\nif (err) {\nconsole.log(err);\nreturn;\n}\nconsole.log('Firmware: ' + board.firmware.name\n+ '-' + board.firmware.version.major\n+ '.' + board.firmware.version.minor);\n\n\n}", "get Joystick8Button11() {}", "get Joystick8Button15() {}", "function onOpen(evt) {\n\n \n console.log(\"Connected\"); // Log connection state\n \n doSend(\"getLEDState\"); // Get the current state of the LED\n}", "async toggle_cpu_pin(port, bit) {\n try {\n\t let cmd_index; // map port/bit to cmd_index\n\t if (port==\"A\") {\n switch (bit) {\n case 0: cmd_index=0; break;\n case 2: cmd_index=1; break;\n case 3: cmd_index=2; break;\n\t }\n\t } else {\n\t cmd_index = 3; \n\t }\n\n this.log(`Toggling Programmer Port ${port} bit ${bit}...\\n`, \"blue\");\n await this.at_verify(\"AFCIO\", /^Done/, cmd_index);\n this.log(`P${port}${bit} was toggled.\\n`, \"blue\");\n } catch (e) {\n this.log(\"error: failed to toggle bit.\\n\", \"red\");\n console.error(e);\n }\n }", "get Joystick8Button14() {}", "function dac_trigger_gpio(trg, callback) {\n console.log(\"setting P_On:\" + trg)\n last_trigger_write = new Date();\n\n P_On.writeSync(trg); // set P_On GPIO to pon.\n Trig_Out_1.writeSync(trg);\n Trig_Out_2.writeSync(trg);\n// callback = read_dac_gpio();\n}", "function set_led(on) {\n let lvl = !!!on;\n GPIO.write(STATUS_LED, lvl);\n}", "get Joystick8Button8() {}", "function ledOFF() {\n socket.emit('ledOFF');\n}", "function toggleLED(){\r\n myBLE.read(ledCharacteristic, handleLED);\r\n}", "get Joystick2Button16() {}", "function unExportGpio() {\n log.info(\"unExportGpio\");\n PIR_UpStairs.unexport();\n PIR_UpStairs.unexport();\n LedStrips.unexport();\n }", "get Joystick2Button8() {}", "get Joystick8Button16() {}", "get Joystick8Button17() {}", "function Main(func){\n\t\tTone = func();\n\t}", "function Main(func){\n\t\tTone = func();\n\t}", "function Main(func){\n\t\tTone = func();\n\t}", "function Main(func){\n\t\tTone = func();\n\t}", "function Main(func){\n\t\tTone = func();\n\t}", "function Main(func){\n\t\tTone = func();\n\t}", "function Main(func){\n\t\tTone = func();\n\t}", "get Joystick2Button15() {}", "function ping() {\n // console.log('ping');\n b.digitalWrite(trigger, 0);\n startTime = process.hrtime();\n}", "function ping() {\n // console.log('ping');\n b.digitalWrite(trigger, 0);\n startTime = process.hrtime();\n}", "function toggleRedLed() {\n let val = gpioRedLed.readSync() ^ 1;\n gpioRedLed.writeSync(val);\n return val\n}", "get Joystick5Button11() {}", "function openAllPins() \n{\n for(var i=0;i<pins.length;i++)\n {\n gpio.open(pins[i], \"output\");\n }\n}", "get Joystick5Button16() {}", "function runProgram()\r\n{\r\n //Trigger program LED\r\n ShowLED.write(1);\r\n console.log(\"Show LED ON\")\r\n console.log(\"Program Started\");\r\n \r\n //Trigger LEDs timing\r\n setLEDtimer();\r\n}", "function yFindLed(func)\n{\n return YLed.FindLed(func);\n}", "function setupAudio(){\n\n // Create an Audio input\n mic = new p5.AudioIn();\n // start the Audio Input.\n // By default, it does not .connect() (to the computer speakers)\n mic.start(); \n}", "get Joystick2Button11() {}", "get Joystick8Button5() {}", "get Joystick8Button10() {}", "get Joystick5Button14() {}", "function initArduino() {\n\t// add a listener to be notified when the board is ready\n\tarduino.addEventListener(IOBoardEvent.READY, onReady);\n}", "get Joystick2Button14() {}", "get Joystick7Button11() {}", "get Joystick5Button8() {}", "get JoystickButton11() {}", "function led_blinker() {\n if(led_blinker.state === \"flashing\") {\n led_blinker.led = (led_blinker.led) ? false : true;\n } else if(led_blinker.state === \"on\") {\n led_blinker.led = true;\n } else if(led_blinker.state === \"off\") {\n led_blinker.led = false;\n } \n fs.writeFileSync(\"/sys/class/gpio/gpio61/value\", led_blinker.state? \"1\" : \"0\");\n}", "get Joystick8Button12() {}", "function initializePythonModule() {\n pythonModule.on(configuration.socket.communicationChannel,(data)=>{\n broadcastListenerData(\"python-vs\",data.value);\n });\n\n pythonModule.on(\"disconnect\",()=>{\n console.log(\"Python Module disconnected...\");\n pythonModule = undefined;\n });\n}", "get Joystick8Button19() {}", "static get AMP_ENABLE_PIN (){ return 15 }", "static get PULSE_PIN () { return 3 }", "get JoystickButton15() {}", "get Device() {\n return require('./device').default\n }", "get Joystick7Button15() {}", "function Cfg(options) { // use \"new Cfg()\"\" to create a unique object\n\n var cfg = this ; // for returning our module properties and methods\n var ver = {} ; // a reference to the version compare helper module\n var opt = {} ; // to store argument object (options) passed to constructor\n\n options = options || {} ; // force an arguments object if none was passed\n opt = options ; // assign passed arguments to our permanent object\n\n if( opt.skipTest && (opt.skipTest !== true) )\n opt.skipTest = false ;\n\n if( opt.altPin && !Number.isInteger(opt.altPin) )\n opt.altPin = false ;\n\n try {\n require.resolve(\"mraa\") ;\n }\n catch(e) {\n console.error(\"Critical: mraa node module is missing, try 'npm install -g mraa' to fix.\", e) ;\n process.exit(-1) ;\n }\n cfg.mraa = require(\"mraa\") ; // initializes libmraa for I/O access\n ver = require(\"./version-compare\") ; // simple version strings comparator\n\n\n\n/**\n * Configure the I/O object constructor input arguments to default values.\n *\n * Includes a place to store the default values for the I/O object that is used\n * to manipulate the I/O pin(s) used by this application. The caller will create\n * the I/O object based on the parameter values we send back in the cfg object.\n *\n * The cfg.init() function must be called to configure for a specific IoT board.\n *\n * See mraa API documentation, especially I/O constructor, for details:\n * http://iotdk.intel.com/docs/master/mraa/index.html\n *\n * @member {Object} for storing mraa I/O object to be created by caller\n * @member {Number} Gpio class constructor parm, mraa GPIO pin #\n * @member {Boolean} Gpio class constructor parm, Gpio object lifetime owner\n * @member {Boolean} Gpio class constructor parm, Gpio object addressing mode\n */\n\n cfg.io = {} ; // used by caller to hold mraa I/O object\n cfg.ioPin = -1 ; // set to unknown pin (will force a fail)\n cfg.ioOwner = true ; // set to constructor default\n cfg.ioRaw = false ; // set to constructor default\n\n\n\n/**\n * Using the mraa library, detect which IoT platform we are running on\n * and make the appropriate adjustments to our io configuration calls.\n *\n * Check the case statements to find out which header pin is being\n * initialized for use by this app. Specifically, see the\n * `io = opt.altPin ...` lines in the code below.\n *\n * If we do not recognize the platform, issue an error and exit the app.\n *\n * NOTE: Regarding the Galileo Gen 1 board LED: this board requires the use of\n * raw mode to address the on-board LED. This board's LED is not connected to\n * pin 13, like the Edison and Gen2 Galileo boards. See this page for details\n * <https://iotdk.intel.com/docs/master/mraa/galileorevd.html>.\n *\n * @function\n * @return {Boolean} true if supported platform detected (and initialized)\n */\n\n cfg.init = function() {\n\n var io = opt.altPin || -1 ; // set to bad value if none provided by altPin\n var chkPlatform = true ; // start out hopeful!\n var mraaError = cfg.mraa.SUCCESS ; // for checking some mraa return codes\n\n if( opt.skipTest ) { // skip platform test?\n io = opt.altPin ; // force run on unknown platform with alt pin\n }\n else if( typeof(cfg.mraa.getPlatformType()) === \"undefined\" ) {\n console.error(\"getPlatformType() is 'undefined' -> possible problem with 'mraa' library?\") ;\n chkPlatform = false ; // did not recognize the platform\n }\n else {\n switch( cfg.mraa.getPlatformType() ) { // which board are we running on?\n\n case cfg.mraa.INTEL_GALILEO_GEN1: // Galileo Gen 1\n\n io = opt.altPin ? io : 3 ; // use alternate pin?\n cfg.ioOwner = false ; // raw mode is not recommended\n cfg.ioRaw = true ; // see NOTE above re use of RAW\n break ;\n\n\n case cfg.mraa.INTEL_GALILEO_GEN2: // Galileo Gen 2\n case cfg.mraa.INTEL_EDISON_FAB_C: // Edison\n\n io = opt.altPin ? io : 13 ; // use alternate pin?\n break ;\n\n\n case cfg.mraa.INTEL_GT_TUCHUCK: // Joule (aka Grosse Tete)\n case cfg.mraa.INTEL_JOULE_EXPANSION: // new preferred name for Joule platform\n\n io = opt.altPin ? io : 100 ; // use alternate pin?\n break ; // gpio 100, 101, 102 or 103 will work\n\n\n // following are most potential \"Gateway + Arduino 101 + firmata\" platforms\n case cfg.mraa.INTEL_DE3815: // DE3815 Baytrail NUCs\n case cfg.mraa.INTEL_NUC5: // 5th gen Broadwell NUCs\n case cfg.mraa.INTEL_CHERRYHILLS: // could be found on a NUC/Gateway\n case cfg.mraa.INTEL_UP: // Intel UP board (small Atom board)\n case cfg.mraa.NULL_PLATFORM: // most likely a generic platform/NUC/Gateway\n case cfg.mraa.UNKNOWN_PLATFORM: // might also be a generic platform/NUC/Gateway\n\n if( typeof(opt.devTty) === \"string\" || opt.devTty instanceof String ) {\n mraaError = cfg.mraa.addSubplatform(cfg.mraa.GENERIC_FIRMATA, opt.devTty) ;\n }\n else { // assume standard Arduino 101 serial-over-USB tty name for Linux\n mraaError = cfg.mraa.addSubplatform(cfg.mraa.GENERIC_FIRMATA, \"/dev/ttyACM0\") ;\n }\n\n // imraa + Arduino 101 should add \"+ firmata\" to getPlatformName(), but doesn't always happen\n if( (mraaError === cfg.mraa.SUCCESS) && (/firmata/.test(cfg.mraa.getPlatformName()) || cfg.mraa.hasSubPlatform()) ) {\n io = opt.altPin ? io : (13 + 512) ; // use alternate pin?\n }\n else {\n console.error(\"'firmata' sub-platform required but not detected: \" + cfg.mraa.getPlatformName()) ;\n console.error(\"Attach Arduino 101 (i.e., 'firmata' board) to USB port on your IoT Gateway/NUC.\") ;\n console.error(\"Try disconnecting and reconnecting your Arduino 101 to the USB port on your system.\") ;\n console.error(\"Use 'imraa -a' to initialize your Arduino 101 with the 'firmata' firmware image.\") ;\n chkPlatform = false ; // did not recognize the platform\n }\n break ;\n\n\n default:\n console.error(\"Unrecognized libmraa platform: \" + cfg.mraa.getPlatformType() + \" -> \" + cfg.mraa.getPlatformName()) ;\n chkPlatform = false ; // did not recognize the platform\n }\n }\n\n if( chkPlatform )\n cfg.ioPin = io ; // return the desired pin #\n\n return chkPlatform ;\n } ;\n\n\n\n/**\n * Confirms that we have a version of libmraa and Node.js that works\n * with this version of the app and on this board.\n *\n * If we detect incompatible versions, return false.\n *\n * @function\n * @return {Boolean} true if \"all systems go\"\n */\n\n cfg.test = function() {\n\n var checkNode = false ;\n var checkMraa = false ;\n var isUbuntu = false ;\n\n // check to see if running on Ubuntu\n // stricter requirements for mraa version\n // should also check for Ubuntu version, but not now...\n var fs = require(\"fs\") ;\n var fileName = \"/etc/os-release\" ;\n var fileData = \"\" ;\n if( fs.existsSync(fileName) ) {\n fileData = fs.readFileSync(fileName, \"utf8\") ;\n isUbuntu = fileData.toLowerCase().includes(\"ubuntu\") ;\n }\n\n if( opt.skipTest ) { // if bypassing version testing\n return true ; // pretend platform tests passed\n }\n else if( typeof(cfg.mraa.getPlatformType()) === \"undefined\" ) {\n console.error(\"getPlatformType() is 'undefined' -> possible problem with 'mraa' library?\") ;\n }\n else {\n switch( cfg.mraa.getPlatformType() ) { // which board are we running on?\n\n case cfg.mraa.INTEL_GALILEO_GEN1: // Gallileo Gen 1\n case cfg.mraa.INTEL_GALILEO_GEN2: // Gallileo Gen 2\n case cfg.mraa.INTEL_EDISON_FAB_C: // Edison\n checkNode = checkNodeVersion(\"4.0\") ;\n if( isUbuntu )\n checkMraa = checkMraaVersion(\"1.6.1\", cfg.mraa) ;\n else\n checkMraa = checkMraaVersion(\"1.0.0\", cfg.mraa) ;\n break ;\n\n case cfg.mraa.INTEL_GT_TUCHUCK: // old Joule name (aka Grosse Tete)\n case cfg.mraa.INTEL_JOULE_EXPANSION: // new preferred name for Joule platform\n checkNode = checkNodeVersion(\"4.0\") ;\n if( isUbuntu )\n checkMraa = checkMraaVersion(\"1.6.1\", cfg.mraa) ;\n else\n checkMraa = checkMraaVersion(\"1.3.0\", cfg.mraa) ;\n break ;\n\n case cfg.mraa.INTEL_DE3815: // DE3815 Baytrail NUCs\n case cfg.mraa.INTEL_NUC5: // 5th gen Broadwell NUCs\n case cfg.mraa.INTEL_CHERRYHILLS: // could be found on a NUC/Gateway\n case cfg.mraa.INTEL_UP: // Intel UP board (small Atom board)\n case cfg.mraa.NULL_PLATFORM: // most likely a generic platform/NUC/Gateway\n case cfg.mraa.UNKNOWN_PLATFORM: // might also be a generic platform/NUC/Gateway\n checkNode = checkNodeVersion(\"4.0\") ;\n if( isUbuntu )\n checkMraa = checkMraaVersion(\"1.6.1\", cfg.mraa) ;\n else\n checkMraa = checkMraaVersion(\"0.10.1\", cfg.mraa) ;\n break ;\n\n default:\n console.error(\"Unknown libmraa platform: \" + cfg.mraa.getPlatformType() + \" -> \" + cfg.mraa.getPlatformName()) ;\n }\n }\n return (checkMraa && checkNode) ;\n } ;\n\n\n // \"Private\" helper functions used by cfg.test() function, above.\n // Defined outside of cfg.test() to minimize chance of memory leaks;\n // per Gavin, our resident JavaScript guru.\n\n function checkNodeVersion(minNodeVersion) {\n if( ver.versionCompare(process.versions.node, \"0\") === false ) {\n console.error(\"Bad Node.js version string: \" + process.versions.node) ;\n return false ;\n }\n\n if( ver.versionCompare(process.versions.node, minNodeVersion) < 0 ) {\n console.error(\"Node.js version is too old, upgrade your board's Node.js.\") ;\n console.error(\"Installed Node.js version is: \" + process.versions.node) ;\n console.error(\"Required min Node.js version: \" + minNodeVersion) ;\n return false ;\n }\n else\n return true ;\n }\n\n function checkMraaVersion(minMraaVersion, mraa) {\n if( ver.versionCompare(mraa.getVersion(), \"0\") === false ) {\n console.error(\"Bad libmraa version string: \" + mraa.getVersion()) ;\n return false ;\n }\n\n if( ver.versionCompare(mraa.getVersion(), minMraaVersion) < 0 ) {\n console.error(\"libmraa version is too old, upgrade your board's mraa node module.\") ;\n console.error(\"Installed libmraa version: \" + mraa.getVersion()) ;\n console.error(\"Required min libmraa version: \" + minMraaVersion) ;\n return false ;\n }\n else\n return true ;\n }\n\n\n\n/**\n * Using standard node modules, identify platform details.\n * Such as OS, processor, etc.\n *\n * For now it just prints info to the console...\n *\n * @function\n * @return {Void}\n */\n\n cfg.identify = function() {\n\n if( opt.altPin )\n console.log(\"Alternate I/O pin \" + opt.altPin + \" was used.\") ;\n if( opt.skipTest )\n console.log(\"Platform compatibility tests were skipped.\") ;\n\n console.log(\"node version: \" + process.versions.node) ;\n console.log(\"mraa version: \" + cfg.mraa.getVersion()) ;\n console.log(\"mraa platform type: \" + cfg.mraa.getPlatformType()) ;\n console.log(\"mraa platform name: \" + cfg.mraa.getPlatformName()) ;\n\n var os = require('os') ;\n console.log(\"os type: \" + os.type()) ;\n console.log(\"os platform: \" + os.platform()) ;\n console.log(\"os architecture: \" + os.arch()) ;\n console.log(\"os release: \" + os.release()) ;\n console.log(\"os hostname: \" + os.hostname()) ;\n// console.log(\"os.cpus: \", os.cpus()) ;\n } ;\n\n\n return cfg ;\n}", "get Joystick8Button18() {}", "get Joystick2Button17() {}", "get Joystick5Button15() {}", "async function init() {\n try {\n process.stdin.resume();\n await orb.connect(listen);\n\n // print system/battery state\n console.log(await battery());\n } catch (error) {\n console.log(\"::CONNECTION ERROR\", error);\n }\n}" ]
[ "0.6260263", "0.60906976", "0.59696287", "0.5846195", "0.5734063", "0.5710472", "0.56113666", "0.54286736", "0.5427009", "0.54153293", "0.53943205", "0.53943205", "0.5387146", "0.53404504", "0.53272253", "0.5303377", "0.5301991", "0.5298132", "0.52870667", "0.52645177", "0.5261703", "0.5251458", "0.52388555", "0.5222516", "0.5222516", "0.5222516", "0.5222516", "0.5222516", "0.5222516", "0.5222516", "0.52206177", "0.5219938", "0.520473", "0.5198496", "0.51959586", "0.5183225", "0.51662636", "0.51536757", "0.515133", "0.51385826", "0.5126423", "0.5126423", "0.5126423", "0.5115887", "0.5115678", "0.5109527", "0.50985724", "0.50944763", "0.5078348", "0.50740176", "0.5069102", "0.5040363", "0.5034458", "0.50330085", "0.50302416", "0.50267476", "0.50249106", "0.50234014", "0.50218225", "0.5017548", "0.5006318", "0.5006318", "0.5006318", "0.5006318", "0.5006318", "0.5006318", "0.5006318", "0.50019056", "0.5001049", "0.5001049", "0.49998328", "0.49951592", "0.4993787", "0.4987561", "0.4987051", "0.4981553", "0.49754986", "0.4972504", "0.49720576", "0.4967279", "0.49627528", "0.49617115", "0.49611038", "0.4953589", "0.4950848", "0.49496955", "0.4949419", "0.49468985", "0.49462584", "0.49431863", "0.4942826", "0.49426565", "0.4940419", "0.49394158", "0.4938649", "0.4926345", "0.4923257", "0.49226975", "0.49174297", "0.49165908" ]
0.586769
3
Note: we don't validate that the hour is in the range [0,23] or [1,12].
function parseHour24(d, string, i) { var n = numberRe.exec(string.slice(i, i + 2)); return n ? (d.H = +n[0], i + n[0].length) : -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHour(value) {\n return /^\\d+\\:\\d{2}$/.test(value);\n}", "function checkHourInRange(hourField)\n{\n\tvar hourValue = hourField.val();\n\t\n\tif ((hourValue >= 0) && (hourValue <= 24))\n\t{\n\t\thourField.removeClass('timeError');\n\t}\n\telse {\n\t\thourField.addClass('timeError');\n\t}\n}", "function checkHour(hour) {\n var hour = hour - 1;\n var amPM = (hour > 11) ? \"am\" : \"pm\";\n if(hour > 12) {\n hour -= 12;\n } else if(hour == 0) {\n hour = \"12\";\n }\n return hour + amPM;\n}", "function checkHourMinute(elt)\r\n{\r\n\tvar val = elt.value ;\r\n\tvar t = val.split(\":\");\r\n\t\r\n\tif(t.length != 2)\r\n\t{\r\n\t return false;\r\n\t}\r\n\r\n\tif(t[0].length != 2)\r\n\t{\r\n\t return false;\r\n\t}\r\n\r\n\tif(t[1].length != 2)\r\n\t{\r\n\t return false;\r\n\t}\r\n\r\n\tif(isNaN (t[0]) )\r\n\t{\r\n\t return false;\r\n\t}\r\n\r\n\tif(isNaN (t[1]) )\r\n\t{\r\n\t return false;\r\n\t}\r\n\t\r\n\tif(parseInt(t[0]) < 0 || parseInt(t[0]) > 24 )\r\n\t{\r\n\t return false;\r\n\t}\r\n\r\n\tif(parseInt(t[1]) < 0 || parseInt(t[1]) > 60 )\r\n\t{\r\n\t return false;\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "function standard_24h_time_validp() {\n\t// TODO do validation for realizies---use regexp?\n\treturn true;\n}", "function _is24HourValue(value) {\n\tif(value){\n var hour_min = value.split(':');\n var hour = hour_min[0];\n return ((hour > 12 && hour <= 24) || (hour < 10 && hour >= 0 && hour.length === 2));\n } else {\n return false;\n }\n}", "function valid_time(time) {\n time = time.split(':');\n if (time[0] >= 0 && time[0] <= 24\n && time[1] >= 0 && time[1] <= 59) {\n return true;\n } else {\n return false;\n }\n}", "function isValidTime(time) {\n\tlet timeArray = time.split(':');\n\n\tif (Number(timeArray[0]) > 23) return false;\n\telse if (Number(timeArray[1]) > 59) return false;\n\n\t// Valid inputs assumed\n\treturn true;\n}", "function hourChange(){\n\tif((userInputHour.length === 2) && (userInput < 10)){\n\t\thourNew = userInputHour.slice(1, 2);\n\t} else if(userInputHour > 25) {\n\t\talert('Please insert a proper hour figure')\n\t}\n}", "function checkHoursWorked(hours) {\n /*var nstring = \"0.\" + num.substring(2);\n var integer = parseFloat(nstring);\n integer = integer * 60;\n if (integer % 15 != 0) {\n alert(\"Hours Worked is invalid, it must be in fifteen-minute intervals. E.g. 1.50, 2.75, 3.25 or 1.00.\")\n document.getElementById(\"txtHoursWorked\").focus();\n }*/ \n\n\n if (hours <= 0 || hours > 4) {\n alert(\"Hours Worked must be in between 0 and 4.00.\");\n document.getElementById(\"txtHoursWorked\").focus();\n }else if(!tryParse(hours, 2)){\n alert(\"Hours Worked is invalid, it must be in fifteen-minute intervals. E.g. 1.50, 2.75, 3.25 or 1.00.\");\n document.getElementById(\"txtHoursWorked\").focus();\n }else{\n return true;\n }\n\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}", "@computed('hour')\n get hourWithinRange() {\n const hourWithinRange = this.hour <= 12 && this.hour > 0;\n return !!hourWithinRange;\n }", "function test12HourTime(time12input,time24input){\n\t var time12 = $(time12input);\n\t var time24 = $(time24input);\n\t var value12 = time12.val();\n\t\n var timeMatch = /^(\\d{1,2}):*(\\d{2})*([ap]m)?$/i\n \n if(value12.match(timeMatch) != null){\n time12.removeClass(\"stop\");\n \n var hours = RegExp.$1;\n var mins = RegExp.$2;\n var ampm = RegExp.$3; \n if(Number(hours) > 0 && Number(hours) < 13 && Number(mins) < 60 && Number(mins) > -1){\n time12.addClass(\"go\");\n time24.val(format24HourTimeFrom12HourPieces(hours,mins,ampm));\n time24.change();\n //do nothing right now for blanks\n } else {\n time12.addClass(\"stop\");\n } \n } else if( $.trim(value12) == '' ) {\n time12.addClass(\"yield\");\n } else {\n time12.addClass(\"stop\");\n }\n}", "function isValidTime(time) {\t\r\n\tif (time.val() == '') {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tvar array = time.val().split(':');\t\r\n\tvar min = (+array[0]) * 60 + (+array[1]);\r\n\t\r\n\tif (min < 540 || min > 765 && min < 870 || min > 1000)\r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\r\n}", "function validTime(str) {\n // write code here.\n const [hours, minutes] = str.split(':');\n if (parseInt(hours) > 23 || parseInt(hours) < 0){\n return false;\n }\n if (parseInt(minutes) > 59 || parseInt(minutes) < 0) {\n return false;\n }\n return true;\n}", "function validTime(time, id) \n\t\t{\n\t\t\tvar isValid = false;\n\t\t\t\n\t\t\tif (time === \"\")\n\t\t\t\tisValid = true;\n\t\t\telse \n\t\t\t\tisValid = /([0-1]\\d|2[0-3]):([0-5]\\d)/.test(time);\n\t\t\t\n\t\t\t\n\t\t\treturn changeInputField(isValid, id);\n\t\t}", "function validarHora(hora){\n cadena=/^[0-9]{2}:[0-9]{2}:[0-9]{2}$/;\n if(cadena.test(hora))\n return 1;\n else\n return 0;\n}", "function isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}", "function validateTime(value, field) {\n\tif (value === field.unknown) return []\n\n\t// Check valid_values\n\tfor (let validValue of field.valid_values.split(','))\n\t\tif (value === validValue.trim()) return []\n\n\t// Check empty\n\tif (value === undefined || value === '')\n\t\treturn [`'${field.label}' can not be empty`]\n\n\t// Check format\n\tif (!/^[0-9][0-9]:[0-9][0-9]$/.test(value))\n\t\treturn [`'${value}' is not in correct format HH:mm`]\n\n\t// Check ranges\n\tlet tok = value.split(':')\n\tlet h = parseInt(tok[0])\n\tlet m = parseInt(tok[1])\n\n\treturn h >= 0 && h < 24 && m >= 0 && m < 60\n\t\t? []\n\t\t: [`'${value}' is not a valid time`]\n}", "function checkTime(time){\r\n\tvar re = /^(([01][0-9])|(2[0-3])):[0-5][0-9]$/;\r\n\tif (re.test(time)) return true;\r\n\telse return false;\r\n}", "function hours(hour){\n if (hour == 0){\n hour = '12am'\n }\n else if (hour < 12){\n hour = hour + 'am'\n }\n else if (hour == 12){\n hour = '12pm'\n }\n else {\n hour = (hour - 12) + 'pm'\n }\n return hour\n}", "function checkTime(timeStr) {\r\n\tvar separator = ':';\r\n\tvar regex = /^(\\d\\d):(\\d\\d)$/;\r\n\tif(timeStr.match(regex)) {\r\n\t\tvar array = timeStr.split(separator);\r\n\t\thour = parseInt(array[0]);\r\n\t\tminute = parseInt(array[1]);\r\n\t\tif(hour > 23 || minute > 59) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function validateAndFormat24HoursTimeInput(theTime) {\n var tmpTime = new String(theTime);\n var newTime = \"\";\n if (tmpTime.length > 2 && tmpTime.indexOf(\":\") < 0) {\n //handle 00** template\n if (tmpTime.length == 3 && tmpTime.charCodeAt(0) == 48 && tmpTime.charCodeAt(1) == 48) {\n newTime = tmpTime.substring(0, 2) + \":0\" + tmpTime.substring(2, 3);\n }\n //handle 0*** template\n else if (tmpTime.length == 3 && tmpTime.charCodeAt(0) == 48) \n {\n newTime = \"00:\" + tmpTime.substring(1, tmpTime.length);\n }\n else {\n newTime = tmpTime.substring(0, 2) + \":\" + tmpTime.substring(2, tmpTime.length);\n }\n return validateAndFormat24HoursTimeInput(newTime);\n }\n if (tmpTime.indexOf(\":\") < 0) {\n if (parseInt(tmpTime, 10) < 24) \n {\n if (tmpTime.length == 2)\n newTime = new String(tmpTime + \":00\");\n else {\n if (tmpTime.length > 2) {\n newTime = tmpTime.substring(0, 2) + \":\" + tmpTime.substring(2, tmpTime.length);\n }\n else {\n newTime = new String(\"0\" + tmpTime + \":00\");\n }\n }\n }\n else {\n newTime = \"-1\";\n }\n }\n else {\n var spl = tmpTime.split(\":\");\n if (parseInt(spl[0], 10) < 24 && parseInt(spl[1], 10) < 60) {\n newTime = tmpTime;\n }\n else {\n newTime = \"-1\";\n }\n }\n return newTime;\n}", "function ValidateTime(theHour, theMinutes, theSeconds, theMilisecs, bAm, bPm)\n{\n\t//the result\n\tvar theRes = null;\n\t//convert the data into numbers\n\ttheHour = Get_Number(theHour, null);\n\ttheMinutes = Get_Number(theMinutes, null);\n\ttheSeconds = Get_Number(theSeconds, null);\n\ttheMilisecs = Get_Number(theMilisecs, null);\n\t//do we have am/pm?\n\tif (theHour != null && (bAm || bPm))\n\t{\n\t\t//hour must be 1 to 12\n\t\tif (theHour == 0 || theHour > 12)\n\t\t{\n\t\t\t//fail the hour\n\t\t\ttheHour = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//am only matter if its 12\n\t\t\tif (bAm && theHour == 12)\n\t\t\t{\n\t\t\t\t//convert to 24 hours\n\t\t\t\ttheHour = 0;\n\t\t\t}\n\t\t\telse if (bPm)\n\t\t\t{\n\t\t\t\t//add 12 to the hour\n\t\t\t\ttheHour += 12;\n\t\t\t}\n\t\t}\n\t}\n\t//is the data correct\n\tif (theHour != null && theMinutes != null && theSeconds != null && theMilisecs != null &&\n\t\ttheHour >= 0 && theHour < 24 &&\n\t\ttheMinutes >= 0 && theMinutes < 60 &&\n\t\ttheSeconds >= 0 && theSeconds < 60 &&\n\t\ttheMilisecs >= 0 && theMilisecs < 10000)\n\t{\n\t\t//compose the time into a number\n\t\ttheRes = theHour * 100000000 + theMinutes * 1000000 + theSeconds * 10000 + theMilisecs;\n\t}\n\t//return the result\n\treturn theRes;\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}", "isDisabledHour(date) {\n let isDisabled = false\n if (typeof this.disabled === 'undefined' || !this.disabled) {\n return false\n }\n if (typeof this.disabled.to !== 'undefined' && this.disabled.to) {\n if (date.getHours() < this.disabled.to.getHours()) {\n isDisabled = true\n }\n }\n if (typeof this.disabled.from !== 'undefined' && this.disabled.from) {\n if (date.getHours() > this.disabled.from.getHours()) {\n isDisabled = true\n }\n }\n return isDisabled\n }", "function amFromHourOfDay(hh24)\r\n{\r\n if(hh24 <= 11)\r\n return \"AM\";\r\n else\r\n return \"PM\";\r\n}", "function verifyTime(input)\n{\n if (input.value) {\n var timeStr = input.value.toUpperCase();\n\n var hrsmin = timeStr.split(\":\");\n if (hrsmin.length > 1) {\n if (hrsmin[0] < 0 || hrsmin[0] > 99 || hrsmin[1] < 0 || hrsmin[1] > 59) {\n input.value = \"\";\n input.focus();\n } else\n input.value = ((parseInt(hrsmin[0], 10) * 60) + parseInt(hrsmin[1], 10)).toFixed();\n } else {\n var time = parseInt(timeStr, 10);\n if (isNaN(time) || time < 0 || time > 24*60) {\n input.value = \"\";\n input.focus();\n }\n }\n gasUse();\n }\n return;\n}", "function hourFromHourOfDay(hh24)\r\n{\r\n var retVal = hh24 % 12;\r\n\r\n return (retVal == 0?12:retVal);\r\n}", "function checkOvertimeIsValid(timespanStr){\n let arr = timespanStr.split(':');\n let h = Number(arr[0]);\n let m = Number(arr[1]);\n if(h < 1 || (h == 1 && m < 30)) return false;\n return true;\n}", "function validarHora() {\n\t// usaremos un expresion regular para comprobar que la hora cumple el patron indicado:\n\t// podemos teclear horas de 00 a 23 (0[0-9]|1[0-9]|2[0-3]) Ej: 01 o 12 o 22\n\t// seguido de : [:]\n\t// y para terminar el numero de minutos desde 00 a 59 (0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])\n var exp = /(0[0-9]|1[0-9]|2[0-3])[:](0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])/;\n if (!exp.test(document.getElementById(\"hora\").value)){\n document.getElementById(\"hora\").value = \"error!\";\n document.getElementById(\"hora\").focus();\n document.getElementById(\"hora\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error en la hora. <br/> Formato no correcto Ej. 14:30\";\n return false;\n }\n else {\n document.getElementById(\"hora\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function horario(time) {\n time = time.split(':');\n if (time[0] >= 7 && time[0] <= 8) {\n return true;\n }\n if (time[0] >= 16 && time[0] <= 18) {\n return true;\n }\n if (time[0] == 9 || time[0] == 19) {\n if (time[1] >= 0 && time[1] <= 30) {\n return true;\n }\n }\n return false;\n}", "function to12Hrs(hour){\r\n\t\tif(hour === 0) return [12, \"am\"];\r\n\t\telse if(hour == 12) return [12, \"pm\"];\r\n\t\telse if(hour >= 1 && hour < 12) return [hour, \"am\"];\r\n\t\telse return [hour - 12, \"pm\"];\r\n\t}", "function filterHours(hour) {\n let filter;\n\n if(hour.length === 2){\n filter = function(item) {\n return item[\"HRMM\"].length === 4 && item[\"HRMM\"].startsWith(hour);\n };\n } else if(hour !== \"0\") {\n filter = function(item) {\n return item[\"HRMM\"].length === 3 && item[\"HRMM\"].startsWith(hour);\n };\n } else {\n filter = function(item) {\n return item[\"HRMM\"].length === 2 || item[\"HRMM\"].length === 1;\n };\n }\n\n return filter;\n}", "function setHours() {\n if (hourNow >=11) {\n hour = hourNow - 12\n }\n else {\n hour = hourNow;\n }\n if (minNow > 30) {\n\t\thour++;\n }\n return arrHours[hour];\n}", "function CalculateHour()\n{\n\tfor(var i = 0;i < 43;i++)\n\t{\n\t\thourInt = Math.floor(startHour/60);\n\t\tminuteInt = Math.round(startHour % 60);\n\t\tif(hourInt < 10)\n\t\t{\n\t\t\thour = String.format(\"0\"+hourInt);\n\t\t}\n\t\telse\n\t\t{\n\t\t\thour = String.format(hourInt);\t\n\t\t}\n\t\tif(minuteInt == 0)\n\t\t{\n\t\t\tminute = String.format(\"0\"+minuteInt);\n\t\t}else{minute = String.format(minuteInt);}\n\t\ttime = String.format(hour+\":\"+minute);\n\t\tcolOfTime.push(time);\n\t\tstartHour += 20;\n\t}\n\tConvertToRangesOfHours();\n}", "function checkTime(field)\n{\n var errorMsg = \"\";\n \n // regular expression to match required time format\n var re = /^(\\d{1,2}):(\\d{2})(:00)?([ap]m)?$/;\n var regs = [];\n if(field != '') { \n if(regs = field.match(re)) {\n if(regs[4]) {\n // 12-hour time format with am/pm\n if(regs[1] < 1 || regs[1] > 12) {\n errorMsg = \"Invalid value for hours: \" + regs[1];\n }\n } else {\n // 24-hour time format\n if(regs[1] > 23) {\n errorMsg = \"Invalid value for hours: \" + regs[1];\n }\n }\n if(!errorMsg && regs[2] > 59) {\n errorMsg = \"Invalid value for minutes: \" + regs[2];\n }\n } else {\n \t// not a valid time format\n \tvar onlyInt = field.match(/^\\d+$/);\n \tif (onlyInt) {\n \t\t// pass\n \t} else {\n \t\terrorMsg = \"Invalid time format: \" + field;\n \t}\n }\n }\n\n if(errorMsg != \"\") {\n return errorMsg;\n }\n\n return true;\n}", "function checkTimeDifference(startHour, startMin, endHour, endMin, rowNum)\n{\n\tvar timeDifference = calculateTimeDifference(startHour.val(), startMin.val(), endHour.val(), endMin.val());\n\t\n\t// If the timeDifference isn't a number or negative then show the warning icon\n\tif ((isNaN(timeDifference)) || (timeDifference <= 0))\n\t{\n\t\t// If the time fields are just empty then don't show error\n\t\tif ((startHour.val() == '') && (startMin.val() == '') && (endHour.val() == '') && (endMin.val() == ''))\n\t\t{\n\t\t\t$('#warningIcon' + rowNum).hide();\n\t\t}\n\t\telse {\n\t\t\t// Otherwise show the warning icon\n\t\t\t$('#warningIcon' + rowNum).show();\n\t\t}\t\t\n\t}\n\telse {\n\t\t$('#warningIcon' + rowNum).hide();\n\t}\n}", "function getHoursFromTemplate ( ) {\n\t var hours = parseInt( $scope.hours, 10 );\n\t var valid = ( $scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n\t if ( !valid ) {\n\t return undefined;\n\t }\n\n\t if ( $scope.showMeridian ) {\n\t if ( hours === 12 ) {\n\t hours = 0;\n\t }\n\t if ( $scope.meridian === meridians[1] ) {\n\t hours = hours + 12;\n\t }\n\t }\n\t return hours;\n\t }", "function test(expected, input){\n if(parseHours(input) !== expected)\n \tconsole.log(\"ParseHours Problem with: \"+input);\n else\n console.log(\"Test \"+input+\" passed\");\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 getHoursFromTemplate ( ) {\n var hours = parseInt( $scope.hours, 10 );\n var valid = ( $scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if ( !valid ) {\n return undefined;\n }\n\n if ( $scope.showMeridian ) {\n if ( hours === 12 ) {\n hours = 0;\n }\n if ( $scope.meridian === meridians[1] ) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate ( ) {\n var hours = parseInt( $scope.hours, 10 );\n var valid = ( $scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if ( !valid ) {\n return undefined;\n }\n\n if ( $scope.showMeridian ) {\n if ( hours === 12 ) {\n hours = 0;\n }\n if ( $scope.meridian === meridians[1] ) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate ( ) {\n var hours = parseInt( $scope.hours, 10 );\n var valid = ( $scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if ( !valid ) {\n return undefined;\n }\n\n if ( $scope.showMeridian ) {\n if ( hours === 12 ) {\n hours = 0;\n }\n if ( $scope.meridian === meridians[1] ) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate ( ) {\n var hours = parseInt( $scope.hours, 10 );\n var valid = ( $scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if ( !valid ) {\n return undefined;\n }\n\n if ( $scope.showMeridian ) {\n if ( hours === 12 ) {\n hours = 0;\n }\n if ( $scope.meridian === meridians[1] ) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function d3_time_parseHour24(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.substring(i, i + 2));\n return n ? (date.H = +n[0], i += n[0].length) : -1;\n}", "@computed('hour', 'minute', 'timeOfDay', 'hourWithinRange', 'minuteWithinRange')\n get timeValid() {\n const timeValid = this.hour && this.minute && this.timeOfDay && this.hourWithinRange && this.minuteWithinRange;\n return timeValid;\n }", "function getHoursFromTemplate ( ) {\n\t\t\tvar hours = parseInt( $scope.hours, 10 );\n\t\t\tvar valid = ( $scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n\t\t\tif ( !valid ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif ( $scope.showMeridian ) {\n\t\t\t\tif ( hours === 12 ) {\n\t\t\t\t\thours = 0;\n\t\t\t\t}\n\t\t\t\tif ( $scope.meridian === meridians[1] ) {\n\t\t\t\t\thours = hours + 12;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hours;\n\t\t}", "function check_time()\n{\n var time = prompt(\"Enter time:\");\n //time pattern regular expression\n var regexp = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/;\n\n if (regexp.test(time))\n {\n alert(\"Right time format\")\n }\n else\n {\n alert(\"Wrong time format\")\n }\n}", "function humanHour() {\n var h = hour() % 12;\n if (h == 0) {\n h = 12;\n }\n return h;\n}", "function humanHour() {\n var h = hour() % 12;\n if (h == 0) {\n h = 12;\n }\n return h;\n}", "isWorkingHours(time){\n let date = new Date(time);\n if(date.getHours() >= 6 && date.getHours() < 18){\n return true;\n }\n return false;\n }", "function getHoursFromTemplate() {\n var hours = parseInt($scope.hours, 10);\n var valid = $scope.showMeridian ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if (!valid) {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = parseInt($scope.hours, 10);\n var valid = $scope.showMeridian ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if (!valid) {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = parseInt($scope.hours, 10);\n var valid = $scope.showMeridian ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if (!valid) {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function validateIsMidnight(timeInfo) {\n\n var zeroCounter = 0;\n var charsToCount = timeInfo.length;\n var midnight = false; \n if (timeInfo.length > 2) {\n charsToCount = 2;\n }\n for (ci = 0; ci < charsToCount; ci++) {\n if (timeInfo.charCodeAt(ci) == 48) {\n zeroCounter++;\n }\n }\n if (zeroCounter == charsToCount) {\n midnight = true;\n }\n return midnight;\n}", "function greeter() {\n let currentHour = hour + 3;\n \n if (currentHour >= 0 && currentHour <= 11) {\n console.log('Good Morning!');\n } else if (currentHour >= 12 && currentHour <= 16) {\n console.log('Good Afternoon!');\n } else if (currentHour >= 17 && currentHour <= 21) {\n console.log('Good Evening!');\n } else {\n console.log('Good Night!');\n }\n}", "function getHoursFromTemplate ( ) {\n var hours = parseInt( scope.hours, 10 );\n var valid = ( scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if ( !valid ) {\n return undefined;\n }\n\n if ( scope.showMeridian ) {\n if ( hours === 12 ) {\n hours = 0;\n }\n if ( scope.meridian === meridians[1] ) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function VerificaHora(campo){\n var hora=campo.value;\n var min=campo.value;\n\tvar num = parseInt(hora.substring(0,2));\n var min2 = parseInt(min.substring(3,5));\n if ((num > 19 || num < 7) || min2 > 60){\n \twindow.alert(\"A HORA ESTA FORA DE PADRAO!\");\n \treturn false;\n }else{\n \treturn true;\n }\n \n \n \n \n}", "function validateInterval(value, config) {\n if (value >= 24 && value % 24 == 0) {\n return true;\n } else if (value < 24 && value > 1) {\n return true;\n } else {\n return \"Interval must be between 1-24 or a multiple of 24 hours\";\n }\n }", "function hourOfDay(hh, am)\r\n{\r\n if (hh == 12)\r\n hh = 0;\r\n\r\n return (am == 'AM' ? hh : Number(hh) + 12);\r\n}", "function CheckValidTime(obj) {\r\n var blnComplete = true;\r\n for (i = 0; i < obj.value.length; i++) {\r\n var ch = obj.value.charCodeAt(i);\r\n if ((ch < 48) || (ch > 58))\r\n blnComplete = false;\r\n }\r\n\r\n if (!blnComplete) {\r\n alert('Time format is not correct');\r\n obj.focus();\r\n }\r\n else {\r\n var arrChar = obj.value.split(\":\");\r\n if ((arrChar[0] > 23) || (arrChar[1] > 59)) {\r\n alert('Time format is not correct');\r\n obj.focus();\r\n blnComplete = false;\r\n }\r\n }\r\n return blnComplete;\r\n}", "function validTimeString(timeStr) {\n\tvar timeArray = timeStr.split(\":\");\n\tif (isNaN(parseInt(timeArray[0])) || isNaN(parseInt(timeArray[1]))) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function checkHour(session){\n for (var hour in hours){\n if (session.includes(hour)){\n return hours[hour];\n }\n }\n}", "function hourById(id){\n var h = id/2;\n var hf;\n var exp;\n\n if (id%2 != 0){\n hf = Math.ceil(h) + \":00\";\n h = Math.floor(h) + \":30\";\n }\n else {\n hf = Math.floor(h) + \":30\";\n h = h + \":00\";\n }\n\n exp = \"De \"+h+\" a \"+hf+\" \";\n\n return exp;\n\n}", "function tripsHour(hour) {\n return function(t) {\n return t.hour == hour;\n }\n }", "function tripsHour(hour) {\n return function(t) {\n return t.hour == hour;\n }\n }", "function getHoursRangeComment() {\n var result = true;\n\n if (typeof server_day_of_week != 'undefined' && server_day_of_week < 6) {\n if (typeof server_hour != 'undefined' && (server_hour >= 22 || server_hour < 9)) {\n result = false;\n }\n } else {\n if (typeof server_hour != 'undefined' && (server_hour >= 22 || server_hour < 10)) {\n result = false;\n }\n }\n return result;\n}", "function isInvalidTime(val, counter_date, new_date) {\n var val1, val2;\n if (val === \"from\") {\n val1 = ((counter_date.getUTCHours() >= new_date.getUTCHours()) &&\n (counter_date.getUTCMinutes() > new_date.getUTCMinutes()));\n\n val2 = ((counter_date.getUTCHours() > new_date.getUTCHours()) &&\n (counter_date.getUTCMinutes() >= new_date.getUTCMinutes()));\n\n } else if (val === \"to\") {\n val1 = ((counter_date.getUTCHours() <= new_date.getUTCHours()) &&\n (counter_date.getUTCMinutes() < new_date.getUTCMinutes()));\n\n val2 = ((counter_date.getUTCHours() < new_date.getUTCHours()) &&\n (counter_date.getUTCMinutes() <= new_date.getUTCMinutes()));\n }\n\n return !(val1 || val2);\n}", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function is24HourTime() {\n const date = new Date();\n const localeString = date\n .toLocaleTimeString(document.querySelector('html').getAttribute('lang') || navigator.language)\n .toLowerCase();\n return localeString.indexOf('am') < 0 && localeString.indexOf('pm') < 0;\n}", "function FormatHours(hour)\n{\n if (hour >12)\n {\n hour =hour %12;\n }\n return hour;\n}", "function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid) {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }", "function greeting(hour){\n if(hour>=5 && hour<12){\n console.log(\"Good Morning\");\n }\n else if(hour>=12 && hour<20){\n console.log(\"Good Afternoon\");\n }\n else if(hour>=16 && hour < 20){\n console.log(\"Good Evening\");\n }\n else{\n console.log(\"Good Night\");\n }\n}", "function checkDay(hours)\n{\n if(hours >= 6 && hours <= 12)\n {\n return \"morning\";\n }\n else if(hours >= 13 && hours <= 17)\n {\n return \"afternoon\";\n }\n else if(hours >= 18 && hours <=24 || hours <=5)\n {\n return \"evening\";\n }\n else\n {\n return \"morning\";\n }\n}", "function d3_time_parseHour24(date, string, i) {\n d3_time_numberRe.lastIndex = 0;\n var n = d3_time_numberRe.exec(string.substring(i, i + 2));\n return n ? (date.setHours(+n[0]), i += n[0].length) : -1;\n}", "function HourFromTime(t) {\n typeof t === \"number\";\n return modulo(Math.floor(t / msPerHour), HoursPerDay);\n } // 20.3.1.10 Hours, Minutes, Second, and Milliseconds", "function numHour(hour) {\n let num;\n if (hour.length === 3) {\n num = parseInt(hour[0]);\n } else {\n num = parseInt(hour[0] + hour[1]);\n }\n\n if ((hour[hour.length - 2] === \"P\") && (num != 12)) {\n num = num + 12;\n }\n\n return num;\n}", "getMidDay(hour) {\n return hour >= 12 ? \"PM\" : \"AM\";\n }", "function format_time(hour) {\n if(hour > 23){ \n hour -= 24; \n } \n let amPM = (hour > 11) ? \"pm\" : \"am\"; \n if(hour > 12) { \n hour -= 12; \n } \n if(hour == 0) { \n hour = \"12\"; \n } \n return hour + amPM;\n }", "h (date) {\n const hours = date.getHours();\n return hours === 0\n ? 12\n : (hours > 12 ? hours % 12 : hours)\n }", "function isValidSolarHijriDate(hy, hm, hd) {\n return hy >= -61 && hy <= 3177 &&\n hm >= 1 && hm <= 12 &&\n hd >= 1 && hd <= solarHijriMonthLength(hy, hm)\n}", "function validateWorkDay() {\n var value = 0;\n\n value = $(\"#txtWorkDay\").val();\n\n var re = new RegExp(\"^[0-9]+(\\.[0-9]{1,2})?$\");\n var status;\n\n // Declare a regular expression to use validating the input\n\n // verify that there are no non digit characters in the string\n status = re.test(value);\n // make sure the number is less than 24\n if (status) {\n value = parseFloat(value);\n if (value >= 24) {\n status = false;\n }\n }\n\n if (!status) {\n alert(\"The Workday field must contain a valid number of hours in the work day represented as decimal number less than 24. Please update the value.\");\n // Set the work day to the default value\n $(\"#txtWorkDay\").val(\"8\");\n }\n\n }", "function format_time(hour){\n if(hour > 23){ \n hour -= 24; \n } \n let amPM = (hour > 11) ? \"pm\" : \"am\"; \n if(hour > 12) { \n hour -= 12; \n } \n if(hour == 0) { \n hour = \"12\"; \n } \n return hour + amPM;\n}", "function isHourInPast(hour) {\n // if day selected is today\n if (moment().dayOfYear() === parseInt($stateParams.day)) {\n return hour < moment().hour();\n } else {\n return false;\n }\n }", "upHourEnabled() {\r\n return !this.maxDateTime || this.compareHours(this.stepHour, this.maxDateTime) < 1;\r\n }" ]
[ "0.7551652", "0.75261337", "0.73758394", "0.7366656", "0.72008437", "0.71051514", "0.7091429", "0.7070924", "0.69397914", "0.6867882", "0.6842198", "0.6776657", "0.6726623", "0.6724341", "0.6690905", "0.6671071", "0.66431254", "0.6639305", "0.65944886", "0.65772575", "0.6569999", "0.6567939", "0.6567827", "0.6564299", "0.6490341", "0.6484099", "0.6480498", "0.64683783", "0.6456588", "0.6429956", "0.64179444", "0.6409609", "0.63552505", "0.6329037", "0.6305078", "0.62859464", "0.6281216", "0.6266046", "0.62609506", "0.6259967", "0.6249971", "0.6224698", "0.6224698", "0.6224698", "0.6224698", "0.6222534", "0.6214479", "0.6213738", "0.62073183", "0.62065274", "0.62065274", "0.62006766", "0.61825085", "0.61825085", "0.61825085", "0.61662525", "0.6164637", "0.61618274", "0.615726", "0.6152239", "0.6148909", "0.6146121", "0.6146027", "0.614146", "0.614086", "0.6127903", "0.6127903", "0.6114041", "0.6112365", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.6108087", "0.60938513", "0.60933536", "0.6090556", "0.6071144", "0.6067234", "0.6063678", "0.6063548", "0.60583043", "0.60526365", "0.60447633", "0.6032825", "0.60184145", "0.60183275", "0.6007747", "0.6007471", "0.5985084" ]
0.64952916
24
When the user clicks on the button, toggle between hiding and showing the dropdown content
myFunction() { const dropdown = document.querySelector("#myDropdown"); dropdown.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}", "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.78086853", "0.7671226", "0.7492039", "0.73909956", "0.73507655", "0.7345771", "0.733192", "0.7264133", "0.7262537", "0.72421074", "0.72128516", "0.721195", "0.71751916", "0.7170899", "0.71551865", "0.7150268", "0.7145991", "0.71219933", "0.7102685", "0.7097431", "0.7092747", "0.7091917", "0.708534", "0.70791435", "0.7070383", "0.7062354", "0.70526874", "0.70485836", "0.70236564", "0.7010393", "0.70102197", "0.700729", "0.700389", "0.70028704", "0.69942933", "0.6994111", "0.6991057", "0.6987531", "0.69850177", "0.6978712", "0.6967247", "0.69646573", "0.6958163", "0.69578445", "0.6942459", "0.6930674", "0.69236493", "0.6908804", "0.6902528", "0.68894184", "0.6876645", "0.6862844", "0.68564016", "0.68454355", "0.6845187", "0.6838733", "0.6836812", "0.6829922", "0.6815373", "0.68125695", "0.6809369", "0.68074065", "0.68057144", "0.6802885", "0.6802885", "0.6802885", "0.6802885", "0.6802885", "0.6802885", "0.6802885", "0.6785991", "0.677647", "0.67712474", "0.6767587", "0.6765561", "0.6759275", "0.6751503", "0.67503434", "0.6745883", "0.6742857", "0.6728979", "0.67221385", "0.67096955", "0.6708224", "0.67021567", "0.66989255", "0.6684438", "0.6684438", "0.6684438", "0.66801137", "0.6679686", "0.6679686", "0.6679686", "0.6679686", "0.6679686", "0.6679686", "0.6679686", "0.6679686", "0.6679686", "0.6671952" ]
0.68688893
51
Method to retrieve application state from store
function getAppState() { return TranslationsStore.getStrings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAppState() {\n return UserStore.getData();\n}", "function getAppState() {\n return {\n users: AppStore.getUsers(),\n roles: AppStore.getRoles(),\n userToEdit: AppStore.getUserToEdit()\n }\n}// === end of function to get the state === //", "function getAppState() {\n return {\n searchGridState: ApiStore.getData(),\n didFirstSearch: ApiStore.didFirstSearch(),\n states: ApiStore.getStates(),\n orgTypes: ApiStore.getOrgTypes(),\n cities: ApiStore.getCities(),\n counties: ApiStore.getCounties(),\n };\n}", "function getAppState() {\n\t //console.log(\"A CHANGE IN USER OR POST STORE\");\n\t return {\n\t allPosts: PostStore.getAll(),\n\t currentUser: UserStore.getCurrentUser(),\n\t isLoggedIn: UserStore.isSignedIn(),\n\t isAdmin: UserStore.isAdmin(),\n\t currentSongList: PostStore.getSortedPosts(),\n\t currentSong: PostStore.getCurrentSong()\n\t };\n\t}", "function getState() {\n return JSON.parse(device.localStorage.getItem(stateKey));\n}", "function loadState() {\n try {\n const serialisedState = localStorage.getItem('app_state');\n if (!serialisedState) return undefined;\n return JSON.parse(serialisedState);\n } catch (e) {\n return undefined;\n }\n}", "getAppState() {\n return window.appState;\n }", "function getStateFromStores() {\n return {\n // usercontext: UserContextStore.getContext()\n\t\t// data: DeploymentOptionsStore.getData()\n }\n}", "function getStoreState() {\n return {\n results: VotingResultsStore.getResults(),\n showReturnToWorkspace: false,\n };\n}", "function getState () {\n // get app state\n const state = window.getCleanAppState()\n // remove unnecessary data\n delete state.localeMessages\n delete state.metamask.recentBlocks\n // return state to be added to request\n return state\n }", "function getStateFromStore() {\n return {\n workspaceList: WorkspaceStore.getWorkspaceList(),\n workspaceValue: WorkspaceStore.getWorkspaceIndex().toString()\n };\n}", "function getStateFromStores() {\n return {\n messages: MessageStore.getMessagesforCurrentThread(),\n userName: MessageStore.getUserNameForCurrentThread(),\n threadID: { id: \"1234\"}, //ThreadStore.getCurrentThreadID(),\n };\n}", "async _getState () {\n const serialized = await AsyncStorage.getItem(this._storageKey)\n return serialized ? JSON.parse(serialized) : undefined\n }", "_getStateFromStore() {\n return PersonStore.getPeople()\n }", "function loadFromLocalStorage() {\n try {\n const jsonState = localStorage.getItem(\"appState\");\n if (jsonState === null) \n return undefined;\n return JSON.parse(jsonState);\n } catch (e) {\n console.warn(e);\n return undefined;\n }\n}", "function getAllState() {\n return {\n data : GameStore.getAll(),\n }\n}", "function getApplicationState() {\n return {\n contactInfoVisible: CheckoutRepository.getContactInfoVisible(),\n contactInfo: CheckoutRepository.getContactInformation()\n };\n}", "function getState () {\n return state\n }", "function getState () {\n return state\n }", "function getState() {\n return window.stokr.model.getState();\n }", "function loadStoredInfo() {\n try {\n const stored = JSON.parse(localStorage.getItem('FULL_STATE'));\n return Object.assign(initialState, stored);\n }\n catch (err) {\n console.error(err);\n return initialState;\n }\n}", "getAppTitleState() {\r\n const state = this.store.getState();\r\n return {\r\n title: state.appTitleState.title\r\n };\r\n }", "function getState() {\n generalServices.addLogEvent('stateServices', 'getState', 'Start');\n return $q(function (resolve, reject) {\n var params = { sessionId: window.localStorage.sessionId, id: window.localStorage.id, loggingLevel: window.localStorage.loggingLevel };\n\n generalServices.callRestApi('/getState', params)\n .then(function (data) { // Data \n if (data.error != \"\") {\n userServices.userDataNotFoundHandler();\n reject();\n } else {\n resolve(data.state);\n }\n },\n function () { reject(); });\n });\n }", "static async loadState(state) {\n const itemsString = await AsyncStorage.getItem('@MobilePocket:items');\n console.log('itemsString', itemsString);\n if (itemsString === null) {\n console.log('there are no persisted items yet');\n return {...state};\n }\n return {\n ...state,\n items: JSON.parse(itemsString)\n };\n }", "function get(store) {\n var value = {};\n store.subscribe(function (state) {\n value = state;\n })();\n return value;\n}", "function getInstance() {\n if (!instanceOf ) {\n instanceOf = new AppState();\n }\n return instanceOf;\n }", "function getSavedState(key) {\n return JSON.parse(window.localStorage.getItem(key))\n}", "function rehydrate() {\n // inject initial state into stores\n return _store2.default.set(window.__STATE);\n}", "get_all(){\n let product = productStore.state\n let cart = cartStore.state\n let state = { product, cart }\n return state\n }", "function getState() {\n return state;\n }", "function retrieveDeviceState() {\n /*\n * If the user has selected the application interface, device type and\n * device, retrieve the current state of the selected device.\n */\n if ( DashboardFactory.getSelectedDeviceType()\n && DashboardFactory.getSelectedDevice()\n && DashboardFactory.getSelectedApplicationInterface()\n ) {\n DeviceType.getDeviceState(\n {\n typeId: DashboardFactory.getSelectedDeviceType().id,\n deviceId: DashboardFactory.getSelectedDevice().deviceId,\n appIntfId: DashboardFactory.getSelectedApplicationInterface().id\n },\n function(response) {\n // Inject our own timestamp into the response\n response.timestamp = Date.now();\n vm.deviceStateData.push(response);\n },\n function(response) {\n debugger;\n }\n );\n }\n }", "loadComponentState() {\n const storedVal = this.getItem(LocalStorageStore.reactComponentStateKey);\n if (storedVal) {\n return JSON.parse(storedVal);\n }\n return {};\n }", "_getStateObj () {\n return {\n openTab: PageStore.getOpenTab(),\n allInsights: InsightsStore.getAllInsights()\n }\n }", "function loadState() {\n return loadStateFromExtensionStorage()\n .then(value => {\n return value || loadStateFromLocalStorage()\n })\n .catch(error => {\n console.error(\"Could not load state\", error)\n return undefined\n })\n}", "function getState(){\n\tif(fs.existsSync(getPath('cache/state.json'))){\n\t\tlet state_json = fs.readFileSync(getPath('cache/state.json'));\n\t\ttry{\n\t\t\tlet state = JSON.parse(state_json);\n\t\t\treturn state;\n\t\t}catch(e){console.log('Fail to read state.json');}\n\t}\n\n\t// Load default state from state.js, for first time run\n\tlet state = require(getPath('cache/state'));\n\tfs.writeFileSync(getPath('cache/state.json'), JSON.stringify(state));\n\n\treturn state;\n}", "getState() {\n return state;\n }", "function getStoreProps(state) {\n return state\n}", "function loadState () {\n var state = localStorage.getItem(STORAGE_KEY);\n if (!state) {\n state = DEFAULT_STATE;\n saveState(state);\n } else {\n state = JSON.parse(state);\n }\n return state;\n}", "function getCurrentState() {\n\t\treturn {};\n\t}", "static async getInitialProps(appContext) {\n const appProps = await App.getInitialProps(appContext);\n const initialStoreState = await fetchInitialStoreState();\n\n\n return {\n ...appProps,\n initialStoreState\n };\n }", "get currentAppId() {\n return storeData.currentAppId;\n }", "get kvstore () {\n return this.app.kvstore;\n }", "get() {\n return this._state\n }", "function getStateAndProcess() {\n generalServices.addLogEvent('stateServices', 'getStateAndProcess', 'Start');\n return $q(function (resolve, reject) {\n var params = { sessionId: window.localStorage.sessionId, id: window.localStorage.id, loggingLevel: window.localStorage.loggingLevel };\n\n generalServices.callRestApi('/getState', params)\n .then(function (data) { // Data \n if (data.error != \"\") {\n userServices.userDataNotFoundHandler();\n reject();\n } else {\n // Always set loggingLevel in case it has changed\n if (data.loggingLevel != null) {\n window.localStorage.setItem(\"loggingLevel\", data.loggingLevel);\n //alert(data.loggingLevel);\n }\n\n if (window.state != data.state) {\n setState(data.state);\n resolve();\n } else {\n resolve();\n }\n }\n },\n function () { reject(); });\n });\n }", "function storeAppState() {\n\tapp_state['global_vars'] = global_vars;\n\tsetItemInLocalStorage(\"dx_app_state\",btoa(JSON.stringify(app_state)));\n}", "function getStores() {\n return [MainStore];\n}", "function ApplicationStore() {\n this.currentPageName = null;\n this.currentPage = null;\n this.currentRoute = null;\n this.pages = {\n home: {\n text: 'Home',\n route: 'home'\n },\n about: {\n text: 'About',\n route: 'about'\n }\n };\n}", "getState() {\n return this._platformLocation.getState();\n }", "function getSavedState(key) {\n if (window.localStorage.getItem(key) === 'undefined') {\n return undefined;\n }\n return JSON.parse(window.localStorage.getItem(key))\n}", "function get_offline_data() {\n var data = store.get(\"app_activities\", []);\n return data;\n}", "getState() {\n return JSON.parse(JSON.stringify(this._state));\n }", "getState() {\n\n }", "function loadState() {\n return localStorage[\"Inspector-Settings\"] ? JSON.parse(localStorage[\"Inspector-Settings\"]) : {\n appCompiler: true,\n sysCompiler: false,\n verifier: true,\n release: true,\n symbolsInfo: false\n };\n}", "function getUserState() {}", "function buildingGetSaveState() {\n var result = {};\n\n result.storage = buildingStorage.getSaveState();\n\n return result;\n}", "function getStateFromAlbumStore () {\n // console.log('AlbumCardList ' + this.state.albumList)\n return {\n albumList: AlbumStore.getAlbumList()\n }\n}", "getState() {\n return this._state;\n }", "getState() {\n return this.state;\n }", "function getProductState() {\n return {\n allProducts: ProductStore.getProducts()\n }\n}", "getStoresLoading() {\r\n return this.store.pipe(select(StoreFinderSelectors.getStoresLoading));\r\n }", "function getDataFromAppState(appState) {\n\n //Whatever we return is put on props\n return {\n message: 'hello from the other side',\n currentValue: appState.currentValue,\n state: appState\n }\n}", "function loadCurrentApplication() {\n ApplicationsService\n .loadCurrent($stateParams.companyId, $stateParams.appId)\n .then(function resolve(response) {\n vm.current = response.data.app;\n });\n }", "getState () {\n return _data;\n }", "getState(state) {\n return state[this.key];\n }", "getState(state) {\n return state[this.key];\n }", "get_state() {\n return this.state;\n }", "getAvailableStores() {\n // Call the function to load all available stores\n var data = autocomplete.cloudLoadAvailableStores().then((value) => {\n // Get the stores and ids\n var titles = value.titles;\n var ids = value.ids;\n var addrs = value.addrs;\n var names = value.names;\n\n // Save the names and ids to the state\n var temp = [];\n for (var i = 0; i < ids.length; i++) {\n temp.push({\n title: titles[i],\n id: ids[i],\n addr: addrs[i],\n storeName: names[i]\n });\n }\n\n temp.push({\n title: \"Register a store...\",\n id: -1\n });\n\n return temp;\n });\n\n return data;\n }", "onStoreChange() {\n this.setState(this._getStateFromStore);\n }", "getSaveStates() {\n const getSaveStatesTask = async () => {\n let cartridgeObject = await WasmBoyMemory.getCartridgeObject();\n if (!cartridgeObject) {\n return [];\n } else {\n return cartridgeObject.saveStates;\n }\n };\n\n return getSaveStatesTask();\n }", "function getTodoState() {\n return {\n allTasks: TaskStore.getAll(),\n areAllComplete: TaskStore.allComplete()\n };\n}", "state() {\n return this.context.state;\n }", "function getAllState() {\r\n return get('/state/getall').then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "initialiseStore (state) {\n if (localStorage.getItem('store')) {\n this.replaceState(\n Object.assign(state, JSON.parse(localStorage.getItem('store')))\n )\n }\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return this._platformLocation.getState();\n }", "getState() {\n return undefined;\n }", "function getStore() {\n return LocalDBManager.getStore('wavemaker', 'offlineChangeLog');\n }", "getState() {\n if (this.state) {\n return this.state;\n }\n\n if (this.options.getState instanceof Function) {\n return this.options.getState();\n }\n\n return {};\n }", "function getStateFromDb() {\r\n console.log('clientApp: getting state of the sisbot from db');\r\n $http({\r\n method: \"GET\",\r\n url: 'sis/getState'\r\n }).then(function (response) {\r\n state = response.data.state;\r\n\r\n curPlaylist = state.curPlaylist;\r\n socket.emit('changePL',state.curPlaylist);\r\n // use curPlaylist and Playlist db\r\n getPlaylistsFromDb()\r\n });\r\n }", "function getBuildingState() {\n return {\n data: MapitStore.getAll()\n };\n}", "observe(state) {\n return {\n name: state.app.name\n }\n }", "static get store() {\n if (!this._store) {\n this._store = {};\n }\n return this._store;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "function getLibrary(){\n return {items: AppStore.getLibrary()}\n}", "function AppStore() {\n _classCallCheck(this, AppStore);\n\n var _this = _possibleConstructorReturn(this, (AppStore.__proto__ || Object.getPrototypeOf(AppStore)).call(this));\n\n _this.client = null;\n _this.commandLog = [];\n\n __WEBPACK_IMPORTED_MODULE_6__dispatcher__[\"a\" /* default */].register(function (action) {\n // this._log(`Sent action: ${JSON.stringify(action)}`);\n switch (action.actionType) {\n case __WEBPACK_IMPORTED_MODULE_7__constants_app_constants__[\"a\" /* default */].APP_CLIENT_SETUP:\n _this.connectAndSetupClient(action.loginOptions);\n break;\n\n case __WEBPACK_IMPORTED_MODULE_7__constants_app_constants__[\"a\" /* default */].APP_LOGIN:\n _this.connectAndSetupClient(action.loginOptions);\n if (_this.audioView) _this.audioView.resume();\n break;\n\n default:\n // nop\n }\n });\n\n // Register callback to handle app Actions\n __WEBPACK_IMPORTED_MODULE_9__sculpture_store__[\"a\" /* default */].on(__WEBPACK_IMPORTED_MODULE_3_anyware_lib_game_logic_sculpture_store___default.a.EVENT_CHANGE, function (changes, metadata) {\n _this.emitChange();\n setTimeout(function () {\n _this.client.sendStateUpdate(changes, metadata);\n _this._debug('Sent state update: ' + JSON.stringify(changes));\n }, 0);\n });\n _this.sculptureActionCreator = new __WEBPACK_IMPORTED_MODULE_4_anyware_lib_game_logic_actions_sculpture_action_creator___default.a(__WEBPACK_IMPORTED_MODULE_6__dispatcher__[\"a\" /* default */]);\n\n _this.audioInitialized = false;\n _this.audioView = new __WEBPACK_IMPORTED_MODULE_5_anyware_lib_views_audio_view___default.a(__WEBPACK_IMPORTED_MODULE_9__sculpture_store__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_8__config__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_6__dispatcher__[\"a\" /* default */]);\n _this.audioView.load(function (err) {\n if (err) {\n return console.log('AudioView error: ' + err);\n }\n _this.audioInitialized = true;\n console.log('Loaded sounds');\n });\n return _this;\n }", "function getTodoState() {\n return {\n allTodos: TodoStore.getAll(),\n areAllComplete: TodoStore.areAllComplete()\n };\n}", "getStores() {\n Service.get(this).getStores(state.get(this).params.companyId);\n }", "componentDidMount(){\n this.getStores();\n \n }" ]
[ "0.8153088", "0.7872657", "0.7517885", "0.74018997", "0.71385133", "0.70886946", "0.70465195", "0.69950664", "0.6862005", "0.682821", "0.66446626", "0.66405934", "0.6565479", "0.6389475", "0.63688415", "0.6368136", "0.63419384", "0.6227596", "0.6227596", "0.62041265", "0.6189606", "0.6169101", "0.61625415", "0.6086097", "0.6078027", "0.6060591", "0.6056088", "0.6029503", "0.6025096", "0.6022284", "0.6017274", "0.60170203", "0.60056984", "0.5996681", "0.5974637", "0.59070903", "0.59005016", "0.5895548", "0.58642775", "0.5856925", "0.58492965", "0.5844214", "0.5839017", "0.58276325", "0.58220494", "0.58102995", "0.58028066", "0.58013374", "0.5787078", "0.578233", "0.5776876", "0.57585967", "0.57531804", "0.5749254", "0.57475257", "0.57427305", "0.57389456", "0.57385397", "0.5738482", "0.5738397", "0.5731875", "0.57315063", "0.57274765", "0.5720842", "0.5720842", "0.57076514", "0.570444", "0.56986773", "0.5670221", "0.566645", "0.56657183", "0.5663525", "0.56604385", "0.56576574", "0.56576574", "0.56576574", "0.56576574", "0.56576574", "0.565764", "0.5657331", "0.56379384", "0.5635687", "0.56192046", "0.5618038", "0.56161755", "0.56135136", "0.56135136", "0.56135136", "0.56135136", "0.5605725", "0.5595064", "0.55839986", "0.55804235", "0.55660015" ]
0.6756284
16
Author: ofa Function that validates al inputs in div with id=setcion_id
function validate_section(section_id){ var required_valid_status = email_valid_status = true; $(section_id+' input.required-input').each(function(){ $(this).removeClass('not-valid required'); if(!$(this).val().length){ required_valid_status = false; $(this).addClass('not-valid required'); } }); $(section_id+' textarea.required-text').each(function(){ $(this).removeClass('not-valid required'); if(!$(this).val().length){ required_valid_status = false; $(this).addClass('not-valid required'); } }); $(section_id+' select.required-select').each(function(){ $(this).removeClass('not-valid required'); if($(this).val()==0){ required_valid_status = false; $(this).addClass('not-valid required'); } }); $(section_id+' input.required-email').each(function(){ $(this).removeClass('not-valid required'); if(!$(this).val().length){ required_valid_status = false; $(this).addClass('not-valid required'); } else { var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; if ( !regex.test($(this).val()) ){ email_valid_status = false; $(this).addClass('not-valid required'); } } }); if (!required_valid_status) { errors.push('required-field') } if (!email_valid_status) { errors.push('invalid-email') } return (required_valid_status && email_valid_status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n \n $(\".requisito\").each(function(index,value){\n \n id= $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo= $(value).children(\".nombre_requisito\").text();\n estatusViejo= $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n { \n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n\n $(\".requisito\").each(function(index,value){\n\n id = $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo = $(value).children(\".nombre_requisito\").text();\n estatusViejo = $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n {\n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "function validateId () {\r\n\tvar idEl = getFormElementById('numeroidentificacion_c');\r\n\tvar tipoIdEl = getFormElementById('tipoidentificacion_c');\r\n\tvar tipoId = 'nif';\t// Indica si el tipo de documento es un NIF o NIE (puede ser pasaporte)\r\n\tif (! tipoIdEl) {\r\n\t\tconsole.warn(\"No se ha definido el campo Tipo de Identificación, se asume que es un NIF.\");\r\n\t} else {\r\n\t\ttipoId = tipoIdEl.options[tipoIdEl.selectedIndex];\r\n\t}\r\n\tif (! idEl) {\r\n\t\tconsole.warn(\"No se ha definido el campo NIF.\");\r\n\t\treturn true;\r\n\t} else {\r\n\t\tswitch (tipoId.value) {\r\n\t\t\tcase 'nif': \r\n\t\t\tcase 'nie': return isValidDNI(idEl.value); break;\r\n\t\t\tcase 'cif': return isValidCif(idEl.value); break;\r\n\t\t\tdefault: console.log(\"Tipo de identificación no validable.\");\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}\r\n}", "function validarCampos(ids)\n{\n var estaTodoOk = true;\n\n for (x = 0; x < ids.length; x++) {\n\n //alert(document.getElementById(cars[x]).value);\n if ($(ids[x]).find(\"input\").val() == \"\") {\n $(ids[x]).addClass(\"has-error\")\n //document.getElementById(cars[x]).style.borderColor = \"red\";\n estaTodoOk = false;\n } \n }\n\n if (!estaTodoOk) {\n toastr.error(\"Llene los campos obligatorios\");\n //alert(\"Llene los campos obligatorios\");\n }\n\n return estaTodoOk;\n}", "function eleValidate(id) {\n\t// Se è presente l'identificativo dell'elemento form\n\t// allora recuperiamo tutti gli elementi di tipo input presenti nel form\n\t// e li sottoponiamo a verifica\n\t// altrimenti la verifica viene attivata dal listener\n\n\tvar pattern;\n\n\tif (typeof(id) == \"string\") {\n\t\t//scansione elementi\n\t\t// recuperiamo tutti gli elementi di tipo input presenti nel form\n\t\tpattern = \"#\" + id + \" input\";\n\t} else {\n\t\tpattern = \"#\" + this.name;\n\t}\n\n\tvar fields = YAHOO.util.Selector.query(pattern);\n\t\n\tfor (var i = 0; i < fields.length; i++) {\n\t\tvar className = fields[i].className;\n\t\tvar classResult = className.split(\" \");\n\t\tfor (var j = 0; j < classResult.length; j++) {\n\t\t\tvar rule = formValidation.rules[classResult[j]];\n\t\t\t/* Se esiste (typeof) la regola 'rule' nell'oggetto formValidation\n\t\t\t * verifichiamo (rule.test) la corrispondenza del valore inserito\n\t\t\t * dall'utente con la regola attuale. Se non c'è match vuol\n\t\t\t * dire che il valore inserito non è valido e accanto al modulo\n\t\t\t * viene inserito un elemento span per visualizzare il messaggio\n\t\t\t * di errore corrispondente\n\t\t\t */\n\n\t\t\tif (typeof rule != \"undefined\") {\n\t\t\t\t//\n\t\t\t\tif (!rule.test(fields[i].value)) {\n\t\t\t\t\t//YAHOO.util.Event.stopEvent(id);\n\t\t\t\t\tshowError(fields[i], formValidation.errors[classResult[j]]);\n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}\n\n\t// I controlli sono stati superati con successo\n\treturn true\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"estado\").value;\n var porId2 = document.getElementById(\"nombre\").value;\n var porId3 = document.getElementById(\"codigo\").value;\n \n\n $(\".municipio\").each(function(index,value){\n\n \n \n nombre_municipioViejo= $(value).children(\".nombre_municipio\").text();\n codigoViejo= $(value).children(\".codigo\").text();\n\n });\n var id_estadotabla = $(\".id_estado\").val();\n if((id_estadotabla==porId )&&(nombre_municipioViejo==porId2) &&(codigoViejo==porId3))\n { \n MensajeModificarNone();\n return false;\n }else\n {\n return true;\n }\n\n}", "function marcar_elemento_valido(id_input){\n if($(id_input).hasClass(\"is-invalid\"))\n $(id_input).removeClass(\"is-invalid\")\n\n $(id_input).addClass(\"is-valid\")\n}", "function verificarCamposForm(id){\n // se verifican cuantos campos tiene el formulario\n // la ultima posicion corresonde al boton de envío\n for (let i = 0; i < $(id)[0].length - 1; i++) {\n let campo = $(id)[0][i];\n let value = $(campo).val();\n let select = $(campo).attr('id');\n select = '#'+select;\n\n if(value == \"\" || value == null || $(select).hasClass('is-invalid')) {\n return false;\n }\n }\n return true;\n}", "function validarCamposDetalle(){\r\n if(document.getElementById(\"Cantidad\").value == \"\"){\r\n alert(\"falta la cantidad\");\r\n return false;\r\n }\r\n if(document.getElementById(\"Precio\").value == \"\"){\r\n alert(\"falta el precio\");\r\n return false;\r\n }\r\n return true;\r\n}", "function id_Valid(){\r\n const id = document.getElementById(\"id_input\");\r\n const id_err = document.getElementById(\"err_id\");\r\n\r\n const ex = /^(((\\d{2}((0[13578]|1[02])(0[1-9]|[12]\\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\\d|30)|02(0[1-9]|1\\d|2[0-8])))|([02468][048]|[13579][26])0229))(( |-)(\\d{4})( |-)(\\d{3})|(\\d{7}))/;\r\n\r\n if(id.value.length === 13 || id.value.length === 0 ){\r\n id_err.innerText = \"\";\r\n }\r\n if(id.value.length != 13){\r\n id_err.innerText = \"SA ID's are 13 Characters long \\n\";\r\n errs = \" length\";\r\n }\r\n if (!(id.value.match(/^[0-9]*$/g))){\r\n id_err.innerText += \"Only numeric Values\\n\";\r\n errs += \" num\";\r\n }\r\n if(!(id.value.toString().match(ex))){\r\n id_err.innerText += \"invalid SA ID format\";\r\n errs += \" format\";\r\n }\r\n if( id.value.length === 0 || (id.value.length === 13 && (id.value.toString().match(ex)) && (id.value.match(/^[0-9]*$/g)))){\r\n id_err.innerText = \"\";\r\n errs = \"\";\r\n }\r\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 verifyInput(fildset){\n let requiredElems = Array.from(fildset.querySelectorAll('input[required]'));\n console.log(requiredElems.length);\n\n if(requiredElems.length == 0){\n return;\n } else {\n let flag = requiredElems.every(notNull);\n\n if (flag){\n console.log('все поля заполнены');\n fildset.querySelector('.verifiable-btn').removeAttribute('disabled');\n } else {\n console.log('есть не заполненые поля');\n fildset.querySelector('.verifiable-btn').setAttribute('disabled', 'disabled');\n }\n }\n\n function notNull(element, index, array) {\n if(element.type == 'radio' || element.type == 'checkbox'){\n let name = element.name;\n console.log(name);\n let arrBtns = Array.from(fildset.querySelectorAll('input[name=\"'+name+'\"]'));\n console.log(arrBtns.some(isChecked));\n if(arrBtns.some(isChecked)){return element;}\n } else if (element.type == 'text' && element.value.trim() != ''){\n return element;\n }\n }\n\n function isChecked(el){\n console.log('value = '+el.value.trim());\n if(el.checked && el.value.trim() != ''){\n return el;\n }\n }\n}", "function validarParametrosBusqueda(){\n var idFicha = $(\"#lIdficha\").text();\n var idResult = listaIDSResultadoSel.length;\n var idInstr = $(\"#lIdInstructor\").text();\n \n if(idFicha != \"\" && idResult > 0 && idInstr != \"\"){\n return true;\n }\n\n return false;\n}", "function marcar_elemento_no_valido(id_input){\n if($(id_input).hasClass(\"is-valid\"))\n $(id_input).removeClass(\"is-valid\")\n\n $(id_input).addClass(\"is-invalid\")\n}", "function validatemodalbox() {\n isValid = true;\n if (document.getElementById(\"namahasiswa\").value == \"\"|| document.getElementById(\"NoInduk\").value == \"\"\n ||document.getElementById(\"Jurus\").value ==\"\"||document.getElementById(\"Angkat\").value==\"\" ) {\n isValid = false;\n alert(\"Semua Data Wajib Diisi\");\n editfailalert();\n } else {\n isValid = true;\n editalert();\n }\n return isValid;\n}", "function validate() {\n if (id1.value == \"\" || id2.value == \"\" || id3.value == \"\" || id4.value == \"\" || id5.value == \"\" || id6.value == \"\") {\n alert(\"all feilds are mandatory_feilds cannot be empty\");\n return false;\n } else {\n return true;\n }\n}", "function ValidarFields() {\r\n\r\n\tif(document.getElementById('codigo').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el código del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.getElementById('nombre').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el nombre del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.getElementById('precio').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el precio del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n}", "function validation(id){\t\n\tvar value = $(\"#\"+id).val();\t\n\tif(parseInt(value) >12){\n\t\t$(\"#vaccinationCondition\").css(\"display\",\"none\");\n\t}else{\n\t\t$(\"#vaccinationCondition\").css(\"display\",\"block\");\n\t}\n\t$(\"#patientDateOfBirth\").val(calculateDob(dob))\n\t\n }", "function validateAll(type,formId){\n\t// Type: INDIVIDUAL, COMBINED or DETECT\n\tvar errorFound=0;\n\tif(type==\"INDIVIDUAL\") resetAll(formId); // reset all elems first\n\tvar form=document.getElementById(formId);\n\tfor(var i=0;i<form.elements.length;i++){\n\t\tvar elem=form.elements[i];\n\t\tif(elem==null) return false;\t// element not found\n\t\tif(elem.type.toUpperCase()==\"submit\".toUpperCase() || elem.type.toUpperCase()==\"reset\".toUpperCase()) continue; // skip submit/reset buttons\n\t\tif(type==\"INDIVIDUAL\")\n\t\t\tvar errorElem=document.getElementById(elem.id+\"_error\");\n\t\t// Text fields\n\t\tif(elem.tagName.toUpperCase()==\"input\".toUpperCase() && elem.type.toUpperCase()==\"text\".toUpperCase() && (elem.value==\"\" || elem.value==null)){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Password fields\n\t\tif(elem.tagName.toUpperCase()==\"input\".toUpperCase() && elem.type.toUpperCase()==\"password\".toUpperCase() && (elem.value==\"\" || elem.value==null)){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Text areas\n\t\tif(elem.tagName.toUpperCase()==\"textarea\".toUpperCase() && (elem.value==null || elem.value==\"\")){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t\t// Radios -- so far no way to check. ALT: have one radio selected by default\n\t\t// Checkboxes -- they are optional anyway, isn't it?\n\t\t// Select lists\n\t\tif(elem.tagName.toUpperCase()==\"select\".toUpperCase() && (elem.value==null || elem.value==\"\" || elem.value==\"-1\")){\n\t\t\tif(type==\"INDIVIDUAL\"){\n\t\t\t\tif(errorElem!=null) errorElem.style.display=\"block\";\n\t\t\t}\n\t\t\telse if(type==\"DETECT\")\n\t\t\t\treturn elem.id;\n\t\t\telse if(type==\"COMBINED\")\n\t\t\t\treturn false;\n\t\t\terrorFound=1;\n\t\t}\n\t}\n\tif(type==\"INDIVIDUAL\")\n\t\tif(errorFound==0) return true;\n\t\telse return false;\n\telse if(type==\"DETECT\") return null;\n\telse return true;\n}", "function category_validation(){\n 'use strict';\n var idformat = /^[1-4]$/;\n var id_name = document.getElementById(\"catID\");\n var id_value = document.getElementById(\"catID\").value;\n var id_length = id_value.length;\n if(!id_value.match(idformat) || id_length === 0)\n {\n document.getElementById('id_err').innerHTML = 'This is not a valid id the number has to be between 1-4.';\n id_name.focus();\n document.getElementById('id_err').style.color = \"#FF0000\";\n }\n else\n {\n document.getElementById('id_err').innerHTML = 'Valid Category ID';\n document.getElementById('id_err').style.color = \"#00AF33\";\n }\n }", "function checkValidation(id) {\n let bool = false;\n for (let i = 0; i < arrayInput.length; i++) {\n if (arrayInput[i].getAttribute('id') == id) {\n if (!(arrayInput[i].value == '' || arrayInput[i].value == null)) {\n switch (arrayInput[i].getAttribute('id')) {\n case 'txtName':\n let patternName = new RegExp(\"^[a-zA-Z_ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯĂẠẢẤẦẨẪẬẮẰẲẴẶ\" +\n \"ẸẺẼỀỀỂưăạảấầẩẫậắằẳẵặẹẻẽềềểỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợ\" +\n \"ụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ\\\\s]+$\");\n if (!(patternName.test(arrayInput[i].value.trim()))) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Name is not match with format';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n }\n\n break;\n case 'txtEmail':\n let patternEmail = new RegExp(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"\n + \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n if (!(patternEmail.test(arrayInput[i].value.trim()))) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Email is not match with format';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n if (document.getElementById('btnAdd').innerHTML == '<i class=\"fa fa-plus mr-2\"></i>Add Employee') {\n if (checkExistData(arrayInput[i].value.trim())) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Data is existed';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n\n }\n } else {\n if (checkExistData(arrayInput[i].value.trim())) {\n if (arrayInput[i].value.trim() == employeeUpdateTemp._Email) {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n } else {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Data is existed';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n }\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n\n }\n }\n }\n\n break;\n case 'txtPhoneNumber':\n let patternPhoneNumber = new RegExp('(0[3|7|8|5])+([0-9]{8})');\n if (!(patternPhoneNumber.test(arrayInput[i].value))) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Phone number is not match with format';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n if (document.getElementById('btnAdd').innerHTML == '<i class=\"fa fa-plus mr-2\"></i>Add Employee') {\n if (checkExistData(arrayInput[i].value)) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Data is existed';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n\n }\n } else {\n if (checkExistData(arrayInput[i].value)) {\n if (arrayInput[i].value == employeeUpdateTemp._PhoneNumber) {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n } else {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Data is existed';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n }\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n\n }\n }\n\n }\n break;\n case 'txtDate':\n let patternDate = new RegExp(\"(([1-2][0-9])|(0?[1-9])|(3[0-1]))/((1[0-2])|(0?[1-9]))/[1-9][0-9]{3}\");\n if (!patternDate.test(arrayInput[i].value.trim())) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Date is not match with format';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide'\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n }\n break;\n case 'txtSalary':\n if (arrayInput[i].value <= 0 || arrayInput[i].value <= 2999999) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Basic salary must be 3000000 or more';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n }\n break;\n case 'txtNumberWorking':\n if (arrayInput[i].value <= 0 || arrayInput[i].value < 24) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Number of working days must be 24 or more';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n }\n break;\n case 'txtPosition':\n let patternPosition = new RegExp(\"^[a-zA-Z_ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯĂẠẢẤẦẨẪẬẮẰẲẴẶ\" +\n \"ẸẺẼỀỀỂưăạảấầẩẫậắằẳẵặẹẻẽềềểỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợ\" +\n \"ụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ\\\\s]+$\");\n if (!(patternPosition.test(arrayInput[i].value.trim()))) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Position is not match with format';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n }\n break;\n case 'txtAllowance':\n if (arrayInput[i].value <= 0 || arrayInput[i].value <= 499999) {\n arrayInput[i].parentElement.nextElementSibling.innerHTML = '*Allowances must be 500000 or more';\n arrayInput[i].parentElement.nextElementSibling.className = 'required';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick show';\n }\n break;\n }\n } else {\n arrayInput[i].parentElement.nextElementSibling.className = 'hide';\n arrayInput[i].nextElementSibling.className = 'iconTick hide';\n bool = true;\n }\n }\n }\n return bool;\n}", "function template_eventosVotacion_validarCampos() {\n\tpadre = $(\".template_contenedorReputacion ._contenedorEstrellas.active\");\n\t_url = \"lib_php/votacionInmobiliaria.php\";\n\t\n\t\n\tvar datos = {\n\t\tid: padre.attr(\"data-id\"),\n\t\tcalificacion: padre.attr(\"data-calificacion\"),\n\t\tcomentario: $(\"#template_calificar_comentario\").val()\n\t}\n\t\n\t\n\tif (padre.attr(\"data-inmobiliaria\"))\n\t\tdatos[\"inmobiliaria\"] = padre.attr(\"data-inmobiliaria\");\n\telse {\n\t\tdatos[\"usuarioCalificado\"] = padre.attr(\"data-usuariocalificado\");\n\t\t_url = \"lib_php/votacionUsuario.php\";\n\t}\n\t\n\t\n\t$.ajax({\n\t\turl: _url,\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\tif (respuesta_json.isExito == 1) {\n\t\t\tpadre.attr(\"data-id\", respuesta_json.id);\n\t\t}\n\t});\n}", "function responsibilityVerify(){\n if(responsibility.value != null || responsibility.value != \"\"){\t\t\t\n responsibility.style.border = \"1px solid #5e6e66\";\n document.getElementById('responsibility_div').style.color = \"#5e6e66\";\n responsibility_error.innerHTML = \"\";\n return true;\n }\n}", "function validacionCampos(nombreCampo, valorCampo, tipoCampo) {\n\n var expSoloCaracteres = /^[A-Za-zÁÉÍÓÚñáéíóúÑ]{3,10}?$/;\n var expMatricula = /^([A-Za-z]{1}?)+([1-9]{2}?)$/;\n\n if (tipoCampo == 'select') {\n valorComparar = 0;\n } else {\n valorComparar = '';\n }\n\n //validamos si el campo es rellenado.\n if (valorCampo != valorComparar) {\n $('[id*=' + nombreCampo + ']').removeClass('is-invalid');\n\n //Aplicamos validaciones personalizadas a cada campo.\n if (nombreCampo == 'contenidoPagina_nombreMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n\n }\n else if (nombreCampo == 'contenidoPagina_apellidoMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n \n }\n else if (nombreCampo == 'contenidoPagina_especialidadMedico') {\n return true;\n\n }\n else if (nombreCampo == 'contenidoPagina_matriculaMedico') {\n\n if (expMatricula.test(valorCampo)) {\n\n $(\"[id*=contenidoPagina_matriculaMedico]\").off('keyup');\n $(\"[id*=contenidoPagina_matriculaMedico]\").on('keyup', function () {\n return validarMatriculaUnica($(this).val(), matAcomparar);\n });\n\n return validarMatriculaUnica($(\"[id*=contenidoPagina_matriculaMedico]\").val(), matAcomparar);\n } else {\n mostrarMensaje(nombreCampo, 'estructuraInc');\n return false;\n } \n }\n } else {\n mostrarMensaje(nombreCampo, 'incompleto');\n return false;\n }\n }", "function validaCampoVacio(Nombre, _G_ID_) {\n /* Es de tipo select */\n if ($(_G_ID_ + '_txt_' + Nombre).is('select')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == -1) {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n return false;\n } else {\n return true;\n }\n } else /* de tipo input*/\n if ($(_G_ID_ + '_txt_' + Nombre).is('input')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == '') {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n return false;\n } else {\n return true;\n }\n }\n}", "function id_detect_exist(e){\n // var id_value={\n // id:e.target.value\n // }\n\n console.log(e.target.value);\n var ret=checkid(e.target.value)\n if(ret==false){\n $(\"#idmsg\")[0].innerHTML=\"格式錯誤\"; \n }else if(ret==true){\n $(\"#idmsg\")[0].innerHTML=\"格式正確\"; \n }\n //return;\n}", "function validarDosOMasCampos(elemento)\n{ \n if(elemento.value.length > 0){\n for (var i = 0; i < elemento.value.length; i++) {\n if (((elemento.value.charCodeAt(i)==32))) {\n if ((elemento.value.charCodeAt(i-1)!=32)&&(elemento.value.charCodeAt(i+1)>=65)&&(elemento.value.charCodeAt(i+1)<=122)){\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML =''; \n }else{\n \n document.getElementById('mensaje3').innerHTML=\"\" ;\n }\n elemento.style.border = '2px greenyellow solid';\n return true;\n }else{\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML = 'Nombres Incorrecto'; \n }else{\n document.getElementById('mensaje3').innerHTML = 'Apellidos Incorrecto';\n }\n elemento.style.border = '2px red solid';\n return false;\n }\n }else{\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML = 'Nombres Incorrecto';\n console.log(\"Es nombre\"); \n }else{\n document.getElementById('mensaje3').innerHTML = 'Apellidos Incorrecto';\n }\n elemento.style.border = '2px red solid';\n }\n \n }\n }\n}", "function validaCamposM(){\n var marca = document.getElementById(\"selectMarcaEdicion\");\n var color = document.getElementById(\"selectColorEdicion\");\n var tipo = document.getElementById(\"selectTipoEdicion\");\n var boton = document.getElementById(\"btnConfirmaEdicion\");\n if(marca.value!=\"\" && color.value!=\"\" && tipo.value!=\"\")\n boton.removeAttribute(\"disabled\");\n}", "function validatePresence(id) {\n let input = $(id)\n if (input.val() == '') {\n input.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n input.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function ValidateArticolo() {\n\tvar value = document.getElementsByName('parole')[1].value;\n\tif (!/^\\s*$/.test(value)) {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('id_autore')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvar sel = document.getElementsByName('keywords')[0];\n\tfor (var i=0, len=sel.options.length; i<len; i++) {\n opt = sel.options[i];\n if ( opt.selected ) {\n\t\t\treturn true;\n\t\t}\t\t\n\t}\n\tvalue = document.getElementsByName('categoria')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('data_inizio_year')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('data_fine_year')[0].value;\n\tif (value != \"\") {\n\t\treturn true;\n\t}\n\tvalue = document.getElementsByName('citato')[0].value;\n\tif (!/^\\s*$/.test(value)) {\n\t\treturn true;\n\t}\n\n\talert(\"Devi inserire almeno un campo\");\n\treturn false; \n}", "function validarCamposOrden(){\r\n /*if(document.getElementById(\"codigoOrden\").value == \"\"){\r\n alert(\"Falta el codigo de la orden de compra\");\r\n return false;\r\n }*/\r\n if(document.getElementById(\"Proveedor\").value == null){\r\n alert(\"Falta el proveedor\")\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaPedido\").value == \"\"){\r\n alert(\"Falta le fecha de pedido\");\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaEntrega\").value == \"\"){\r\n alert(\"Falta la fecha de entrega\");\r\n return false;\r\n }\r\n return true;\r\n}", "function validarCampos3 () {\n\tvar id = inmueble_pos_comp;\n\tvar continua = true;\n\t\t\n\tif (id == -1) {\n\t\tcontinua = false;\n\t\t\t\n\t\tif (!vacio($(\"#imagen\").val(), \"Imagen\")) {\n\t\t\tcontinua = true;\n\t\t}\n\t}\n\t\t\n\tif (continua) {\n\t\tsaveImagen();\n\t}\n}", "function validarCampos3 () {\n\tvar id = inmueble_pos_comp;\n\tvar continua = true;\n\t\t\n\tif (id == -1) {\n\t\tcontinua = false;\n\t\t\t\n\t\tif (!vacio($(\"#imagen\").val(), \"Imagen\")) {\n\t\t\tcontinua = true;\n\t\t}\n\t}\n\t\t\n\tif (continua) {\n\t\tsaveImagen();\n\t}\n}", "function validateCardExp(id) {\n let inputID = $(id)\n let inputTest = $(id).val()\n let isValid = /^\\d{2}\\/?\\d{2}?$/.test(inputTest);\n if (!isValid) {\n inputID.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n inputID.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function validarCampos(ev) {\n var contador = 0\n\n for (let i = 1; i <= 6; i++) {\n let auxRecuadro = \"recuadro\" + i;\n\n for (let j = 1; j <= 6; j++) {\n let auxPalabra = \"palabra\" + j;\n if (document.getElementById(auxPalabra).parentNode.id == auxRecuadro) {\n contador = contador + 1;\n }\n }\n }\n if (contador == 6) {\n document.getElementById(\"boton\").style.display = \"unset\";\n alert(\"Ha llenado todos los campos\");\n\n }\n}", "function validar(validar,div){\n\tlet x = document.getElementById(validar);\n\tlet y = document.getElementById(div);\n\n\n\tif(x.value==\"\"){\n\t\ty.style.backgroundColor=\"red\"\n\t\ty.style.display=\"block\";\n \n\t}else{\n\t\ty.style.display=\"none\";\n\t\tx.style.backgroundColor=\"white\"\n\t}\n}", "function validate(ctr1,ctr2) {\n if((document.getElementById(ctr1).value.split(' ').join('') == \"\") ||\n (document.getElementById(ctr1).value.split(' ').join('') == \"0\")){\n var div = document.getElementById(ctr2);\n div.style.display=\"block\";\n div.style.color=\"red\";\n div.setAttribute(\"style\", \"display:block; color:red; float:left;margin:5px 0px 0px 10px; font-size:12px;\");\n return false;\n } else {\n document.getElementById(ctr2).style.display = \"none\";\n return true;\n }\n}", "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 validarcamposcarrito(){\n var inputs=$(\"#frmcarrito :input\");\n var formvalido = true;\n \n inputs.each(function(){\n \n if(this.value.length==0){\n $(this).parent().parent().addClass('has-error');\n formvalido = false;\n }else{\n $(this).parent().parent().removeClass('has-error');\n }\n }); \n return formvalido;\n}", "function validarcampos_p1 () {\n\t\n\tif (nom_div(\"nombre_p1\").value!=\"\"&&nom_div(\"opcion_1\").value!=0) {\n\n\t\treturn true;\n\n\t}\n\n\n\telse{\n\n\t\tif (nom_div(\"nombre_p1\").value==\"\") {\n\n\t\t\talert('Asigne un nombre al proceso 1');\n\t\t\tnom_div(\"nombre_p1\").focus();\n\t\t}\n\n\t\tif(nom_div(\"opcion_1\").value==0){\n\n\t\t\talert('¿Cuantas Lineas de codigo quiere compilar en el proceso 1?')\n\t\t\tnom_div(\"opcion_1\").focus();\n\t\t}\n\n\t\treturn false;\n\t};\n}//FIN**********VALIDAR CAMPOS PROCESO 1******", "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}", "function validarProvincia() {\n // comprobaremos que el valor del elemento provincia es igual que alguno de los valores reales, si lo es, devolvera true, si no dara error.\n if ((document.getElementById(\"provincia\").value)!=\"C\" && (document.getElementById(\"provincia\").value)!=\"LU\" && (document.getElementById(\"provincia\").value)!=\"OU\" && (document.getElementById(\"provincia\").value)!=\"PV\"){\n document.getElementById(\"provincia\").value = \"error!\";\n document.getElementById(\"provincia\").focus();\n document.getElementById(\"provincia\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error, debes seleccionar una provincia.\";\n return false;\n }\n else {\n document.getElementById(\"provincia\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function checkInput(){\n var length_of_array;\n var fields_required = [\n { \"field_id\":\"name\" , \"warning_msg_id\":\"name_msg\", \"warning_msg\":\"请填入姓名\"},\n { \"field_id\":\"condo\" , \"warning_msg_id\":\"condo_msg\", \"warning_msg\":\"请选择是否为condo\" },\n { \"field_id\":\"source\" , \"warning_msg_id\":\"source_msg\", \"warning_msg\":\"请选择来源\" },\n { \"field_id\":\"target_marketing\" , \"warning_msg_id\":\"target_marketing_msg\", \"warning_msg\":\"请选择客户为华人还是西人\" },\n { \"field_id\":\"price_requirement\" , \"warning_msg_id\":\"price_requirement_msg\", \"warning_msg\":\"请选择预期但的价格\" },\n { \"field_id\":\"business\" , \"warning_msg_id\":\"business_msg\", \"warning_msg\":\"请选择是否为商业装修\" },\n { \"field_id\":\"price_range\" , \"warning_msg_id\":\"price_range_msg\", \"warning_msg\":\"请选择价格偏向\" }\n ];\n var boolean_required;\n length_of_array = Object.keys(fields_required).length;\n for (var i = 0; i < length_of_array; i++){\n if (document.getElementById(fields_required[i].field_id).value.trim() == \"\"){\n document.getElementById(fields_required[i].warning_msg_id).innerHTML = fields_required[i].warning_msg;\n boolean_required = false;\n }\n else{\n document.getElementById(fields_required[i].warning_msg_id).innerHTML = \"\";\n boolean_required = true;\n }\n }\n return boolean_required;\n}", "function validation(value, id){\n\n // hide any errors already showing\n $('#' + id).parent('.field-item').find('.error-message').hide();\n // remove existing border error class\n $('#' + id).removeClass('error-border');\n\n //trim blank space from value\n value = $.trim(value);\n\n // get validation rules from data attribute\n var attr = $('#' + id).attr('data-validate');\n if (typeof attr !== 'undefined' && attr !== false) {\n validationRules = $('#' + id).data('validate').split(',');\n\n // check data attribute for validation rules\n for (var i = 0; i < validationRules.length; i++){\n var type = validationRules[i];\n type = type.replace(' ', '');\n if(value === '' && type === 'required'){\n // show required erorr\n $('#' + id).parent('.field-item').find('.error-message.required').fadeIn();\n $('#' + id).addClass('error-border');\n valid.push('false');\n }else if(!validate[type].test($('#' + id).val()) && value != ''){\n // fade in error message\n $('#' + id).parent('.field-item').find('.error-message.' + type).fadeIn();\n // add border class to the input field\n $('#' + id).addClass('error-border');\n valid.push('false');\n }else{\n valid.push('true');\n }\n }\n \n }\n }", "function validarCampoE(fila) {\n if ($(\"#cbo-det-2-\" + fila).val() == 0) {\n return false;\n } else if ($(\"#cbo-det-3-\" + fila).val() == 0) {\n return false;\n } else if ($(\"#txt-det-1-\" + fila).val() == \"\") {\n return false;\n } else if ($(\"#txt-det-2-\" + fila).val() == \"\") {\n return false;\n } else {\n return true;\n }\n}", "function validaPesquisaFaixaSetor(){\r\n\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.setorComercialOrigemCD.value != form.setorComercialDestinoCD.value){\r\n\t\tif(form.localidadeOrigemID.value != form.localidadeDestinoID.value){\r\n\t\t\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Setor Comercial as Localidade inicial e final devem ser iguais.\");\r\n\t\t\tform.setorComercialDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t\t}\t\t\r\n\t}\r\n\t\r\n\tif((form.setorComercialOrigemCD.value != \"\" )\r\n\t\t&& (form.setorComercialOrigemCD.value > form.setorComercialDestinoCD.value)){\r\n\t\talert(\"O c?digo do Setor Comercial Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.setorComercialDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n\r\n}", "function checarCamposRequire()\n{\n var form_elements = $(\"form input[required], form select[required]\");\n var bandera = true;\n\n form_elements.each( function()\n {\n var div_control = $(this).closest(\"div[class='form-group']\");\n\n if ( $(this).val().length == 0 )\n {\n div_control.addClass(\"has-error\");\n bandera = false;\n }\n else\n {\n div_control.removeClass(\"has-error\");\n }\n });// => Funcion each\n\n if ( bandera )\n $(\"#1\").css(\"visibility\", \"visible\");\n else\n $(\"#1\").css(\"visibility\", \"hidden\");\n\n return bandera;\n} // => Funcion checarCamposRequire", "function checkInput(panoId) {\n let pId = extractId(panoId)\n // console.log('checkInput ', pId)\n let val = validateNewPano(pId) \n let clear = false // Does not flag invalid fields (outline in red), only clears valid fields from being flagged. \n flagInvalidFields(val, clear)\n let addButton = gPanos[pId].elements.addButton\n if (val.all.valid){\n // console.log('add button enabled') \n // gAddButton.className = 'add_button'\n addButton.style.color = '#86450f'\n addButton.style.backgroundColor = '#f0c769' \n clearAllMessages() \n // gAddButton.disabled = false\n gbvaluesValid = true\n } else { \n // console.log('add button disabled')\n // gAddButton.className = 'add_button_disabled'\n addButton.style.color = '#757575'\n addButton.style.backgroundColor = '#e2e2e2'\n // gAddButton.disabled = true\n gbvaluesValid = false\n }\n return val \n }", "function validator(elements) {\n var errors = 0;\n $.each(elements, function(index, element) {\n if ($.trim($('#' + element).val()) == '') errors++;\n });\n if (errors) {\n $('.error').html('Please insert title, start and description.');\n return false;\n }\n return true;\n }", "function validar_add_despliegue_nombre(){\r\n\r\n\tif(document.getElementById('txt_despliegue').value==''){\r\n\t\tmostrarDiv('error_despliegue');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_programada').value=='' || document.getElementById('txt_fecha_programada').value=='0000-00-00'){\r\n\t\tmostrarDiv('error_fecha_programada');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_produccion').value=='' || document.getElementById('txt_fecha_produccion').value=='0000-00-00'){\r\n\t\tmostrarDiv('error_fecha_produccion');\r\n\t\treturn false;\r\n\t}\r\n\tdocument.getElementById('frm_add_despliegue').action='?mod=despliegues&niv=1&task=saveAdd';\r\n\tdocument.getElementById('frm_add_despliegue').submit();\r\n}", "function myValidate(id,regExp,message){\nif ($(\"#\" +id).val()!=='')\n {\n //alert(id);\n var idm= $(\"#\" +id).val(); //alert('val is-> '+idm); \n\n //if REgEXp match\n if(idm.match(regExp))\n {\n $(\"#\" +id).prevAll(\".sp:first\").html('Correct');// erase error message\n $(':input[type=\"button\"]').prop('disabled', false); //enable button\n $('#btnSubmit').val('Submit');\n \n }\n //if RegExp not match\n else\n { \n $(\"#\" +id+\"Err\").html(message); //$(\"#\" +id).prevAll(\".sp:first\").html(message); \n $(':input[type=\"button\"]').prop('disabled', true);\n $('#btnSubmit').val('disabled');\n }\n\n }// end if ($(\"#\" +id).val()!==''){\n else\n { \n //if empty set gain no error\n $(\"#\" +id).prevAll(\".sp:first\").html('');\n $('#btnSubmit').val('Submit');\n \n } \n}", "function validarItinerario(id,no_de_itinerario,noItinerarioSet){\n\t//alert(\"Valor de itinerario de ventana\"+no_de_itinerario);\n\t//alert(\"valor del itinerario seleccionado\"+noItinerarioSet);\n\t\n\t//Funciones que permitiran recorrer los indices de las cotizaciones de hotel realizadas\n\t $(\"#rowCount_hotel\"+no_de_itinerario).bind(\"restar\",function(e,data,data1){\n\t \te.stopImmediatePropagation();\n\t\t\t\t$(\"#rowCount_hotel\"+no_de_itinerario).val(parseInt($(\"#hotel_table\"+no_de_itinerario+\">tbody >tr\").length));\n\t });\n\t $(\"#rowDel_hotel\"+no_de_itinerario).bind(\"cambiar\",function(e,inicio,tope){\n\t e.stopImmediatePropagation();\n\t\t\tvar nextno = \"\";\n\t\t\tvar no = \"\";\n\t\t\tvar jqueryno = \"\";\n\t\t\tvar nextrow = \"\";\n\t\t\tvar row = \"\";\n\t\t\tvar jqueryrow = \"\";\n\t\t\tvar nextciudad = \"\";\n\t\t\tvar ciudad = \"\";\n\t\t\tvar jqueryciudad =\"\";\n\t\t\tvar nexthotel = \"\";\n\t\t\tvar hotel = \"\";\n\t\t\tvar jqueryhotel =\"\";\n\t\t\tvar nextcomentario = \"\";\n\t\t\tvar comentario = \"\";\n\t\t\tvar jquerycomentario =\"\";\n\t\t\tvar nextnoches = \"\";\n\t\t\tvar noches = \"\";\n\t\t\tvar jquerynoches =\"\";\n\t\t\tvar nextllegada = \"\";\n\t\t\tvar llegada = \"\";\n\t\t\tvar jqueryllegada =\"\";\n\t\t\tvar nextsalida = \"\";\n\t\t\tvar salida = \"\";\n\t\t\tvar jquerysalida =\"\";\n\t\t\tvar nextnoreservacion = \"\";\n\t\t\tvar noreservacion = \"\";\n\t\t\tvar jquerynoreservacion =\"\";\n\t\t\tvar nextcostoNoche = \"\";\n\t\t\tvar costoNoche = \"\";\n\t\t\tvar jquerycostoNoche =\"\";\n\t\t\tvar nextiva = \"\";\n\t\t\tvar iva = \"\";\n\t\t\tvar jqueryiva =\"\";\n\t\t\tvar nexttotal = \"\";\n\t\t\tvar total = \"\";\n\t\t\tvar jquerytotal =\"\";\n\t\t\tvar nextselecttipodivisa = \"\";\n\t\t\tvar selecttipodivisa = \"\";\n\t\t\tvar jqueryselecttipodivisa =\"\";\n\t\t\tvar nextmontoP = \"\";\n\t\t\tvar montoP = \"\";\n\t\t\tvar jquerymontoP =\"\";\n\t\t\tvar nextdel = \"\";\n\t\t\tvar del = \"\";\n\t\t\tvar jquerydel =\"\";\n\t\t\tvar nextsubtotal = \"\";\n\t\t\tvar subtotal = \"\";\n\t\t\tvar jquerysubtotal =\"\";\n\t\t\tvar nextdeldiv = \"\";\n\t\t\tvar deldiv = \"\";\n\t\t\tvar jquerydeldiv =\"\";\n\t\t\t\n\t/*\t\t*/\n\t\t\t\n\t\t\tfor (var i=parseFloat(inicio);i<=parseFloat(tope);i++){\n\t\t\t\tnextno=\"#no_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tno=\"no_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryno=\"#no_\"+no_de_itinerario+\"_\"+parseInt(i);\n\n\t\t\t\tnextrow=\"#row_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\trow=\"row_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryrow=\"#row_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\t\n\t\t\t\tnextciudad=\"#ciudad_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tciudad=\"ciudad_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryciudad=\"#ciudad_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnexthotel=\"#hotel_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\thotel=\"hotel_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryhotel=\"#hotel_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextcomentario=\"#comentario_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tcomentario=\"comentario_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerycomentario=\"#comentario_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextnoches=\"#noches_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tnoches=\"noches_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerynoches=\"#noches_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextllegada=\"#llegada_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tllegada=\"llegada_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryllegada=\"#llegada_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextsalida=\"#salida_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tsalida=\"salida_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerysalida=\"#salida_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextnoreservacion=\"#noreservacion_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tnoreservacion=\"noreservacion_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerynoreservacion=\"#noreservacion_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextcostoNoche=\"#costoNoche_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tcostoNoche=\"costoNoche_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerycostoNoche=\"#costoNoche_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextiva=\"#iva_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tiva=\"iva_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryiva=\"#iva_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnexttotal=\"#total_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\ttotal=\"total_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerytotal=\"#total_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextselecttipodivisa=\"#selecttipodivisa_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tselecttipodivisa=\"selecttipodivisa_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryselecttipodivisa=\"#selecttipodivisa_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextmontoP=\"#montoP_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tmontoP=\"montoP_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerymontoP=\"#montoP_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextsubtotal=\"#subtotal_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tsubtotal=\"subtotal_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerysubtotal=\"#subtotal_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\t\n\t\t\t\tnextdeldiv=\"#delDiv_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tdeldiv=\"delDiv_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerydeldiv=\"#delDiv_\"+no_de_itinerario+\"_\"+parseInt(i);\n\n\t\t\t\tdel=parseInt(i)+\"delHotel\";\n\t\t\t\tjquerydel=\"#\"+parseInt(i)+\"delHotel\";\n\t\t\t\tnextdel=\"#\"+((parseInt(i)+(1)))+\"delHotel\";\n\n\t\t\t\t$(nextno).attr(\"id\",no);\n\t\t\t\t$(jqueryno).attr(\"name\",no);\n\t\t\t\t$(jqueryno).html(parseInt(i));\n\t\t\t\t\n\t\t\t\t$(nextrow).attr(\"id\",row);\n\t\t\t\t$(jqueryrow).attr(\"name\",row);\n\t\t\t\t\n\t\t\t\t$(nextciudad).attr(\"id\",ciudad);\n\t\t\t\t$(jqueryciudad).attr(\"name\",ciudad);\n\t\t\t\t$(nexthotel).attr(\"id\",hotel);\n\t\t\t\t$(jqueryhotel).attr(\"name\",hotel);\n\t\t\t\t$(nextcomentario).attr(\"id\",comentario);\n\t\t\t\t$(jquerycomentario).attr(\"name\",comentario);\n\t\t\t\t$(nextnoches).attr(\"id\",noches);\n\t\t\t\t$(jquerynoches).attr(\"name\",noches);\n\t\t\t\t$(nextllegada).attr(\"id\",llegada);\n\t\t\t\t$(jqueryllegada).attr(\"name\",llegada);\n\t\t\t\t$(nextsalida).attr(\"id\",salida);\n\t\t\t\t$(jquerysalida).attr(\"name\",salida);\n\t\t\t\t$(nextnoreservacion).attr(\"id\",noreservacion);\n\t\t\t\t$(jquerynoreservacion).attr(\"name\",noreservacion);\n\t\t\t\t$(nextcostoNoche).attr(\"id\",costoNoche);\n\t\t\t\t$(jquerycostoNoche).attr(\"name\",costoNoche);\n\t\t\t\t$(nextiva).attr(\"id\",iva);\n\t\t\t\t$(jqueryiva).attr(\"name\",iva);\n\t\t\t\t$(nexttotal).attr(\"id\",total);\n\t\t\t\t$(jquerytotal).attr(\"name\",total);\n\t\t\t\t$(nextselecttipodivisa).attr(\"id\",selecttipodivisa);\n\t\t\t\t$(jqueryselecttipodivisa).attr(\"name\",selecttipodivisa);\n\t\t\t\t$(nextmontoP).attr(\"id\",montoP);\n\t\t\t\t$(jquerymontoP).attr(\"name\",montoP);\n\t\t\t\t$(nextsubtotal).attr(\"id\",subtotal);\n\t\t\t\t$(jquerysubtotal).attr(\"name\",subtotal);\n\t\t\t\t$(nextdel).attr(\"id\",del);\n\t\t\t\t$(jquerydel).attr(\"name\",del);\n\t\t\t\t$(nextdeldiv).attr(\"id\",deldiv);\n\t\t\t\t$(jquerydeldiv).attr(\"name\",deldiv);\n\t\t\t}\n\t });\n\t //END de funciones.\t \t\n\t\t\t//alert(\"elimna click\");\n\t\t\t//$(this).parent().parent().parent().fadeOut(\"normal\", function () {\n\t\t\t//$(this).fadeOut(\"normal\", function () {\n\t\t\t$(\"#hotel_table\"+no_de_itinerario+\">tbody\").find(\"tr\").eq((parseFloat(id))-1).fadeOut(\"normal\", function () {\t\t\t\t\t\n\t\t\t\tvar i=0;\t\t\t\n\t\t\t\t$(this).remove();\t\n\t\t\t\t$(\"#rowCount_hotel\"+no_de_itinerario).trigger(\"restar\");\n\t\t\t\t$(\"#rowCount_hotel\"+no_de_itinerario).unbind(\"restar\");\n\t\t\t\t\t var tope=$(\"#rowCount_hotel\"+no_de_itinerario).val();\n\t\t\t\t\t i=parseFloat(id);\n\t\t\t\t$(\"#rowDel_hotel\"+no_de_itinerario).trigger(\"cambiar\",[i,tope]);\n\t\t\t\t$(\"#rowDel_hotel\"+no_de_itinerario).unbind(\"cambiar\");\n\t\t\t\tcalculaTotalHospedaje();\n\t\t\t\tdeshabilita_aceptar();\t\t\t\t\n\t });\n}", "function validaceldalugar(){\n\tvar sitio=document.getElementById(\"lugar\").value ;\n if(sitio==\"\")\n\t{\n\tdocument.trabajo.lugar.className=\"error\";\t\n\tdocument.trabajo.lugar.focus();\n\t}\n\telse{ document.trabajo.lugar.className=\"correcto\";\n\t}\n }", "function validateCardCVC(id) {\n let inputID = $(id)\n let inputTest = $(id).val()\n let isValid = /^\\d{3}$/.test(inputTest);\n if (!isValid) {\n inputID.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n inputID.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function check_estimate(){ \n showLoadingGif();\n if(jQuery('#lvalue').val()==''){\n alert('Category cannot be blank');\n return false;\n }\n}", "function validateInputField(id, errorId) {\r\n\r\n let txtField = document.getElementById(id).value;\r\n let errField = document.getElementById(errorId);\r\n if(txtField === \"\") {\r\n errField.className = \"err\";\r\n return false;\r\n }\r\n errField.className = \"hidden\";\r\n return true;\r\n}", "function requerido($id){\n var id = $id;\n var input = document.getElementById('fuente_imagen' + id)\n $(input).prop('required',true);\n\n}", "function blankfunc2(id1,id2,check2,id3)\n{\n\t$(check2+'_err1').removeClassName('showElement');\n\t$(check2+'_err1').addClassName('hideElement');\n\tvar msg = \"\";\n\tif($F(id1) == '')\n\t{\n\t\tmsg += \"enter value in field one\\n\";\n\t\t\t$(id1+'_err1').removeClassName('hideElement');\n\t\t\t$(id1+'_err1').addClassName('showElement');\n\t\t\t//alert('enter value');\n\t\t//\treturn false;\n\t}\n\telse\n\t{\n\t\t$(id1+'_err1').removeClassName('showElement');\n\t\t$(id1+'_err1').addClassName('hideElement');\n\t\t\n\t}\n\t\n\tif($F(id2) == '')\n\t{\n\t\t\t\tmsg += \"enter value in field two\\n\";\n\t\t\t\t$(id2+'_err1').removeClassName('hideElement');\n\t\t\t\t$(id2+'_err1').addClassName('showElement');\n\t}\n\telse\n\t{\n\t\t\t$(id2+'_err1').removeClassName('showElement');\n\t\t\t$(id2+'_err1').addClassName('hideElement');\n\t}\n\tif($F(id3) == '')\n\t{\n\t\t\t\tmsg += \"enter value in field two\\n\";\n\t\t\t\t$(id3+'_err1').removeClassName('hideElement');\n\t\t\t\t$(id3+'_err1').addClassName('showElement');\n\t}\n\telse\n\t{\n\t\t\t$(id3+'_err1').removeClassName('showElement');\n\t\t\t$(id3+'_err1').addClassName('hideElement');\n\t}\t\n\t\tif(msg.length>0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n}", "function validForm() {\n // si el nombre es igual a vacio\n // entonces muestrame que es invalido\n if ($('#titulo').val() == \"\") {\n $('#titulo').removeClass(\"is-valid\")\n $('#titulo').addClass(\"is-invalid\")\n } else {\n $('#titulo').removeClass(\"is-invalid\")\n $('#titulo').addClass(\"is-valid\")\n }\n if ($('#descripcion').val() == \"\") {\n $('#descripcion').removeClass(\"is-valid\")\n $('#descripcion').addClass(\"is-invalid\")\n } else {\n $('#descripcion').removeClass(\"is-invalid\")\n $('#descripcion').addClass(\"is-valid\")\n } \n if ($('#categorias').val() == \"\") {\n $('#categorias').removeClass(\"is-valid\")\n $('#categorias').addClass(\"is-invalid\")\n } else {\n $('#categorias').removeClass(\"is-invalid\")\n $('#categorias').addClass(\"is-valid\")\n }\n if ($('#contenido').val() == \"\") {\n $('#contenido').removeClass(\"is-valid\")\n $('#contenido').addClass(\"is-invalid\")\n } else {\n $('#contenido').removeClass(\"is-invalid\")\n $('#contenido').addClass(\"is-valid\")\n }\n if ($('#fecha_publ').val() == \"\") {\n $('#fecha_publ').removeClass(\"is-valid\")\n $('#fecha_publ').addClass(\"is-invalid\")\n } else {\n $('#fecha_publ').removeClass(\"is-invalid\")\n $('#fecha_publ').addClass(\"is-valid\")\n }\n if ($('#fecha_fin').val() == \"\") {\n $('#fecha_fin').removeClass(\"is-valid\")\n $('#fecha_fin').addClass(\"is-invalid\")\n } else {\n $('#fecha_fin').removeClass(\"is-invalid\")\n $('#fecha_fin').addClass(\"is-valid\")\n }\n if ($('#titulo').val() != \"\" && $('#categoria').val() != 0 && $('#descripcion').val() != \"\" && $('#contenido').val() != \"\" && $('#fecha_publ').val() != \"\" && $('#fecha_fin').val() >= \"\") {\n CrearOActualizar()\n }\n}", "function validarcampos_p3 () {\n\t\n\tif (nom_div(\"nombre_p3\").value!=\"\"&&nom_div(\"opcion_3\").value!=0) {\n\n\t\treturn true;\n\n\t}\n\n\n\telse{\n\n\t\tif (nom_div(\"nombre_p3\").value==\"\") {\n\n\t\t\talert('Asigne un nombre al proceso 3');\n\t\t\tnom_div(\"nombre_p3\").focus();\n\t\t}\n\n\t\tif(nom_div(\"opcion_3\").value==0){\n\n\t\t\talert('¿Cuantas Lineas de codigo quiere compilar en el proceso 3?')\n\t\t\tnom_div(\"opcion_3\").focus();\n\t\t}\n\n\t\treturn false;\n\t};\n}//FIN**********VALIDAR CAMPOS PROCESO 1******", "function validaCajasOcultasMod2(caja1,caja2){\n\n if(document.getElementById(caja1).value.length > 0 &&\n document.getElementById(caja2).value.length > 0){\n\n $('#submitModal2').prop('disabled', false);\n\n }else{\n\n $('#submitModal2').prop('disabled', true);\n\n }\n\n}", "function validarCampoVacioLogin(id){\n if (document.getElementById(id).value == ''){\n document.getElementById('Error-Login-'+id).style.display = 'block';\n document.getElementById(id).classList.add('input-error');\n return false;\n }\n document.getElementById('Error-Login-'+id).style.display = 'none';\n document.getElementById(id).classList.remove('input-error');\n return true;\n}", "function validate_spaces (id) {\n\tvar obj = document.getElementById(id).value;\n\t//alert('hiii');\n\t// var decimal= /^[a-zA-Z0-9_ ]*$/;\n\n\tif (!obj.replace(/\\s/g, '').length) {\n\t\terror_msg_alert('It should not allow spaces.');\n\t\t$('#' + id).css({ border: '1px solid red' });\n\t\tdocument.getElementById(id).value = '';\n\t\t$('#' + id).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse if (parseInt(obj) < 0) {\n\t\terror_msg_alert('Please enter valid information.');\n\t\t$('#' + id).css({ border: '1px solid red' });\n\t\tdocument.getElementById(id).value = '';\n\t\t$('#' + id).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse {\n\t\t$('#' + id).css({ border: '1px solid #ddd' });\n\t\treturn true;\n\t}\n}", "function validamaquna()\n{\n\nfunction fechacantidadservicio(z){\t\nvar id=document.getElementById('id').value;\ntecla=(document.all) ? z.keyCode : z.which;\nif(tecla==13){\n if(fecha!=''){\n document.fmaquina.id.className=\"correcto \";\t\t \n document.fmaquina.contador.focus(); \t\n}\n \nif(fecha==\"\") \n {\n alert(\"Valor invalido\"); \n document.trabajo.id.value=\"\";\n }\n \n}\n}\n\n\n}", "function validarFormulario() {\n var plantilla_producto = document.getElementById('nombre').value;\n var version_producto = document.getElementById('version').value;\n\n if(plantilla_producto == ''){\n alert(\"Rellene el campo: Plantilla de Producto\");\n return false;\n }\n else if(version_producto == ''){\n alert(\"Rellene el campo: Versión\");\n return false;\n }\n else {\n SeleccionarPerifericos();\n SeleccionarKits();\n return true;\n }\n}", "function validarvacios() {\n var bandera = true;\n /*Creamos un for que nos recorrera todos los elmentos de nuestra html */\n for (var i = 0; i < document.forms[0].elements.length; i++) {\n var elemento = document.forms[0].elements[i]\n /*seleccionamos todoslos elementos de tipo text y comparamos si estos estan vacios */\n if (elemento.value == '' && elemento.type == 'text') {\n /*Si los elementos se encuentran vacios mostrara un mensaje de error en nuestras etiquetas spam */\n if (elemento.id == 'nombre') {\n document.getElementById('errorNombre').style = 'display:block; color:white;'\n document.getElementById('errorNombre').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n\n }\n if (elemento.id == 'apellido') {\n document.getElementById('errorApellido').style = 'display:block; color:white;'\n document.getElementById('errorApellido').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'cedula') {\n document.getElementById('errorCedula').style = 'display:block; color:white;'\n document.getElementById('errorCedula').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'telefono') {\n document.getElementById('errorTelefono').style = 'display:block; color:white;'\n document.getElementById('errorTelefono').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'direccion') {\n document.getElementById('errorDireccion').style = 'display:block; color:white;'\n document.getElementById('errorDireccion').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'fecha') {\n document.getElementById('errorFecha').style = 'display:block; color:white;'\n document.getElementById('errorFecha').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'correo') {\n document.getElementById('errorCorreo').style = 'display:block; color:white;'\n document.getElementById('errorCorreo').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'contrasenia') {\n document.getElementById('errorContrasenia').style = 'display:block; color:white;'\n document.getElementById('errorContrasenia').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n \n } else {\n\n /*se leeel dato de nuestra etiqueta cedula y posteriormente se la envia a nuestra funcion de validar cedula */\n\n\n if(elemento.id == 'cedula'){\n cedula = document.getElementById(\"cedula\").value;\n /*si nuestra cedula esigual a 10 procede a ingresar a nuestro metodo de validacion */\n if (validarnumero(cedula)==false) {\n document.getElementById('errorCedula').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorCedula').innerHTML = '<b>No se permite letras'\n }else{\n validaCedula();\n }\n\n }\n\n /* el siguiente if compara si los elementos ingresados son de tipo numerico */\n if (elemento.id == 'nombre') {\n document.getElementById('errorNombre').style = 'display:none;'\n nombre = document.getElementById(\"nombre\").value;\n if (validarNombre(nombre) == false) {\n document.getElementById('errorNombre').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorNombre').innerHTML = '<b>No se permite numeros</b>'\n }\n }\n /* el siguiente if compara si los elementos ingresados son de tipo numerico */\n if (elemento.id == 'apellido') {\n document.getElementById('errorApellido').style = 'display:none;'\n apellido = document.getElementById(\"apellido\").value;\n \n if (validarNombre(apellido) == false) {\n document.getElementById('errorApellido').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorApellido').innerHTML = '<b>No se permite numeros</b>'\n }\n\n }\n if (elemento.id == 'telefono') {\n document.getElementById('errorTelefono').style = 'display:none;'\n numero= document.getElementById(\"telefono\").value;\n /*compararemos si todos los datos son de tipo numericos */\n if (validarnumero(numero) == false) {\n document.getElementById('errorTelefono').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorTelefono').innerHTML = '<b>Revise nuevamente su numero telefonico</b>'\n }\n /*Nos aseguramos de que nuestro telefono tenga un maximo de 10 */\n if (numero.length < 10) {\n document.getElementById('errorTelefono').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorTelefono').innerHTML = '<b>Revise nuevamente su numero telefonico</b>'\n }\n\n }\n if (elemento.id == 'fecha') {\n document.getElementById('errorFecha').style = 'display:none;'\n fech = document.getElementById(\"fecha\").value;\n \n if (validarformato(fech) == false) {\n document.getElementById('errorFecha').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorFecha').innerHTML = '<b>Formato de fecha incorrecta</b>'\n }\n\n }\n if (elemento.id == 'correo') {\n document.getElementById('errorCorreo').style = 'display:none;'\n cor = document.getElementById(\"correo\").value;\n \n if (validarEmail(cor) == false) {\n document.getElementById('errorCorreo').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorCorreo').innerHTML = '<b>Extencion de correo incorrecta </b>'\n }\n\n }\n\n if (elemento.id == 'contrasenia') {\n document.getElementById('errorContrasenia').style = 'display:none;'\n contra = document.getElementById(\"contrasenia\").value;\n \n if (contra.length < 8) {\n document.getElementById('errorContrasenia').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorContrasenia').innerHTML = '<b>Ingrese nuevamente una nueva contraseña </b>'\n }\n \n if (validarPasswd (contra) == false) {\n document.getElementById('errorContrasenia').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorContrasenia').innerHTML = '<b>Ingrese nuevamente una nueva contraseña </b>'\n }\n \n\n\n }\n\n \n }\n\n\n bandera = false\n }\n \n}", "function validate_input() {\n\tvar err = 0; // pocet chyb\n\tfor(let i = 0; i < 9; i++) {\n\t\tif(user_order[i] !== order[i])\n\t\t\terr++;\n\t}\n\t$('#errcount').val(err);// ukaz tlacitko odeslani a zvaliduj napred\n\t$('#dialogform1').toggleClass(\"disappear\"); // ukaz odesilaci formular\n}", "function inputValid(id, event){\n const idTag = document.getElementById(id);\n const text = event.target.value;\n if(text.length > 0) {\n idTag.classList.add(\"active\")\n } else {\n idTag.classList.remove(\"active\")\n }\n}", "function check_required_fields(inputObj) {\n \t\n \tvar isValid = true;\n \t$(inputObj).each(function(){\n\n \t\tif (!notempty($(this).attr('id'))) {\n \t\t\tisValid = false;\n \t\t\treturn isValid;\n \t\t}\n \t});\n \treturn isValid;\n }", "function validarGuardadoPrimeraSucursal(){\n\n\tvar sw = 0; // variable para determinar si existen campos sin diligenciar\n\n\t\n\tif( $(\"#sucursal_nombre\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_nombre\").addClass( \"active\" );\n\t\t$(\"#sucursal_nombre\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#sucursal_telefono1\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_telefono1\").addClass( \"active\" );\n\t\t$(\"#sucursal_telefono1\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\n\t\n\t\n\tif( $(\"#sucursal_celular\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_celular\").addClass( \"active\" );\n\t\t$(\"#sucursal_celular\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\n\t\n\t\n\tif( $(\"#sucursal_direccion\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_direccion\").addClass( \"active\" );\n\t\t$(\"#sucursal_direccion\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idPais\").val() == '0' ){\n\t\t\n\t\t$(\"#label_sucursal_pais\").addClass( \"active\" );\n\t\t$(\"#pais\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idCiudad\").val() == '0' ){\n\t\t\n\t\t$(\"#label_sucursal_ciudad\").addClass( \"active\" );\n\t\t$(\"#ciudad\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idBarrio\").val() == '0'){\n\t\t\n\t\t$(\"#label_sucursal_barrio\").addClass( \"active\" );\n\t\t$(\"#barrio\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif(sw == 1){\n\t\treturn false;\n\t}else{\n\t\t$(\"#form_primeraSucursal\").submit();\n\t}\n \n}", "function input_valid($id, $longueur) {\n\n $('#' + $id).on('keyup', function(e) {\n\n if (($('#' + $id).val()).length < $longueur) {\n $('#' + $id).css('color', 'red');\n } else {\n $('#' + $id).css('color', 'black');\n }\n });\n }", "function validateForm(id)\n {\n temp=[];\n var elements = document.querySelectorAll(id);\n for (var i = 0,element; element = elements[i++];)\n {\n //alert(i+\" \"+element.value);\n temp[i-1]=element.value;\n if (element.value === \"\")\n {\n alert(\"Please fill \"+ element.name+\" Field\");\n return false;\n }\n }\n //console.log(temp[0]+\" \"+temp[1]);\n return true;\n }", "function validate_items() {\n\tvar selected = $(\".padding\"); // vsechny spravne polozky\t\n\tvar err = 0; // pocet chyb\n\t\n\tfor(let i = 0; i < selected.length; i++) { // neco co nemelo byt zaskrtnute zaskrtnul\n\t\tif($(selected[i]).hasClass(\"striked\")) {\n\t\t\t\terr++;\n\t\t\t}\n\t}\n\n\tvar striked = $(\".striked\");\n\tif(striked.length < 13)\n\t\terr += (13-striked.length);\t\n\t\n $(\"#errcount\").val(err); // zvaliduj kolik tam ma chyb\n $(\"#dialogform3\").submit(); // odesli formular a hod sem dalsi test\n\t\n}", "function validator(elements) {\n var errors = 0;\n $.each(elements, function(index, element){\n if($.trim($('#' + element).val()) == '') errors++;\n });\n if(errors) {\n $('.error').html('Please insert title and description');\n return false;\n }\n return true;\n }", "function validator(elements) {\n var errors = 0;\n $.each(elements, function(index, element){\n if($.trim($('#' + element).val()) == '') errors++;\n });\n if(errors) {\n $('.error').html('Please insert title and description');\n return false;\n }\n return true;\n }", "function validator(elements) {\n var errors = 0;\n $.each(elements, function(index, element){\n if($.trim($('#' + element).val()) == '') errors++;\n });\n if(errors) {\n $('.error').html('Please insert title and description');\n return false;\n }\n return true;\n }", "function validate() {\n\n // clear all previous errors\n $(\"input\").removeClass(\"error\");\n var errors = false;\n\n // check all except author, which is special cased\n $(\"input[@name!='author']\").each(function(){\n\n if(! $(this).val()) {\n\n errors = true;\n $(this).addClass(\"error\");\n\n } \n });\n\n // check author\n var seen_author = false;\n $(\"input[@name='author']\").each(function(){\n if ($(this).val()) seen_author = true;\n });\n\n if (!seen_author) {\n $(\"//input[@name='author']:first\").addClass(\"error\");\n errors = true;\n }\n\n // submit if no errors\n return !(errors);\n\n} // validate", "function validateForm() {\n\n\tvar blnvalidate = true;\n\tvar elementsInputs;\n\tvar elementsInputs2;\n\tvar elementsSelect =(formElem.fr_estado.value);\n\n\telementsInputs = document.getElementsByTagName('input');\n\n \tfor (var intCounter = 0; intCounter < elementsInputs.length; intCounter++)\n {\n \telementsInputs2 = elementsInputs[intCounter].id;\n if (elementsInputs[intCounter].id != \"photoin\" && elementsInputs[intCounter].id != \"check\" && elementsInputs[intCounter].id != \"fr_comp\" && elementsInputs[intCounter].id != \"fr_email\")\n {\n \tif (validateText(elementsInputs, intCounter) == true)\n {\n \tblnvalidate = false;\n \tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFEDEF\"; \n }\n else \n \t\t{\n \t\tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFFFFF\";\n \t\t}\t\t\n } \n else if (elementsInputs[intCounter].id == \"fr_email\")\n {\n \tif (validateEmail(elementsInputs, intCounter) == true)\n {\n \tblnvalidate = false;\n \tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFEDEF\"; \n \t}\n \telse \n \t\t{\n \t\tdocument.getElementById(elementsInputs2).style.backgroundColor=\"#FFFFFF\";\n \t\t}\t\t\n }\n else if (elementsInputs[intCounter].id == \"check\")\n {\n if (elementsInputs[intCounter].checked == false)\n {\n blnvalidate = false;\n document.getElementById('fr_error').innerHTML = '<p class=\"p_erro\"><h11>Por favor, marcar o campo \"Aceito os termos de Uso.\"</h11></p>';\n }\n }\n else if (elementsSelect == \"all\") \n {\n \tformElem.fr_estado.style.backgroundColor=\"#FFEDEF\"; \n }\n else \n {\n \tformElem.fr_estado.style.backgroundColor=\"#FFFFFF\";\n }\n\t}\n $(\"body\").animate({\"scrollTop\":\"0\"},500);\n\treturn blnvalidate;\n}", "function validarCampos () {\n\tif (!vacio($(\"#titulo\").val(), $(\"#titulo\").attr(\"placeholder\"))) {\n\t\tsave();\n\t}\n}", "function validateForm(){\n\tvar horario = $('.horario').val();\n\tvar materia = $('.materia').val();\n\tvar dia = $('.dia').val();\n\tvar hi = $('.horaI').val();\n\tvar hf = $('.horaF').val();\n\tvar res = false;\n\n\tif (horario === 0 || horario == null || materia === 0 || materia == null || dia === 0 || dia == null || hi == \"\" || hf == \"\") {\n\t\tres = true;\n\t}\n\n\treturn res;\n}", "function validarCampos () {\n\tvar arrayCamposEvaluar = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\", \"cajonesEstacionamiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayCamposObligatorios = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\");\n\t\n\tif ($(\"#celdaCodigo\").css(\"display\") != \"none\") {\n\t\tarrayCamposObligatorios.push(\"codigo\");\n\t}\n\t\n\tvar arrayFlotantes = new Array(\"precio\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayEnteros = new Array(\"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\");\n\t\n\t\n\tfor (var x = 0; x < arrayCamposEvaluar.length; x++) {\n\t\t//evalua los que son obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) > -1) {\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (vacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\"), $(\"#\"+arrayCamposEvaluar[x]+\" option[value='-1']\").text()))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (vacio($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los flotantes\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los enteros\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//evalua todos aquellos que no son necesariamente obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) == -1) {\n\t\t\tvar continua = false;\n\t\t\t\n\t\t\t//evalua primeramente que no esten vacios\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (!isVacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\")))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (!isVacio($(\"#\"+arrayCamposEvaluar[x]).val()))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\t\n\t\t\t//si no lo estan\n\t\t\tif (continua) {\n\t\t\t\t//evalua los flotantes\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//evalua los enteros\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tvar id = pos_comp;\n\t\n\tif (pos_comp != -1)\n\t\tid = positions[pos_comp].id;\n\t\t\n\t\n\tif (isVacio($(\"#codigo\").val())) {\n\t\tsave();\n\t}\n\telse {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/updInmueble.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tid: id,\n\t\t\t\tvalidarCodigo: 1,\n\t\t\t\tusuario: $(\"#usuario\").val(),\n\t\t\t\tcodigo: $(\"#codigo\").val()\n\t\t\t}\n\t\t}).always(function(respuesta_json) {\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tsave();\n\t\t\t}\n\t\t\telse\n\t\t\t\talert(respuesta_json.mensaje);\n\t\t});\n\t}\n}", "function validarCampos () {\n\tvar arrayCamposEvaluar = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\", \"cajonesEstacionamiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayCamposObligatorios = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\");\n\t\n\tif ($(\"#celdaCodigo\").css(\"display\") != \"none\") {\n\t\tarrayCamposObligatorios.push(\"codigo\");\n\t}\n\t\n\tvar arrayFlotantes = new Array(\"precio\", \"dimensionTotal\", \"dimensionConstruida\", \"cuotaMantenimiento\", \"metrosFrente\", \"metrosFondo\");\n\tvar arrayEnteros = new Array(\"elevador\", \"estacionamientoVisitas\", \"numeroOficinas\");\n\t\n\t\n\tfor (var x = 0; x < arrayCamposEvaluar.length; x++) {\n\t\t//evalua los que son obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) > -1) {\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (vacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\"), $(\"#\"+arrayCamposEvaluar[x]+\" option[value='-1']\").text()))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (vacio($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los flotantes\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//evalua los enteros\n\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\n\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//evalua todos aquellos que no son necesariamente obligatorios\n\t\tif ($.inArray(arrayCamposEvaluar[x], arrayCamposObligatorios) == -1) {\n\t\t\tvar continua = false;\n\t\t\t\n\t\t\t//evalua primeramente que no esten vacios\n\t\t\tif ($(\"#\"+arrayCamposEvaluar[x]).prop(\"tagName\") == \"SELECT\") {//evalua los selects\n\t\t\t\tif (!isVacio(($(\"#\"+arrayCamposEvaluar[x]).val() != -1 ? $(\"#\"+arrayCamposEvaluar[x]).val() : \"\")))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\telse {//todos aquellos que no son selects\n\t\t\t\tif (!isVacio($(\"#\"+arrayCamposEvaluar[x]).val()))\n\t\t\t\t\tcontinua = true;\n\t\t\t}\n\t\t\t\n\t\t\t//si no lo estan\n\t\t\tif (continua) {\n\t\t\t\t//evalua los flotantes\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayFlotantes) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!flotante($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//evalua los enteros\n\t\t\t\tif ($.inArray(arrayCamposEvaluar[x], arrayEnteros) > -1) {\n\t\t\t\t\t_campo = $(\"#\"+arrayCamposEvaluar[x]).val();\n\t\t\t\t\t_campo = _campo.replace(/\\$/g, \"\");\n\t\t\t\t\t_campo = _campo.replace(/,/g, \"\");\n\t\t\t\t\t$(\"#\"+arrayCamposEvaluar[x]).val(_campo);\n\t\t\t\t\t\n\t\t\t\t\tif (!entero($(\"#\"+arrayCamposEvaluar[x]).val(), $(\"#\"+arrayCamposEvaluar[x]).attr(\"placeholder\")))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tvar id = pos_comp;\n\t\n\tif (pos_comp != -1)\n\t\tid = positions[pos_comp].id;\n\t\t\n\t\n\tif (isVacio($(\"#codigo\").val())) {\n\t\tsave();\n\t}\n\telse {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/updInmueble.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tid: id,\n\t\t\t\tvalidarCodigo: 1,\n\t\t\t\tusuario: $(\"#usuario\").val(),\n\t\t\t\tcodigo: $(\"#codigo\").val()\n\t\t\t}\n\t\t}).always(function(respuesta_json) {\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tsave();\n\t\t\t}\n\t\t\telse\n\t\t\t\talert(respuesta_json.mensaje);\n\t\t});\n\t}\n}", "function validar() {\n var i = 0;\n\n if ($(\"#txtNombre\").val().length < 1) {\n i++;\n }\n if ($(\"#txtSemestre\").val().length < 1) {\n i++;\n }\n if ($(\"#txtCarrera\").val().length < 1) {\n i++;\n }\n if ($(\"#txtSerie\").val().length < 1) {\n i++;\n }\n if ($(\"#txtHPracticas\").val().length < 1) {\n i++;\n }\n\n\n if (i == 5) {\n alert(\"Por favor llene todos los campos.\");\n return false;\n }\n\n\n if ($(\"#txtNombre\").val().length < 1) {\n alert(\"El nombre es obligatorio.\");\n }\n if ($(\"#txtSemestre\").val().length < 1) {\n alert(\"El semestre designado es obligatorio.\");\n }\n if ($(\"#txtCarrera\").val().length < 1) {\n alert(\"La carrera es obligatorio.\");\n }\n if ($(\"#txtSerie\").val().length < 1) {\n alert(\"La serie es obligatorio.\");\n }\n if ($(\"#txtHPracticas\").val().length < 1) {\n alert(\"El campo de horas practicas es obligatorio.\");\n }\n\n if (i == 0) {\n saveMtr(); \n $('#txtSerie').val('');\n $('#txtNombre').val('');\n $('#txtSemestre').val('');\n $('#txtCarrera').val('');\n $('#txtHPracticas').val('');\n return false;\n }\n\n}", "function validar_materiap(){\r\n var exp_fecha = /^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$/;\r\n var tipo_mp = document.getElementById('tipo_mp').value;\r\n var cantidad_mp = document.getElementById('cantidad_mp').value;\r\n var entrada_mp = document.getElementById('entrada_mp').value;\r\n var salida_mp = document.getElementById('salida_mp').value;\r\n\r\n if (tipo_mp === \"\" || cantidad_mp === \"\" || entrada_mp === \"\" || salida_mp === \"\") {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'Todos los campos son obligatorios',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n return false;\r\n }\r\n\r\n else if (tipo_mp.length>20) {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'Nombre del tipo de materia prima es muy largo maximo 20 caracteres ',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n document.getElementById('tipo_mp').focus();\r\n document.getElementById('tipo_mp').value=\"\";\r\n return false;\r\n }\r\n\r\n\r\nelse if (isNaN(cantidad_mp)) {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'Cantidad de materia prima no validad',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n document.getElementById('cantidad_mp').focus();\r\n document.getElementById('cantidad_mp').value=\"\";\r\n return false;\r\n\r\n}\r\n\r\n\r\n // else if (!exp_fecha.test(entrada_mp)) {\r\n // Swal.fire({\r\n // icon: 'warning',\r\n // text: 'Fecha no validad',\r\n // position: 'top',\r\n // toast: true,\r\n // timer: 5000,\r\n // allowQutsidClick: false,\r\n // customClass:{\r\n // content: 'content-class',\r\n // },\r\n\r\n // });\r\n // document.getElementById('entrada_mp').focus();\r\n // document.getElementById('entrada_mp').value=\"\";\r\n // return false;\r\n // }\r\n\r\n // else if (!exp_fecha.test(salida_mp)) {\r\n // Swal.fire({\r\n // icon: 'warning',\r\n // text: 'Fecha no validad',\r\n // position: 'top',\r\n // toast: true,\r\n // timer: 5000,\r\n // allowQutsidClick: false,\r\n // customClass:{\r\n // content: 'content-class',\r\n // },\r\n\r\n // });\r\n // document.getElementById('salida_mp').focus();\r\n // document.getElementById('salida_mp').value=\"\";\r\n // return false;\r\n // }\r\n\r\n\r\n\r\n}", "function inicio()\n{\n\t$(\"#id_marca\").keyup(validar_marca);\n\t$(\"#id_fecha_campania\").keyup(validar_fecha_campania);\n\n\n\n\n\t$(\"#btn_nuevo\").click(validar_marca);\n\t$(\"#btn_nuevo\").click(validar_fecha_campania);\n\n\n\t\n}", "function validate(ctr1,ctr2) {\n if((document.getElementById(ctr1).value.split(' ').join('') == \"\") ||\n (document.getElementById(ctr1).value.split(' ').join('') == \"0\"))\n {\n document.getElementById(ctr2).style.display = \"block\";\n return false;\n } else {\n document.getElementById(ctr2).style.display = \"none\";\n return true;\n }\n}", "function ValidateRisultatiArticolo() {\n\tvar value = document.getElementsByName('parole')[1].value;\n\tif (!/^\\s*$/.test(value)) {\n\t\treturn true;\n\t}\n\n\talert(\"Devi inserire almeno una parola da cercare\");\n\treturn false;\n}", "function checkOthAcaQuali(){\n var othAcaQuali = document.getElementById(\"OtherNewAcaQualiOpt\").value;\n\tvar check1 = false ;\n if(othAcaQuali === \"\"){\n check1 = true;\n }\n if(check1){\n document.getElementById(\"otherAcaQualiErrorMsg\").style.display = \"block\";\n }else{\n document.getElementById(\"otherAcaQualiErrorMsg\").style.display = \"none\";\n }\n}", "function validateAnagrafica(formId){\n\tvar result=true;\n\t$('.error').detach();\n\tif($('#'+formId+' #ragioneSociale1').is('input')){ //Esiste il campo ragione sociale 1 e\n\t\tif($('#'+formId+' #ragioneSociale1').val()==\"\"){ //tale campo &egrave; non vuoto\n\t\t\tresult = false;\n\t\t\t$('#'+formId+' #ragioneSociale1').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t}\n\t}\n\t\n\tif($('#'+formId+' #nome').is(\"input\") && //Esiste il campo \"nome\"\n\t $('#'+formId+' #cognome').is('input')){//Esiste il campo \"Cognome\"\n\t\t \n\t\tif($('#'+formId+' #nome').val()==\"\"){//Se il campo nome è vuoto va in errore\n\t\t\tresult = false;\n\t\t\t$('#'+formId+' #nome').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t}\n\t\tif($('#'+formId+' #cognome').val()==\"\"){//Se il campo cognome è vuoto va in errore\n\t\t\tresult = false;\n\t\t\t$('#'+formId+' #cognome').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t}\n\t}\t\n\t\t\t\tif ( $('#'+formId+' #ncivico').val()==\"\" ) {\n\t\t\t\tresult = false;\n\t\t\t\tconsole.log(result );\n\t\t\t\t$('#'+formId+' #ncivico').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t\t\t\n\t\t}\n\t\t\n\t\n\n\tif(result){\n\t\tdocument.forms[formId].submit();\n\t}\n\treturn result;\n}", "function validarEdad(){\r\n\t\r\n\tvar valEdad = recopilarinfotextbox(\"txtEdad\");\r\n\t\r\n\tif (valEdad>=12){\r\n\t\t//alert(valEdad+\" edad mayor de 12\");\r\n\t\tdesactivarelementoFormulario(\"ceo\");\r\n\t\tdocument.getElementById(\"ceo\").value = \"no aplica\";\r\n\t}else{\r\n\t\t//alert(valEdad+\" edad menor de 12\");\r\n\t\tdesactivarelementoFormulario(\"cop\");\r\n\t\tdocument.getElementById(\"cop\").value = \"no aplica\";\r\n\t}\r\n\t\r\n}", "function validateFieldsIE(){\n console.log(\"Elements!!!!!!!\");\n\n var nameElement = document.getElementById('txtNameElement');\n var description = document.getElementById('txtDescription');\n var park = document.getElementById('txtPark');\n \n var emptyName = false, emptyDescription = false, emptyPark = false;\n \n if(nameElement.value.length < 2){//el parque está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n \n \n if(emptyName === true || emptyDescription === true || emptyPark === true){\n return false;\n console.log(\"false\");\n }else{\n return true;\n }\n}", "function valideIdentifiant() {\n\n let élément = document.getElementById(\"identifiant\");\n\n // vérification de la conformité de l'identifiant\n let ok = vérifieIdentifant(élément);\n\n // Cache ou affiche le message d'erreur\n let errorLabel = document.getElementById('identifiantError');\n if (ok === true) {\n errorLabel.style.display = 'none'; // on cache le messsage d'erreur\n } else {\n errorLabel.style.display = 'block'; // on le révèle\n }\n return ok;\n}", "function validarArticulosModificacion()\n{\n\tvar usuario = $(\"#nombreArticulo\");\n\tvar reg = /^[A-Za-z0-9 ]{4,25}$/;\n\n\tvar match = usuario.val().match(reg);\n\tif (!match) \n\t{\n\t\tevent.preventDefault();\n\t\t$(\"#errorModificacionNombre\").siblings().addClass('hidden');\n\t\t$(\"#errorModificacionNombre\").removeClass('hidden');\n\t\treturn false;\n\t}\n\t\n\tvar stockInicial = $(\"#stockArticulo\");\n\tif (stockInicial.val()<1) {\n\t\t$(\"#errorModificacionStock\").siblings().addClass('hidden');\n\t\t$(\"#errorModificacionStock\").removeClass('hidden');\n\t\tevent.preventDefault();\t\n\t\treturn false;\t\n\t}\n\n\tif (isNaN(stockInicial.val())) {\n\t\t$(\"#errorModificacionStock\").siblings().addClass('hidden');\n\t\t$(\"#errorModificacionStock\").removeClass('hidden');\n\t\tevent.preventDefault();\t\n\t\treturn false;\n\t}\n\t$( \"#erroresModificacion\" ).find( \"*\" ).addClass('hidden');\n\t\n}", "function validateForm(){\n\n let inputs = document.getElementsByTagName(\"input\");\n for(let input of inputs) {\n \n \n if (input.id === \"inputName\") {\n console.log(`I have the righ input field to validate - target date input field ${input.id} and I can check if your value ${input.value} is matching my validation function`)\n //Alert message to review your answer\n var AZRegex = /^[a-zA-Z.,'/ -/]*$/;\n let inputNameValue = input.value;\n var inputNameResult = AZRegex.test(inputNameValue);\n\n if (inputNameResult === false) {\n //to input html to div holding name input need for loop to find the right div\n let divs = document.getElementsByTagName(\"div\")\n for(let div of divs ){\n if (div.id === inputNameDiv) {\n this.innerHTML = \n `\n <label for=\"ipnutName\" class=\"form-label\">Name</label>\n <input type=\"text\" class=\"form-control is-invalid\" id=\"inputName\" name=\"name\">\n <div id=\"ageHelp\" class=\"invalid-feedback\">Please use only letters and special characters in the Name field</div>\n `\n }\n }\n\n console.log(`flase result of testing the value ${inputNameResult}`)\n \n } else {\n console.log(`All good to go value ok, create variable: ${input.value} will be used to calculate final result of calcuation`);\n \n };\n\n }\n\n };\n }", "validateForm() {\n\n const singer = this.shadowRoot.getElementById('singer');\n const song = this.shadowRoot.getElementById('song');\n const artist = this.shadowRoot.getElementById('artist');\n const link = this.shadowRoot.getElementById('link');\n\n if(singer && song && artist) {\n return (singer.value != '' && song.value != '' && artist.value != '');\n };\n\n return false;\n }", "function blankfunc3(id1,id2,id3,check3)\n{\n\t/*$(id1+'_err1').removeClassName('showElement');\n\t$(id1+'_err2').removeClassName('showElement');\n\t$(id2+'_err1').removeClassName('showElement');\n\t$(id2+'_err2').removeClassName('showElement');\n\t$(id3+'_err1').removeClassName('showElement');\n\t$(id3+'_err2').removeClassName('showElement');*/\n\t\t$(check3+'_err1').removeClassName('showElement');\n\t $(check3+'_err1').addClassName('hideElement');\n\tvar msg = \"\";\n\tif($F(id1) == '')\n\t{\n\t\tmsg += \"enter value in field one\\n\";\n\t\t\t$(id1+'_err1').removeClassName('hideElement');\n\t\t\t$(id1+'_err1').addClassName('showElement');\n\t\t\t//alert('enter value in parent id');\n\t\t\t\n\t\t\t//return false;\n\t}\n\telse\n\t\t{\n\t\t\t$(id1+'_err1').removeClassName('showElement');\n\t\t\t$(id1+'_err1').addClassName('hideElement');\n\t\t}\n\tif($F(id2) == '')\n\t\t{\n\t\t\tmsg += \"enter value in field two\\n\";\n\t\t $(id2+'_err1').removeClassName('hideElement');\n\t\t\t\t$(id2+'_err1').addClassName('showElement');\n\t\t\t//alert('enter value in account number');\n\t\t\t//return false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(id2+'_err1').removeClassName('showElement');\n\t\t\t$(id2+'_err1').addClassName('hideElement');\n\t\t}\n\tif($F(id3) == '')\n\t\t{\n\t\t\tmsg += \"enter value in field three\\n\";\n\t\t\t $(id3+'_err1').removeClassName('hideElement');\n\t\t\t\t$(id3+'_err1').addClassName('showElement');\n\t\t\t//alert('enter value in firm name');\n\t\t\t//return false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(id3+'_err1').removeClassName('showElement');\n\t\t\t$(id3+'_err1').addClassName('hideElement');\n\t\t}\n\t\t\n\t\t/*if(numeric(id1) == true && alpha_numeric(id2) == true && alpha_numeric(id3) == true)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}*/\n\t\tif(msg.length>0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n}", "function validarApellido(){\n val = in_apellido.value;\n if(val.length < 4){\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_enabled\";\n element.innerHTML = \"<strong>Mínimo 03 caracteres.</strong>\"; \n validator_apellido = false;\n }else{\n if(expRegCadena.test(val)){\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_disabled\";\n btn_registrar.disabled = false;\n validator_apellido = true;\n }else{\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_enabled\";\n element.innerHTML = \"<strong>Apellido no válido, solo letras.</strong>\"; \n validator_apellido = false;\n }\n }\n checkValidator();\n}", "function validateEAN(){\n\tvar boo = true;\n\tvar ean = $(\".EAN\");\n\t\n\tfor(var i = 0; i < ean.length;i++){\n\t\tif(emptyString(ean[i].value)){ // check for an empty string\n\t\t\tsetErrorOnBox($(\"#\"+ean[i].id));\n\t\t\tboo = false;\n\t\t}\t\n\t}\n\treturn boo;\n}", "function validateaadhar() {\n let aadhar = document.getElementById('txtadhaar');\n if (!isvalidaadhar(aadhar.value.trim())) {\n onerror(aadhar, \"aadhar must be 12 numbers\");\n return false;\n\n }\n else {\n onsuccess(aadhar);\n document.queryselector('#check-success').style.display = \"block\";\n }\n\n}", "function validate(id) {\n\n\tif ($(\"#\" + id).val() == null || $(\"#\" + id).val() == \"\") {\n\t\tvar div = $(\"#\" + id).closest(\"div\");\n\t\tdiv.addClass(\"has-error\");\n\t\t//alert(\"in new\");\n\t\t$('[data-toggle=\"'+id+'tooltip\"]').tooltip('show').tooltip({\n\t placement : 'top'\n\t });\n\t\t//alert(\"Validation Error\" +$(\"#\"+id).val() );\n\t\treturn false;\n\t} else {\n\t\tvar div = $(\"#\" + id).closest(\"div\");\n\t\tdiv.removeClass(\"has-error\");\n\t\t//alert(\"in new else\");\n\t\t$('[data-toggle=\"'+id+'tooltip\"]').tooltip('destroy')\n\t\treturn true;\n\t}\n\n\n}", "function validate(){\n let inputs = document.querySelectorAll('input');\n for(let input of inputs){\n input.addEventListener('keyup',function(e){\n switch(e.target.id){\n case 'stackID':\n if(!validateStackID(e.target.value)) showInvalid(input);\n else removeValidationError(e.target);\n break;\n case 'startCallNumber':\n case 'endCallNumber':\n if(!validateCallNumbers(e.target.value)) showInvalid(input)\n else removeValidationError(e.target);\n break;\n }\n });\n }\n}" ]
[ "0.69560295", "0.6943351", "0.6737052", "0.6722853", "0.6631263", "0.66102886", "0.659714", "0.65643567", "0.65233046", "0.64983475", "0.6495941", "0.64505357", "0.6369624", "0.6361338", "0.63401103", "0.633844", "0.6298203", "0.6291724", "0.62580323", "0.6247937", "0.6231633", "0.62313193", "0.62264615", "0.61837894", "0.61815983", "0.6176362", "0.61558014", "0.615319", "0.6151798", "0.61394244", "0.61333513", "0.612217", "0.612217", "0.6115918", "0.6108036", "0.61063856", "0.6103825", "0.60975236", "0.6087236", "0.6084083", "0.6069038", "0.6065246", "0.6062031", "0.6058716", "0.6057653", "0.6050862", "0.6046423", "0.6037663", "0.60375744", "0.60365987", "0.6036521", "0.6035079", "0.6032732", "0.6019932", "0.6016895", "0.6014652", "0.6012066", "0.6005903", "0.6003654", "0.59935987", "0.5990615", "0.5989072", "0.5988912", "0.59867114", "0.59863394", "0.59780437", "0.59670025", "0.59660494", "0.59594864", "0.5956601", "0.5952068", "0.59519887", "0.59509194", "0.5940328", "0.5940328", "0.5940328", "0.5938122", "0.5931364", "0.5929399", "0.592489", "0.59233886", "0.59233886", "0.5920529", "0.5913272", "0.5911902", "0.59114903", "0.59051216", "0.5903328", "0.5901959", "0.5901215", "0.5898812", "0.5896017", "0.5893059", "0.58883446", "0.5888064", "0.5886756", "0.58843464", "0.58840764", "0.5883771", "0.58810806", "0.5879732" ]
0.0
-1
TODO: Hay que obtener este valor de this.config.
get schema() { return this.config.content.esquemas[this.identificador].schemaName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getConfig () {}", "get config() { return this._config; }", "get config() {\r\n return this._CONFIG;\r\n }", "get config() {\n return this.use().config;\n }", "get config() {\n return this._config;\n }", "get config() {\n\t\treturn this._config;\n\t}", "get configuration() {\n return this.config;\n }", "getConfig() {\n return this.config;\n }", "config() {\n return this._config;\n }", "function Config() { }", "function Config() { }", "getConfig() {\n return this.config;\n }", "getConfig() {\n return this.config;\n }", "getConfig() {\n return this._config;\n }", "constructor(config) {\n\t\tthis.config = config;\n\t}", "get config() {\n if (!this._config)\n this._config = new Configuration();\n return this._config;\n }", "static onReadConfig(context, config){\n\t}", "getFullConfig() {\n return this.config;\n }", "constructor(config) {\n this.config = config\n }", "constructor(config) {\n this.config = config;\n }", "constructor(config) {\n this.config = config;\n }", "get config() {\n return this.state.config;\n }", "get configTemplate() {\n return {\n // The color is used for the `this.log()` function and also custom command help\n color: '1af463',\n // The optional icon to use with the `this.sendLocalMessage` function. If left blank, a default one will be used instead\n iconURL: 'https://i.ytimg.com/vi/KEkrWRHCDQU/maxresdefault.jpg'\n };\n }", "function configure() {\n\n\t\n}", "getConfig() {\n if (config) {\n return config;\n }\n return false;\n }", "function config(name) {\n\t\treturn getProperty(CONFIG, name);\n\t}", "get config() {\n return this.$config;\n\n }", "getConfig() {\n return this.options;\n }", "config(config) {\n if (typeof config !== \"object\" || Object.keys(config).length === 0) {\n this.emit('error', {\n name: 'InvalidConfig',\n message: 'A config was not provided to measurement library'\n })\n }\n\n if (!config.asset || typeof config.asset !== 'string') {\n this.emit('error', {\n name: 'InvalidConfig',\n message: 'No asset artifact provided in measurement config or not a string'\n })\n }\n\n //Add config info to this.config\n this.config = {}\n Object.assign(this.config, config)\n }", "function $get() {\r\n return this.config; // can be really confusing (what's inside)\r\n }", "function getConfig() {\n return config;\n }", "function onConfigUpdate(updatedConfig) {\n console.log(updatedConfig);\n }", "function ReturnConfig() {\n return config;\n}", "constructor(config) {\r\n if (config) {\r\n this.config = config;\r\n }\r\n }", "config(name) {\n var v = this.module.config(name);\n return v !== undefined\n ? v\n : this.proj && this.proj.config(name);\n }", "configure(config) {\n this.name = config.getAsStringWithDefault(\"name\", this.name);\n this.description = config.getAsStringWithDefault(\"description\", this.description);\n this.properties = config.getSection(\"properties\");\n }", "getConfig() {\n return this.options;\n }", "static getExtraConfig () {\n return {}\n }", "constructor(config){ super(config) }", "constructor(config){ super(config) }", "_getConfigValueOrDefault(name) {\n let out = CONFIG_DEFAULTS[name];\n if (this._config.hasOwnProperty(name)) {\n out = this._config[name];\n }\n if (out == undefined) {\n throw new Error(\"Cannot create Renderable without \" + name);\n }\n return out;\n }", "getValue(k) {\n return this._config[k];\n }", "getName() {\n return this.configs.name\n }", "get_config_data() {\n return {}\n }", "get (what) {\n const config = {\n appopticsVersion: this.ao.version,\n bindingsVersion: this.ao.addon.version,\n oboeVersion: this.ao.addon.Config.getVersionString(),\n contextProvider: this.ao.contextProvider,\n config: this.ao.cfg,\n sampleRate: this.ao.sampleRate,\n traceMode: this.ao.traceMode !== undefined ? this.ao.traceMode : 'unset',\n lastSettings: this.ao.lastSettings,\n logging: this.ao.control.logging,\n os: this.os,\n node: process.version,\n pid: this.pid,\n metricsState: this.ao.metrics && this.ao.metrics.state,\n metricsInterval: this.ao.metrics && this.ao.metrics.interval,\n }\n\n if (what in config) {\n return {[what]: config[what]};\n }\n if (what) {\n return {status: 404, message: `unknown config ${what}`};\n }\n return config;\n }", "getConfigId(){\n\t\treturn 'specconfig_'+this.spec_id;\n\t}", "function DefaultConfig() {\n return defaultConfig;\n}", "function config () {\n XTemplate.config.apply(arguments)\n}", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "get prop() {\n return this.config.prop;\n }", "get akConfig() { return this[_config_akasha]; }", "function Config()\n{\n this.mCoordX = 0; \n this.mCoordY = 0;\n this.mCityName = \"null\";\n this.mDescription = \"\";\n}", "function getConfig(configName)\n {\n if ( angular.isUndefined(fuseConfiguration[configName]) )\n {\n return false;\n }\n\n return fuseConfiguration[configName];\n }", "getConfigFromDb() {}", "updateInternalConfig () {\n // If the given external and internal configs are the same, do nothing\n if (_.isEqual(this.config, this.value)) return\n // Go through all config keys defined on *this* chart\n // All other elements of config will be ignored\n _.each(this.config, (val, key) => {\n // Undefined value is treated in special way: It is assigned the global default, defined in this mixin\n if (val === undefined) {\n if (!(key in this.defaultConfigValues)) throw Error(`No default value for config '${key}' available!`)\n // Don't assign default if value is given by external config\n if (!(key in this.value)) this.$set(this.config, key, _.cloneDeep(this.defaultConfigValues[key]))\n }\n if (key in this.value) this.$set(this.config, key, this.value[key])\n })\n }", "static createConfig(config) {\r\n return config;\r\n }", "static createConfig(config) {\r\n return config;\r\n }", "static get() {\n if (this._config) {\n return this._config;\n } else {\n return this.build();\n }\n }", "configure(config) {\n this._interval = config.getAsLongWithDefault(\"options.interval\", this._interval);\n this._maxCacheSize = config.getAsIntegerWithDefault(\"options.max_cache_size\", this._maxCacheSize);\n this._source = config.getAsStringWithDefault(\"source\", this._source);\n }", "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "static getConfig() {\n return {\n apiKey: Firebase.apiKey,\n appId: Firebase.appId,\n authDomain: Firebase.authDomain,\n databaseURL: Firebase.databaseURL,\n projectId: Firebase.projectId,\n messagingSenderId: Firebase.messagingSenderId,\n };\n }", "writeConfig(title, config) {\n return; // fix later\n }", "function sampleConfig() {\n return \"\\\n---\\n\\\n# Configuration sample file for Jingo (YAML)\\n\\\napplication:\\n\\\n title: \\\"CartoWiki\\\"\\n\\\nserver:\\n\\\n hostname: \\\"localhost\\\"\\n\\\n port: 6067\\n\\\n localOnly: false\\n\\\n baseUrl: \\\"http://localhost:6067\\\"\\n\\\nauthentication:\\n\\\n google:\\n\\\n enabled: true\\n\\\n\ttwitter:\\n\\\n\t enabled: true\\n\\\n\t oauthkeys:\\n\\\n consumerKey : ''\\n\\\n consumerSecret : ''\\n\\\n cacheExpire: 3600000\\n\\\n\tfacebook:\\n\\\n\t enabled: true\\n\\\n\t oauthkeys:\\n\\\n clientID : ''\\n\\\n clientSecret : ''\\n\\\n alone:\\n\\\n enabled: false\\n\\\n username: \\\"\\\"\\n\\\n passwordHash: \\\"\\\"\\n\\\n email: \\\"\\\"\\n\\\ntwitterClient:\\n\\\n consumerKey : ''\\n\\\n consumerSecret : ''\\n\\\n accessTokenKey : ''\\n\\\n accessTokenSecret : ''\\n\\\n\";\n }", "findConfigElement(name) {\n let index = this.checkpointConfig.findIndex((element) => {\n return element.name === name;\n });\n return this.checkpointConfig[index];\n }", "_configOptions(config) {\n this.options = {\n containerSelector: '#gol-container',\n style: 'canvas',\n cellSize: 20,\n speed: 1,\n\n size: {\n width: 1860,\n height: 930\n }\n };\n \n if(config) {\n Object.assign(this.options, config);\n }\n }", "get configuration() {\n // Always returns a copy of the authentication configuration\n return Object.assign({}, options_1.default, this.app.get(this.configKey));\n }", "getConfigValue (type, key)\n {\n if (this.config[type] && typeof this.config[type][key] !== 'undefined')\n {\n return this.config[type][key]\n }\n return this.config[key]\n }", "@api\n get config() {\n return this._config || { buttons: [] };\n }", "get databaseConfig() { return this._databaseConfig; }", "list() {\n let config = this.readSteamerConfig();\n\n for (let key in config) {\n if (config.hasOwnProperty(key)) {\n this.info(key + '=' + config[key] || '');\n }\n }\n\n }", "getRunConfig() {\n return {\n ...this.options,\n dispatch: this.onDispatch.bind(this),\n getState: this.getState.bind(this),\n onError: this.onError.bind(this),\n };\n }", "getConfig() {\n let config = this.trs80.getConfig();\n for (const displayedOption of this.displayedOptions) {\n if (displayedOption.input.checked) {\n config = displayedOption.block.updateConfig(displayedOption.option.value, config);\n }\n }\n return config;\n }", "getConfiguration() {\n return this.configuration;\n }", "setConfig(config) {\n throw new Error(\"Must be implemented\");\n }", "function DialogServiceConfig() {\n }", "getConfig(key, def){\n\t\tlet className = this.getModelClass();\n\t\treturn className.$getConfig(key, def)\n\t}", "function getBidderConfig() {\n return bidderConfig;\n }", "function viewConfig(){\n SHOWERRORS(true);\n ALERT(\">\"+INSPECT(CONFIG()));\n}", "function load_config(){\n S.config = K.config.fetch();\n return S.config;\n }", "function getConfig() {\n\treturn config ? config : DEFAULT_CONFIG;\n}", "config_fields() {\n\t\treturn [{\n\t\t\ttype: 'text',\n\t\t\tid: 'info',\n\t\t\twidth: 12,\n\t\t\tlabel: 'Information',\n\t\t\tvalue: 'This module controls a Datavideo vision mixer.</br>Note: Companion needs to be restarted if the model is changed.</br>Use Auto port selection for SE-2200.</br>'\n\t\t},\n\t\t{\n\t\t\ttype: 'textinput',\n\t\t\tid: 'host',\n\t\t\tlabel: 'IP Address',\n\t\t\twidth: 6,\n\t\t\tdefault: '192.168.1.101',\n\t\t\tregex: this.REGEX_IP\n\t\t},\n\t\t{\n\t\t\ttype: 'dropdown',\n\t\t\tid: 'port',\n\t\t\tlabel: 'Port',\n\t\t\twidth: 4,\n\t\t\tchoices: this.CHOICES_PORT,\n\t\t\tdefault: '0',\n\t\t},\n\t\t{\n\t\t\ttype: 'dropdown',\n\t\t\tid: 'modelID',\n\t\t\tlabel: 'Model',\n\t\t\twidth: 6,\n\t\t\tchoices: this.CHOICES_MODEL,\n\t\t\tdefault: 'se1200mu'\n\t\t},\n\t\t{\n\t\t\ttype: 'checkbox',\n\t\t\tid: 'debug',\n\t\t\tlabel: 'Debug to console',\n\t\t\tdefault: '0',\n\t\t},\n\t\t{\n\t\t\ttype: 'checkbox',\n\t\t\tid: 'legacy_feedback',\n\t\t\tlabel: 'Legacy feedback request (For testing)',\n\t\t\tdefault: '0',\n\t\t},\n\t\t]\n\t}", "loadConfig(config) {\n this.isClosable = config.isClosable;\n this.closeResult = config.closeResult;\n this.size = config.size;\n this.isFullScreen = config.isFullScreen;\n this.isBasic = config.isBasic;\n this.isInverted = config.isInverted;\n this.isCentered = config.isCentered;\n this.mustScroll = config.mustScroll;\n this.transition = config.transition;\n this.transitionDuration = config.transitionDuration;\n }", "static $config(){\n\t\treturn {\n\t\t\tkey: '_id'\n\t\t}\n\t}", "function verConfiguracion(){console.log(copiaConfiguracionBase);}", "getDefaultConfig() {\n return {\n karyotypePanelVisible: true,\n chromosomePanelVisible: true,\n overviewPanelVisible: true,\n region: null,\n quickSearchDisplayKey: \"name\",\n quickSearchResultFn: null,\n zoom: 50,\n width: 100,\n featuresOfInterest: [],\n featuresOfInterestTitle: \"Features of Interest\",\n historyControlsVisible: true,\n zoomControlsVisible: true,\n positionControlsVisible: true,\n geneSearchVisible: true,\n regionSearchVisible: true,\n };\n }", "static $getConfig(key, def){\n\t\tlet $config = this.$config();\n\t\tif(key !== undefined){\n\t\t\tif($config && $config[key] !== undefined){\n\t\t\t\treturn $config[key]\n\t\t\t} else {\n\t\t\t\treturn def;\n\t\t\t}\n\t\t}\n\t\treturn $config;\n\t}", "get configurationInput() {\n return this._configuration;\n }", "_getCustomConfig (key, defaultValue) {\n return typeof (this.aioConfig[key]) !== 'undefined' ? this.aioConfig[key] : defaultValue\n }", "function getSPPConfig () {\n return SPP_CONFIG\n}", "function Config() {\n\t\"use strict\";\n}", "function Config() {\n\t\"use strict\";\n}", "get() {\n const config = { ...this.config };\n if (config.elements) {\n config.elements = config.elements.map((cur) => {\n if (typeof cur === \"string\") {\n return cur.replace(this.rootDir, \"<rootDir>\");\n }\n else {\n return cur;\n }\n });\n }\n return config;\n }", "function get(name) {\n const value = config.get(name)\n console.assert(value != null && value != undefined, \"Missing config param \" + name)\n return value\n}", "function get(name) {\n const value = config.get(name)\n console.assert(value != null && value != undefined, \"Missing config param \" + name)\n return value\n}", "constructor() { \n \n GeneralConfigPart.initialize(this);\n }", "function getConfiguration()\n {\n var result = {};\n return $.extend(true, configuration, result);\n }" ]
[ "0.7606637", "0.73842585", "0.7082008", "0.7068292", "0.7022429", "0.6997734", "0.69381946", "0.6858097", "0.67695224", "0.673225", "0.673225", "0.6713872", "0.6713872", "0.65167046", "0.64767826", "0.6449887", "0.64469904", "0.64455074", "0.6420435", "0.6402406", "0.6402406", "0.63921887", "0.63862556", "0.6314758", "0.6281848", "0.6272941", "0.6264614", "0.6264014", "0.6263757", "0.62527174", "0.62503433", "0.62455535", "0.62251997", "0.62144744", "0.6172237", "0.6171761", "0.6145771", "0.6137328", "0.6125794", "0.6125794", "0.61222297", "0.61215585", "0.6114883", "0.61103785", "0.6097202", "0.6095235", "0.6092113", "0.6083232", "0.6068778", "0.6068778", "0.6068778", "0.6068778", "0.6068778", "0.6068778", "0.6066454", "0.60502523", "0.602726", "0.602525", "0.60247153", "0.6016473", "0.6007795", "0.6007795", "0.6007527", "0.6007449", "0.5985923", "0.59816515", "0.59811175", "0.5961878", "0.59447235", "0.5941089", "0.5915865", "0.59127396", "0.59068066", "0.59037894", "0.58997107", "0.5893778", "0.5892293", "0.5888678", "0.5882063", "0.5869656", "0.5860158", "0.5856624", "0.58541304", "0.585298", "0.58506894", "0.58478767", "0.58444864", "0.5823296", "0.5821232", "0.5817287", "0.58127826", "0.5812647", "0.581236", "0.5809564", "0.58084756", "0.58084756", "0.5805148", "0.580347", "0.580347", "0.5782654", "0.57772285" ]
0.0
-1
Buscan campos en los esquemas.
obtenerCampo(clave, entidad) { if(!entidad.customSchemas) return null; try { return entidad.customSchemas[this.schema][clave]; } catch(error) { return undefined; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rellenarCampos(datos){\n this.tituloInput.value = datos.titulo;\n this.cuerpoInput.value = datos.cuerpo;\n this.idInput.value = datos.id;\n this.estado = \"editar\";\n this.cambiarEstado(this.estado);\n }", "function LimpiarCampos()\n{\n\t\n\t__('agente_name').value= \"\";\n\t__('agente_venta').value= \"\";\n\t__('user_zona').value = \"\";\n\t__('agente_comision').value= \"\";\n\t__('agente_folio').value = \"\";\n\t__('user').value = \"\";\n\t__('registro').style.display = \"inline\";\n\t__('modifica').style.display = \"none\";\n\t__('elimina').style.display = \"none\";\n\t\n\t\n\t// __('cancelar').style.display = 'none';\n\t// __('imprimir').style.display = 'none';\n}", "function inicializarCampos() {\r\n document.querySelector('#tipo').value = vehiculos[0].tipo;\r\n document.querySelector('#marca').value = vehiculos[0].marca;\r\n document.querySelector('#modelo').value = vehiculos[0].modelo;\r\n document.querySelector('#patente').value = vehiculos[0].patente;\r\n document.querySelector('#anio').value = vehiculos[0].anio;\r\n document.querySelector('#precio').value = vehiculos[0].precio;\r\n if (document.querySelector('#tipo').value == \"auto\") {\r\n document.querySelector('#capacidadBaul').value = vehiculos[0].capacidadBaul;\r\n }\r\n else if (document.querySelector('#tipo').value == \"camioneta\") {\r\n document.querySelector('#capacidadCarga').value = vehiculos[0].capacidadCarga;\r\n }\r\n}", "limpiarCampos(){\n this.tituloInput.value = \"\";\n this.cuerpoInput.value = \"\";\n this.idInput.value = \"\";\n }", "function limpiarCampos(){\n\t$('#t').val(\"\");\n\t$('#cant').val(\"1\");\n\t$('#idInputSeleccionar').val(\"\");\n\t//$('#precio').val(\"Cantidad x Precio\");\n\t//$('#total').val(\"Total\");\n\t//$('#codigo').val(\"\");\n }", "function limpiarCampos() {\n $('#compra').val('').focus();\n $('#venta').val('');\n }", "function limpiarCamposAdicional(){\n $cedula.val(\"\");\n $primerNombre.val(\"\");\n $segundoNombre.val(\"\");\n $primerApellido.val(\"\");\n $segundoApellido.val(\"\");\n $nombreTarjeta.val(\"\");\n $cupoOtorgado.val(\"\");\n $sexo.val($(\"#sexo option:first\").val());\n $estadoCivil.val($(\"#estadoCivil option:first\").val());\n $parentesco.val($(\"#parentesco option:first\").val());\n $fechaNacimiento.val(\"\");\n $nacionalidadSelect.val($(\"#nacionalidadSelect option:first\").val());\n $nacionalidad.val(\"ECUATORIANA\");\n $nacionalidadDiv.hide();\n $observaciones.val(\"\");\n}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function fParametrosBusq(Busq)\n{\n\tif(Busq == 'cedula') {\n\t\t$('#divBusqCedula').css('display','');\n\t\t$('#divBusqNormal').css('display','none');\n\t\t$('#cmbIdNacionalidadBusq').focus();\n\t}\n\telse {\n\t\tvar Content = 'Buscar por ' + Busq;\n\t\t$('#divBusqCedula').css('display','none');\n\t\t$('#divBusqNormal').css('display','');\n\t\t$('#txtBusqueda').attr('data-content',Content);\n\t\t$('#txtBusqueda').popover('show');\n\t\t$('#txtBusqueda').focus();\n\t}\n\t$('#cmbIdNacionalidadBusq').val('');\n\t$('#txtCedulaBusq').val('');\n\t$('#txtBusqueda').val('');\n}", "function limpiaCampos(){\n $(\"#name2\").val('');\n $(\"#email2\").val('');\n $(\"#password2\").val('');\n $(\"#repassword2\").val('');\n $(\"#telefono2\").val('');\n $(\"#empresa2\").val('');\n $(\"#persona2\").val('');\n }", "function setCajasServidor() {\n for (var i = 0; i < self.datosProyecto.businesModel.length; i++) {\n var businesModel = self.datosProyecto.businesModel[i];\n for (var x = 0; x < businesModel.cajas.length; x++) {\n var caja = businesModel.cajas[x];\n for (var j = 0; j < cajasServidor.length; j++) {\n if (caja.id == cajasServidor[j].id) {\n caja.titulo = cajasServidor[j].titulo;\n caja.descripcion = cajasServidor[j].descripcion;\n caja.color = cajasServidor[j].color;\n caja.textoCheck = cajasServidor[j].textoCheck;\n }\n }\n }\n }\n}", "function limpiar_campos(){\r\n\r\n\t//NOMBRE\r\n\tdocument.getElementById(\"txt_nombre\").value = \"\";\r\n\t$(\"#div_nombre\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_nombre\").hide();\r\n\t\r\n\t//EMAIL\r\n\tdocument.getElementById(\"txt_email\").value = \"\";\r\n\t$(\"#div_email\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_email\").hide();\r\n\r\n\t//TELEFONO\r\n\tdocument.getElementById(\"txt_telefono\").value = \"\";\r\n\t$(\"#div_telefono\").attr(\"class\",\"form-group\");\r\n\t$(\"#span_telefono\").hide();\r\n\r\n //TIENE HIJOS?\r\n tiene_hijos[0].checked=true;\r\n\r\n //ESTADO CIVIL\r\n document.getElementById(\"cbx_estadocivil\").value=\"SOLTERO\";\r\n\r\n //INTERESES\r\n document.getElementById(\"cbx_libros\").checked =false;\r\n document.getElementById(\"cbx_musica\").checked =false;\r\n document.getElementById(\"cbx_deportes\").checked =false;\r\n document.getElementById(\"cbx_otros\").checked =false;\r\n $(\"#div_intereses\").attr(\"class\",\"form-group\");\r\n $(\"#span_intereses\").hide();;\r\n}", "function destacaCamposComProblemaEmForms( erros ){\n\n tabela.find('.form-group').removeClass('has-error');\n\n $.each( erros, function( index, erro ){\n\n $(\"[name='\"+index+\"']\").parents(\".form-group\").addClass('has-error');\n\n });\n\n }", "function CleanFields() {\n $scope.Empleados = null;\n $scope.Message = \"\";\n $scope.Empleado = \"\";\n $scope.Empleados = \"\";\n $scope.ClassActive = \"\";\n $scope.SelectedNroDocumento = \"\";\n $scope.SelectedNombre = \"\";\n $scope.SelectedSalarioMensual = \"\";\n $scope.TransaccionesEmpleado = \"\";\n }", "function validarCampos () {\n\tif (!vacio($(\"#titulo\").val(), $(\"#titulo\").attr(\"placeholder\"))) {\n\t\tsave();\n\t}\n}", "limparCampoForm(form) {\n form.id.value = \"\";\n form.nome.value = \"\";\n form.descricao.value = \"\";\n form.detalhes.value = \"\";\n }", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "function mobjetos__inicializar(){\n\t/* $(\"#txtNombreDelCampo\").val(\"\"); */\n\t/* cmbNombreDelCampo__inicializar(); */\n\t/* $(\"#txtNombreDelCampo\").focus(); */\n}", "function inicializaContadores(){\n campo.on(\"input\", function(){\n var conteudo = campo.val();\n \n // contador de palavras\n var qtdPalavras = conteudo.split(/\\S+/).length -1; \n $(\"#contador-palavras\").text(qtdPalavras);\n // >> /\\S+/ = expressão regular que busca espço vazio\n \n // contador de letras\n var qtdCaracteres = conteudo.length\n $(\"#contador-caracteres\").text(qtdCaracteres);\n });\n }", "static claerFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function limparUltimosCampos(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\t//if(form.idMunicipio.value == \"\")\r\n\t\t//limparUltimosCampos(1);\r\n\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //municipio\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\tcase 2: //bairro\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\t\tform.idLogradouro.value =\"\";\t\t\t\r\n\t\tcase 3://logradouro\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\t\tform.CEP.value = \"\";\r\n\t\tcase 4://cep\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\t}\r\n}", "atualizaCampo(e) {\n const produto = { ...this.state.produto }\n produto[e.target.name] = e.target.value;\n\n //MÁSCARA E VALIDAÇÃO\n $('#desconto').mask('999');\n $('#preco').mask('999');\n\n this.setState({ isChecked: !this.state.isChecked });\n\n this.setState({\n produto\n });\n\n }", "function seteaValoresParaGuardar() {\n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n\tset(FORMULARIO + '.hMarca', get(FORMULARIO + '.ValorMarca') );\n\tset(FORMULARIO + '.hCanal', get(FORMULARIO + '.ValorCanal') );\n\tset(FORMULARIO + '.hTipoCurso', get(FORMULARIO + '.ValorTipoCurso') ); \n\tset(FORMULARIO + '.hAccesoInformacion', get(FORMULARIO + '.ValorAccesoInformacion') ); \n\tset(FORMULARIO + '.hFrecuenciaDictado', get(FORMULARIO + '.ValorFrecuenciaDictado') ); \n\tset(FORMULARIO + '.hSubgerenciaVentas', get(FORMULARIO + '.ValorSubgerenciaVentas') ); \n\tset(FORMULARIO + '.hRegion', get(FORMULARIO + '.ValorRegion') ); \n\tset(FORMULARIO + '.hZona', get(FORMULARIO + '.ValorZona') ); \n\tset(FORMULARIO + '.hSeccion', get(FORMULARIO + '.ValorSeccion') ); \n\tset(FORMULARIO + '.hTerritorio', get(FORMULARIO + '.ValorTerritorio') ); \n\tset(FORMULARIO + '.hTipoCliente', get(FORMULARIO + '.ValorTipoCliente') ); \n\tset(FORMULARIO + '.hCapacitador', get(FORMULARIO + '.ValorCapacitador') ); \n\tset(FORMULARIO + '.hSubtipoCliente', get(FORMULARIO + '.ValorSubtipoCliente') ); \n\tset(FORMULARIO + '.hClasificacion', get(FORMULARIO + '.ValorClasificacion') ); \n\tset(FORMULARIO + '.hTipoClasificacion', get(FORMULARIO + '.ValorTipoClasificacion') ); \n\tset(FORMULARIO + '.hStatusCliente', get(FORMULARIO + '.ValorStatusCliente') ); \n\tset(FORMULARIO + '.hStatusCursosExigidos', get(FORMULARIO + '.ValorStatusCursosExigidos') ); \n\tset(FORMULARIO + '.hPeriodoInicio', get(FORMULARIO + '.ValorPeriodoInicio') ); \n\tset(FORMULARIO + '.hPeriodoFin', get(FORMULARIO + '.ValorPeriodoFin') ); \n\tset(FORMULARIO + '.hPeriodoInicioV', get(FORMULARIO + '.ValorPeriodoInicioV') ); \n\tset(FORMULARIO + '.hPeriodoFinV', get(FORMULARIO + '.ValorPeriodoFinV') ); \n\tset(FORMULARIO + '.hPeriodoIngreso', get(FORMULARIO + '.ValorPeriodoIngreso') ); \n\tset(FORMULARIO + '.hProductoEntregar', get(FORMULARIO + '.ValorProductoEntregar') ); \n\tset(FORMULARIO + '.hMomentoEntregar', get(FORMULARIO + '.ValorMomentoEntregar') ); \n\n\tset(FORMULARIO + '.hNombreCurso', get(FORMULARIO + '.ValorNombreCurso') ); \n\tset(FORMULARIO + '.hObjetivoCurso', get(FORMULARIO + '.ValorObjetivoCurso') ); \n\tset(FORMULARIO + '.hContenidoCurso', get(FORMULARIO + '.ValorContenidoCurso') ); \n\tset(FORMULARIO + '.hAccesoSeleccionDM', get(FORMULARIO + '.ValorAccesoSeleccionDM') ); \n\tset(FORMULARIO + '.hPathDM', get(FORMULARIO + '.ValorPathDM') ); \n\tset(FORMULARIO + '.hFechaDisponible', get(FORMULARIO + '.ValorFechaDisponible') ); \n\tset(FORMULARIO + '.hFechaLanzamiento', get(FORMULARIO + '.ValorFechaLanzamiento') ); \n\tset(FORMULARIO + '.hFechaFin', get(FORMULARIO + '.ValorFechaFin') ); \n\tset(FORMULARIO + '.hAlcanceGeografico', get(FORMULARIO + '.ValorAlcanceGeografico') ); \n\tset(FORMULARIO + '.hNOptimo', get(FORMULARIO + '.ValorNOptimo') ); \n\tset(FORMULARIO + '.hBloqueo', get(FORMULARIO + '.ValorBloqueo') ); \n\tset(FORMULARIO + '.hRelacion', get(FORMULARIO + '.ValorRelacion') ); \n\tset(FORMULARIO + '.hNOrdenes', get(FORMULARIO + '.ValorNOrdenes') ); \n\tset(FORMULARIO + '.hMonto', get(FORMULARIO + '.ValorMonto') ); \n\tset(FORMULARIO + '.hFechaIngreso', get(FORMULARIO + '.ValorFechaIngreso') ); \n\tset(FORMULARIO + '.hNCondicion', get(FORMULARIO + '.ValorNCondicion') ); \n\tset(FORMULARIO + '.hFechaUltimo', get(FORMULARIO + '.ValorFechaUltimo') ); \n\tset(FORMULARIO + '.hNRegaloParticipantes', get(FORMULARIO + '.ValorNRegaloParticipantes') ); \n\tset(FORMULARIO + '.hCondicionPedido', get(FORMULARIO + '.ValorCondicionPedido') ); \n\tset(FORMULARIO + '.hControlMorosidad', get(FORMULARIO + '.ValorControlMorosidad') ); \n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n}", "function lerTarefas() {\n\n for (let i = 0; i < dados.length; i++) {\n\n $(`input[id=\"tarefa_nam${i}\"]`).val(dados[i].tarefa)\n $(`input[id=\"tarefa_val${i}\"]`).val(dados[i].peso)\n\n }\n}", "function limpiar_campos(id_combo){\n\tif($('#'+id_combo).length >0){ // si existe si lo borra\n\t\t$('#'+id_combo).val('');\n\t\t$this = $('#'+id_combo);\n\t}\n}", "_readFromForm() {\n this.dao.phylum = document.getElementById('phylum').value;\n this.dao.phylum_ott_id = document.getElementById('phylum_ott_id').value;\n this.dao.class = document.getElementById('class').value;\n this.dao.class_ott_id = document.getElementById('class_ott_id').value;\n this.dao.order = document.getElementById('order').value;\n this.dao.order_ott_id = document.getElementById('order_ott_id').value;\n this.dao.family = document.getElementById('family').value;\n this.dao.family_ott_id = document.getElementById('family_ott_id').value;\n this.dao.genus = document.getElementById('genus').value;\n this.dao.genus_ott_id = document.getElementById('genus_ott_id').value;\n this.dao.species = document.getElementById('species').value;\n this.dao.species_ott_id = document.getElementById('species_ott_id').value;\n this.dao.unique_name = document.getElementById('unique_name').value;\n this.dao.vernacular_name = document.getElementById('vernacular_name').value;\n\n if (this.dao.ott_id =='' || this.dao.phylum == '' || this.dao.class == '' || \n this.dao.order == '' || this.dao.family == '' || this.dao.genus == '' ||\n this.dao.species == '' || this.dao.unique_name == '' ||\n this.dao.vernacular_name == '') throw('Please fill all fields');\n }", "function posicionarCombos() { \n\t\t//combo tipoSolicitud\n\t\tvar iSeleccionadoTipoSol = new Array(); \n\t\tiSeleccionadoTipoSol[0] = get('frmFormulario.hOidTipoSolicitud'); \n\t\tset('frmFormulario.cbTipoSolicitud',iSeleccionadoTipoSol); \n\n\t\t//combo periodos\n\t\tvar iSeleccionadoPeriodo = new Array(); \n\t\tiSeleccionadoPeriodo[0] = get('frmFormulario.hPeriodo'); \n\t\tset('frmFormulario.cbPeriodo',iSeleccionadoPeriodo); \n\t}", "function verificarCamposForm(id){\n // se verifican cuantos campos tiene el formulario\n // la ultima posicion corresonde al boton de envío\n for (let i = 0; i < $(id)[0].length - 1; i++) {\n let campo = $(id)[0][i];\n let value = $(campo).val();\n let select = $(campo).attr('id');\n select = '#'+select;\n\n if(value == \"\" || value == null || $(select).hasClass('is-invalid')) {\n return false;\n }\n }\n return true;\n}", "function datosFormulario(frm) {\n let nombre= frm.nombre.value;\n let email = frm.email.value;\n let asunto= frm.asunto.value;\n let mensaje = frm.mensaje.value\n \n console.log(\"Nombre \",nombre);\n console.log(\"Email \",email);\n console.log(\"Asunto \",asunto);\n console.log(\"Mensaje \",mensaje);\n\n}", "function bindDatosForm(row){\n var formularioEditar = $(\".form-editar-gabinete\");\n $.each(camposEnColumnas,function(index,value){\n formularioEditar.find('[name*='+value+']').val(row.find(\".td\"+value).data(value));\n });\n $.each(camposEnFilas,function(index,value){\n formularioEditar.find('[name*='+value+']').val(row.data(value));\n });\n}", "function limparCampos(){\n document.getElementById('categoria').value=0;\n document.getElementById('ano').value='';\n document.getElementById('atores').value='';\n document.getElementById('infos').value=''; \n}", "function definirAlumnos(){\n var _carreraAlumno = \"\";\n // uso de la variable alumno \n}", "limpaFormulario(){\n this._inputDataNascimento.value = ''\n this._inputIdade.value = 1;\n this._inputSalario.value = 0;\n this._inputDataNascimento.focus();\n }", "function esCampo(campo)\n{\n\tif (campo==null) return false;\n\tif (campo.name==null) return false;\n\treturn true;\n}", "function CleanFields() {\n $scope.Message = \"\";\n $scope.TipoIngreso = \"\";\n $scope.TiposIngreso = \"\";\n $scope.ClassActive = \"\";\n $scope.SelectedNombre = \"\";\n $scope.SelectedDependeDeSalario = \"\";\n $scope.SelectedEstado = \"\";\n \n }", "function resetearCampos()\n{\t$(\"#formGenerico input[@type=text]\").attr(\"value\",\"\");\n\t$(\"#formGenerico select\").attr(\"value\",\"\");\n\t$(\"#formGenerico textarea\").attr(\"value\",\"\");\n}", "function limpiarCamposForm(idForm){\n\n idForm.each (function(){\n \n this.reset();\n\n });\n\n }", "function cargaCombosMarcaCanal() {\n\tvar idioma = get(FORMULARIO+'.idioma').toString();\n\tvar pais = get(FORMULARIO+'.pais').toString();\n\n\tvar marca = get(FORMULARIO+'.hMarca').toString();\n\tvar canal = get(FORMULARIO+'.hCanal').toString();\n\tvar tipoCurso = get(FORMULARIO+'.hTipoCurso').toString();\n\tvar accesoInformacion = get(FORMULARIO+'.hAccesoInformacion').toString();\n\tvar statusCursos = get(FORMULARIO+'.hStatusCursosExigidos').toString();\n\tvar periodoInicio = get(FORMULARIO+'.hPeriodoInicio').toString();\n\tvar periodoFin = get(FORMULARIO+'.hPeriodoFin').toString();\n\tvar periodoInicioV = get(FORMULARIO+'.hPeriodoInicioV').toString();\n\tvar periodoFinV = get(FORMULARIO+'.hPeriodoFinV').toString();\n\tvar periodoIngreso = get(FORMULARIO+'.hPeriodoIngreso').toString();\n\tvar subgerenciaVentas = get(FORMULARIO+'.hSubgerenciaVentas').toString();\n\t\n\t// Se carga el combo de tipo de curso\n\tif (marca != '') {\n\t\tvar parametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorTipoCurso'; \n \tparametros[1] = \"CMNObtieneTiposCurso\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaTipoCurso(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorTipoCurso', 'CMNObtieneTiposCurso', DTODruidaBusqueda, \n\t\t\t[['oidIdioma',idioma], ['oidPais',pais], ['oidMarca', marca]], \n\t\t\t'seleccionaTipoCurso(datos)', tipoCurso);*/\n\t}\n\t\n\t// Se carga el combo de acceso informacion\n\tif (canal != '') {\n\t\tvar parametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorAccesoInformacion'; \n \tparametros[1] = \"CMNObtieneAccesos\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaAccesoInformacion(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorAccesoInformacion', 'CMNObtieneAccesos', DTODruidaBusqueda, \n\t\t\t[['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]], \n\t\t\t'seleccionaAccesoInformacion(datos)', accesoInformacion);*/\n\t}\n\t\n\t// Se cargan los combos de status de cursos, periodos (los 5) y subgerencias\n\tif (marca != '' && canal !='') {\n\t\tvar casoUso = get(FORMULARIO+'.casoUso').toString();\n\t\tif (casoUso == 'modificar' || statusCursos != '') {\n\t\t\tvar parametros = new Array(5);\n \t\tparametros[0] = FORMULARIO+'.ValorStatusCursosExigidos'; \n \t\t//SCS, se cambia por: CMNObtieneTiposCurso parametros[1] = \"CMNObtieneCursos\";\n\t\t\tparametros[1] = \"CMNObtieneTiposCurso\";\n \t\tparametros[2] = DTODruidaBusqueda;\n \t\tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \t\tparametros[4] = \"seleccionaStatusCursos(datos)\";\n \t\tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t\t/*gestionaCombo(FORMULARIO+'.ValorStatusCursos', 'CMNObtieneCursos', DTODruidaBusqueda,\n\t\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t\t'seleccionaStatusCursos(datos)',statusCursos);*/\n\t\t}\n\t\t\n\t\tvar parametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorPeriodoInicio'; \n \tparametros[1] = \"CMNObtienePeriodos\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaPeriodoInicio(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorPeriodoInicio', 'CMNObtienePeriodos', DTODruidaBusqueda, \n\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaPeriodoInicio(datos)',periodoInicio); */\n\n\t\tparametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorPeriodoFin'; \n \tparametros[1] = \"CMNObtienePeriodos\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaPeriodoFin(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorPeriodoFin', 'CMNObtienePeriodos', DTODruidaBusqueda, \n\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaPeriodoFin(datos)',periodoFin);*/\n\t\t\n\t\tparametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorPeriodoInicioV'; \n \tparametros[1] = \"CMNObtienePeriodos\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaPeriodoInicioV(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorPeriodoInicioV', 'CMNObtienePeriodos', DTODruidaBusqueda,\n\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaPeriodoInicioV(datos)',periodoInicioV);*/\n\t\t\n\t\tparametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorPeriodoFinV'; \n \tparametros[1] = \"CMNObtienePeriodos\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaPeriodoFinV(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorPeriodoFinV', 'CMNObtienePeriodos', DTODruidaBusqueda, \n\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaPeriodoFinV(datos)',periodoFinV);*/\n\t\n\t\tparametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorPeriodoIngreso'; \n \tparametros[1] = \"CMNObtienePeriodos\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaPeriodoIngreso(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorPeriodoIngreso', 'CMNObtienePeriodos', DTODruidaBusqueda,\n\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaPeriodoIngreso(datos)',periodoIngreso); */\n\t\n\t\tparametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorSubgerenciaVentas'; \n \tparametros[1] = \"CMNObtieneSubgerenciasVentas\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidMarca', \" + marca + \"], ['oidCanal', \" + canal + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaSubgerenciaVentas(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorSubgerenciaVentas', 'CMNObtieneSubgerenciasVentas', DTODruidaBusqueda,\n\t\t\t[['oidMarca', marca],['oidCanal', canal], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaSubgerenciaVentas(datos)',subgerenciaVentas);*/\n\t}\n}", "function datosCita(e) {\r\n citaObj[e.target.name] = e.target.value;\r\n}", "busquedaUsuario(termino, seleccion) {\n termino = termino.toLowerCase();\n termino = termino.replace(/ /g, '');\n this.limpiar();\n let count = +0;\n let busqueda;\n this.medidoresUser = [], [];\n this.usersBusq = [], [];\n for (let index = 0; index < this.usuarios.length; index++) {\n const element = this.usuarios[index];\n switch (seleccion) {\n case 'nombres':\n busqueda = element.nombre.replace(/ /g, '').toLowerCase() + element.apellido.replace(/ /g, '').toLowerCase();\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n case 'cedula':\n busqueda = element.cedula.replace('-', '');\n termino = termino.replace('-', '');\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n default:\n count = -1;\n break;\n }\n }\n if (count < 1) {\n this.usersBusq = null;\n }\n this.conteo_usuario = count;\n }", "materializar() {\n\t\t// Se pueden agregar comprobaciones para evitar que haya campos en blanco cuando se guarda.\n\t\tthis.guardarObjetoEnArchivo();\n\t}", "function deshabilitoCampos() {\r\n $('.containerPayMethods input[type=\"text\"]').each(function () {\r\n $(this).prop(\"disabled\", true);\r\n });\r\n }", "function agregarValidacionesAInputs() {\n /*$('#nueva-mercaderia')\n // Busco los inputs\n .find('input').each(function() {\n var id = $(this).data('id');\n\n if (id == \"precio\") {\n // Si es precio agrego que sea numérico\n $(this).rules(\"add\", {\n number: true,\n required: true,\n verificarMismosCamposDeArticulosConCodigoIgual: true,\n messages: {\n number: 'Ingrese un número válido',\n required: 'Este campo es obligatorio',\n verificarMismosCamposDeArticulosConCodigoIgual: 'Los precios deben ser los mismos para códigos iguales'\n }\n });\n } else if (id == \"cantidad\") {\n // Si es cantidad agrego que sea digitos\n $(this).rules(\"add\", {\n digits: true,\n required: true,\n messages: {\n digits: 'Ingrese sólo dígitos',\n required: 'Este campo es obligatorio'\n }\n });\n } else {\n // Agrego que sea obligatorio\n $(this).rules(\"add\", {\n required: true,\n messages: {\n required: 'Este campo es obligatorio'\n }\n });\n }\n })\n\n // Busco el select\n .find('select').each(function() {\n console.log($(this));\n // Agrego que sea obligatorio\n $(this).rules(\"add\", {\n required: true,\n messages: { required: 'Este campo es obligatorio' }\n });\n });\n\n console.log('asd');*/\n }", "misDatos() { // un metodo es una funcion declarativa sin el function dentro de un objeto, puede acceder al universo del objeto\n return `${this.nombre} ${this.apellido}`; // por medio del \"this\", que es una forma de acceder a las propiedades del objeto en un metodo\n }", "function validarCampos5 () {\n\tsaveTransaccion();\n}", "function validarCampos5 () {\n\tsaveTransaccion();\n}", "static fields () {\n return {\n cod: this.attr(null),\n titulo: this.attr(''),\n precio: this.attr('')\n }\n }", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "set nombre(nom){\n this._nombres = nom;\n }", "function init_inpt_formulario_cargar_recorrido() {\n // Inputs del formulario para inicializar\n}", "getValues(){\n // declarando com let, para ficar somente dentro do escopo\n let user = {};\n\n // varialve de verificacao de validade do formulario\n let isValid = true;\n \n // vamos rodar o foreach nos elementos do formulario.\n // por se tratar de um objto, nao encontrara o metodo forEach()\n // entao e usado os [] envolta do objeto para converter em array\n // mas ai teria outro problema de ficar percorrendo todos os indices do objeto\n // para isso tem um operador novo chamado Spread (...) antes do this para nao ter que precisar verificar quantos indices\n // o array vai ter\n \n [...this.formEl.elements].forEach(function(field, index){\n\n // verifica se tem o campo requerido e se esta vazio\n if([\"name\", \"email\", \"password\"].indexOf(field.name) > -1 && !field.value){\n\n field.parentElement.classList.add(\"has-error\");\n isValid = false;\n\n }\n\n if(field.name == \"gender\"){\n \n if(field.checked === true ){\n user[field.name] = field.value;\n }\n \n }else if(field.name == \"admin\"){\n\n user[field.name] = field.checked;\n\n }else{\n user[field.name] = field.value;\n }\n \n \n });\n\n //retorna se o formulario for invalido, como se fosse um break\n if(!isValid){\n return false;\n }\n \n // retornado direto a resposta da classe\n return new User(\n user.name, \n user.gender, \n user.birth, \n user.country, \n user.email, \n user.passwor, \n user.photo, \n user.admin);\n\n \n }", "function VaciaCamposTitulos(){\n\t$(\"#inputTitulo\").val(\"\");\n\t$(\"#inputDescripcion\").val(\"\");\n\t//$('#selectIdioma').val('')\n\t$('#selectIdioma').prop('SelectedIndex',0);\n\t$(\"#inputTitulo\").focus();\n}", "function inicializaContadores() {\n\tcampo.on(\"input\", function() {\n\t\tvar qtdPalavras = campo.val().split(/\\S+/).length - 1;\t\n\t\t$(\"#contador-palavras\").text(qtdPalavras);\n\t\t$(\"#contador-caracteres\").text(campo.val().length);\n\t});\n}", "constructor(nombres, apellidos, fechaN, direccion, celuar, email, departamento, action) {\n this.nombres = nombres;\n this.apellidos = apellidos;\n this.fechaN = fechaN;\n this.direccion = direccion;\n this.celuar = celuar;\n this.email = email;\n this.departamento = departamento;\n this.action = action;\n\n }", "function habilitoDeshabilitoCampos(metodoDePago) {\r\n if (metodoDePago == \"tCredito\") {\r\n $('#metodoPagoTarjeta input[type=\"text\"]').each(function () {\r\n $(this).prop(\"disabled\", false);\r\n });\r\n $('#metodoPagoTransferencia input[type=\"text\"]').each(function () {\r\n $(this).prop(\"disabled\", true);\r\n $(this).val(\"\");\r\n });\r\n\r\n } else {\r\n $('#metodoPagoTarjeta input[type=\"text\"]').each(function () {\r\n $(this).prop(\"disabled\", true);\r\n $(this).val(\"\");\r\n });\r\n $('#metodoPagoTransferencia input[type=\"text\"]').each(function () {\r\n $(this).prop(\"disabled\", false);\r\n });\r\n }\r\n }", "function asignarAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n const cursoId = document.getElementById(\"cursos\").value;\n document.getElementById(\"cursoId\").value = cursoId;\n}", "function seleccionarContacto() {\n\n var ver = document.getElementById(\"ver\").value;\n\n contador_registros = ver;\n\n for (let i = 0; i < agenda.length; i++) {\n\n let persona = agenda[i];\n\n if ((persona.id) == ver) {\n document.getElementById(\"nombre\").value = persona.nombre;\n document.getElementById(\"apellidos\").value = persona.apellidos;\n document.getElementById(\"telefono\").value = persona.telefono;\n document.getElementById(\"fecha\").value = persona.fecha;\n\n }\n }\n actualizarRegistos();\n}", "constructor(props) {\n super(props);\n\n const { esReinscripcion, alumno } = this.props;\n\n this.state = {\n paso0: {\n inputs: {\n dni: {\n valor: esReinscripcion ? alumno.dni : '',\n valido: false,\n msjError: \"Ingrese un DNI\",\n habilitado: !esReinscripcion\n },\n tipoDni: {\n valor: esReinscripcion ? alumno.tipoDni : 'DNI',\n valido: true,\n msjError: \"Seleccione un Tipo de DNI\",\n habilitado: !esReinscripcion\n },\n nombre: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el nombre\",\n habilitado: false\n },\n apellido: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el apellido\",\n habilitado: false\n },\n genero: {\n valor: '',\n valido: false,\n msjError: \"Seleccione un género\",\n habilitado: false\n },\n email: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un email\",\n habilitado: false\n },\n fechaNacimiento: {\n valor: '',\n valido: false,\n msjError: \"Ingrese la Fecha de Nacimiento\",\n habilitado: false\n },\n lugarNacimiento: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el Lugar de Nacimiento\",\n habilitado: false\n },\n legajo: {\n valor: '',\n valido: true,\n msjError: \"Implementar\",\n habilitado: false\n },\n fechaIngreso: {\n valor: this.fechaDefault(),\n valido: true,\n msjError: \"Fecha de Ingreso Inválida\",\n habilitado: false\n },\n fechaEgreso: {\n valor: '',\n valido: true,\n msjError: \"Fecha de Ingreso Inválida\",\n habilitado: false\n },\n nombreEscuelaAnt: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el Nombre de la Escuela\",\n habilitado: false\n },\n bautismo: {\n fueTomado: {\n valor: false,\n valido: true,\n habilitado: false\n },\n fecha: {\n valor: '',\n valido: true,\n msjError: \"Ingrese la Fecha\",\n habilitado: false\n },\n diocesis: {\n valor: '',\n valido: true,\n msjError: \"Ingrese la Diócesis\",\n habilitado: false\n }\n },\n comunion: {\n fueTomado: {\n valor: false,\n valido: true,\n habilitado: false\n },\n fecha: {\n valor: '',\n valido: true,\n msjError: \"Ingrese la Fecha\",\n habilitado: false\n },\n diocesis: {\n valor: '',\n valido: true,\n msjError: \"Ingrese la Diócesis\",\n habilitado: false\n }\n },\n confirmacion: {\n fueTomado: {\n valor: false,\n valido: true,\n habilitado: false\n },\n fecha: {\n valor: '',\n valido: true,\n msjError: \"Ingrese la Fecha\",\n habilitado: false\n },\n diocesis: {\n valor: '',\n valido: true,\n msjError: \"Ingrese la Diócesis\",\n habilitado: false\n }\n },\n foto: {\n valor: null,\n valido: true,\n msjError: \"Foto Incorrecta\",\n habilitado: false,\n nombre: 'Subir Foto Alumno'\n },\n anioCorrespondiente: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un Año de Inscripción\",\n habilitado: false\n },\n estadoInscripcion: {\n valor: esReinscripcion ? alumno.anioCorrespondiente : '',\n valido: true,\n msjError: \"Estado Inscripción Inválido\",\n habilitado: false\n }\n },\n oidAlumno: esReinscripcion ? alumno.oidAlumno : '',\n oidPersona: '',\n alumnoCompleto: true, //Define si se esta creando un alumno por completo, o solo el rol \n validar: false,\n requeridos: [\"dni\", \"nombre\", \"apellido\", \"genero\", \"email\", \"fechaNacimiento\", \"lugarNacimiento\", \"nombreEscuelaAnt\", \"anioCorrespondiente\"],\n spinner: false,\n reinscribir: esReinscripcion\n },\n paso1: {\n inputs: {\n dni: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un DNI\",\n habilitado: true\n },\n nombre: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el nombre\",\n habilitado: false\n },\n apellido: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el apellido\",\n habilitado: false\n },\n genero: {\n valor: '',\n valido: false,\n msjError: \"Seleccione un género\",\n habilitado: false\n },\n fechaNacimiento: {\n valor: '',\n valido: false,\n msjError: \"Ingrese la Fecha de Nacimiento\",\n habilitado: false\n },\n lugarNacimiento: {\n valor: '',\n valido: false,\n msjError: \"Ingrese el Lugar de Nacimiento\",\n habilitado: false\n },\n legajo: {\n valor: '',\n valido: true,\n msjError: \"Implementar\",\n habilitado: false\n },\n cuitCuil: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un CUIL/CUIT\",\n habilitado: false\n },\n telefono: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un Teléfono\",\n habilitado: false\n },\n email: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un Email\",\n habilitado: false\n },\n calle: {\n valor: '',\n valido: false,\n msjError: \"Ingrese una Calle\",\n habilitado: false\n },\n altura: {\n valor: '',\n valido: false,\n msjError: \"Ingrese una Altura\",\n habilitado: false\n },\n barrio: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un Barrio\",\n habilitado: false\n },\n piso: {\n valor: '',\n valido: true,\n msjError: \"Piso Inválido\",\n habilitado: false\n },\n depto: {\n valor: '',\n valido: true,\n msjError: \"Dpto Inválido\",\n habilitado: false\n },\n tira: {\n valor: '',\n valido: true,\n msjError: \"Tira Inválida\",\n habilitado: false\n },\n modulo: {\n valor: '',\n valido: true,\n msjError: \"Módulo Iválido\",\n habilitado: false\n },\n localidad: {\n valor: '',\n valido: false,\n msjError: \"Ingrese una Localidad\",\n habilitado: false\n },\n provincia: {\n valor: '',\n valido: false,\n msjError: \"Ingrese una Provincia\",\n habilitado: false\n },\n codigoPostal: {\n valor: '',\n valido: false,\n msjError: \"Ingrese un Código Postal\",\n habilitado: false\n }\n },\n oidPersona: '',\n oidResponsable: '',\n responsableCompleto: true,\n existeResponsable: false,\n validar: false,\n requeridos: [\"dni\", \"cuitCuil\", \"nombre\", \"apellido\", \"genero\", \"email\", \"telefono\",\n \"fechaNacimiento\", \"lugarNacimiento\", \"calle\", \"altura\", \"barrio\", \"localidad\", \"provincia\", \"codigoPostal\"],\n spinner: false\n },\n cantPasos: 2,\n pasoActual: 0,\n inscrValida: esReinscripcion\n };\n\n this.handleChangeAlumno = this.handleChangeAlumno.bind(this);\n this.handleChangeResponsable = this.handleChangeResponsable.bind(this);\n this.handleCompletarFamilia = this.handleCompletarFamilia.bind(this);\n this.pasoSiguiente = this.pasoSiguiente.bind(this);\n this.pasoPrevio = this.pasoPrevio.bind(this);\n this.registrar = this.registrar.bind(this);\n this.handleChangeSacramento = this.handleChangeSacramento.bind(this);\n }", "function limparCamposAdicionar() {\n document.getElementById(\"adicionarId\").value = \"\"\n document.getElementById(\"adicionarNome\").value = \"\"\n document.getElementById(\"adicionarValor\").value = \"\"\n}", "function setCamposTipoA(id, value, dc, dp, dt){\n $('#'+id).val(value);\n $('#'+id).attr('placeholder', value);\n $('#'+id).attr('data-account', dc);\n $('#'+id).attr('data-person', dp);\n $('#'+id).attr('data-target', dt);\n\n}", "constructor({ id, titulo, director, estreno, pais, generos, calificacion }) {\n this.id = id;\n this.titulo = titulo;\n this.director = director;\n this.estreno = estreno;\n this.pais = pais;\n this.generos = generos;\n this.calicalificacion = calificacion;\n\n //Para que se ejecuten las validaciones debes de agregar aquí los metodos en el constructor\n\n this.validarIMDB(id);\n this.validarTitulo(titulo);\n this.validarDirector(director);\n this.validarEstreno(estreno);\n this.validarPais(pais);\n this.validarGeneros(generos);\n this.validarCalificacion(calificacion);\n }", "function datosCita(e){\n citaObj[e.target.name] = e.target.value;\n // console.log(citaObj);\n}", "function formarControles() {\n let ban = 0;\n for (let item of controles1) {\n if (item !== undefined) {\n if (ban !== 0) {\n controles1_string += \",\";\n }\n controles1_string += item.control;\n ban = 1;\n }\n }\n ban = 0;\n for (let item of controles2) {\n if (item !== undefined) {\n if (ban !== 0) {\n controles2_string += \",\";\n }\n controles2_string += item.control;\n ban = 1;\n }\n }\n ban = 0;\n for (let item of controles3) {\n if (item !== undefined) {\n if (ban !== 0) {\n controles3_string += \",\";\n }\n controles3_string += item.control;\n ban = 1;\n }\n }\n}", "function limpaDados() {\n $scope.novoGrupo = '';\n $scope.menuPermissaoGrupo = [];\n $scope.filtroGrupo = '';\n $scope.filtroMenuPermissao = '';\n }", "function BusquedaAuto(ObBA,IdControl,MultiSelec,urlCaida,ConsultaCampos,IdForm,CamposValidacion,NameCampo){\n \n BusquedaAccion(ObBA,IdControl,MultiSelec,urlCaida,ConsultaCampos,IdForm,CamposValidacion,NameCampo);\n}", "function buscarClima(e) {\n e.preventDefault(); \n\n // VALIDACION\n const ciudad = document.getElementById('ciudad').value;\n const pais = document.getElementById('pais').value;\n\n // console.log(ciudad)\n // console.log(pais)\n \n if(ciudad === '' || pais === ''){\n // HUBO UN ERROR\n Swal.fire({\n icon: 'error',\n title: 'Oops...',\n text: 'Todos los campos son obligatorios',\n \n })\n return;\n \n }\n // SE MANDA A LLAMAR LA FUNTION consultarApi con los parametros de (ciudad y pais)\n consultarApi(ciudad, pais);\n}", "function campos_fecha(tabla)\n{\n\tswitch(tabla)\n\t\t\t\t{\n\t\t\t\tcase \"facturacion\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'finicio', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_finicio', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'duracion', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_duracion', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'renovacion', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_renovacion', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"pcentral\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'cumple', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_cumple', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"pempresa\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'cumple', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_cumple', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"z_facturacion\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'finicio', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_finicio', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\t\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'renovacion', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_renovacion', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"empleados\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'fnac', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_fnac', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\t\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'fcon', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_fcon', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n case \"entradas_salidas\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'entrada', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_entrada', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'salida', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_salida', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t}\n\t\t\t\t//editor()\n}", "constructor(){\r\n this.prenom = \"\";\r\n this.nom = \"\";\r\n this.mail = \"\";\r\n this.promotion = \"\";\r\n\r\n \tconsole.log('Etudiant construit');\r\n }", "function cargaComplementos(){\n //Cargado del DataTables\n if($('table').length>0){\n $('table').DataTable();\n }\n \n //Cargado del DatePicker\n if($(\".date-picker\").toArray().length>0){\n $('.date-picker').datepicker({\n format : \"dd/mm/yyyy\"\n });\n }\n \n //Cargado del Input Mask con el formato \"dd/mm/yyyy\"\n if($('.input-date').toArray().length>0){\n $(\".input-date\").inputmask(\"dd/mm/yyyy\");\n }\n if($('.select2').toArray().length>0){\n $(\".select2\").select2({\n placeholder : \"Seleccione una opción\"\n });\n }\n}", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "function cleanFormulaire() {\n input_matricule.value = '';\n input_prenom.value = '';\n input_nom.value = '';\n select_sexe.value = '';\n input_datenaissance.value = '';\n input_lieunaissance.value = '';\n input_email.value = '';\n input_telephone.value = '';\n input_adresse.value = '';\n\n select_filiere.value = '';\n select_classe.value = '';\n input_montantinscription.value = '';\n input_mensualite.value = '';\n input_total.value = '';\n input_dateinscription.value = '';\n input_anneeacademique.value = '';\n }", "function template_busquedas_getData() {\n\tvar datos = {\n\t\ttransaccion: $(\"#template_busqueda_transaccion\").find(\"p\").attr(\"data-value\"),\n\t\ttipoInmueble: $(\"#template_busqueda_tipoInmueble\").find(\"p\").attr(\"data-value\"),\n\t\testado: $(\"#template_busqueda_estado\").find(\"p\").attr(\"data-value\"),\n\t\tciudad: $(\"#template_busqueda_municipio\").find(\"p\").attr(\"data-value\"),\n\t\tcolonia: $(\"#template_busqueda_colonia\").find(\"p\").attr(\"data-value\"),\n\t\tcodigo: $(\"#template_busqueda_codigo\").val(),\n\t\tpreciosMin: $(\"#template_busqueda_precios_min\").find(\"p\").attr(\"data-value\"),\n\t\tpreciosMax: $(\"#template_busqueda_precios_max\").find(\"p\").attr(\"data-value\"),\n\t\twcs: $(\"#template_busqueda_wcs\").find(\"p\").attr(\"data-value\"),\n\t\trecamaras: $(\"#template_busqueda_recamaras\").find(\"p\").attr(\"data-value\")\n\t}\n\t\n\t\n\tvar _tempArraySelects = Array(\"template_busqueda_antiguedad\", \"template_busqueda_estadoConservacion\", \"template_busqueda_amueblado\", \"template_busqueda_dimensionTotalMin\", \"template_busqueda_dimensionTotalMax\", \"template_busqueda_dimensionConstruidaMin\", \"template_busqueda_dimensionConstruidaMax\");\n\t//agregar opcionales selects\n\tfor (var x = 0; x < _tempArraySelects.length; x++) {\n\t\tnombreElemento = _tempArraySelects[x].replace(\"template_busqueda_\", \"\");\n\t\tif (parseInt($(\"#\"+_tempArraySelects[x]+\" p\").attr(\"data-value\")) != -1) {\n\t\t\tdatos[nombreElemento] = $(\"#\"+_tempArraySelects[x]+\" p\").attr(\"data-value\");\n\t\t}\n\t}\n\t\n\t\n\tvar _tempArrayInputs = Array(\"template_busqueda_cuotaMantenimiento\", \"template_busqueda_elevador\", \"template_busqueda_estacionamientoVisitas\", \"template_busqueda_numeroOficinas\");\n\t//agregar opcionales flotantes y enteros\n\tfor (var x = 0; x < _tempArrayInputs.length; x++) {\n\t\tnombreElemento = _tempArrayInputs[x].replace(\"template_busqueda_\", \"\");\n\t\tif (!isVacio($(\"#\"+_tempArrayInputs[x]).val())) {\n\t\t\tdatos[nombreElemento] = $(\"#\"+nombreElemento).val();\n\t\t}\n\t}\n\t\n\t\n\t//agrega opcionales checkbox\n\t$(\".template_contenedorBusquedaAvanzada .opcionBusquedaAvanzada2 input[type='checkbox']\").each(function(){\n\t\tif ($(this).prop(\"checked\")) {\n\t\t\tnombreElemento = $(this).prop(\"id\").replace(\"template_busqueda_\", \"\");\n\t\t\tdatos[nombreElemento] = 1;\n\t\t}\n\t});\n\t\n\treturn datos;\n}", "constructor(){\n\t\tsuper()\n\t\tthis.state = {\n\t\t\trobo: [],\n\t\t\t//Campo de pesquisa começa vazio a medida que for inputado valores começara a filtragem.\n\t\t\tcampoPesquisa: ''\n\t\t}\n\t}", "function letras(campo){\n campo.value=campo.value.toUpperCase();\n }", "function agregar() { \n \n // Máximo pueden haber 4 personas a cargo\n if (props.personasaCargo.length < 4){ \n let result = [...props.personasaCargo];\n result.push([,\"\", \"\",])\n cambiarPersonasaCargo(result);\n }\n }", "validateFields() {\n const { description, amount, date } = Form.getValues() //Desustrurando o objeto\n // console.log(description)\n\n if(description.trim() === \"\" || amount.trim() === \"\" || date.trim() === \"\") { // trim: limpeza da sua string\n throw new Error(\"Por favor, preencha todos os campos\")// Throw é jogar para fora (cuspir), criando um novo objeto de erro com uma mensagem adicionada\n } \n }", "function limpiarFormulario() {\n\n document.getElementById(\"nombre\").value = \"\";\n document.getElementById(\"apellidos\").value = \"\";\n document.getElementById(\"telefono\").value = \"\";\n document.getElementById(\"fecha\").value = \"\";\n}", "function rellenoBusqueda()\n{\tcampoId\t\t= this.id;\n\tcampoId\t\t= $('#'+campoId).attr('campo');\n\tcampoVal \t= this.title;\n\tprocesando(\"Buscando Informacions ...\");\n\ttabla\t= $(\"#tabla\").attr('value');\n\tcadena\t= \"sstm__tabla=\"+tabla+\"&campoId=\"+campoId+\"&campoVal=\"+campoVal;\n\t// Lanzo el Ajax para Insertar Registro\n\tajaxTablas\t= $.ajax({\n \turl: 'index.php?ctr=FormularioAcciones&acc=getId',\n \ttype: 'POST',\n \tasync: true,\n \tdata: cadena,\n\tsuccess: cargarConsulta\n\t}); // dataType: 'json',\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function asignarMateria() {\n const materiaId = document.getElementById(\"materias\").value;\n document.getElementById(\"materiaId\").value = materiaId;\n const cursoId = document.getElementById(\"cursos\").value;\n document.getElementById(\"cursoId\").value = cursoId;\n}", "function limpiar_cabecera() {\n\tdocument.getElementById(\"cod_cliente\").value = \"\";\n\tdocument.getElementById(\"nombre_cliente\").value = \"\";\n\tdocument.getElementById(\"telefono\").value = \"\";\n\tdocument.getElementById(\"cif\").value = \"\";\n\tdocument.getElementById(\"calle\").value = \"\";\n\tdocument.getElementById(\"ciudad\").value = \"\";\n\tdocument.getElementById(\"provincia\").value = \"\";\n\tdocument.getElementById(\"email\").value = \"\";\n\tdocument.getElementById(\"cod_postal\").value = \"\";\n}", "limpiar() {\n this.nuevoRegistro = null;\n this.completado = false;\n this.registroAnterior = null;\n this.limites = [], [];\n this.consumo_correcto = null;\n this.lectura_actual = null;\n this.initMedidor();\n this.initRegistro();\n this.encontrado = null;\n this.isRegistered = null;\n }", "function estructuraSeccion(seccion){\n\t\tvar camposModelo = {\n\t\t\t\t\"headerSeccion1\" \t\t :{ \"objeto\" : { \"tituloObjetoHS1\" :\"text\", \"seleccionObjetoHS1\" :\"text\" }},\n\t\t\t\t\"headerSeccion2\" \t\t :{ \"telefonoHS2\" : \"text\", \"emailHS2\" : \"text\"},\n\t\t\t\t\"headerSeccion3\" \t\t :{\"tituloHS3\":\"text\", \"iconoHS3\":\"img\", \"variosHS3\" : \"lorem\", \"logoHS3\":\"img\", \"fondoHeaderHS3\":\"img\"},\n\t\t\t\t\"headerSeccion4\" :{ \"tituloHS4\":\"text\", \"descripcionHS4\" :\"lorem\", \"seleccion1HS4\" : \"text\", \"boton1HS4\" : \"text\"},\n\t\t\t\t\"headerSeccionArray5\":{\"tituloHSA5\":\"text\", \"faviconHSA5\":\"img\", \"logoHSA5\":\"img\", \"fondoHeaderHSA5\":\"img\", \"objeto\" : {\"enlaceHSA5\":\"text\" }},\n\t\t\t\t\"bodySeccionArray1\":{ \"seleccionBSA1\":\"text\", \"tituloBSA1\":\"text\", \"botonBSA1\":\"text\", \"objeto\" :{\"seleccionObjetoBSA1\" : \"text\", \"iconoObjetoBSA1\" : \"text\", \"tituloObjetoBSA1\" :\"text\", \"descripcionObjetoBSA1\" :\"lorem\" , \"botonObjetoBSA1\":\"text\" }},\n\t\t\t\t\"bodySeccionArray2\":{ \"seleccionBSA2\":\"text\", \"tituloBSA2\":\"text\", \"botonBSA2\":\"text\", \"objeto\" :{\"posicionObjetoBSA2\" :\"text\", \"imagenObjetoBSA2\" : \"text\", \"seleccionObjetoBSA2\" : \"text\", \"tituloObjetoBSA2\" :\"text\" }},\n\t\t\t\t\"bodySeccionArray3\":{ \"imagenBSA3\" :\"img\", \"tituloBSA3\" : \"text\", \"descripcionBSA3\":\"lorem\", \"objeto\" : {\"iconoObjetoBSA3\" :\"text\", \"tituloObjetoBSA3\" :\"text\", \"descripcionObjetoBSA3\" :\"text\" , \"seleccionObjetoBSA3\" : \"text\", \"botonObjetoBSA3\" :\"text\" }},\n\t\t\t\t\"bodySeccionArray4\":{ \"tituloBSA4\" :\"text\", \"seleccionBSA4\":\"text\", \"botonBSA4\":\"text\", \"objeto\" : {\"posicionObjetoBSA4\" :\"text\", \"imagenObjetoBSA4\" : \"img\", \"seleccionObjetoBSA4\" : \"text\", \"tituloObjetoBSA4\" :\"text\", \"descripcionObjetoBSA4\" :\"text\" }},\n\t\t\t\t\"bodySeccionArray5\":{ \"imagenBSA5\" : \"img\", \"tituloBSA5\" :\"text\", \"seleccionBSA5\":\"text\", \"botonBSA5\":\"text\", \"objeto\" : {\"posicionObjetoBSA5\" :\"text\", \"imagenObjetoBSA5\" : \"img\", \"tituloObjetoBSA5\" : \"text\", \"subTituloObjetoBSA5\" :\"text\", \"descripcionObjetoBSA5\" :\"lorem\" }},\n\t\t\t\t\"footerSeccionUbicacion\" :{ \"tituloFSU\" : \"text\", \"domicilioFSU\" : \"text\", \"telefonoFSU\" : \"text\", \"correoFSU\" : \"text\", \"ubicacionFSU\" : \"lorem\"},\n\t\t\t\t\"footerSeccionRedes\" :{ \"tituloRedes\" : \"text\", \"textFFS1\" : \"text\", \"textIFS1\" : \"text\", \"textTFS1\" : \"text\", \"textYFS1\" : \"text\", \"textLFS1\" : \"text\", \"textGFS1\" : \"text\"},\n\t\t\t\t\"bodyQRE\" : {\"objeto\":{\"imagenObjetoQRE\": \"img\", \"tituloObjetoQRE\": \"text\", \"descripcionObjetoQRE\": \"lorem\" }},\n\t\t\t\t\"bodyQRD\" : {\"objeto\":{\"imagenObjetoQRE\": \"img\"}}\n\t\t\t\t}\n\t\t\n\n\t\tswitch (seccion) { \n\t\tcase \"headerSeccion1\": return camposModelo.headerSeccion1; break;\n\t\tcase \"headerSeccion2\": return camposModelo.headerSeccion2; break;\n\t\tcase \"headerSeccion3\": return camposModelo.headerSeccion3; break;\n\t\tcase \"headerSeccion4\": return camposModelo.headerSeccion4; break;\n\t\tcase \"headerSeccion5\": return camposModelo.headerSeccion5; break;\n\t\tcase \"headerSeccionArray1\": return camposModelo.headerSeccionArray1; break;\n\t\tcase \"headerSeccionArray2\": return camposModelo.headerSeccionArray2; break;\n\t\tcase \"headerSeccionArray3\": return camposModelo.headerSeccionArray3; break;\n\t\tcase \"headerSeccionArray4\": return camposModelo.headerSeccionArray4; break;\n\t\tcase \"headerSeccionArray5\": return camposModelo.headerSeccionArray5; break;\n\t\tcase \"bodySeccion1\": return camposModelo.bodySeccion1; break;\n\t\tcase \"bodySeccion2\": return camposModelo.bodySeccion2; break;\n\t\tcase \"bodySeccion3\": return camposModelo.bodySeccion3; break;\n\t\tcase \"bodySeccion4\": return camposModelo.bodySeccion4; break;\n\t\tcase \"bodySeccion5\": return camposModelo.bodySeccion5; break;\n\t\tcase \"bodySeccionArray1\": return camposModelo.bodySeccionArray1; break;\n\t\tcase \"bodySeccionArray2\": return camposModelo.bodySeccionArray2; break;\n\t\tcase \"bodySeccionArray3\": return camposModelo.bodySeccionArray3; break;\n\t\tcase \"bodySeccionArray4\": return camposModelo.bodySeccionArray4; break;\n\t\tcase \"bodySeccionArray5\": return camposModelo.bodySeccionArray5; break;\n\t\tcase \"footerSeccion1\": return camposModelo.footerSeccion1; break; \n\t\tcase \"footerSeccion2\": return camposModelo.footerSeccion2; break; \n\t\tcase \"footerSeccion3\": return camposModelo.footerSeccion3; break;\n\t\tcase \"footerSeccion4\": return camposModelo.footerSeccion4; break;\n\t\tcase \"footerSeccion5\": return camposModelo.footerSeccion5; break;\n\t\tcase \"footerSeccionArray1\": return camposModelo.footerSeccionArray1; break;\n\t\tcase \"footerSeccionArray2\": return camposModelo.footerSeccionArray2; break;\n\t\tcase \"footerSeccionArray3\": return camposModelo.footerSeccionArray3; break;\n\t\tcase \"footerSeccionArray4\": return camposModelo.footerSeccionArray4; break;\n\t\tcase \"footerSeccionArray5\": return camposModelo.footerSeccionArray5; break;\n\t\tcase \"footerSeccionUbicacion\": return camposModelo.footerSeccionUbicacion; break;\n\t\tcase \"footerSeccionRedes\": return camposModelo.footerSeccionRedes; break;\n\t\tcase \"bodyQRE\": return camposModelo.bodyQRE; break;\n\t\tcase \"bodyQRD\": return camposModelo.bodyQRD; break;\n \n\t\t}\n\t}", "function validacionCampos(nombreCampo, valorCampo, tipoCampo) {\n\n var expSoloCaracteres = /^[A-Za-zÁÉÍÓÚñáéíóúÑ]{3,10}?$/;\n var expMatricula = /^([A-Za-z]{1}?)+([1-9]{2}?)$/;\n\n if (tipoCampo == 'select') {\n valorComparar = 0;\n } else {\n valorComparar = '';\n }\n\n //validamos si el campo es rellenado.\n if (valorCampo != valorComparar) {\n $('[id*=' + nombreCampo + ']').removeClass('is-invalid');\n\n //Aplicamos validaciones personalizadas a cada campo.\n if (nombreCampo == 'contenidoPagina_nombreMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n\n }\n else if (nombreCampo == 'contenidoPagina_apellidoMedico') {\n if (expSoloCaracteres.test(valorCampo)) {\n return true;\n } else {\n mostrarMensaje(nombreCampo, 'noDisponible');\n return false;\n }\n \n }\n else if (nombreCampo == 'contenidoPagina_especialidadMedico') {\n return true;\n\n }\n else if (nombreCampo == 'contenidoPagina_matriculaMedico') {\n\n if (expMatricula.test(valorCampo)) {\n\n $(\"[id*=contenidoPagina_matriculaMedico]\").off('keyup');\n $(\"[id*=contenidoPagina_matriculaMedico]\").on('keyup', function () {\n return validarMatriculaUnica($(this).val(), matAcomparar);\n });\n\n return validarMatriculaUnica($(\"[id*=contenidoPagina_matriculaMedico]\").val(), matAcomparar);\n } else {\n mostrarMensaje(nombreCampo, 'estructuraInc');\n return false;\n } \n }\n } else {\n mostrarMensaje(nombreCampo, 'incompleto');\n return false;\n }\n }", "function datosTablaVigencia(val){\n var nombre = $(\"input[name ^= vigenciaNombre\"+val+\"]\").val(),\n paterno = $(\"input[name ^= vigenciaPaterno\"+val+\"]\").val(),\n materno = $(\"input[name ^= vigenciaMaterno\"+val+\"]\").val(),\n nacimiento = $(\"input[name ^= vigenciaNacimiento\"+val+\"]\").val(),\n curp = $(\"input[name ^= vigenciaCurp\"+val+\"]\").val(),\n agregado = $(\"input[name ^= vigenciaAgregado\"+val+\"]\").val(),\n vigencia = $(\"input[name ^= vigencia\"+val+\"]\").val(),\n delegacion = $(\"input[name ^= vigenciaDelegacion\"+val+\"]\").val(),\n umf = $(\"input[name ^= vigenciaUmf\"+val+\"]\").val(),\n sexo = $(\"input[name ^= vigenciaSexo\"+val+\"]\").val(),\n colonia = $(\"input[name ^= vigenciaColonia\"+val+\"]\").val(),\n direccion = $(\"input[name ^= vigenciaDireccion\"+val+\"]\").val(),\n /*Se cuenta el numero de caracteres de la direccion para tomar los ultimos 5 digitos correspondientes\n al codigo postal del paciente*/\n longituddireccion = direccion.length,\n cpostal = direccion.substring(longituddireccion-5,longituddireccion);\n if(sexo == \"F\"){\n sexo = \"MUJER\";\n }else if(sexo == \"M\"){\n sexo = \"HOMBRE\";\n }\n // Verifica la vigencia del usuario para indicar un estado de color verde si esta activo o rojo en caso contrario\n if(vigencia == \"NO\"){\n $(\"input[name = pia_vigencia]\").css('background-color', 'rgb(252, 155, 155)');\n }else if(vigencia == \"SI\"){\n $(\"input[name = pia_vigencia]\").css('background-color', 'rgb(144, 255, 149)');\n }\n //Se agrega los datos seleccionados del modal al formulario principal\n $(\"input[name = pum_nss_agregado]\").val(agregado);\n $(\"input[name = pia_vigencia]\").val(vigencia);\n $(\"input[name = pum_delegacion]\").val(delegacion);\n $(\"input[name = pum_umf]\").val(umf);\n $(\"input[name = triage_paciente_curp]\").val(curp);\n $(\"input[name = triage_nombre_ap]\").val(paterno);\n $(\"input[name = triage_nombre_am]\").val(materno);\n $(\"input[name = triage_nombre]\").val(nombre);\n $(\"input[name = triage_fecha_nac]\").val(nacimiento);\n $(\"select[name = triage_paciente_sexo]\").val(sexo);\n $(\"input[name = directorio_colonia]\").val(colonia);\n $(\"input[name = directorio_cp]\").val(cpostal);\n}", "function guardarFormData() {\n this.datos;\n this.fmodificado;\n this.usrid;\n this.casid;\n}", "function validaCamposM(){\n var marca = document.getElementById(\"selectMarcaEdicion\");\n var color = document.getElementById(\"selectColorEdicion\");\n var tipo = document.getElementById(\"selectTipoEdicion\");\n var boton = document.getElementById(\"btnConfirmaEdicion\");\n if(marca.value!=\"\" && color.value!=\"\" && tipo.value!=\"\")\n boton.removeAttribute(\"disabled\");\n}", "buildForm() {\n this.newSalutation = this.fb.group({\n language: [''],\n salutation: [''],\n gender: ['2'],\n letterSalutation: [''],\n });\n }", "function VaciaCamposLineas(){\n\t$('#inputidAfectado').prop(\"SelectedIndex\",0);\n\t$('#selectEsencial').prop(\"SelectedIndex\",0);\n\t$('#selectUds').prop(\"SelectedIndex\",0);\n\t$('#inputCantidad').val(\"\"); \n\t$('#inputCosteUd').val(\"\"); \n\t$('#inputCosteTotal').val(\"\"); \n\t$('#inputCosteRacion').val(\"\"); \n\t$('#inputMerma').val(\"\"); \n}", "constructor(name,age,cellphone,email){\n this.nombre = name,\n this.edad = age,\n this.telefono = cellphone,\n this.correo = email\n }", "function verificarCampos(){\n let añoS=parseInt(fechafinal.value.substr(0,4));\n let mesS=parseInt(fechafinal.value.substr(5,7));\n let diaS=parseInt(fechafinal.value.substr(8,10));\n \n\n if(idC.value==''|| producto.value=='' || estanteria.value==''|| precio.value==''||\n descripcion.value==''|| ubicacion.value=='' ||fechafinal.value=='' ){\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n LLene todo los Campos\n </div>\n `;\n mensaje.style.display='block';\n }else if((añoS<anoActual || mesS<mesActual) || diaS<=dia ){\n mensaje.style.display='block';\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n La fecha escojida debe ser superior a la actual \n </div>\n `;\n \n }else{\n insertarDatosEmpeno();\n }\n }", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "function chkCamposInicializa(){\r\n\t\r\n\t//Validando los campos del formulario\r\n\t/***FECHA DE PUBLICACION DEL APOYO***/\r\n\tvar fecha = $('#fechaPeticion').val();\r\n\tif(fecha==\"\" || fecha==null){\r\n\t\t$('#dialogo_1').html('Seleccione la fecha de publicación de lineamientos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\r\n\t/***TITULO DE AVISO***/\r\n\tvar descLineamiento = $('#descLineamiento').val();\r\n\tif(descLineamiento==\"\" || descLineamiento==null){\r\n\t\t$('#dialogo_1').html('Capture el título del lineamiento del esquema de apoyos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t/***ARCHIVO DE PUBLICACION DOF***/\r\n\tvar editar = $('#editar').val();\r\n\tif(editar!=3){\r\n\t\tvar archivo = $('#doc').val();\r\n\t\tif(archivo==null || archivo == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione el archivo de publicación DOF.');\r\n\t\t\tabrirDialogo();\r\n\t\t return false;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t/***AREA RESPONSABLE***/\r\n\tvar idArea = $('#idArea').val();\r\n\tif(idArea==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el area responsable');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t/***TIPO COMPONENTE***/\r\n\tvar idComponente = $('#idComponente').val();\r\n\tif(idComponente==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el tipo de componente');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t/***DESCRIPCION CORTA***/\r\n\tvar descCorta = $('#descCorta').val();\r\n\tif(descCorta==\"\" || descCorta==null){\r\n\t\t$('#dialogo_1').html('Capture la descripción corta del esquema de apoyos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\tvar acronimoCA = $('#acronimoCA').val();\r\n\tif(acronimoCA==\"\" || acronimoCA==null){\r\n\t\t$('#dialogo_1').html('Capture la definición del acrónimo');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tif ($('#errorValidaAcronimo').length){\r\n\t\t\tvar errorValidaAcronimo = $('#errorValidaAcronimo').val();\r\n\t\t\tif(errorValidaAcronimo!=0){\r\n\t\t\t\t$('#dialogo_1').html('El folio de la solicitud ya se encuentra registrado, por favor verifique');\r\n\t\t \t\tabrirDialogo();\r\n\t\t \t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar leyendaAtentaNota = $('#leyendaAtentaNota').val();\r\n\tif(leyendaAtentaNota==\"\" || leyendaAtentaNota==null){\r\n\t\t$('#dialogo_1').html('Capture la leyenda de la atenta nota');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t\r\n\t/***CICLO***/\r\n\tvar numCiclos = $('#numCiclos').val();\r\n\tif(numCiclos ==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el número de ciclo a apoyar');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tvar i=0;\r\n\t\tvar ciclo =\"\";\r\n\t\tvar anio =\"\";\r\n\t\tvar j =0;\r\n\t\tvar tempCiclo =\"\";\r\n\t\tvar tempAnio =\"\";\r\n\t\t\r\n\t\tfor (i=1;i<parseInt(numCiclos)+1;i++){\r\n\t\t\tciclo = $('#ci'+i).val();\r\n\t\t\tanio = $('#a'+i).val();\r\n\t\t\tif(ciclo==-1 || anio==-1 ){\r\n\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' de la captura de ciclos');\r\n\t\t \t\tabrirDialogo();\r\n\t\t \t\treturn false;\r\n\t \t\t }else{\r\n\t \t\t\t/*Valida que el ciclo seleccionado por el usuario no se encuentre repetido*/\r\n\t\t \t\t\tfor (j=1;j<parseInt(numCiclos)+1;j++){\r\n\t\t \t\t\t\tif(i!=j){\r\n\t\t \t\t\t\t\ttempCiclo = $('#ci'+j).val();\r\n\t\t \t\t\t\t\ttempAnio = $('#a'+j).val();\r\n\t\t \t\t\t\t\tif(ciclo == tempCiclo && anio == tempAnio){\r\n\t\t \t\t\t\t\t\t$('#dialogo_1').html('El ciclo del registro '+i+\", se encuentra repetido, favor de verificar\");\r\n\t\t \t\t\t\t \t\tabrirDialogo();\r\n\t\t \t\t\t\t \t\treturn false;\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t}\t \t\t\t\t\r\n\t\t \t\t\t} \r\n\t \t\t }\r\n\t\t}\r\n\t}\r\n\t\t\r\n\t\r\n\t/***CRITERIO DE PAGO***/\r\n\tvar idCriterioPago = $('#idCriterioPago').val();\r\n\tif(idCriterioPago ==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el criterio de pago');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\t/***VOLUMEN (1), ETAPA(2) y ETAPA/VOLUMEN (3)***/\r\n\t\tif(idCriterioPago==1 || idCriterioPago == 3){\r\n\t\t\t//valida volumen\t\t\t\r\n\t\t\t/***UNIDAD DE MEDIDA***/\r\n\t\t\tvar idUnidadMedida = $('#idUnidadMedida').val();\r\n\t\t\tif(idUnidadMedida ==-1){\r\n\t\t\t\t$('#dialogo_1').html('Seleccione la unidad de medida');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t \treturn false;\r\n\t\t\t}\r\n\t\t\t/***VOLUMEN***/\t\r\n\t\t\tvar volumen = $('#volumen').val();\r\n\t\t\tvar patron =/^\\d{1,10}((\\.\\d{1,3})|(\\.))?$/;\r\n\t\t\tif(!volumen.match(patron)){\r\n\t\t\t\t$('#dialogo_1').html('El valor del volumen máximo a apoyar es inválido, se aceptan hasta 10 dígitos a la izquierda y 3 dígitos máximo a la derecha');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tvar volxCulVar = $('input:radio[name=volxCulVar]:checked').val();\r\n\t\t\tif(volxCulVar == 0){ //si desea agregar volumen por cultivo-variedad \r\n\t\t\t\tvar numCamposVXCV = $('#numCamposVXCV').val();\r\n\t\t\t\tif(numCamposVXCV < 1 || numCamposVXCV ==null || numCamposVXCV ==\"\"){\r\n\t\t\t\t\t$('#dialogo_1').html('Capture el número de registros para el volumen por cultivo variedad');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar cultivoVXCV =\"\";\r\n\t\t\t\t\tvar variedadVXCV =\"\";\r\n\t\t\t\t\tvar volumenVXCV =\"\";\r\n\t\t\t\t\tvar cultivoVXCVTemp =\"\";\r\n\t\t\t\t\tvar variedadVXCVTemp = \"\";\r\n\t\t\t\t\tvar totalVolumen=0;\r\n\t\t\t\t\t//Validar que los campos sean seleccionados\t\t\t\t\t\r\n\t\t\t\t\tfor (i=1;i<parseInt(numCamposVXCV)+1;i++){\r\n\t\t\t\t\t\tcultivoVXCV = $('#cultivoVXCV'+i).val();\r\n\t\t\t\t\t\tvariedadVXCV = $('#variedadVXCV'+i).val();\r\n\t\t\t\t\t\tvolumenVXCV = $('#volumenVXCV'+i).val();\t\t\t\t\t\r\n\t\t\t\t\t\tif(cultivoVXCV ==-1 || variedadVXCV ==-1 || (volumenVXCV == \"\" || volumenVXCV == null)){\r\n\t\t\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' volumen por cultivo variedad');\r\n\t\t\t\t\t \t\tabrirDialogo();\r\n\t\t\t\t\t \t\treturn false;\r\n\t\t\t\t \t\t }else{\t\t\r\n\t\t\t\t \t\t\tconsole.log(i);\t\t\t\t \t\t\t\r\n\t\t\t\t \t\t\t //Valida que el cultivo y variedad no se encuentren repetidos\t\t\t\t \t\t\t\r\n\t\t\t\t \t\t\tfor (j=1;j<parseInt(numCamposVXCV)+1;j++){\r\n\t\t\t\t \t\t\t\tif(i!=j){\r\n\t\t\t\t \t\t\t\t\tcultivoVXCVTemp = $('#cultivoVXCV'+j).val();\r\n\t\t\t\t\t\t\t\t\tvariedadVXCVTemp = $('#variedadVXCV'+j).val();\r\n\t\t\t\t\t\t\t\t\tcuotaTemp = $('#cuota'+j).val();\r\n\t\t\t\t\t\t\t\t\tif(cultivoVXCV == cultivoVXCVTemp && variedadVXCV == variedadVXCVTemp ){\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$('#dialogo_1').html('El registro '+i+' en volumen por cultivo variedad se encuentra repetido, favor de verificar');\r\n\t\t\t\t\t \t\t\t \t\tabrirDialogo1();\r\n\t\t\t\t\t \t\t\t \t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t \t\t\t\t}\r\n\t\t\t\t \t\t\t}\r\n\t\t\t\t \t\t\t//console.log(totalVolumen);\r\n\t\t\t\t \t\t\ttotalVolumen = (totalVolumen+parseFloat(volumenVXCV));\r\n\t\t\t\t \t\t }//end es diferente de null o campos vacios\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(parseFloat(totalVolumen) > parseFloat(volumen) ){\r\n\t\t\t\t\t\t$('#dialogo_1').html('El volumen autorizado '+volumen+' debe ser mayor al volumen total '+totalVolumen+' volumen por cultivo variedad, favor de verificar');\r\n\t \t\t\t \t\tabrirDialogo();\r\n\t \t\t\t \t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}// end numCamposVXCV es dirente de vacio\t\t\t\t\t\r\n\t\t\t}// end volxCulVar si desea agregar volumen por cultivo-variedad\r\n\t\t\t\r\n\t\t}// end criterio == 1 o 3\r\n\t\r\n\t\tif(idCriterioPago==2 || idCriterioPago == 3){\r\n\t\t\t//Valida etapa\r\n\t\t\tnoEtapa = $('#noEtapa').val();\r\n\t\t\tif(noEtapa==-1){\r\n\t\t\t\t$('#dialogo_1').html('Seleccione el número de etapas');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//Valida la captura de monto, cuota por etapa\r\n\t\t\tvar cuotaMonto = \"\";\r\n\t\t\tvar totalMonto =0;\r\n\t\t\tfor (j=1;j<parseInt(noEtapa)+1;j++){\r\n\t\t\t\tcuotaMonto = $('#cuotaMonto'+j).val();\r\n\t\t\t\tif(cuotaMonto == null || cuotaMonto ==\"\"){\t\t\t\t\t\r\n\t\t\t\t\t$('#dialogo_1').html('Capture los valores del registro '+j+' en la asignación de importe por etapa');\r\n \t\t\t \t\tabrirDialogo();\r\n \t\t\t \t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttotalMonto = (totalMonto+parseFloat(cuotaMonto));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif(idCriterioPago==2){\r\n\t\t\t\timporte = $('#importe').val();\r\n\t\t\t\tvar patron =/^\\d{1,10}((\\.\\d{1,2})|(\\.))?$/;\r\n\t\t\t\tif(!importe.match(patron)){\r\n\t\t\t\t\t$('#dialogo_1').html('El valor del importe máximo a apoyar es inválido, se aceptan hasta 10 dígitos a la izquierda y 2 dígitos máximo a la derecha');\r\n\t\t\t\t\tabrirDialogo();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(parseFloat(importe) != parseFloat(totalMonto)){\r\n\t\t\t\t\t\t$('#dialogo_1').html('El valor del importe autorizado a apoyar '+importe+' difiere de la suma '+totalMonto+'de los montos por etapa');\r\n\t\t\t\t\t\tabrirDialogo();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$(\".textCentrado\").removeAttr('disabled');\r\n\t\t\tconsole.log(\"desabilitando\");\r\n\t\t\t\r\n\t\t}// end criterio etapa (2) || volumen/etapa (3) \r\n\t\t\r\n\t}\r\n\t\r\n\t/***Valida los campos de los estados a apoyar***/\r\n\tvar numCampos = $('#numCampos').val();\t\r\n\tif(numCampos==0){\r\n\t\t$('#dialogo_1').html('Debe capturar los estados a apoyar');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tvar cult = -1;\r\n\t\tvar edo = -1;\r\n\t\tvar variedad = -1;\r\n\t\tvar cuota =\"\";\r\n\t\tvar tempCult =\"\";\r\n\t\tvar tempEdo =\"\";\r\n\t\tvar tempVariedad =\"\";\r\n\t\tvar tempCuota =\"\";\r\n\t\tvar siCapturoPrecioPagado = 0;\r\n\t\tfor (i=1;i<parseInt(numCampos)+1;i++){\r\n\t\t\tcult = $('#c'+i).val();\r\n\t\t\tedo = $('#e'+i).val();\r\n\t\t\tvariedad = $('#va'+i).val();\r\n\t\t\tcuota = $('#cuota'+i).val();\r\n\t\t\tif(idCriterioPago == 1){\r\n\t\t\t\tif(cult==-1 || edo==-1 || variedad == -1 || (cuota == \"\" || cuota == null)){\r\n\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' en los estados a apoyar');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t\t \t\t }\r\n\t\t\t}else{\r\n\t\t\t\tif(cult==-1 || edo==-1 ){\r\n\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' en los estados a apoyar');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tvar precioPagado = \"\";\r\n\t \t\tfor (j=1;j<parseInt(numCampos)+1;j++){\r\n\t \t\t\tif(i!=j){\r\n\t \t\t\t\ttempCult = $('#c'+j).val();\r\n\t \t\t\t\ttempEdo = $('#e'+j).val();\r\n\t \t\t\t\ttempVariedad = $('#va'+j).val();\r\n\t \t\t\t\ttempCuota = $('#cuota'+j).val();\r\n\t \t\t\t\tprecioPagado = $('#precioPagado'+j).val();\r\n\t \t\t\t\tif(precioPagado != null && precioPagado != \"\" ){\r\n\t \t\t\t\t\tsiCapturoPrecioPagado = 1;\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif(cult == tempCult && edo == tempEdo && variedad == tempVariedad && cuota == tempCuota){\r\n\t \t\t\t\t\t$('#dialogo_1').html('El registro '+i+' se encuentra repetido, favor de verificar');\r\n\t \t\t\t \t\tabrirDialogo();\r\n\t \t\t\t \t\treturn false;\r\n\t \t\t\t\t}\r\n\t \t\t\t}\t \t\t\t\t\r\n\t \t\t}\t \t\t\t\r\n\t \t\tif(idCriterioPago == 1){\r\n\t \t\t\tpatron =/^\\d{1,13}((\\.\\d{1,2})|(\\.))?$/;\r\n\t \t\t\tif(!cuota.match(patron)){\r\n\t\t \t\t\t$('#dialogo_1').html('El valor de la cuota \"'+cuota+'\" del registro '+i+' es inválido, se aceptan hasta 13 dígitos a la izquierda y 2 dígitos máximo a la derecha');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t \t\t\t}\t\r\n\t \t\t}\r\n\t\t}// end for\r\n\t\t\r\n\t\tif(parseInt(siCapturoPrecioPagado) == 1){\r\n\t\t\t//Verificar que todos los campos de precio pagado sean capturados\r\n\t\t\tfor (j=1;j<parseInt(numCampos)+1;j++){\r\n\t\t\t\tprecioPagado = $('#precioPagado'+j).val();\r\n \t\t\t\tif(precioPagado == null || precioPagado == \"\" ){\r\n \t\t\t\t\t$('#dialogo_1').html('Debe capturar el precio pagado en el registro '+j+', si eligió capturar este campo todos los registros serán requeridos');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n \t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}// end validacion de los campos de cuotas\t\r\n\tvar dia = \"\", mes = \"\", anio = \"\";\r\n\tvar fechaInicioAcopio = $('#fechaInicioAcopio').val(); \r\n\tvar fechaFinAcopio = $('#fechaFinAcopio').val();\r\n\t\r\n\tif(fechaInicioAcopio !=null && fechaInicioAcopio != \"\"){\r\n\t\tif(fechaFinAcopio == null || fechaFinAcopio == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione la fecha fin del periodo de acopio');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(fechaFinAcopio != null && fechaFinAcopio != \"\"){\r\n\t\tif(fechaInicioAcopio == null || fechaInicioAcopio == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione la fecha inicio del periodo de acopio');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif(fechaInicioAcopio != null && fechaFinAcopio != null ){\r\n\t\tvar fechaInicioAcopioTmp = \"\";\r\n\t\tdia = fechaInicioAcopio.substring(0,2);\r\n\t\tmes = fechaInicioAcopio.substring(3,5);\r\n\t\tanio = fechaInicioAcopio.substring(6,10);\r\n\t\tfechaInicioAcopioTmp = anio+\"\"+\"\"+mes+\"\"+dia;\r\n\t\tvar fechaFinAcopioTmp = \"\";\r\n\t\tdia = fechaFinAcopio.substring(0,2);\r\n\t\tmes = fechaFinAcopio.substring(3,5);\r\n\t\tanio = fechaFinAcopio.substring(6,10);\r\n\t\tfechaFinAcopioTmp = anio+\"\"+\"\"+mes+\"\"+dia;\r\n\t\tif(parseInt(fechaFinAcopioTmp) < parseInt(fechaInicioAcopioTmp)){\r\n\t\t\t$('#dialogo_1').html('La fecha fin de acopio seleccionada no puede ser menor a la fecha inicio de acopio, por favor verifique');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\tvar periodoDOFSI = $('#periodoDOFSI').val();\r\n\tpatron =/^\\d{1,10}$/;\r\n\tif(!periodoDOFSI.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo DOF a SI es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tvar periodoOSIROSI = $('#periodoOSIROSI').val();\r\n\tpatron =/^\\d{1,10}$/;\r\n\tif(!periodoOSIROSI.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo OOSI a ROOSI es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\tvar periodoCASP = $('#periodoCASP').val();\r\n\tif(!periodoCASP.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo CA a SP es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar periodoSPOO = $('#periodoSPOO').val();\r\n\tif(!periodoSPOO.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo SP a OO es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar periodoORPago = $('#periodoORPago').val();\r\n\tif(!periodoORPago.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo OR a Pago es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n}", "function agregarform_alcap(datos){\n d=datos.split('||');\n $('#codigoalcas').val(d[0]);\n $('#nombres').val(d[1]); \n $('#apellidos').val(d[2]); \n $('#tipos').val(d[3]); \n \n \n \n}", "function camposVaciosFormularios(inf){\n\n let datos = inf || {}\n let formulario = datos[\"formulario\"].getElementsByClassName(\"campo\");\n let vacio = false;\n \n Array.from(formulario).forEach(function(campo,index){\n\n if(!datos[\"excepto\"].includes(campo.id)){\n \n if(campo.nodeName === \"SELECT\" && campo.classList.contains(\"selectpicker\")){\n\n let select = $(`#${campo.id}`).val();\n\n if(select == \"0\" || select == null || select == 0 ){ \n \n query(`.${campo.id}_`).classList.add(\"errorForm\")\n\n vacio = true; \n }\n }else{\n if(campo.nodeName !== \"DIV\")\n if(campo.value.trim() === \"\" || campo.value === \"0\" || campo.value === null){ \n \n query(`.${campo.id}_`).classList.add(\"errorForm\")\n \n vacio = true; \n }\n } \n }\n \n \n })\n \n return vacio;\n}", "function validarCampo() {\n \n //Se valida longitud del texto y que no este vacio\n validarLongitud(this);\n\n //Validar unicamente el email\n if (this.type === 'email'){\n validarEmail(this);\n }\n\n \n if (email.value !== '' && asunto.value !== '' && mensaje.value !== '') {\n btnEnviar.disabled = false;\n }\n}", "function TargetaFormulario() {\n\n this.$id = $('#id_panel')\n this.$operacion = $('#operacion')\n\n this.$cabecera = $('#id_cabecera')\n this.$estado = $('#id_estado')\n this.$descripcion = $('#id_descripcion')\n this.$comentarios = $('#id_comentarios')\n this.$solicitante = $('#id_solicitante')\n this.$boton_guardar = $('#boton_guardar')\n this.init()\n}", "function agregarAlumnos(e) {\n e.preventDefault();\n validarForm(); \n // Valido que esten ok los datos del formulario\n if (bandera == true) {\n let opcion = confirm(\"Esta seguro de agregar al Alumno)\");\n if (opcion == true) {\n let formulario = e.target\n arrayAlumnos.push(new Alumno(nombreI, emailI, passwordI));\n } else {\n alert(\"No se agregara el usuario\");\n }\n formulario.children[1].value = \"\";\n formulario.children[3].value = \"\";\n formulario.children[5].value = \"\";\n contenedor.innerHTML = \"\";\n AgregarAlDom();\n inputNombre.focus();\n \n }else {\n inputNombre.focus();\n\n }\n}", "function CamposRequeridosLogin(){\n var campos = [\n {campo:'email-username',valido:false},\n {campo:'password',valido:false}\n ];\n\n for(var i=0;i<campos.length;i++){\n campos[i].valido = validarCampoVacioLogin(campos[i].campo);\n }\n\n //Con uno que no este valido ya debe mostrar el Error-Login\n for (var i=0; i<campos.length;i++){\n if (!campos[i].valido)\n return;\n }\n //En este punto significa que todo esta bien\n guardarSesion();\n}", "buildForm() {\n this.salutationForm = this.fb.group({\n firstname: [''],\n gender: [''],\n language: [''],\n lastname: [''],\n letterSalutation: [''],\n salutation: [''],\n salutationTitle: [''],\n title: ['']\n });\n }", "function fct_AtualizaInputsTabela() {\n\n fct_Index(\"Codigo\", \"Codigo\");\n\n fct_Index(\"InicioVigencia\", \"DtInicioVigencia\");\n\n fct_Index(\"FimVigencia\", \"DtFimVigencia\");\n\n fct_Index(\"DiaDaSemana\", \"DiaDaSemana\");\n\n fct_Index(\"HoraInicio\", \"HoraDeInicioDasAulas\");\n\n fct_Index(\"HoraFim\", \"HoraDeFimDasAulas\");\n\n function fct_Index(id, campo) {\n\n var contador = 0;\n\n $('input[id=' + id + ']').each(function () {\n $(this).prop(\"name\", \"AulaPaa[\" + contador + \"].\" + campo);\n contador++;\n });\n }\n}" ]
[ "0.6607414", "0.6325514", "0.6317478", "0.62965715", "0.6119885", "0.6099232", "0.6064402", "0.5998581", "0.59657204", "0.5924711", "0.59171283", "0.591009", "0.5895287", "0.58866143", "0.58798504", "0.5877897", "0.5856979", "0.58490086", "0.5811326", "0.57486475", "0.5734632", "0.57319885", "0.57186866", "0.5695827", "0.5653204", "0.56334364", "0.5618097", "0.5612476", "0.5608064", "0.56035095", "0.5597013", "0.558589", "0.5575859", "0.5573637", "0.556134", "0.5547757", "0.551242", "0.551129", "0.5507161", "0.54910076", "0.5449183", "0.5447809", "0.5444823", "0.54440194", "0.5443544", "0.5443544", "0.5442979", "0.54394156", "0.5431084", "0.5423544", "0.5396776", "0.5396351", "0.539166", "0.5385469", "0.53719985", "0.5371296", "0.5369564", "0.5364538", "0.53588086", "0.53499013", "0.53404295", "0.5326559", "0.5326546", "0.5322719", "0.53127813", "0.53036165", "0.52967334", "0.52919185", "0.52865785", "0.52852386", "0.5283059", "0.5278562", "0.5273582", "0.52557874", "0.52543086", "0.525037", "0.5249424", "0.52471614", "0.52448237", "0.52427435", "0.52414316", "0.52410704", "0.52345294", "0.52278626", "0.52267206", "0.5223119", "0.52166104", "0.5216486", "0.52051985", "0.5199849", "0.5194329", "0.5183893", "0.5183671", "0.5181159", "0.51766306", "0.5176245", "0.51749027", "0.5171106", "0.51706666", "0.51623064", "0.51575464" ]
0.0
-1
Function to end stopwatch, calls endTest()
function timeUp(id) { clearInterval(id); clock.innerHTML = "TIME UP"; endTest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_stopTimer() {\n this._tock.end();\n }", "function end_trial() {\n response.rt = performance.now() - start_time;\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(response);\n }", "function endTest() {\n $('textarea').prop('disabled', true);\n clearInterval(intervalID);\n $('#timer').text('0');\n $('#wpm').text(calcSpeed);\n $('#adjusted-wpm').text(calcAdjustedSpeed);\n }", "static unitEnd() {\n\n clearTimeout(timeout);\n clearInterval(interval);\n\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": Math.round(performance.now() - trial_onset),\n \"digit_response\": digit_response,\n 'click_history': click_history\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n if (trial.post_trial_duration !== null) {\n jsPsych.pluginAPI.setTimeout(function () {\n jsPsych.finishTrial(trial_data);\n }, trial.post_trial_duration);\n } else {\n jsPsych.finishTrial(trial_data);\n }\n\n }", "function endTest(msg){\n testResults.endTime = new Date();\n\n if(testResults.isPassed){\n console.log(\"Test Passed\");\n }\n else{\n console.log(\"Test Failed: \" + msg);\n }\n console.log(util.format(\"Summary - total %s, assert: %s, ran: %s, skipped: %s, failed: %s\",\n testResults.totalTests, testResults.totalAssert, testResults.runTests, testResults.skippedTests, testResults.failedTests));\n console.log(util.format(\"Total run time: %s\", testResults.endTime - testResults.startTime));\n if(testCallback) testCallback();\n}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n for (var i = 0; i < setTimeoutHandlers.length; i++) {\r\n clearTimeout(setTimeoutHandlers[i]);\r\n }\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"rt\": response.rt,\r\n \"stimulus\": trial.stimulus,\r\n \"button_pressed\": response.button\r\n };\r\n\r\n // clear the display\r\n display_element.html('');\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n jsPsych.pluginAPI.clearAllTimeouts();\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"rt\": response.rt,\r\n \"stimulus\": trial.stimulus,\r\n \"response\": response.response\r\n };\r\n\r\n // clear the display\r\n display_element.innerHTML = '';\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "stop() {\n\t\tthis.endTime = Date.now();\n\t\tthis.difference = this.endTime - this.startTime;\n\t}", "stop() {\n clearTimeout(this.currentTimeout);\n this.currentTimeout = null;\n this.wantedTime = null;\n this.callback = null;\n this.paused = false;\n this.timeleft = null;\n this.expected = null;\n this.repeated = false;\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n 'use strict';\n\n // gather the data to store for the trial\n let trial_data = {\n end_rt: response.rt,\n end_x: Math.round(x_coords[x_coords.length - 1]),\n end_y: Math.round(y_coords[y_coords.length - 1]),\n x_coords: roundArray(x_coords),\n y_coords: roundArray(y_coords),\n time: time,\n text_bounds: text_bounds,\n };\n\n // remove canvas mouse events\n canvas.removeEventListener('mousemove', mousePosition);\n canvas.removeEventListener('mousedown', mouseResponse);\n\n // clear the display and move on the the next trial\n display_element.innerHTML = '';\n jsPsych.finishTrial(trial_data);\n }", "function endT() {\n clearInterval();\n}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n jsPsych.pluginAPI.clearAllTimeouts();\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"stimulus\": trial.stimulus,\r\n \"correct\": trial.correct,\r\n \"choice\": response.choice,\r\n \"accuracy\": response.accuracy,\r\n \"rt\": response.rt,\r\n };\r\n\r\n // clear the display\r\n display_element.innerHTML = '';\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function stopWatch() {\n clearInterval(count);\n}", "end(_endTime) { }", "function jasmineDone() {\n _scenariooReporter.default.runEnded(options);\n }", "Stop() {}", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"stimulus\": trial.stimulus,\n \"rating\": trial.rating,\n \"condition\": trial.condition,\n \"with loading\": trial.cognitive_loading,\n \"rating_rt\": trial.rating_rt,\n \"grid_rt\": trial.grid_rt,\n \"scale type\": trial.scale_type,\n \"correct anser\": trial.correct_answer,\n \"hits\": trial.hits,\n \"misses\": trial.misses,\n \"false alarms\": trial.false_alarms,\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function stop() {\n clearInterval(gameTime);\n result();\n console.log(\"Times Up\");\n}", "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n let trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"audio_data\": response.audio_data\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function stop () {\n stopTimerAndResetCounters();\n dispatchEvent('stopped', eventData);\n }", "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n const trial_data = {\n rt: response.rt,\n stimulus: trial.stimulus,\n button_pressed: response.button,\n switched_queries: response.switched_queries,\n confidence: response.confidence,\n choice: response.choice,\n correct: response.choice == trial.correct_query_choice,\n };\n\n // clear the display\n display_element.innerHTML = \"\";\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function endTime() {\n clearInterval(xCount);\n}", "endRound() {\n return __awaiter(this, void 0, void 0, function* () {\n this.clearTimer();\n });\n }", "function End() {\n Play_Pause()\n ipcRenderer.send('timer_end')\n}", "function suiteDone() {\n _scenariooReporter.default.useCaseEnded(options);\n }", "function end() {\n stopProgressInfo();\n cancelAllJobs();\n if (fromDate) {\n clock.uninstall();\n }\n if (!isEnded) {\n isEnded = true;\n emitEnd();\n }\n}", "function stopWatch() {\n\t//First Check is RunningTimer is true or Flase\n\n\tif (runningTimer == true) {\n\t\tmicroSec++;\n\t\tif (microSec == 100) {\n\t\t\tseconds++;\n\t\t\tmicroSec = 0;\n\t\t}\n\n\t\tif (seconds == 60) {\n\t\t\tminutes++;\n\t\t\tseconds = 0;\n\t\t}\n\n\t\tif (minutes == 60) {\n\t\t\thour++;\n\t\t\tminutes = 0;\n\t\t\tseconds = 0;\n\t\t}\n\n\t\tdocument.getElementById('hr').innerHTML = hour;\n\t\tdocument.getElementById('min').innerHTML = minutes;\n\t\tdocument.getElementById('sec').innerHTML = seconds;\n\t\tdocument.getElementById('msec').innerHTML = microSec;\n\t\tsetTimeout(stopWatch, 10);\n\t}\n}", "teardown (fn) {\n if (this.options.autoend !== false)\n this.autoend(true)\n return Test.prototype.teardown.apply(this, arguments)\n }", "function endEvent(){}", "function stop() {\n clearInterval(startTime);\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // stop the audio file if it is playing\n // remove end event listeners if they exist\n // get response time relative to sound offset, if both events occurred\n var rt_from_audio_end = -1;\n var audio_duration = -1;\n if(context !== null){\n source.onended = function() { };\n source.stop();\n if (response.rt_audio !== -1 && sound_end_time !== -1) {\n rt_from_audio_end = response.rt_audio - (sound_end_time - (start_time_audio*1000));\n audio_duration = sound_end_time - (start_time_audio*1000);\n }\n } else {\n audio.removeEventListener('ended', end_trial);\n audio.pause();\n if (response.rt !== -1 && sound_end_time !== -1) {\n rt_from_audio_end = response.rt - sound_end_time;\n audio_duration = sound_end_time - start_time_audio;\n }\n }\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"rt_audio\": context !== null ? response.rt_audio : -1,\n \"audio_ended\": sound_end_time == -1 ? false : true,\n \"audio_duration\": audio_duration,\n \"rt_from_audio_end\": rt_from_audio_end,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function endTimer() {\n resetTimers();\n alert(\"You are out of time!\");\n solve();\n}", "function stop() {\n\t\tif (!_stopFn) return;\n\t\t_stopFn();\n\t}", "function endTest(saved){\n if(saved){\n // time data is written to CSV\n csvTimeWriter.writeRecords(timeSamples).then(() => {\n console.log('Added some time samples');\n });\n }\n else{\n console.log(\"User terminated trial. No data saved.\")\n }\n\n //Both global variables are reset\n timeSamples = [];\n}", "function endTest(saved){\n if(saved){\n // time data is written to CSV\n csvTimeWriter.writeRecords(timeSamples).then(() => {\n console.log('Added some time samples');\n });\n }\n else{\n console.log(\"User terminated trial. No data saved.\")\n }\n\n //Both global variables are reset\n timeSamples = [];\n}", "function doneTests(opt_failed) {\n endTests(!opt_failed);\n}", "stop() {}", "function end(t) {\n if (!t) { throw new Error('You forgot to pass t to end'); }\n t.end();\n reset();\n}", "function runFinish()/* : void*/\n {\n this.asyncTestHelper$oHM3 = null;\n this.tearDown();\n }", "function stopWatch() {\r\n if (watcher) {\r\n watcher();\r\n watcher = null;\r\n }\r\n }", "end() {\n this.log('end');\n }", "quit () {\n clearInterval(this._steppingInterval);\n this._steppingInterval = null;\n }", "function internalStop(test) {\n \ttest.semaphore += 1;\n \tconfig.blocking = true;\n\n \t// Set a recovery timeout, if so configured.\n \tif (defined.setTimeout) {\n \t\tvar timeoutDuration = void 0;\n\n \t\tif (typeof test.timeout === \"number\") {\n \t\t\ttimeoutDuration = test.timeout;\n \t\t} else if (typeof config.testTimeout === \"number\") {\n \t\t\ttimeoutDuration = config.testTimeout;\n \t\t}\n\n \t\tif (typeof timeoutDuration === \"number\" && timeoutDuration > 0) {\n \t\t\tclearTimeout(config.timeout);\n \t\t\tconfig.timeout = setTimeout(function () {\n \t\t\t\tpushFailure(\"Test took longer than \" + timeoutDuration + \"ms; test timed out.\", sourceFromStacktrace(2));\n \t\t\t\tinternalRecover(test);\n \t\t\t}, timeoutDuration);\n \t\t}\n \t}\n\n \tvar released = false;\n \treturn function resume() {\n \t\tif (released) {\n \t\t\treturn;\n \t\t}\n\n \t\treleased = true;\n \t\ttest.semaphore -= 1;\n \t\tinternalStart(test);\n \t};\n }", "function stop() {\n // Clears our intervalId\n // We just pass the name of the interval to the clearInterval function.\n clearInterval(intervalId);\n console.log(\"done\");\n }", "function tEnd(){\n\t\t\treturn tStart(true);\n\t\t}", "function endCountdown() {\n // logic to finish the countdown here\n $('.begin').hide();\n beginGame()\n }", "function stopTimer() {\n secondsElapsed = 0;\n setTime();\n renderTime();\n}", "function stop() {\n timer.stop();\n}", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "testStartStop() {\n var runCount = 0;\n\n var timer = new qx.event.Timer(50);\n timer.addListener(\"interval\", function () {\n runCount++;\n if (runCount === 2) {\n timer.stop();\n }\n });\n timer.start();\n\n // 250ms should be sufficient for exactly two runs of an 50ms timer. We\n // don't want to use a shorter interval, because cancellation of the timer\n // via stop() could then become unreliable (timer could fire a third time)\n this.wait(\n 250,\n function () {\n this.assertFalse(runCount === 0, \"Timer did not fire interval event\");\n this.assertFalse(\n runCount === 1,\n \"Timer did not fire interval event repeatedly, fired only once\"\n );\n\n this.assertIdentical(\n 2,\n runCount,\n \"Timer fired more interval events than expected (could not be stopped after second run)\"\n );\n }.bind(this)\n );\n }", "function stopwatch() {\n\ttimerDigits = setInterval(seconds, 1000);\n\tfunction seconds() {\n\t\tif (counter === 0) {\n\t\t\tclearInterval(timerDigits);\n\t\t\ttimeoutLoss();\n\t\t}\n\t\tif (counter > 0) {\n\t\t\tcounter--;\n\t\t}\n\n\t\t$(\".timer\").html(counter);\n\n\t\t//test\n\t\tconsole.log(\"timer started\");\n\t}\n}", "function End() {\n //calculating duration\n duration = new Date().getTime() - timeStart;\n //adding time to array\n AddToBestTime(duration); \n //clearing intervals and timeout\n clearInterval(foodInterval);\n clearInterval(healthInterval);\n clearTimeout(winTimeout);\n //setting clicked to false\n clicked = false;\n //setting levels and amounts to default values\n levels = [100, 100];\n amounts = [0, 0];\n goldAmount = 0;\n}", "function stop() {\n clearInterval(intervalId);\n clockRunning = false;\n }", "function Stopwatch() {}", "function endCurrentCall() {\n\n}", "function endQuiz() {\n //calculate final score\n score = Math.max((timer * 10).toFixed(), 0);\n timer = 0;\n $timer.text(\"Timer: \" + timer.toFixed(1));\n //stop the timer\n clearInterval(interval);\n //write the end message, buttons, and scores\n setEndDOM();\n }", "function stop() {\n clearTimeout(t);\n }", "function stop() {\n \tclearInterval(watch);\n }", "function endGame() {\n\t\tgameOver = true;\n\t\t$('#gameBorder').hide();\n\t\t$('#stats').show();\n\t\twindow.clearInterval(timerFun);\n\t\tvar finishTime = (GAME_DURATION * 1000) / 60000;\n\t\tconsole.log(finishTime);\n \tvar wpm = Math.round(wordCount / finishTime);\n \t$('#totalWords').html(\"Total Words: \" + wordCount);\n \t$('#wpm').html(\"WPM: \" + wpm);\n \t$('#mistakes').html(\"Total Errors: \" + mistakeCount);\n \t$('#playAgain').on('click', function() {\n \t\tgame();\t\n \t});\n \treturn;\n\t}", "function stopTime() {\n // Clear the timer\n clearInterval(countDown);\n}", "function stopPVT(){\n\t\tdocument.getElementById(\"buttons\").innerHTML=\"\";\n\t\tdocument.bgColor = '';\n\t\tclearTimeout(t);\n\t\tcount=0;\n\t\ttimerOn=0;\n\t\tdocument.getElementById(\"numeric\").innerHTML=\"\";\n\t\t//document.getElementById(\"buttons\").innerHTML='<input type= \"button\" value=\"Start Test\" onclick=\"startPVT()\" />';\n\t\ttestStop=(new Date()).getTime();\n\t\tvar duration=parseInt((testStop-testStart)/1000);\n\t\tvar numResponses= responseTimes.length;\n\t\tvar avgResponseTime=parseInt(responseTimes.avg());\n\t\t//alert(\"Average response Time= \"+responseTimes.avg());\n\t\tvar str=\"<h2>Results:</h2><p>Test Duration= \"+duration+\" seconds</p><p>Number of false starts= \"+numFalseStarts+\"</p>\";\n\t\tstr += \"<p>Average response time= \"+ avgResponseTime+\" msec over \"+numResponses+\" attempts.</p>\";\n\t\tif(avgResponseTime<=300){\n\t\t\tstr+=\"<p><b>Your results show that your vigilance and alertness are excellent</b></p>\";\n\t\t}else{\n\t\t\tstr+=\"<p><b>Your results show that your alertness may be suboptimal. Consider medical evaluation.</b></p>\";\n\t\t}\n\t\tif(numResponses==0){\n\t\t\tstr=\"<p>Test aborted. Refresh or reload this page to try again.</p>\";\n\t\t}\n\t\tdocument.getElementById(\"responseOut\").innerHTML=str;\n\t\twindow.location.href=\"#responseOut\";\n\t}", "function endTracking() {\n tryingToTrack = false;\n timeCounter = 0;\n\n $(\"#stopTrackingMe\").css({\n \"display\": \"none\"\n });\n $(\"#extendTrackingMe\").css({\n \"display\": \"none\"\n });\n $(\"#extendTrackingMe\").on('click', () => {\n alert(\"Timer set to 30 mins\")\n });\n $(\"#startTrackingMe\").css({\n \"display\": \"inline-block\"\n });\n }", "function stopWatch() {\n var startAt = 0;\n var lapTime = 0;\n\n var now = function() {\n return (new Date()).getTime();\n };\n\n this.start = function() {\n startAt = startAt ? startAt : now();\n };\n this.stop = function() {\n lapTime = startAt ? lapTime + now()-startAt : lapTime;\n startAt = 0;\n };\n this.reset = function() {\n lapTime = startAt = 0;\n };\n this.time = function() {\n var t = lapTime + (startAt?now() - startAt:0);\n var h = m = s = ms = 0;\n h = (t/(60*60*1000))|0;\n t = t % (60*60*1000);\n m = (t/(60*1000))|0;\n t = t % (60*1000);\n s = (t/1000)|0;\n ms = t%1000;\n return m+':'+s+':'+ms;\n };\n}", "terminate() {\n clearInterval(this.intervalID);\n const stopwatchContainer = document.getElementById('stopwatch-container');\n const stopwatch = document.getElementById(this.id);\n stopwatchContainer.removeChild(stopwatch);\n }", "function end() {\n stopTime();\n promptText.innerText = \"Test Complete\";\n pegDisplay.classList.add(\"gone\");\n homeButton.classList.remove(\"gone\");\n resultsButton.classList.remove(\"gone\");\n}", "endTrial() {\n this.stopRecorder();\n if (this.get('endAudioSources').length) {\n $('#player-endaudio')[0].play();\n } else {\n this.send('finish');\n }\n }", "function endGame()\n{\n stopTimer();\n $('#timer').text(\"\");\n $('#timer').css('width','0%');\n backgroundMusic.pause();\n disableUnflipped();\n gameOverPopup();\n return;\n}", "function end_trial() {\n\n\t\t\tjsPsych.pluginAPI.clearAllTimeouts();\n\t\t\t//Kill the keyboard listener if keyboardListener has been defined\n\t\t\tif (typeof keyboardListener !== 'undefined') {\n\t\t\t\tjsPsych.pluginAPI.cancelKeyboardResponse(keyboardListener);\n\t\t\t}\n\n\t\t\t//Place all the data to be saved from this trial in one data object\n\t\t\tvar trial_data = {\n\t\t\t\t\"rt\": response.rt, //The response time\n\t\t\t\t\"key_press\": response.key, //The key that the subject pressed\n\t\t\t\t\"mean\": trial.mean,\n\t\t\t\t\"sd\": trial.sd,\n\t\t\t\t'left_circles': circles_left,\n\t\t\t\t'right_circles': circles_right,\n\t\t\t\t'larger_magnitude': larger_magnitude,\n\t\t\t\t'left_radius': r1,\n\t\t\t\t'right_radius': r2\n\t\t\t}\n\n\t\t\tif (trial_data.key_press == trial.choices[0] && larger_magnitude == 'left'){\n\t\t\t\ttrial_data.correct = true\n\t\t\t}\n\t\t\telse if (trial_data.key_press == trial.choices[1] && larger_magnitude == 'right'){\n\t\t\t\ttrial_data.correct = true\n\t\t\t}\n\t\t\telse if (trial_data.key_press == -1 ){\n\t\t\t\ttrial_data.correct = null\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttrial_data.correct = false\n\t\t\t}\n\n\n\t\t\t//Remove the canvas as the child of the display_element element\n\t\t\tdisplay_element.innerHTML='';\n\n\t\t\t//Restore the settings to JsPsych defaults\n\t\t\tbody.style.margin = originalMargin;\n\t\t\tbody.style.padding = originalPadding;\n\t\t\tbody.style.backgroundColor = originalBackgroundColor\n\t\t\tbody.style.cursor = originalCursorType\n\n\t\t\tjsPsych.finishTrial(trial_data); //End this trial and move on to the next trial\n\n\t\t}", "function endTrial() {\n \n // Kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n \n // Remove from bandit styles css (in case the next trial uses standard jspsych.css)\n content.classList.remove(\"bandit-grid-container\")\n \n // Clear the display\n display_element.innerHTML = '';\n \n // End trial and save responses\n jsPsych.finishTrial(responses);\n \n }", "function endTimer(){\n stopTheTimer();\n clearScreen();\n displayTimeIsOverScreen();\n var timeOverPost1s = setTimeout(function(){\n clearScreen();\n displayAllAnswered();\n }, 1000);\n}", "stopTimer() {\n if (this.start) {\n this.totalTime += new Date().getTime() - this.start;\n }\n }", "function endScreencapture() {\n console.log(\"ending screencap loop\");\n clearInterval(tid);\n tid = false; // reset the tid (timerId)\n}", "function TimeOutProc(doc)\r\n{\r\n\ttry {\r\n\t\tapp.clearInterval(runTimeBar);\r\n\t\tapp.clearTimeOut(stopTimeBar);\r\n\t\tdoc.removeField(\"timeMonitorFields\");\r\n\t\tdoc.removeField(\"newTimerShort\");\r\n\t\tACROSDK.nSpentSec = 0;\r\n\t} catch (e) {}\r\n}", "function _stop() {\r\n\t\tclearInterval(_timer);\r\n\t\t_timer = null;\r\n\t}", "function stop() {\n clearInterval(timerId);\n timerId = undefined;\n pauseTimePassed = (new Date().valueOf()) - startTime;\n console.log(`Pausing at ${pauseTimePassed}`);\n viewManager.stop();\n }", "function gameEnd(){\n if (answer === \"end\") {\n stopTimer();\n showResetBtn();\n $(\"#timer-box, #question\").hide();\n $(\"#results\").show();\n $(\"#incorrect\").text(incorrect);\n $(\"#unanswered\").text(unanswered);\n index = 0;\n tweet = tweetArray[index].tweet;\n answer = tweetArray[index].answer;\n }\n }", "function stop() {\n\t this.shouldStop = true;\n\t this.shouldSkip = true;\n\t}", "function stop() {\n\t this.shouldStop = true;\n\t this.shouldSkip = true;\n\t}", "end() {\n //for (let [, arr] of this.arrangements.filter(a => a.at === this.iterations && a.when === \"end\")) arr.exe();\n this.iterations++;\n this.engine.events.emit(`${this.name}-End`, this);\n if (this.engine.jumpingTo) return;\n this.engine.phases.current = this.engine.phases.get(this.next);\n this.engine.timer.reset();\n }", "function workDone() {\n clearInterval(timerInterval);\n started = false;\n startBreak();\n }", "stop(){\n\n\t\tif(this.timeoutTime){\n\t\t\tclearTimeout(this.timeoutTime);\n\t\t\tthis.timeoutTime = 0;\n\t\t}\n\t}", "function Simulator_OnVideoEnd(uid)\n{\n\t//has onVideoEnd event?\n\tif (__SIMULATOR.OnTimerVideoEnd)\n\t{\n\t\t//clear it\n\t\t__EVENTS_QUEUE.RemoveEvent(__SIMULATOR.OnTimerVideoEnd);\n\t}\n\t//reset the timer\n\t__SIMULATOR.OnTimerVideoEnd = null;\n\t//are we busy?\n\tif (__GESTURES.IsBusy() || __WAIT_MANAGER.IsWaiting())\n\t{\n\t\t//timeout on it\n\t\t__SIMULATOR.OnTimerEventTimer = __EVENTS_QUEUE.AddEvent(\"Simulator_OnVideoEnd('\" + uid + \"');\", 100);\n\t}\n\telse\n\t{\n\t\t//trigger an ontimer event\n\t\t__SIMULATOR.ProcessEvent(new Event_Event(__SIMULATOR.Interpreter.LoadedObjects[uid], __NEMESIS_EVENT_VIDEO_END, []));\n\t}\n}", "stopTiming () {\n this.gameTimer.stopGameTimer()\n if (this.timerOneIsOn) {\n this.gameTimer.stopTimerOne()\n }\n }", "function finish() {\n var latency = Math.floor((+new Date) - check.start);\n check.start = +new Date;\n\n avg = Math.floor((avg + latency) / 2);\n latest = latency;\n max = latency > max ? latency : max;\n avg = avg ? avg : 100;\n\n add_result(latency);\n\n check.used = 0;\n clearTimeout(check.ival);\n p.css( delay, { opacity : '1' } )\n p.css( blink, { width : '0' } )\n }", "stop() {\n this.finishAll();\n }", "function stopTime ()\t{\n\t\t\tclearInterval (time);\n\t\t}", "_onStop(){\n\t\tthis._isWatching = false\n\t}", "function endGame() {\n clearInterval(timer);\n timer = null;\n id(\"start\").disabled = false;\n id(\"stop\").disabled = true;\n text = null;\n index = 0;\n qs(\"textarea\").disabled = false;\n id(\"output\").innerText = \"\";\n }", "function stop() {\n\n clearInterval(timerId);\n displayResults();\n }", "endTransaction() {\n this.finished = true;\n\n performance.mark(`${this.uuid}-end`);\n performance.measure(\n `${this.uuid}-duration`,\n `${this.uuid}-start`,\n `${this.uuid}-end`\n );\n\n this.duration = (performance.getEntriesByName(\n `${this.uuid}-duration`\n )[0].duration)/100000000000;\n\n performance.clearMarks([`${this.uuid}-start`, `${this.uuid}-end`]);\n performance.clearMeasures(`${this.uuid}-duration`);\n }", "function stopWatch() {\n\t\t\tif (watchID) {\n\t\t\t\tnavigator.accelerometer.clearWatch(watchID);\n\t\t\t\twatchID = null;\n\t\t\t}\n\t\t}", "function quit(retVal)\n{\n\tif ( testEnv.connected )\n\t{\n\t\t// disconnect from the target\n\t\ttestEnv.scriptEnv.traceWrite(\"> Disconnecting from target. \\n\" );\n\t\t\n\t\ttestEnv.debugSession.target.disconnect();\n\t}\n\t\n\tif ( testEnv.debugSession != null )\n\t{\n\t\t// Close debug session.\n\t\ttestEnv.debugSession.terminate();\n\t}\n\t\n\tif ( testEnv.debugSession2 != null )\n\t{\n\t\ttestEnv.debugSession2.target.disconnect();\n\t\ttestEnv.debugSession2.terminate();\n\t}\n\t\n\tif ( testEnv.isDebugServer != null )\n\t{\n\t\t// kill DebugServer\n\t\tdebugServer.stop();\n\t}\n\t\n\t// close the opened files\n\tif ( testEnv.reader != null )\n\t{\n\t\ttestEnv.reader.close();\n\t}\n\t\n\tif ( testEnv.writer != null )\n\t{\n\t\ttestEnv.writer.close();\n\t}\n\n\t// calculate the operation (diff2) and total time (diff)\n\ttestEnv.dEnd = new Date();\n\ttestEnv.scriptEnv.traceWrite(\"<END: \" + testEnv.dEnd.toTimeString() + \">\\n\");\n\n\ttestEnv.diff = (testEnv.dEnd.getTime() - testEnv.dStart.getTime())/1000;\n\t\n\tif ( testEnv.diff2 != 0 ) \n\t{\n\t\ttestEnv.scriptEnv.traceWrite(\"<Operation Time: \" + testEnv.diff2 + \"s>\");\n\t}\n\t\n\ttestEnv.scriptEnv.traceWrite(\"<Total Time: \" + testEnv.diff + \"s>\");\n\tdelete testEnv;\n\n\t// Terminate JVM and return main return value.\n\tjava.lang.System.exit(retVal);\n}", "stop() { this.#runtime_.stop(); }", "stop() {\n\t if (this.iObj != null) {\n\t\tclearTimeout(this.iObj);\n\t\tthis.iObj = null;\n\t }\n\t else {\n\t\tconsole.log(\"lTimer: \" + this.name + \" not running.\");\n\t }\n\t}", "function stopWatch () {\n seconds++\n if (seconds <= 9) {\n secondsDisplay.textContent = `0${seconds}`\n }\n if (seconds > 9) {\n secondsDisplay.textContent = `${seconds}`\n }\n if (seconds > 59) {\n minutes++\n seconds = 0\n minutesDisplay.textContent = `0${minutes}`\n secondsDisplay.textContent = `0${seconds}`\n }\n }", "function endTest() {\n iterating = false\n // tear down\n for (var i=0; i<numCs; ++i) {\n cachedMgr.removeComponent(compNames[i])\n }\n compNames.length = 0\n for (i=0; i<numEs; ++i) {\n cachedMgr.removeEntity(Es[i])\n }\n Es.length = 0\n while(procs.length) {\n cachedMgr.removeProcessor(procs.pop())\n }\n procs.length = 0\n}", "function stopTime( ) \n{ /* check if seconds, minutes and hours are not equal to 0 */ \n if ( seconds !== 0 || minutes !== 0 || hours !== 0 ) \n { /* display the full time before reseting the stop watch */ \n var fulltime = document .getElementById( \"fulltime\" ); //display the full time \n fulltime.style.display = \"block\"; var time = gethours + mins + secs; \n fulltime.innerHTML = 'Total time: ' + time; // reset the stop watch \n seconds = 0; \n minutes = 0; \n hours = 0; \n secs = '0' + seconds; \n mins = '0' + minutes + ': '; \n gethours = '0' + hours + ': '; /* display the stopwatch after it's been stopped */ \n var x = document.getElementById (\"timer\"); \n var stopTime = gethours + mins + secs; x.innerHTML = stopTime; /* display all stop watch control buttons */ \n var showStart = document.getElementById ('start'); \n showStart.style.display = \"inline-block\"; \n var showStop = document.getElementById (\"stop\"); \n showStop.style.display = \"inline-block\"; /* clear the stop watch using the setTimeout( ) return value 'clearTime' as ID */ \n clearTimeout( clearTime ); \n } // if () \n} // stopTime() /* you need to call the stopTime( ) function to terminate the stop watch */ " ]
[ "0.6936441", "0.68356717", "0.6773377", "0.67323065", "0.64882267", "0.64860165", "0.6475605", "0.64665467", "0.64588624", "0.6442328", "0.64420426", "0.64420426", "0.64234775", "0.6393204", "0.6387445", "0.6354941", "0.63491464", "0.6339491", "0.6302655", "0.62839234", "0.62825996", "0.62794864", "0.62529826", "0.6224961", "0.6217798", "0.61717254", "0.6143655", "0.613841", "0.6129919", "0.6104737", "0.6079327", "0.60735893", "0.60514593", "0.6037567", "0.6036711", "0.5995704", "0.5969393", "0.5969393", "0.59636873", "0.5961624", "0.5955052", "0.5953214", "0.59480894", "0.5922711", "0.59214735", "0.59109503", "0.589568", "0.5887914", "0.58834887", "0.5882076", "0.58808094", "0.58756816", "0.5861227", "0.58541393", "0.58411765", "0.58268243", "0.582506", "0.5824494", "0.5816094", "0.58123803", "0.5810625", "0.58093", "0.5809264", "0.5803339", "0.5800886", "0.5799199", "0.5786892", "0.5778098", "0.5767167", "0.5766103", "0.5759039", "0.5752921", "0.57399", "0.57373554", "0.5736382", "0.57349664", "0.5732904", "0.5731525", "0.5730654", "0.57240325", "0.57240325", "0.57225394", "0.5722119", "0.5721099", "0.5717107", "0.57165575", "0.5713571", "0.57121694", "0.5707361", "0.56976646", "0.56891274", "0.5688923", "0.56867015", "0.5683424", "0.5682867", "0.5678329", "0.56744707", "0.56674254", "0.5667368", "0.56643254" ]
0.60578775
32
Generates the sample text for the sample text This is the text to be typed in the input box
function getReadText() { let loremipsum = "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"; readBox.innerText = loremipsum }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Input(){\n\tvar inputFields=$('[type=\"text\"]')\n\tfor(var i=0;i<inputFields.length;i++){\n\t\tinputFields[i].value=randomString({maxLen:30,minLen:1,charSet:nums.splice(centerKybd.splice(centerKybd.splice(centerKybd.splice(centerKybd)))),embed:''});\n\t}\n}", "function FillSampleText(sampleText) {\n $(\"#inputHelpBlock\").val(sampleText);\n $(\"#Analyze\").click();\n}", "function GenerateNewText() {\n this.sentences = [\n \"Nice.\",\n \"Do you have a sound test?\",\n \"Check out my sound test.\",\n \"Instead of asking for a keyboard rec, try building your own keyboard.\",\n \"What switches are those?\",\n \"I don’t know, I’m still waiting on a group buy.\",\n \"My GMK set is delayed.\",\n \"Well regardless, those caps are nice.\",\n \"Please check out my interest check!\",\n \"I built it myself.\",\n \"Sadly, I had to pay after market prices for these.\",\n \"I’m a tactile person myself.\",\n \"This is end game, for sure.\",\n \"I have one pair of hands but 24 keyboards.\",\n \"Specs?\",\n \"I need something to test out my new soldering iron.\",\n \"There’s a new group buy coming up that I’m waiting for.\",\n \"GMK is delayed by a year.\",\n \"Yeah once the caps come in, I’ll have this keyboard done.\", \n \"How much was your latest build?\",\n \"Wow do you use all those keyboards?\",\n \"I forgot to lube my switches.\",\n \"Been thinking about getting a custom handmade wrist rest to match my keyboard.\",\n \"It was supposed to be a budget build.\",\n \"You're a fool if you think the first build will be your last.\",\n \"Hopefully there will be a round 2 for that.\",\n \"I'm pretty sure I saw that on someone's build stream.\",\n \"That's a really nice build.\",\n \"Yeah, I have a custom coiled cable to match my custom mechanical keyboard and custom wrist rest that all fit nicely in my custom keyboard case.\",\n \"Finally had some time to lube these switches.\",\n \"Are those Cherry MX Browns?\",\n \"Really loving the caps!\",\n \"I wonder how long it took for everything to arrive.\", \n \"I find lubing switches to be therapeutic.\",\n \"I'm already thinking about my next build.\",\n \"You have to lube your switches though.\", \n \"Cool build.\",\n \"Thinking about getting an IKEA wall mount to display my boards.\",\n \"I bought that in a group buy a year ago.\",\n \"You won't believe how much shipping was.\",\n \"Not sure when my keyboard will come in honestly.\",\n \"Listen to the type test of this board.\",\n \"Soldered this PCB myself.\",\n \"Imagine buying GMK sets to flip them.\",\n \"My keyboard is stuck in customs.\",\n \"I have a collection of desk mats and only 1 desk.\",\n \"I've seen some cursed builds out there.\",\n \"Keyboards made me broke.\",\n \"I fell in too deep in the rabbit hole.\",\n \"I'm about to spend $500 on a rectangle.\",\n \"Not sure if this is a hobby or hell.\",\n \"Give me some feedback on my first build!\",\n \"The group buy is live now.\",\n \"I think I just forgot to join a group buy.\",\n \"RNG gods please bless me.\",\n \"It's gasket-mounted.\",\n \"But actuation force though.\",\n \"Never really thought of it that way now that you say it.\",\n \"Lots of people get into this hobby without doing their research and it shows.\",\n \"A custom keyboard can change your life, I would know.\",\n \"Group buys have taught me a different type of patience I didn't know I had.\",\n \"This was a group buy, you can't really find this unless you search after market.\"\n ]\n}", "function inputText() {\n memeChoise.text = elInput.value;\n // memeChoise.upperText = memeChoise.text.\n drawImgOnCanvas(memeChoise.id);\n\n}", "function textGenerate() {\n var n = \"\";\n var text = \" Bé thương anh lắm, iu bae của em nữaaa..:333 \";\n var a = Array.from(text);\n var textVal = $('#txtReason').val() ? $('#txtReason').val() : \"\";\n var count = textVal.length;\n if (count > 0) {\n for (let i = 1; i <= count; i++) {\n n = n + a[i];\n if (i == text.length + 1) {\n $('#txtReason').val(\"\");\n n = \"\";\n break;\n }\n }\n }\n $('#txtReason').val(n);\n setTimeout(\"textGenerate()\", 1);\n}", "function GenerateNewText() {\n\n this.choices = []; // create this so we don't duplicate the sentences chosen\n\n // Add property to the object\n this.sentences =\n [\n \"The term \\\"tested in an ABM mode\\\" used in Article II of the Treaty refers to: (a) an ABM interceptor missile if while guided by an ABM radar it has intercepted a strategic ballistic missile or its elements in flight trajectory regardless of whether such intercept was successful or not; or if an ABM interceptor missile has been launched from an ABM launcher and guided by an ABM radar. If ABM interceptor missiles are given the capability to carry out interception without the use of ABM radars as the means of guidance, application of the term \\\"tested in an ABM mode\\\" to ABM interceptor missiles in that event shall be subject to additional discussion and agreement in the Standing Consultative Commission; (b) an ABM launcher if it has been used for launching an ABM interceptor missile; (c) an ABM radar if it has tracked a strategic ballistic missile or its elements in flight trajectory and guided an ABM interceptor missile toward them regardless of whether the intercept was successful or not; or tracked and guided an ABM interceptor missile; or tracked a strategic ballistic missile or its elements in flight trajectory in conjunction with an ABM radar, which is tracking a strategic ballistic missile or its elements in flight trajectory and guiding an ABM interceptor missile toward them or is tracking and guiding an ABM interceptor missile.\",\n \"EWO launch: If sequence does not start after coordinated key turn, refer to Fig 2-1 and Notify command post of type deviation, ETOR, and intent to perform TCCPS; Post ETOR to EWO documents.\",\n \"(For classified information on the RV, refer to the 11N series Technical Orders.)\",\n \"Here's my strategry on the Cold War: we win, they lose.\",\n \"The only thing that kept the Cold War cold was the mutual deterrance afforded by nuclear weapons.\",\n \"The weapons of war must be abolished before they abolish us.\",\n \"Ours is a world of nuclear giants and ethical infants.\",\n \"The safety and arming devices are acceleration-type, arming-delay devices that prevent accidental warhead detonation.\",\n \"The immediate fireball reaches temperatures in the ranges of tens of millions of degrees, ie, as hot as the interior temperatures of the sun.\",\n \"In a typical nuclear detonation, because the fireball is so hot, it immediately begins to rise in altitude. As it rises, a vacuum effect is created under the fireball, and air that had been pushed away from the detonation rushes back toward the fireball, causing an upward flow of air and dust that follows it.\",\n \"The RV/G&C van is used to transport and remove/replace the RV and the MGS for the MM II weapon system.\",\n \"Computer components include a VAX 11/750 main computer, an Intel 80186 CPU in the buffer, and the Ethernet LAN which connects the buffer with the main computer.\",\n \"The Specific Force Integrating Receiver (SFIR) is one of the instruments within the IMU of the Missile G&C Set (MGCS) which measures velocity along three orthogonal axes.\",\n \"The SFIR incorporates a pendulous integrating gyro having a specific mass unbalance along the spin axis, and provides correction rates to the Missile Electronics Computer Assembly (MECA) which provides ouputs to the different direction control units resulting in control of the missile flight.\",\n \"SAC has directed that all VAFB flight test systems and the PK LSS will be compatible with the SAC ILSC requirement.\",\n \"The ground shock accompanying the blast is nullified in the control center by a three-level, steel, shock-isolation cage, which is supported by eight shock mounts hung from the domed roof.\",\n \"(Prior to MCL 3252) Fixed vapor sensing equipment consists of an oxidizer vapor detector, a fuel vapor detector, a vapor detector annunciator panel, and associated sensing devices located throughout the silo area.\",\n \"The LAUNCH CONTROL AND MONITOR section contains switches to lock out the system, select a target, initiate a lunch, shutdown and reset.\",\n \"The CMG-1 chassis contains the logic required to control launch.\",\n \"Attention turned to the Nike X concept, a layered system with more than one type of missile.\",\n \"At this point a fight broke out between the Air Force and Army over who had precedence to develop land-based ABM systems.\",\n \"It is such a big explosion, it can smash in buildings and knock signboards over, and break windows all over town, but if you duck and cover, like Bert [the Turtle], you will be much safer.\",\n \"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.\",\n \"The living will envy the dead.\",\n \"Frequent fear of nuclear war in adolescents seems to be an indicator for an increased risk for common mental disorders and deserves serious attention.\",\n \"The Peacekeeper was the first U.S. ICBM to use cold launch technology.\",\n \"The Protocol to the Agreement with regard to Article III, entitled the United States to have no more than 710 SLBM launchers on 44 modern ballistic missile submarines, and the USSR, no more than 950 SLBM launchers on 62 submarines.\",\n \"Well hell, I'd piss on a spark plug if you thought it would do any good.\",\n \"Do you want to play a game?\",\n \"Gentlemen! You can't fight in here! This is the war room!\",\n \"I do not avoid women, Mandrake. But I do deny them my essence.\",\n \"Mr. Ryan, be careful what you shoot at. Most things here don't react well to bullets.\",\n \"If OPERATE OK on the BVLC does not light in step 5, verify that the proper code is inserted.\",\n \"PEACETIME launch: If abnormal indications occur prior to step 8, report to Launch Director and proceed as directed.\",\n \"The missile silo (figure 1-2) is a reinforced, concrete structure with inside dimensions of approximately 146 feet in depth and 55 feet in diameter.\",\n \"General, you are listening to a machine.\",\n \"The mechanism is... Oh James, James... Will you make love to me all the time in England?\",\n \"I never joke about my work, 007.\", \n \"Eventually Kwajalein Island was selected, as it was 4,800 miles from California, perfect for ICBMs, and already had a US Navy base with considerable housing stocks and an airstrip.\",\n \"From Stettin in the Baltic to Trieste in the Adriatic an iron curtain has descended across the Continent.\",\n \"Whether you like it or not, history is on our side. We will bury you.\",\n \"I like Mr. Gorbachev. We can do business together.\",\n \"Mr. Gorbachev, tear down this wall!\",\n \"Gort! Klaatu barada nikto!\",\n \"It is no concern of ours how you run your own planet. But if you threaten to extend your violence, this Earth of yours will be reduced to a burned-out cinder.\",\n \"The remaining base in North Dakota, the Stanley R. Mickelsen Safeguard Complex, became active on 1 April 1975 and fully operational on 1 October 1975. By that time the House Appropriations Committee had already voted to deativate it. The base was shutdown on 10 February 1976.\"\n\n\n ];\n\n console.log(\"How many sentences? \",this.sentences.length);\n}", "function startTyping(){\n start++;\n $('.speed').show();\n $('.startt').hide();\n $('.guidelines').hide();\n $('.answer').show();\n $('.accuracy').hide();\n generateRandomParagraph();\n startTime= new Date().getTime();\n words=0;\n document.getElementById('paragraphInput').value= null;\n inputLen=0;\n y= setInterval(timer,600);\n document.querySelector('#paragraphInput').focus();\n console.log(inputUnit.innerText);\n}", "function customText() {\n let text = document.querySelector(\"textarea\").value;\n let parsedText = validateText(text);\n if (parsedText != null) {\n setInitials();\n displayText(parsedText);\n }\n}", "function placeText() {\n const name = type.value();\n placeText.html('hello ' + name + '!');\n this.c = color(random(255), random(255), random(255));\n type.value('');\n//number of text\n for (let i = 0; i < 150; i++) {\n push();\n fill(this.c);\n translate(random(1800), random(1500));\n text(name, 0, 0);\n pop();\n }\n}", "function getText() {\n if(PLAYING_SOMETHING){\n\n }\n else{\n var textInput = document.getElementById(\"textArea\").value;\n //console.log(textInput);\n //var textblock = textInput;\n // titleElement = document.getElementById(\"resultTitle\");\n // //titleElement.innerHTML = \"Your input:\";\n //\n // resultElement = document.getElementById(\"resultP\");\n //resultElement.innerHTML = textInput;\n\n readText(textInput);\n }\n}", "function textGenerate() {\n var n = \"\";\n var text = \" Tại vì Tuấn đẹp trai có phải không,Hương hồng hoa từ trên người em. khiến anh hiếu hì hơn về em .Em là ai ? Anh muốn biết nhiều hơn ngoài tên, Hương này son hay phấn trên áo trắng hay tóc em vương,Thôi để anh đoán thử có phải em phương xa tự nhiên hương :)).\";\n var a = Array.from(text);\n var textVal = $('#txtReason').val() ? $('#txtReason').val() : \"\";\n var count = textVal.length;\n if (count > 0) {\n for (let i = 1; i <= count; i++) {\n n = n + a[i];\n if (i == text.length + 1) {\n $('#txtReason').val(\"\");\n n = \"\";\n break;\n }\n }\n }\n $('#txtReason').val(n);\n setTimeout(\"textGenerate()\", 1);\n}", "function getWord(){\nrdm = Math.floor((Math.random() * words.length-1) + 1);\n console.log('Word: ' + words[rdm]);\nconsole.log('Random: ' + rdm)\ndocument.getElementById(\"printWord\").innerHTML = words[rdm];\ndocument.getElementById(\"cajatexto\").value =\"\";\nfocusTextBox();\ndspWord = words[rdm];\ndraw();\n}", "function generateText(text) {\n let mm = new MarkovMachine(text);\n console.log(mm.makeText());\n}", "function onCreateText() {\n let elText = document.querySelector('.currText').value\n if (elText === '') return;\n createText()\n resetValues()\n draw()\n}", "function clickHandler(){\n var content = \"translated text for \";\n outputDiv.innerText= content +txtInput.value +\" : \"+\" bhgt ftctfe rx<>nug 6guy&\" \n console.log(outputDiv); \n}", "function showWhatWeTyped() {\n // fill the div with the content of the input field\n theDiv.innerHTML = field.value;\n subtitle.innerHTML = field2.value; \n}", "function renderNewWord() {\n\n // random word generator\n var random = Math.floor(Math.random() * wordLength.length);\n\n // get a random word and clear the string display\n let word = wordLength[random];\n wordDisplayString.innerHTML = \"\";\n\n // for each character in the word array create a 1 char span\n word.split(\"\").forEach(character => {\n const characterSpan = document.createElement(\"span\");\n characterSpan.innerText = character;\n wordDisplayString.appendChild(characterSpan);\n })\n\n // set input to null and focus it\n wordInput.value = null;\n wordInput.focus();\n }", "function createText(){\n\t\t//variablen erhalten Werte aus Eingabeboxen\n var input_name = document.getElementById(\"name\");\n var input_number = document.getElementById(\"number\");\n var input_thing = document.getElementById(\"thing\");\n var output = document.getElementById(\"loesung\");\n output.innerHTML = (input_name.value +\" \"+ input_number.value +\" \"+ input_thing.value);\n\n\n\n\n}", "function GenerateNewText() {\n\t//Add property to the object\n\tthis.sentences = \n\t[\n\t\t\"Quote number 1.\",\n\t\t\"Second cool quote.\",\n\t\t\"Another nice quote.\",\n\t\t\"The very last quote.\"\n\t];\n}", "function text() {\n \tclear();\n \tchangeClicks(1);//turn on clicking\n\trandomizer();//this is only numbers so it is not type specific\n \tdocument.getElementById(\"one\").innerHTML = \"<div style='font-size:250%;margin-top:100px;'>\" + one + \"</div>\";\n \tdocument.getElementById(\"two\").innerHTML = \"<div style='font-size:250%;margin-top:100px;'>\" + two + \"</div>\";\n \tdocument.getElementById(\"three\").innerHTML = \"<div style='font-size:250%;margin-top:100px;'>\" + three + \"</div>\";\n \treset();\n}", "async function generateText(model, charSet, charSetSize, sampleLen, seedTextInput) {\n try {\n if (model == null) {\n console.log('ERROR: Please load text data set first.');\n return;\n }\n const generateLength = generateLengthInput;\n const temperature = temperatureInput;\n if (!(generateLength > 0)) {\n console.log(\n `ERROR: Invalid generation length: ${generateLength}. ` +\n `Generation length must be a positive number.`);\n return;\n }\n if (!(temperature > 0 && temperature <= 1)) {\n console.log(\n `ERROR: Invalid temperature: ${temperature}. ` +\n `Temperature must be a positive number.`);\n return;\n }\n\n let seedSentence;\n let seedSentenceIndices;\n if (seedTextInput.length === 0) {\n console.log(\n `ERROR: seed sentence length is zero. Seed Sentence: ` +\n seedTextInput.value + '.');\n return;\n } else {\n seedSentence = seedTextInput;\n if (seedSentence.length < sampleLen) {\n console.log(\n `ERROR: Seed text must have a length of at least ` +\n `${sampleLen}, but has a length of ` +\n `${seedSentence.length}.`);\n return;\n }\n seedSentence = seedSentence.slice(\n seedSentence.length - sampleLen, seedSentence.length);\n\n seedSentenceIndices = [];\n for (let i = 0; i < seedSentence.length; ++i) {\n seedSentenceIndices.push(\n charSets[selectedText].indexOf(seedSentence[i]));\n }\n }\n\n const sentence = await genText(\n seedSentenceIndices, generateLength, temperature, model, charSet, charSetSize, sampleLen);\n generatedTextInput = sentence;\n const currStatus = 'Done generating text.';\n console.log(currStatus);\n\t\n console.log('sentence in generateText: '+ sentence);\n return sentence;\n } catch (err) {\n console.log(`ERROR: Failed to generate text: ${err.message}, ${err.stack}`);\n }\n}", "textEnter() {}", "function showText() {\n $(\"#textDisplay\").empty();\n $(\"#instructions\").empty();\n randomWords = [];\n for (var i = 0; i < wordCount; i++) {\n var ranWord = wordList[Math.floor(Math.random() * wordList.length)];\n if (wordList[wordList.length - 1] !== ranWord || wordList[wordList.length - 1] === undefined) {\n randomWords.push(ranWord);\n }\n }\n randomWords.forEach(function(word){\n $(\"#textDisplay\").append($(\"<span>\",{\"text\": word + \" \",\"class\":\"word\"}));\n });\n textDisplay.firstChild.classList.add(\"highlightedWord\")\n }", "function generateQuestion() {\n // Randomly select a question from the array\n currentQuestion = questions[Math.floor(Math.random() * questions.length)];\n\n // Update the question text in the HTML\n document.getElementById(\"question\").innerHTML =\n \"Spell the number \" +\n currentQuestion.number +\n \" in \" +\n currentQuestion.language +\n \":\";\n\n // Clear the answer input field\n document.getElementById(\"answer\").value = \"\";\n // Set the cursor to the answer input field\n document.getElementById(\"answer\").focus();\n}", "function enterName() {\n let fullSentence = \"Your pet is named\" + \" \" + txtName.value;\n \n console.log(fullSentence);\n dvResult.innerHTML = fullSentence;\n\n txtName.value = \"\";\n\n}", "function TextGenerator(env, data) {\n var container = env.area.appendChild(document.createElement('div'));\n container.setAttribute('id', 'text');\n container.innerHTML = data.subject;\n\n var heRead = function() {\n document.removeEventListener('keyup', heRead);\n env.area.removeEventListener('click', heRead);\n env.io.happen('read');\n };\n document.addEventListener('keyup', heRead);\n env.area.addEventListener('click', heRead);\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}", "function generateSentence() {\nvar randomIndex = Math.floor(Math.random() * sentences.length);\ncurrentSentence = sentences[randomIndex];\nprompt.innerHTML = currentSentence;\n}", "function generateText() {\n\t$(\"#display\").html(\"<h3>\" + questionList[questionNumber].question + \"</h3><h4 class='choice'>A. \" + questionList[questionNumber].answerArray[0] + \"</h4><h4 class='choice'>B. \"+questionList[questionNumber].answerArray[1]+\"</h4><h4 class='choice'>C. \"+questionList[questionNumber].answerArray[2]+\"</h4><h4 class='choice'>D. \"+questionList[questionNumber].answerArray[3]+\"</h4>\");\n\n}", "function EnterText2(){\n dataProvider = DataProvider.getDataProvider()\n query = \"select * from Regression where CaseName like 'EnterText%'\"\n recSet = dataProvider.execute(query) \n \n if(recSet == null || recSet.EOF){\n Log.Warning(\"Result of the query is empty.\", query);\n return false\n }\n \n recSet.MoveFirst() \n while (!recSet.EOF) {\n InputText(recSet.Fields.Item(\"Param1\").Value) \n recSet.MoveNext();\n }\n \n dataProvider.closeConnection()\n}", "function testy(){\n\n document.getElementById('word1').value = 'fast';\n document.getElementById('word2').value = 'memory';\n document.getElementById('number').value = 511;\n\n}", "function init() {\n //picks a random number and matches it to a letter\n currentWord = words[Math.floor(Math.random()*words.length)];\n wordHint.textContent = currentWord.split(\"\").map(letter => letter = \"__\").join(\" \");\n}", "function onInput() {\r\n\tvar x = document.getElementById('myInput').value;\r\n\tdocument.getElementById('oninput_P').innerHTML = \"your text:\" + x;\r\n}", "generateInstruction(isDemo, timeStamp){\n let chosenText;\n let x;\n if (isDemo){\n chosenText = \"Watch closely!\";\n x = -0.11;\n\n }\n else{\n chosenText = \"Repeat the sequence!\";\n x = -0.15;\n }\n instrName = chosenText;\n instrStamp = timeStamp;\n let instrTextObj = new Text(this, chosenText, new Vector3(x,0.01,-0.08), 0.00009);\n this.add(instrTextObj);\n }", "init() {\n this.appendDummyInput()\n .appendField('text');\n this.setPreviousStatement(true);\n this.setNextStatement(true);\n this.setColour(textHUE);\n this.setTooltip('Adds a text input');\n this.contextMenu = false;\n }", "function displayInputString() {\n guessSection.innerText = document.getElementById('main-input').value;\n yourLastGuessWas.innerText = \"Your last guess was\";\n}", "function processClickFunction(){\n alert(\"Thomas Fracassi: \" + inputvar.value);\n document.getElementById(\"textoutput\").innerHTML = inputvar.value;\n }", "function showText(i) {\n Shiny.onInputChange('text_contents', el.data[i-1].longtext);\n }", "function firstExampleUpdate() {\n\t\t$('#example-one-value').html(\n\t\t\t'<span>' + $('#example-one-input').val() + '</span>'\n\t\t);\n\t\t$('#example-one-value').textfill({\n\t\t\tmaxFontPixels: 200\n\t\t});\n\t}", "static get TEXT_INPUT() {\r\n return 2;\r\n }", "textChange() {\n core.dxp.log.debug('Inside textChange');\n this.assignPlaceholderText();\n }", "function EnterText(){\n //throw new Error(\"User Exception.\");\n dataProvider = DataProvider.getDataProvider()\n query = \"select * from Smoke where CaseName like 'EnterText%'\"\n recSet = dataProvider.execute(query) \n \n if(recSet == null || recSet.EOF){\n Log.Warning(\"Result of the query is empty.\", query);\n return false\n }\n \n recSet.MoveFirst() \n while (!recSet.EOF) {\n InputText(recSet.Fields.Item(\"Param1\").Value) \n recSet.MoveNext();\n }\n \n dataProvider.closeConnection()\n}", "function buildRandomJeanLorem() {\n var builder = '';\n var paragraphInput = $('#paragraph').val();\n for(var i = 0; i < paragraphInput; i++) {\n if ($('#header-with-tag').val() != \"Non\") {\n builder += \"<\" + $('#header-with-tag').val() + \">\";\n if($('#audience').prop('checked')) {\n builder += escapeHtml(jokesAllHeaders[getRandomNumber(jokesAllHeadersLength)]);\n } else {\n builder += escapeHtml(jokesSafeHeaders[getRandomNumber(jokesSafeHeadersLength)]);\n }\n builder += \"</\" + $('#header-with-tag').val() + \">\\n\";\n };\n if($('#paragraph-tag').prop('checked')) {\n builder += \"<p>\";\n };\n if($('#audience').prop('checked')) {\n builder += escapeHtml(jokesAllParagraphs[getRandomNumber(jokesAllParagraphsLength)]);\n } else {\n builder += escapeHtml(jokesSafeParagraphs[getRandomNumber(jokesSafeParagraphsLength)]);\n }\n if($('#paragraph-tag').prop('checked')) {\n builder += \"</p>\";\n };\n builder += \"\\n\\n\";\n };\n var build = \"<!-- start jeanLorem code -->\\n\\n\" + builder + \"<!-- end jeanLorem code -->\";\n $('textarea').val(build);\n}", "function inputText (e){\n\tconsole.log(\"here\");\n\treturn outputEvent.innerHTML = userInput;\n\n\t//var onKeyUp = function(e) {\n\t//var userInput = document.getElementById('keypress-input').value; \t\n}", "init() {\n this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);\n this.setColour(45);\n this.appendDummyInput()\n .appendField(this.newQuote_(true))\n .appendField(new Blockly.FieldTextInput(''), 'TEXT')\n .appendField(this.newQuote_(false));\n this.setOutput(true);\n this.setTooltip('Gives the given text');\n this.setAsLiteral('Text');\n }", "function generateText() {\n console.log(textLength);\n let easyText = [\"a\", \"s\", \"d\", \"w\", \"r\", \"t\", \"h\", \"j\", \"n\", \"m\", \"i\", \"o\", \"v\", \"e\", \"f\"];\n let hardText = [\"g\", \"h\", \"z\", \"x\", \"c\", \"b\", \"k\", \"y\", \"q\", \"p\", \"u\", \"n\", \"m\", \"v\", \"l\"];\n let string = \"\";\n letterCount = 0;\n while (true) {\n if (letterCount > textLength) {\n break;\n }\n if (easy) {\n string = createWords(easyText, string);\n } else {\n string = createWords(hardText, string);\n }\n }\n if (string.length > textLength) {\n string = string.slice(0, textLength);\n }\n\n displayText(string);\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 simpleText()\n {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "function handleText() {\n if (index < text.length) {\n id(\"output\").innerText = \"\";\n let curWord = text[index];\n id(\"output\").innerText = curWord;\n index++;\n } else {\n endGame();\n }\n }", "function speechToText(){\n push();\n textSize(20);\n fill(255);\n textFont(speechFont);\n //appears randomly on the screen\n text(theWords,random(0,width/3),random(0,height));\n pop();\n}", "function generateText() {\n\n words.clear()\n var textFile = document.getElementById(\"inputFile\")\n //console.log(textFile)\n parseFile(textFile)\n\n}", "function initText(text){\n document.getElementById(\"textToReadWrapper\").innerHTML = \"\" \n for (i = 0; i < textToAdd.length; i++){\n document.getElementById(\"textToReadWrapper\").innerHTML +='<span>' + text[i] + \" \"\n }\n }", "function returnQuote() {\n // Generate the number\n var randomNumber = getRandomInt(0, maxLength);\n // Get the random quote\n var quote = lyricsArray[randomNumber];\n // Set the text box\n var boxName = document.getElementById('mainBox');\n boxName.innerHTML = quote;\n}", "function customGenerate(){\n newAreaSounds.play();\n $(\"#name-underline-wrapper\").removeClass(\"faded-out\");\n $(\"#name\").text($(\"#custom-text\").val());\n smartFadeOut();\n}", "function generateTokenizedPassage()\n{\n\ttokenizedPassage = RiTa.tokenize(selectedPassageText);\n\n\tconsole.log(tokenizedPassage[2]);\n}", "function inputChange (e) {\n var isCorrect = game.check(this.value),\n wordObj,\n i,\n l = game.wordsByIndex.length;\n if (isCorrect) {\n // TODO: run correct animation & move to the next stage\n game.level++;\n game.currentSceneIndex++;\n // sound\n game.soundInstance = createjs.Sound.play(\"Correct\"); // play using id. Could also use full sourcepath or event.src.\n //game.soundInstance.addEventListener(\"complete\", createjs.proxy(this.handleComplete, this));\n game.soundInstance.volume = 0.5;\n window.alert('Correct!');\n loadScene(game.currentSceneIndex)\n this.value='';\n } else if (this.value.length > game.minimumWordLength) {\n for (i = 0; i < l; i++) {\n wordObj = game.wordsByIndex[i];\n if (wordsAreEqual(wordObj.spl, this.value)) {\n game.level--;\n setPopupContent(i, 500, 100);\n // show mask\n jQuery('#mask').show();\n // show pop-up\n jQuery('#popup').show();\n this.value='';\n }\n }\n }\n}", "function buttonClick(){\n var customText = document.getElementsByClassName(\"my-input\");\n var results = document.getElementById(\"text\");\n results.innerHTML = \"Hello, \" + customText[0].value; //html code is valid within qutoes\n}", "function suggestion() {\n let randomAdjective = findRandomEntry(adjectives);\n let randomAgent = findRandomEntry(agents);\n let randomVerb = findRandomEntry(verbs);\n let randomPreposition = findRandomEntry(prepositions);\n let randomEnding = findRandomEntry(endings);\n currentSuggestion = (randomAdjective + \" \" + randomAgent + \" \" + randomVerb + \" \" + randomPreposition + \" \" + randomEnding);\n speak(currentSuggestion);\n boxWrite(currentSuggestion + ' \\n (If you would like to hear this again, say \"Could you repeat that?\")')\n}", "function gText(e) {\n displayValue = (document.all) ? document.selection.createRange().text : document.getSelection();\n document.getElementById('input').value = displayValue \n}", "randomText(positive) {\n const posPhrases = [\n 'Goed gedaan!',\n 'Netjes!',\n 'Je doet het súper!',\n 'Helemaal goed!',\n 'Je bent een topper!'\n ]\n const negPhrases = [\n 'Ik weet dat je het kunt!',\n 'Jammer, probeer het nog eens!',\n 'Bijna goed!',\n 'Helaas pindakaas'\n ]\n\n const phrases = positive ? posPhrases : negPhrases\n const maximumNumber = phrases.length\n const randomNumber = Math.floor(Math.random() * maximumNumber)\n \n return phrases[randomNumber]\n }", "function wat(){\n var ranNo = Math.round(Math.random()*10)\n var funnyMessage = [\"You trying to trick me?\", \"Same case silly billy!\", \"Come on stop messing around!\",\n \"What?\", \"cAn NoT cOmPuTe\", \"Computer says no...\", \"Are you trying to be funny?\",\n \"OK I'll just convert that... Not!\", \"You're not the sharpest tool in the box, are you?\", \"How am I supose to work with this?\" ];\n $(\"#textOutput\").val(funnyMessage[ranNo]);\n}", "function useInput() {\n checkVar(getInput.value);\n // console.log(getInput.value);\n outputP.innerText = getInput.value;\n getInput.value = \"\";\n \n\n}", "function generateRandom() {\n // some random function to generate code, hidden\n return text;\n}", "function generateSentence() {\r\n return selectChud()+' '+selectVerb()+' '+selectLefty()+' With '+selectAdjective()+' '+selectEnding();\r\n}", "function createAnswer() {\n\t\tanswer = String(words[Math.floor(Math.random() * words.length)]);\n\t\tconsole.log(answer)\n\t\t$(\".correctAnswer\").html(answer);\n\n\t}", "function textLogger() {\n\tconsole.log(document.querySelector('.txtInput').value);\n\t//push whatever is in the input box to the array\n\tarr.push(document.querySelector('.txtInput').value);\n\tdocument.querySelector('.txtInput').value = '';\n\trender(arr);\n}", "function readIt() {\n\t\tdisplayText(false); \n\t\tcount++;\n\n\t\tif (count >= input.length) { // stop when the input reaches the last word\n\t\t\tcount = 0;\n\t\t\tstop();\n\t\t}\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}", "async function init() {\n const word = await API.getRandomWord();\n console.log(word);\n wordH2.textContent = word.mot;\n checkInputs(word);\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}", "generateFeedback(isPositive, timeStamp){\n let chosenText;\n if (isPositive){\n chosenText = positiveFeedback[Math.floor(Math.random() * 6)];\n }\n else{\n chosenText = negativeFeedback[Math.floor(Math.random() * 6)];\n }\n feedbackName = chosenText;\n feedbackStamp = timeStamp;\n let x = (Math.random() * 0.3) - 0.22;\n let y = (Math.random() * 0.1) - 0.01;\n let fbTextObj = new Text(this, chosenText, new Vector3(x,y,-0.08), 0.00007);\n this.add(fbTextObj);\n }", "function displayInput(){\n input_text = document.getElementById('input-box').value;\n document.getElementById('response-box').innerHTML = input_text;\n}", "function clickedRandomText() {\n originText.innerHTML = texts[Math.floor(Math.random() * texts.length)];\n // It will also call the reset function to reset evrything\n reset();\n}", "function setupInputBox() {\n const input = document.getElementById('textInput');\n let dummy = document.getElementById('textInputDummy');\n const minFontSize = 14;\n const maxFontSize = 16;\n const minPadding = 4;\n const maxPadding = 6;\n\n // If no dummy input box exists, create one\n if (dummy === null) {\n const dummyJson = {\n tagName: 'div',\n attributes: [{\n name: 'id',\n value: 'textInputDummy',\n }],\n };\n\n dummy = Common.buildDomElement(dummyJson);\n document.body.appendChild(dummy);\n }\n\n function adjustInput() {\n if (input.value === '') {\n // If the input box is empty, remove the underline\n input.classList.remove('underline');\n input.setAttribute('style', 'width:' + '100%');\n input.style.width = '100%';\n } else {\n // otherwise, adjust the dummy text to match, and then set the width of\n // the visible input box to match it (thus extending the underline)\n input.classList.add('underline');\n const txtNode = document.createTextNode(input.value);\n ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height',\n 'text-transform', 'letter-spacing'].forEach((index) => {\n dummy.style[index] = window.getComputedStyle(input, null).getPropertyValue(index);\n });\n dummy.textContent = txtNode.textContent;\n\n let padding = 0;\n const htmlElem = document.getElementsByTagName('html')[0];\n const currentFontSize = parseInt(window.getComputedStyle(htmlElem, null).getPropertyValue('font-size'), 10);\n if (currentFontSize) {\n padding = Math.floor((currentFontSize - minFontSize) / (maxFontSize - minFontSize)\n * (maxPadding - minPadding) + minPadding);\n } else {\n padding = maxPadding;\n }\n\n const widthValue = `${dummy.offsetWidth + padding}px`;\n input.setAttribute('style', `width:${widthValue}`);\n input.style.width = widthValue;\n }\n }\n\n // Any time the input changes, or the window resizes, adjust the size of the input box\n input.addEventListener('input', adjustInput);\n window.addEventListener('resize', adjustInput);\n\n // Trigger the input event once to set up the input box and dummy element\n Common.fireEvent(input, 'input');\n }", "function generateRandomStringsToInputData(count) {\n console.log('generateRandomStringsToInputData: ' + count);\n\n // Generate random character string from 3 to 8 characters long.\n var chars = 'aaaaabbcdddeeeeeefghiiijkllmmnnooooapqrrrssstttuuvwxyz'.split('');\n\n for (i = 0; i < count; i++) {\n var len = Math.floor(Math.random() * 6) + 3;\n var str = '';\n for (var j = 0; j < len; j++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n gaInputData.push(str);\n }\n updateInputDataDisplay();\n updateInputDataFooter();\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 updateText(){\r\n\r\n\tvar text = document.getElementById(\"simulationtext\").value;\r\n\tdocument.title = text;\r\n\r\n\tif(text.length>0){\r\n\t\tclearSeed();\r\n\t\tsetAnimationFunction();\r\n\t\tenableShare();\r\n\r\n\t\tsimText = text;\r\n\t\tpathIsText = true;\r\n\t\trestart = true;\r\n\t}\r\n}", "function TemplateInput() {}", "function createWord() {\r\n let randomNumber = Math.floor(Math.random()*wordList.length);\r\n let wordObject = wordList[randomNumber];\r\n\r\n //definitionText.style.visibility=\"hidden\";\r\n document.getElementById('definition').innerHTML = wordObject.definition;\r\n\r\n\r\n return wordObject.name.toUpperCase(); // to pass to letter buttons\r\n}", "function fill_field() { \n var txt=document.getElementById(\"subject_id\").value; \n document.getElementById(\"subject_id\").value = randomString();; \n }", "function textContent(input) {\n var element = document.createElement(\"div\");\n var b = document.createElement(\"b\");\n \n b.textContent = input;\n \n \n element.appendChild(b);\n \n return element\n }", "function setup()\n{\n createCanvas(700, 500); // window size in px before we go into fullScreen()\n frameRate(60); // frame rate (DO NOT CHANGE!)\n \n // DO NOT CHANGE THESE!\n shuffle(phrases, true); // randomize the order of the phrases list (N=501)\n target_phrase = phrases[current_trial];\n \n drawUserIDScreen(); // draws the user input screen (student number and display size)\n}", "outputText(ctx){\r\n let inputText = $('#textInput').val();\r\n contextReal.fillText(inputText,this.textX[0],this.textY[0]+parseInt(canvasSettings.textSize));\r\n //contextReal.stroke();\r\n $('#textInput').css({\"display\":\"none\",\"transform\":\"translateY(0) translateX(0)\"});\r\n $('#textInput').val('');\r\n //$('body').find('input[type=text],input').val('');\r\n this.textX= [];\r\n this.textY = [];\r\n this.onFinish();\r\n }", "function result() {\n let newStory = storyText;\n\n//calls the function and gets it to return one random string out of each respective array\n let xItem = randomValueFromArray(insertX);\n let yItem = randomValueFromArray(insertY);\n let zItem = randomValueFromArray(insertZ);\n\n //Whenever a newStory is called, it is made equal to itself but with substitutions made\n //so each time the button is pressed, these place holders are each replaced with a random silly string.\n newStory = newStory.replace(':insertx:',xItem);\n newStory = newStory.replace(':insertx:',xItem);\n newStory = newStory.replace(':inserty:',yItem);\n newStory = newStory.replace(':insertz:',zItem);\n \n\n//adds another string replacement method to replace the name \"bob\" with the name variable.\n if(customName.value !== '') {\n const name = customName.value;\n newStory = newStory.replace('Bob',name);\n\n }\n\n//Here we're checking to see if the radio button is checked between US or UK. If selected with UK,\n//it then does the math conversions for weight and temperature and converts them to Stone, and Centigrade\"\n if(document.getElementById(\"uk\").checked) {\n const weight = Math.round(300*0.0714286) + ' stone';\n const temperature = Math.round((94-32) * 5 / 9) + ' centigrade';\n newStory = newStory.replace('94 fahrenheit',temperature);\n newStory = newStory.replace('300 pounds',weight);\n\n }\n\n story.textContent = newStory;\n story.style.visibility = 'visible';\n}", "getText(numWords = 100) {\n // MORE CODE HERE\n let textArr = [];\n let wordChoice = Array.from(this.words);\n let word = this.getRandomElement(wordChoice)\n \n \n while (textArr.length < numWords && word !== null){\n textArr.push(word)\n\n let nextWord = this.getRandomElement(this.chain.get(word))\n //append to textarr the newly defined word\n word = nextWord\n\n }\n return textArr.join(\" \");\n }", "function GenerateNewText() {\n // Add property to the object\n this.sentences = doggoarray;\n this.punctuation = [\".\", \",\", \"!\", \"?\", \".\", \",\", \",\", \"!!\", \".\", \",\"];\n}", "function hint (input, random) {\r\n if (input > random) {\r\n msgLog().style.color = \"#BE1830\";\r\n msgLog().style.fontSize = \"1.5em\";\r\n msgLog().textContent = 'Too High';\r\n } else {\r\n msgLog().style.color = \"#BE1830\";\r\n msgLog().style.fontSize = \"1.2em\";\r\n msgLog().textContent = 'Too Low';\r\n }\r\n}", "function checkUserInput(event) {\n log.textContent = event.target.value.toUpperCase();\n randomWord.slice(randomWordSplit)\n if (log.textContent === randomWord) {\n wordBoxReference.innerHTML = '';\n input.value = \"\";\n userScore++;\n document.getElementById('user-score').innerHTML = userScore;\n generateRandomWord();\n } else {\n highlightLetters();\n }\n}", "function doit() {\n\n\tif (!greekActive)\n\t\treturn;\n\n\ttext2 = document.getElementById('signa_description').value;\n\t\n\tif (navigator.userAgent.indexOf('MSIE') > -1) {\n\t\t\n\t\tvar currentRange = document.selection.createRange();\n\t\tvar workRange = currentRange.duplicate();\n\n\t\t// select the whole contents and get 'all' selection\n\t\tevent.srcElement.select();\n\t\tvar allRange = document.selection.createRange();\n\n\t\tvar len = 0;\n\t\t// NB text.length does not give the caret position\n\t\twhile (workRange.compareEndPoints(\"StartToStart\", allRange) > 0) {\n\t\t\tworkRange.moveStart(\"character\", -1);\n\t\t\tlen++;\n\t\t\t// recover the original selection\n\t\t\tcurrentRange.select();\n\t\t\t// len contains the caret position if no selection\n\t\t\t// or selection start point offset if any\n\t\t}\n\t}\n\t\n\tvar len = 0;\n\n\tif (!document.all && navigator.userAgent.indexOf('Mozilla') > -1) {\n\t\t\n\t\tvar input2 = document.getElementById('signa_description');\n\t\t\n\t\tif (input2.setSelectionRange){\n\t\t\tlen = input2.selectionStart;\n\t\t}\n\t\tif (keyCode == 57 || keyCode == 48 || keyCode == 191 || keyCode == 220\n\t\t\t\t|| keyCode == 61 || keyCode == 109)\n\t\t\tlen += -1;\n\n\t}\n\n\tvar key = document.all ? event.keyCode : 0;\n\n\tif (navigator.userAgent.indexOf('MSIE') > -1) {\n\t\tif ((event.shiftKey == false) && (key == 191))\n\t\t\tlen += -1;\n\t\tif ((event.shiftKey == true) && (key == 57 || key == 48))\n\t\t\tlen += -1;\n\t\tif (key == 220 || key == 187 || key == 189)\n\t\t\tlen += -1;\n\t}\n\n\tif (key == 8 || key == 16 || key == 17 || key == 18 || key == 20\n\t\t\t|| key == 33 || key == 34 || key == 36 || key == 37 || key == 38\n\t\t\t|| key == 39 || key == 40 || key == 45 || key == 46) {\n\t\treturn;\n\t}\n\n\ttext2 = replace(text2,len, '``', '“');\n\ttext2 = replace(text2,len, '\\'\\'', '”');\n\ttext2 = replace(text2,len, '´´', '”');\n\ttext2 = replace(text2,len, ',,', '„');\n\ttext2 = replace(text2,len, '<<', '«');\n\ttext2 = replace(text2,len, '>>', '»');\n\ttext2 = replace(text2,len, ':', '·');\n\ttext2 = replace(text2,len, '?', ';');\n\ttext2 = replace(text2,len, ' )', '᾽');\n\n\ttext2 = replace(text2,len, 'a', 'α');\n\ttext2 = replace(text2,len, 'α/', 'ά');\n\ttext2 = replace(text2,len, 'α\\\\', 'ὰ');\n\ttext2 = replace(text2,len, 'α=', 'ᾶ');\n\ttext2 = replace(text2,len, 'α)', 'ἀ');\n\ttext2 = replace(text2,len, 'α(', 'ἁ');\n\ttext2 = replace(text2,len, 'α_', 'ᾱ');\n\ttext2 = replace(text2,len, 'α-', 'ᾰ');\n\ttext2 = replace(text2,len, 'α|', 'ᾳ');\n\ttext2 = replace(text2,len, 'ἀ\\\\', 'ἂ');\n\ttext2 = replace(text2,len, 'ἀ/', 'ἄ');\n\ttext2 = replace(text2,len, 'ἁ\\\\', 'ἃ');\n\ttext2 = replace(text2,len, 'ἁ/', 'ἅ');\n\ttext2 = replace(text2,len, 'ἁ=', 'ἇ');\n\ttext2 = replace(text2,len, 'ἀ=', 'ἆ');\n\ttext2 = replace(text2,len, 'ά|', 'ᾴ');\n\ttext2 = replace(text2,len, 'ὰ|', 'ᾲ');\n\ttext2 = replace(text2,len, 'ἀ|', 'ᾀ');\n\ttext2 = replace(text2,len, 'ἁ|', 'ᾁ');\n\ttext2 = replace(text2,len, 'ᾶ|', 'ᾷ');\n\ttext2 = replace(text2,len, 'ἆ|', 'ᾆ');\n\ttext2 = replace(text2,len, 'ἇ|', 'ᾇ');\n\ttext2 = replace(text2,len, 'ἂ|', 'ᾂ');\n\ttext2 = replace(text2,len, 'ἄ|', 'ᾄ');\n\ttext2 = replace(text2,len, 'ἃ|', 'ᾃ');\n\ttext2 = replace(text2,len, 'ἅ|', 'ᾅ');\n\n\ttext2 = replace(text2,len, 'b', 'β');\n\ttext2 = replace(text2,len, 'c', 'ξ');\n\ttext2 = replace(text2,len, 'd', 'δ');\n\n\ttext2 = replace(text2,len, 'e', 'ε');\n\ttext2 = replace(text2,len, 'ε/', 'έ');\n\ttext2 = replace(text2,len, 'ε\\\\', 'ὲ');\n\ttext2 = replace(text2,len, 'ε)', 'ἐ');\n\ttext2 = replace(text2,len, 'ε(', 'ἑ');\n\ttext2 = replace(text2,len, 'ἐ\\\\', 'ἒ');\n\ttext2 = replace(text2,len, 'ἐ/', 'ἔ');\n\ttext2 = replace(text2,len, 'ἑ\\\\', 'ἓ');\n\ttext2 = replace(text2,len, 'ἑ/', 'ἕ');\n\n\ttext2 = replace(text2,len, 'f', 'φ');\n\ttext2 = replace(text2,len, 'g', 'γ');\n\n\ttext2 = replace(text2,len, 'h', 'η');\n\ttext2 = replace(text2,len, 'η/', 'ή');\n\ttext2 = replace(text2,len, 'η\\\\', 'ὴ');\n\ttext2 = replace(text2,len, 'η=', 'ῆ');\n\ttext2 = replace(text2,len, 'η)', 'ἠ');\n\ttext2 = replace(text2,len, 'η(', 'ἡ');\n\ttext2 = replace(text2,len, 'η|', 'ῃ');\n\ttext2 = replace(text2,len, 'ἠ\\\\', 'ἢ');\n\ttext2 = replace(text2,len, 'ἡ\\\\', 'ἣ');\n\ttext2 = replace(text2,len, 'ἠ/', 'ἤ');\n\ttext2 = replace(text2,len, 'ἡ/', 'ἥ');\n\ttext2 = replace(text2,len, 'ἠ=', 'ἦ');\n\ttext2 = replace(text2,len, 'ἡ=', 'ἧ');\n\ttext2 = replace(text2,len, 'ή|', 'ῄ');\n\ttext2 = replace(text2,len, 'ὴ|', 'ῂ');\n\ttext2 = replace(text2,len, 'ῆ|', 'ῇ');\n\ttext2 = replace(text2,len, 'ἠ|', 'ᾐ');\n\ttext2 = replace(text2,len, 'ἡ|', 'ᾑ');\n\ttext2 = replace(text2,len, 'ἢ|', 'ᾒ');\n\ttext2 = replace(text2,len, 'ἣ|', 'ᾓ');\n\ttext2 = replace(text2,len, 'ἤ|', 'ᾔ');\n\ttext2 = replace(text2,len, 'ἥ|', 'ᾕ');\n\ttext2 = replace(text2,len, 'ἦ|', 'ᾖ');\n\ttext2 = replace(text2,len, 'ἧ|', 'ᾗ');\n\n\ttext2 = replace(text2,len, 'i', 'ι');\n\ttext2 = replace(text2,len, 'ι/', 'ί');\n\ttext2 = replace(text2,len, 'ι\\\\', 'ὶ');\n\ttext2 = replace(text2,len, 'ι=', 'ῖ');\n\ttext2 = replace(text2,len, 'ι)', 'ἰ');\n\ttext2 = replace(text2,len, 'ι(', 'ἱ');\n\ttext2 = replace(text2,len, 'ἰ\\\\', 'ἲ');\n\ttext2 = replace(text2,len, 'ἱ/', 'ἵ');\n\ttext2 = replace(text2,len, 'ἰ/', 'ἴ');\n\ttext2 = replace(text2,len, 'ἱ\\\\', 'ἳ');\n\ttext2 = replace(text2,len, 'ἰ=', 'ἶ');\n\ttext2 = replace(text2,len, 'ἱ=', 'ἷ');\n\ttext2 = replace(text2,len, 'ι-', 'ῐ');\n\ttext2 = replace(text2,len, 'ι_', 'ῑ');\n\ttext2 = replace(text2,len, 'ι+', 'ϊ');\n\ttext2 = replace(text2,len, 'ϊ/', 'ΐ');\n\ttext2 = replace(text2,len, 'ϊ\\\\', 'ῒ');\n\ttext2 = replace(text2,len, 'ϊ=', 'ῗ');\n\n\ttext2 = replace(text2,len, 'j', 'ς');\n\ttext2 = replace(text2,len, 'k', 'κ');\n\ttext2 = replace(text2,len, 'l', 'λ');\n\ttext2 = replace(text2,len, 'm', 'μ');\n\ttext2 = replace(text2,len, 'n', 'ν');\n\n\ttext2 = replace(text2,len, 'o', 'ο');\n\ttext2 = replace(text2,len, 'ο/', 'ό');\n\ttext2 = replace(text2,len, 'ο\\\\', 'ὸ');\n\ttext2 = replace(text2,len, 'ο)', 'ὀ');\n\ttext2 = replace(text2,len, 'ο(', 'ὁ');\n\ttext2 = replace(text2,len, 'ὀ\\\\', 'ὂ');\n\ttext2 = replace(text2,len, 'ὁ\\\\', 'ὃ');\n\ttext2 = replace(text2,len, 'ὀ/', 'ὄ');\n\ttext2 = replace(text2,len, 'ὁ/', 'ὅ');\n\n\ttext2 = replace(text2,len, 'p', 'π');\n\ttext2 = replace(text2,len, 'q', 'θ');\n\n\ttext2 = replace(text2,len, 'r', 'ρ');\n\ttext2 = replace(text2,len, 'ρ)', 'ῤ');\n\ttext2 = replace(text2,len, 'ρ(', 'ῥ');\n\n\ttext2 = replace(text2,len, 's', 'σ');\n\ttext2 = replace(text2,len, 't', 'τ');\n\n\ttext2 = replace(text2,len, 'u', 'υ');\n\ttext2 = replace(text2,len, 'υ/', 'ύ');\n\ttext2 = replace(text2,len, 'υ\\\\', 'ὺ');\n\ttext2 = replace(text2,len, 'υ=', 'ῦ');\n\ttext2 = replace(text2,len, 'υ)', 'ὐ');\n\ttext2 = replace(text2,len, 'υ(', 'ὑ');\n\ttext2 = replace(text2,len, 'ὐ\\\\', 'ὒ');\n\ttext2 = replace(text2,len, 'ὑ\\\\', 'ὓ');\n\ttext2 = replace(text2,len, 'ὐ/', 'ὔ');\n\ttext2 = replace(text2,len, 'ὑ/', 'ὕ');\n\ttext2 = replace(text2,len, 'ὐ=', 'ὖ');\n\ttext2 = replace(text2,len, 'ὑ=', 'ὗ');\n\ttext2 = replace(text2,len, 'υ+', 'ϋ');\n\ttext2 = replace(text2,len, 'ϋ/', 'ΰ');\n\ttext2 = replace(text2,len, 'ϋ\\\\', 'ῢ');\n\ttext2 = replace(text2,len, 'ϋ=', 'ῧ');\n\ttext2 = replace(text2,len, 'υ_', 'ῡ');\n\ttext2 = replace(text2,len, 'υ-', 'ῠ');\n\n\ttext2 = replace(text2,len, 'v', 'ϝ');\n\n\ttext2 = replace(text2,len, 'w', 'ω');\n\ttext2 = replace(text2,len, 'ω/', 'ώ');\n\ttext2 = replace(text2,len, 'ω\\\\', 'ὼ');\n\ttext2 = replace(text2,len, 'ω=', 'ῶ');\n\ttext2 = replace(text2,len, 'ω)', 'ὠ');\n\ttext2 = replace(text2,len, 'ω(', 'ὡ');\n\ttext2 = replace(text2,len, 'ω|', 'ῳ');\n\ttext2 = replace(text2,len, 'ὠ/', 'ὤ');\n\ttext2 = replace(text2,len, 'ὡ/', 'ὥ');\n\ttext2 = replace(text2,len, 'ὠ\\\\', 'ὢ');\n\ttext2 = replace(text2,len, 'ὡ\\\\', 'ὣ');\n\ttext2 = replace(text2,len, 'ὠ=', 'ὦ');\n\ttext2 = replace(text2,len, 'ὡ=', 'ὧ');\n\ttext2 = replace(text2,len, 'ώ|', 'ῴ');\n\ttext2 = replace(text2,len, 'ὼ|', 'ῲ');\n\ttext2 = replace(text2,len, 'ῶ|', 'ῷ');\n\ttext2 = replace(text2,len, 'ὠ|', 'ᾠ');\n\ttext2 = replace(text2,len, 'ὡ|', 'ᾡ');\n\ttext2 = replace(text2,len, 'ὤ|', 'ᾤ');\n\ttext2 = replace(text2,len, 'ὥ|', 'ᾥ');\n\ttext2 = replace(text2,len, 'ὢ|', 'ᾢ');\n\ttext2 = replace(text2,len, 'ὣ|', 'ᾣ');\n\ttext2 = replace(text2,len, 'ὦ|', 'ᾦ');\n\ttext2 = replace(text2,len, 'ὧ|', 'ᾧ');\n\n\ttext2 = replace(text2,len, 'x', 'χ');\n\ttext2 = replace(text2,len, 'y', 'ψ');\n\ttext2 = replace(text2,len, 'z', 'ζ');\n\n\ttext2 = replace(text2,len, 'A', 'Α');\n\ttext2 = replace(text2,len, 'Α/', 'Ά');\n\ttext2 = replace(text2,len, 'Α\\\\', 'Ὰ');\n\ttext2 = replace(text2,len, 'Α(', 'Ἁ');\n\ttext2 = replace(text2,len, 'Α)', 'Ἀ');\n\ttext2 = replace(text2,len, 'Α|', 'ᾼ');\n\ttext2 = replace(text2,len, 'Ἁ\\\\', 'Ἃ');\n\ttext2 = replace(text2,len, 'Ἀ\\\\', 'Ἂ');\n\ttext2 = replace(text2,len, 'Ἁ/', 'Ἅ');\n\ttext2 = replace(text2,len, 'Ἀ/', 'Ἄ');\n\ttext2 = replace(text2,len, 'Ἁ=', 'Ἇ');\n\ttext2 = replace(text2,len, 'Ἀ=', 'Ἆ');\n\ttext2 = replace(text2,len, 'Ἁ|', 'ᾉ');\n\ttext2 = replace(text2,len, 'Ἀ|', 'ᾈ');\n\ttext2 = replace(text2,len, 'Ἃ|', 'ᾋ');\n\ttext2 = replace(text2,len, 'Ἂ|', 'ᾊ');\n\ttext2 = replace(text2,len, 'Ἅ|', 'ᾍ');\n\ttext2 = replace(text2,len, 'Ἄ|', 'ᾌ');\n\ttext2 = replace(text2,len, 'Ἇ|', 'ᾏ');\n\ttext2 = replace(text2,len, 'Ἆ|', 'ᾎ');\n\ttext2 = replace(text2,len, 'Α-', 'Ᾰ');\n\ttext2 = replace(text2,len, 'Α_', 'Ᾱ');\n\n\ttext2 = replace(text2,len, 'B', 'Β');\n\ttext2 = replace(text2,len, 'C', 'Ξ');\n\ttext2 = replace(text2,len, 'D', 'Δ');\n\n\ttext2 = replace(text2,len, 'E', 'Ε');\n\ttext2 = replace(text2,len, 'Ε/', 'Έ');\n\ttext2 = replace(text2,len, 'Ε\\\\', 'Ὲ');\n\ttext2 = replace(text2,len, 'Ε)', 'Ἐ');\n\ttext2 = replace(text2,len, 'Ε(', 'Ἑ');\n\ttext2 = replace(text2,len, 'Ἐ\\\\', 'Ἒ');\n\ttext2 = replace(text2,len, 'Ἐ/', 'Ἔ');\n\ttext2 = replace(text2,len, 'Ἑ\\\\', 'Ἓ');\n\ttext2 = replace(text2,len, 'Ἑ/', 'Ἕ');\n\n\ttext2 = replace(text2,len, 'F', 'Φ');\n\ttext2 = replace(text2,len, 'G', 'Γ');\n\n\ttext2 = replace(text2,len, 'H', 'Η');\n\ttext2 = replace(text2,len, 'Η\\\\', 'Ὴ');\n\ttext2 = replace(text2,len, 'Η/', 'Ή');\n\ttext2 = replace(text2,len, 'Η)', 'Ἠ');\n\ttext2 = replace(text2,len, 'Η(', 'Ἡ');\n\ttext2 = replace(text2,len, 'Η|', 'ῌ');\n\ttext2 = replace(text2,len, 'Ἠ\\\\', 'Ἢ');\n\ttext2 = replace(text2,len, 'Ἠ/', 'Ἤ');\n\ttext2 = replace(text2,len, 'Ἠ=', 'Ἦ');\n\ttext2 = replace(text2,len, 'Ἡ\\\\', 'Ἣ');\n\ttext2 = replace(text2,len, 'Ἡ/', 'Ἥ');\n\ttext2 = replace(text2,len, 'Ἡ=', 'Ἧ');\n\ttext2 = replace(text2,len, 'Ἠ|', 'ᾘ');\n\ttext2 = replace(text2,len, 'Ἡ|', 'ᾙ');\n\ttext2 = replace(text2,len, 'Ἢ|', 'ᾚ');\n\ttext2 = replace(text2,len, 'Ἤ|', 'ᾜ');\n\ttext2 = replace(text2,len, 'Ἦ|', 'ᾞ');\n\ttext2 = replace(text2,len, 'Ἣ|', 'ᾛ');\n\ttext2 = replace(text2,len, 'Ἥ|', 'ᾝ');\n\ttext2 = replace(text2,len, 'Ἧ|', 'ᾟ');\n\n\ttext2 = replace(text2,len, 'I', 'Ι');\n\ttext2 = replace(text2,len, 'Ι\\\\', 'Ὶ');\n\ttext2 = replace(text2,len, 'Ι/', 'Ί');\n\ttext2 = replace(text2,len, 'Ι)', 'Ἰ');\n\ttext2 = replace(text2,len, 'Ι(', 'Ἱ');\n\ttext2 = replace(text2,len, 'Ἰ\\\\', 'Ἲ');\n\ttext2 = replace(text2,len, 'Ἰ/', 'Ἴ');\n\ttext2 = replace(text2,len, 'Ἱ\\\\', 'Ἳ');\n\ttext2 = replace(text2,len, 'Ἱ\\\\', 'Ἵ');\n\ttext2 = replace(text2,len, 'Ἰ=', 'Ἶ');\n\ttext2 = replace(text2,len, 'Ἱ=', 'Ἷ');\n\ttext2 = replace(text2,len, 'Ι-', 'Ῐ');\n\ttext2 = replace(text2,len, 'Ι_', 'Ῑ');\n\ttext2 = replace(text2,len, 'Ι+', 'Ϊ');\n\n\ttext2 = replace(text2,len, 'J', '*');\n\ttext2 = replace(text2,len, 'K', 'Κ');\n\ttext2 = replace(text2,len, 'L', 'Λ');\n\ttext2 = replace(text2,len, 'M', 'Μ');\n\ttext2 = replace(text2,len, 'N', 'Ν');\n\n\ttext2 = replace(text2,len, 'O', 'Ο');\n\ttext2 = replace(text2,len, 'Ο\\\\', 'Ὸ');\n\ttext2 = replace(text2,len, 'Ο/', 'Ό');\n\ttext2 = replace(text2,len, 'Ο(', 'Ὁ');\n\ttext2 = replace(text2,len, 'Ο)', 'Ὀ');\n\ttext2 = replace(text2,len, 'Ὁ\\\\', 'Ὃ');\n\ttext2 = replace(text2,len, 'Ὁ/', 'Ὅ');\n\ttext2 = replace(text2,len, 'Ὀ\\\\', 'Ὂ');\n\ttext2 = replace(text2,len, 'Ὀ/', 'Ὄ');\n\n\ttext2 = replace(text2,len, 'P', 'Π');\n\ttext2 = replace(text2,len, 'Q', 'Θ');\n\n\ttext2 = replace(text2,len, 'R', 'Ρ');\n\ttext2 = replace(text2,len, 'Ρ(', 'Ῥ');\n\n\ttext2 = replace(text2,len, 'S', 'Σ');\n\ttext2 = replace(text2,len, 'T', 'Τ');\n\n\ttext2 = replace(text2,len, 'U', 'Υ');\n\ttext2 = replace(text2,len, 'Υ/', 'Ύ');\n\ttext2 = replace(text2,len, 'Υ\\\\', 'Ὺ');\n\ttext2 = replace(text2,len, 'Υ(', 'Ὑ');\n\ttext2 = replace(text2,len, 'Ὑ\\\\', 'Ὓ');\n\ttext2 = replace(text2,len, 'Ὑ/', 'Ὕ');\n\ttext2 = replace(text2,len, 'Ὑ=', 'Ὗ');\n\ttext2 = replace(text2,len, 'Υ-', 'Ῠ');\n\ttext2 = replace(text2,len, 'Υ_', 'Ῡ');\n\ttext2 = replace(text2,len, 'Υ+', 'ϔ');\n\n\ttext2 = replace(text2,len, 'V', 'Ϝ');\n\n\ttext2 = replace(text2,len, 'W', 'Ω');\n\ttext2 = replace(text2,len, 'Ω\\\\', 'Ὼ');\n\ttext2 = replace(text2,len, 'Ω/', 'Ώ');\n\ttext2 = replace(text2,len, 'Ω)', 'Ὠ');\n\ttext2 = replace(text2,len, 'Ω(', 'Ὡ');\n\ttext2 = replace(text2,len, 'Ω|', 'ῼ');\n\ttext2 = replace(text2,len, 'Ὠ\\\\', 'Ὢ');\n\ttext2 = replace(text2,len, 'Ὠ/', 'Ὤ');\n\ttext2 = replace(text2,len, 'Ὠ=', 'Ὦ');\n\ttext2 = replace(text2,len, 'Ὡ\\\\', 'Ὣ');\n\ttext2 = replace(text2,len, 'Ὡ/', 'Ὥ');\n\ttext2 = replace(text2,len, 'Ὡ=', 'Ὧ');\n\ttext2 = replace(text2,len, 'Ὠ|', 'ᾨ');\n\ttext2 = replace(text2,len, 'Ὡ|', 'ᾩ');\n\ttext2 = replace(text2,len, 'Ὢ|', 'ᾪ');\n\ttext2 = replace(text2,len, 'Ὤ|', 'ᾬ');\n\ttext2 = replace(text2,len, 'Ὦ|', 'ᾮ');\n\ttext2 = replace(text2,len, 'Ὣ|', 'ᾫ');\n\ttext2 = replace(text2,len, 'Ὥ|', 'ᾭ');\n\ttext2 = replace(text2,len, 'Ὧ|', 'ᾯ');\n\n\ttext2 = replace(text2,len, 'X', 'Χ');\n\ttext2 = replace(text2,len, 'Y', 'Ψ');\n\ttext2 = replace(text2,len, 'Z', 'Ζ');\n\n\tdocument.getElementById('signa_description').value = text2;\n\n\tif (navigator.userAgent.indexOf('MSIE') > -1) {\n\t\tdocument.getElementById('signa_description').focus();\n\n\t\tvar range = document.getElementById('signa_description').createTextRange();\n\t\trange.moveStart(\"character\", len);\n\t\trange.collapse(), range.select();\n\t}\n\n\tif (navigator.userAgent.indexOf('Mozilla') > -1) {\n\n\t\tvar obj = document.getElementById('signa_description');\n\n\t\tobj.focus();\n\n\t\tobj.scrollTop = obj.scrollHeight;\n\n\t\tsetCaretToPos(document.getElementById('signa_description'), len);\n\t} else\n\t\tdocument.getElementById('signa_description').value = text2;\n\tstoreCaret(document.getElementById('signa_description'));\n}", "function displayText(recognized) {\n document.querySelector('#mytext').setAttribute('value', recognized);\n}", "function displayContents() {\r\n \r\n var thisFile = fileText;\r\n var txt = \"\";\r\n var wordLen = parseInt(document.getElementById(\"WordLength\").value) + 1;\r\n \r\n var fileLength = thisFile.split(\"\\n\").length;\r\n \r\n if (wordLen > 0){\r\n for (i = Math.round(Math.random() * 100);i < fileLength; i = i + 100){\r\n document.getElementById('wait').innerHTML = i;\r\n console.log(i + \": \" + thisFile.split(\"\\n\")[i]);\r\n txt += (thisFile.split(\"\\n\")[i].length == (wordLen)) ? thisFile.split(\"\\n\")[i] + \"\\n\" : \"\";\r\n }\r\n console.log(txt);\r\n }\r\n else {\r\n txt = thisFile;\r\n }\r\n \r\n var txtLength = txt.split(\"\\n\").length;\r\n var rndWord = Math.round(Math.random() * txtLength);\r\n \r\n var el = document.getElementById('main');\r\n el.innerHTML = rndWord + \" / \" + txt.split(\"\\n\")[rndWord]; //display output in DOM\r\n \r\n \r\n \r\n \r\n }", "function printResult() {\n let container = document.querySelector('p#demo')\n container.innerHTML = ''\n container.innerHTML = alphabetPosition(gatherInput())\n document.querySelector('input#inp').value = ''\n}", "function texttospeech(textinput){\n // make it audioble using text to speech API - SpeechSynthesis\n var msg = new SpeechSynthesisUtterance(textinput);\n //msg.lang = 'en-US';\n msg.lang = select_dialect.value;\n \n window.speechSynthesis.speak(msg);\n msg.onend = function(e) {\n console.log('Finished in ' + event.elapsedTime + ' seconds.');\n };\n\n}", "function startGame(){\n runTyping(\"Immer einmal mehr wie du...\");\n inputTextElement.value ='sag was'; \n}", "function generateEasy(easyWords) {\n temp = \"\"\n $.getJSON(easyWords, function(data) {\n let wordVal = Math.floor(Math.random() * data.length)\n actual = data[wordVal].word.toUpperCase()\n for (let i = 0; i < actual.length; i++) {\n if (actual.substring(i, i + 1) == \" \") {\n temp += \" \"\n } \n else {\n temp += \"_\"\n }\n }\n $(\".easy\").text(temp)\n })\n}", "function makeParagraph(listWord){\r\n\tvar paragraph = \"\";\r\n\tvar rawParagraph = \"\";\r\n\tvar firstIndex = 0;\r\n\tvar lastIndex = 0;\r\n\t\r\n\t//Cat doan transcript thanh 2 doan nho : doan truoc tu va doan sau tu\r\n\t//roi ghep cac doan lai voi 1 input o giua\r\n\tfor (var i = 0; i < listWord.length; i++){\r\n\t\t//Cat lay doan truoc tu\r\n\t\tlastIndex = transcript.indexOf(listWord[i]);\r\n\t\tparagraph += transcript.substring(firstIndex, lastIndex);\r\n\t\t\r\n\t\t//Chen phan tu input\r\n\t\tparagraph += \"<input class=\\\"inputWord\\\" id=\\\"input\" + i +\"\\\" type=\\\"text\\\" style=\\\"width: 100px;\\\" >\";\r\n\t\t\r\n\t\t//Cat lay doan sau tu\r\n\t\tfirstIndex = lastIndex + listWord[i].length;\r\n\t\trawParagraph = transcript.substring(firstIndex);\r\n\t}\r\n\t\r\n\tparagraph += rawParagraph;\r\n\treturn paragraph;\r\n}", "function restartTest() {\ngenerateSentence();\ninput.value = \"\";\nresult.innerHTML = \"\";\ntime.innerHTML = \"\";\nstartTest();\n}", "function textOnly(){\n\tlet currentLetter=inputBox.value;\n\t\n\t//console.log(`temp= ${currentLetter}`);\n\t//console.log(`inputBox= ${inputBox}`);\n\t//console.log(`fullText = ${fullText}`);\n\n\tlet letters = /^[A-Za-z]+$/;\n\t if(currentLetter.match(letters)){\n\t \tfullText.innerText+=(currentLetter);\n }\n else{\n \talert(\"That's not a letter!\");\n }\n //we reset the input to blank\n inputBox.value=\"\";\n}", "update() { \n this.text = this._parent.getRandomWord(); \n\n //csantos: randomize and update font size\n let scale = (window.innerWidth < 1280) ? window.innerWidth / 1280 : 1;\n this.style.fontSize = (16 + Math.random() * (50 - 16)) * scale; //min: 16, max: 50 \n }", "function generate() {\n var skript = $('#skript').val();\n\n var ger_lines = $('#ger').val().split(/\\n/);\n var ger_texts = [];\n for (var i = 0; i < ger_lines.length; i++) {\n if (/\\S/.test(ger_lines[i])) {\n ger_texts.push($.trim(ger_lines[i]));\n }\n }\n\n var eng_uncleaned = $('#eng').val();\n var eng_cleaned = eng_uncleaned.replace(\"Translated with www.DeepL.com/Translator\", \"\");\n var eng_lines = eng_cleaned.split(/\\n/);\n var eng_texts = [];\n for (var i = 0; i < eng_lines.length; i++) {\n if (/\\S/.test(eng_lines[i])) {\n eng_texts.push($.trim(eng_lines[i]));\n }\n }\n\n for (var i = 0; i < eng_lines.length; i++) {\n skript = skript.replace(ger_texts[i], eng_texts[i]);\n }\n\n $(\"#final\").val(skript);\n $(\"#final\").attr(\"disabled\", false);\n $(\"#copy\").attr(\"disabled\", false);\n}", "function generatePassword() {\n\n // define our variables\n var lowercaseArray = [\"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 var uppercaseArray = [\"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 var numberArray = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n var specialArray = [\"~\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"-\", \"+\", \"=\"];\n\n // generate the character array to sample from\n // we do this by adding each array to the sample based on whether the user checked the appropriate box\n var sampleArray = [];\n\n // lowercase\n if ( document.getElementById(\"lowercaseCheck\").checked ) {\n sampleArray = sampleArray.concat(lowercaseArray);\n }\n\n // uppercase\n if ( document.getElementById(\"uppercaseCheck\").checked ) {\n sampleArray = sampleArray.concat(uppercaseArray);\n }\n\n // numbers\n if ( document.getElementById(\"numberCheck\").checked ) {\n sampleArray = sampleArray.concat(numberArray);\n }\n\n // special characters\n if ( document.getElementById(\"specialCheck\").checked ) {\n sampleArray = sampleArray.concat(specialArray);\n }\n\n // once the sampling array is generated, we sample it to assemble the password\n\n // define output variable\n var output = \"\";\n\n // add letters to the output until we hit the slider length\n for (i=0; i < lengthSlider.value; i++) {\n\n // grab a random character from the array, add it to the output\n output = output + sampleArray[Math.floor(Math.random() * sampleArray.length)];\n }\n\n return output;\n}" ]
[ "0.70623183", "0.6948196", "0.63450545", "0.6292337", "0.6242953", "0.62025654", "0.60981464", "0.60863614", "0.6074953", "0.60519534", "0.6038025", "0.6001821", "0.5995276", "0.5979618", "0.59327286", "0.59213054", "0.59094405", "0.588931", "0.5887581", "0.5875359", "0.5874911", "0.5857695", "0.5855709", "0.5850033", "0.5832908", "0.58220685", "0.58022225", "0.57997257", "0.57975084", "0.577874", "0.5778448", "0.5748691", "0.5748244", "0.5736017", "0.57288736", "0.5686485", "0.568605", "0.56595224", "0.5658242", "0.56564504", "0.565442", "0.56542003", "0.5650563", "0.564816", "0.56417644", "0.5629183", "0.5624255", "0.5611246", "0.56071484", "0.5604368", "0.5603639", "0.5596827", "0.55799156", "0.5561517", "0.55595374", "0.555649", "0.5552855", "0.55481553", "0.5546229", "0.553715", "0.5536078", "0.5534237", "0.552337", "0.55226636", "0.5517607", "0.55144495", "0.55106145", "0.5505644", "0.5493153", "0.5486806", "0.5485846", "0.548567", "0.5479637", "0.5478048", "0.54779816", "0.5475833", "0.54734063", "0.546789", "0.5461885", "0.5447422", "0.5443535", "0.5443244", "0.54426664", "0.5436084", "0.5433917", "0.5427009", "0.54265064", "0.5423908", "0.5421022", "0.5420379", "0.5419782", "0.5419119", "0.541282", "0.5412172", "0.5411783", "0.54083925", "0.5407655", "0.5401712", "0.5398255", "0.5395533", "0.5395098" ]
0.0
-1
End test function which computes and shows the result
function endTest() { let originalText = readBox.innerText; let inputText = inputBox.val(); inputBox.val('') readBox.innerHTML = sampleText endTestBtn.prop('hidden', true) restartTestBtn.prop('hidden', false) let origArr = originalText.split(' ') console.log('ok'); let inputArr = inputText.split(' ') let correctWords = 0; for (let i = 0; i < inputArr.length; i++) { if (inputArr[i] == origArr[i]) { correctWords++; } } let finalResult = correctWords + ' words/min' console.log(finalResult); console.log(resultBlock); let exp = '' if (correctWords <= 30) { exp = 'You can do better.' } else if (correctWords <= 60) { exp = 'Well done!' } else if (correctWords <= 90) { exp = 'You have got some fast fingers.' } else { exp = 'Holy Shit! Are your hands okay?' } if (correctWords > maxScore) maxScore = correctWords bestScoreBlock.prop('hidden', false) bestScoreBlock[0].innerText = 'Your Best Score so far : ' + maxScore + ' words/min' modalResultText.innerText = 'Your typing speed is ' + finalResult + '. ' + exp resultModal.modal() console.log('res - ', finalResult); resultBlock.prop('hidden', false) resultBlock[0].innerText = 'Your last score - ' + finalResult }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endTest(msg){\n testResults.endTime = new Date();\n\n if(testResults.isPassed){\n console.log(\"Test Passed\");\n }\n else{\n console.log(\"Test Failed: \" + msg);\n }\n console.log(util.format(\"Summary - total %s, assert: %s, ran: %s, skipped: %s, failed: %s\",\n testResults.totalTests, testResults.totalAssert, testResults.runTests, testResults.skippedTests, testResults.failedTests));\n console.log(util.format(\"Total run time: %s\", testResults.endTime - testResults.startTime));\n if(testCallback) testCallback();\n}", "exitTest(ctx) {\n\t}", "EndOperation() {\n this._message = \"The test operation ended successfully\";\n }", "function quit(retVal)\n{\n\tif ( testEnv.connected )\n\t{\n\t\t// disconnect from the target\n\t\ttestEnv.scriptEnv.traceWrite(\"> Disconnecting from target. \\n\" );\n\t\t\n\t\ttestEnv.debugSession.target.disconnect();\n\t}\n\t\n\tif ( testEnv.debugSession != null )\n\t{\n\t\t// Close debug session.\n\t\ttestEnv.debugSession.terminate();\n\t}\n\t\n\tif ( testEnv.debugSession2 != null )\n\t{\n\t\ttestEnv.debugSession2.target.disconnect();\n\t\ttestEnv.debugSession2.terminate();\n\t}\n\t\n\tif ( testEnv.isDebugServer != null )\n\t{\n\t\t// kill DebugServer\n\t\tdebugServer.stop();\n\t}\n\t\n\t// close the opened files\n\tif ( testEnv.reader != null )\n\t{\n\t\ttestEnv.reader.close();\n\t}\n\t\n\tif ( testEnv.writer != null )\n\t{\n\t\ttestEnv.writer.close();\n\t}\n\n\t// calculate the operation (diff2) and total time (diff)\n\ttestEnv.dEnd = new Date();\n\ttestEnv.scriptEnv.traceWrite(\"<END: \" + testEnv.dEnd.toTimeString() + \">\\n\");\n\n\ttestEnv.diff = (testEnv.dEnd.getTime() - testEnv.dStart.getTime())/1000;\n\t\n\tif ( testEnv.diff2 != 0 ) \n\t{\n\t\ttestEnv.scriptEnv.traceWrite(\"<Operation Time: \" + testEnv.diff2 + \"s>\");\n\t}\n\t\n\ttestEnv.scriptEnv.traceWrite(\"<Total Time: \" + testEnv.diff + \"s>\");\n\tdelete testEnv;\n\n\t// Terminate JVM and return main return value.\n\tjava.lang.System.exit(retVal);\n}", "function finalizeTest(token, ex) {\n //add the result to the reporter\n token.result.iteration !== -1 && testReporter.report('end-iteration', token.result);\n\n //resolve the promise\n token.resolve(ex);\n }", "exitOr_test(ctx) {\n\t}", "function testDone(result) {\n if (result == 'pass') {\n console.log(chalk.yellow(mTestInst.getName()) + \" completed with result: \" + chalk.green(result) + \"\\n\");\n } else {\n console.log(chalk.yellow(mTestInst.getName()) + \" completed with result: \" + chalk.red(result) + \"\\n\");\n }\n\n mCurrTest++;\n if (mCurrTest < testObjects.length) {\n resetApp();\n } else {\n console.log(chalk.green(\"All tests completed!\"));\n reportResults();\n }\n }", "exitAnd_test(ctx) {\n\t}", "function endTest(saved){\n if(saved){\n // time data is written to CSV\n csvTimeWriter.writeRecords(timeSamples).then(() => {\n console.log('Added some time samples');\n });\n }\n else{\n console.log(\"User terminated trial. No data saved.\")\n }\n\n //Both global variables are reset\n timeSamples = [];\n}", "function endTest(saved){\n if(saved){\n // time data is written to CSV\n csvTimeWriter.writeRecords(timeSamples).then(() => {\n console.log('Added some time samples');\n });\n }\n else{\n console.log(\"User terminated trial. No data saved.\")\n }\n\n //Both global variables are reset\n timeSamples = [];\n}", "function suiteDone() {\n _scenariooReporter.default.useCaseEnded(options);\n }", "function doneTests(opt_failed) {\n endTests(!opt_failed);\n}", "function endTest() {\n iterating = false\n // tear down\n for (var i=0; i<numCs; ++i) {\n cachedMgr.removeComponent(compNames[i])\n }\n compNames.length = 0\n for (i=0; i<numEs; ++i) {\n cachedMgr.removeEntity(Es[i])\n }\n Es.length = 0\n while(procs.length) {\n cachedMgr.removeProcessor(procs.pop())\n }\n procs.length = 0\n}", "static unitEnd() {\n\n clearTimeout(timeout);\n clearInterval(interval);\n\n }", "runTestCasesAndFinish()\n {\n function finish() {\n InspectorTest.completeTest();\n }\n\n this.runTestCases()\n .then(finish)\n .catch(finish);\n }", "function finalize() {\r\n if (testCase.finalize_flag) return;\r\n testCase.finalize_flag = true;\r\n testLog.end('Total errors: '.concat(errors));\r\n if (errors > 0) {\r\n testCase.test.emit('test_result', testCase.testName,\r\n 'DONE with errors, see '.concat(logFile));\r\n } else {\r\n testCase.test.emit('test_result', testCase.testName, 'PASSED');\r\n }\r\n }", "function endTest() {\n $('textarea').prop('disabled', true);\n clearInterval(intervalID);\n $('#timer').text('0');\n $('#wpm').text(calcSpeed);\n $('#adjusted-wpm').text(calcAdjustedSpeed);\n }", "sendEndTestResult(success, message) {\n if (this.resolveEndTest === null) {\n throw 'No callback function to return the test result.';\n }\n const result = {\n success: success,\n message: message\n };\n this.resolveEndTest(result);\n this.resolveEndTest = null;\n }", "function end() {\n\tshowResult();\n\toutputData.userFinalValue = userCurrentValue;\n\toutputData.marketFinalValue = marketCurrentValue;\n\toutputData.totalTrades = totalTrades;\n\tfinalData = JSON.stringify(outputData);\n\t$.ajax({\n type:'post',\n url: 'echo.py',\n data: {json: finalData},\n });\n}", "function jasmineDone() {\n _scenariooReporter.default.runEnded(options);\n }", "function runFinish()/* : void*/\n {\n this.asyncTestHelper$oHM3 = null;\n this.tearDown();\n }", "function end_trial() {\n 'use strict';\n\n // gather the data to store for the trial\n let trial_data = {\n end_rt: response.rt,\n end_x: Math.round(x_coords[x_coords.length - 1]),\n end_y: Math.round(y_coords[y_coords.length - 1]),\n x_coords: roundArray(x_coords),\n y_coords: roundArray(y_coords),\n time: time,\n text_bounds: text_bounds,\n };\n\n // remove canvas mouse events\n canvas.removeEventListener('mousemove', mousePosition);\n canvas.removeEventListener('mousedown', mouseResponse);\n\n // clear the display and move on the the next trial\n display_element.innerHTML = '';\n jsPsych.finishTrial(trial_data);\n }", "onTestEnd(test) {\n if (this._results.length === 0) {\n console.warn(\"No test cases were matched. Ensure that your tests are declared correctly and matches TRxxx\");\n return;\n }\n this.qaTouch.publish(this._results);\n }", "waitEndTestResult() {\n return this.endTestPromise;\n }", "function finish(expr) {\n\t n.Expression.assert(expr);\n\t if (ignoreResult) {\n\t self.emit(expr);\n\t } else {\n\t return expr;\n\t }\n\t }", "function finish(expr) {\n\t n.Expression.assert(expr);\n\t if (ignoreResult) {\n\t self.emit(expr);\n\t } else {\n\t return expr;\n\t }\n\t }", "function calculateResults() {\n return;\n}", "function onProcessFinal() {\n chai_1.expect(loopResult, 'LoopResult should contain 10').to.contain(10);\n chai_1.expect(loopResult, 'LoopResult should contain 5').to.contain(5);\n chai_1.expect(loopResult, 'LoopResult should contain 1').to.contain(1);\n done();\n }", "function end_trial() {\n\n\t\t\tjsPsych.pluginAPI.clearAllTimeouts();\n\t\t\t//Kill the keyboard listener if keyboardListener has been defined\n\t\t\tif (typeof keyboardListener !== 'undefined') {\n\t\t\t\tjsPsych.pluginAPI.cancelKeyboardResponse(keyboardListener);\n\t\t\t}\n\n\t\t\t//Place all the data to be saved from this trial in one data object\n\t\t\tvar trial_data = {\n\t\t\t\t\"rt\": response.rt, //The response time\n\t\t\t\t\"key_press\": response.key, //The key that the subject pressed\n\t\t\t\t\"mean\": trial.mean,\n\t\t\t\t\"sd\": trial.sd,\n\t\t\t\t'left_circles': circles_left,\n\t\t\t\t'right_circles': circles_right,\n\t\t\t\t'larger_magnitude': larger_magnitude,\n\t\t\t\t'left_radius': r1,\n\t\t\t\t'right_radius': r2\n\t\t\t}\n\n\t\t\tif (trial_data.key_press == trial.choices[0] && larger_magnitude == 'left'){\n\t\t\t\ttrial_data.correct = true\n\t\t\t}\n\t\t\telse if (trial_data.key_press == trial.choices[1] && larger_magnitude == 'right'){\n\t\t\t\ttrial_data.correct = true\n\t\t\t}\n\t\t\telse if (trial_data.key_press == -1 ){\n\t\t\t\ttrial_data.correct = null\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttrial_data.correct = false\n\t\t\t}\n\n\n\t\t\t//Remove the canvas as the child of the display_element element\n\t\t\tdisplay_element.innerHTML='';\n\n\t\t\t//Restore the settings to JsPsych defaults\n\t\t\tbody.style.margin = originalMargin;\n\t\t\tbody.style.padding = originalPadding;\n\t\t\tbody.style.backgroundColor = originalBackgroundColor\n\t\t\tbody.style.cursor = originalCursorType\n\n\t\t\tjsPsych.finishTrial(trial_data); //End this trial and move on to the next trial\n\n\t\t}", "end() {\n this.log('end');\n }", "function endRound()\n{\n //@TODO: Hier coderen we alles om een ronde te beëindigen\n\n}", "end() {\n //for (let [, arr] of this.arrangements.filter(a => a.at === this.iterations && a.when === \"end\")) arr.exe();\n this.iterations++;\n this.engine.events.emit(`${this.name}-End`, this);\n if (this.engine.jumpingTo) return;\n this.engine.phases.current = this.engine.phases.get(this.next);\n this.engine.timer.reset();\n }", "function testdisplaySubSum() {\n const result = getSubSum(21, 5);\n if(result.value !== 16) {\n console.error('testdisplaySubSum - value - FAIL', result.value);\n } else {\n console.log('testdisplaySubSum - value - SUCCESS', result.value);\n }\n}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n jsPsych.pluginAPI.clearAllTimeouts();\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"stimulus\": trial.stimulus,\r\n \"correct\": trial.correct,\r\n \"choice\": response.choice,\r\n \"accuracy\": response.accuracy,\r\n \"rt\": response.rt,\r\n };\r\n\r\n // clear the display\r\n display_element.innerHTML = '';\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "end() {\n }", "end() {\n }", "exitTestlist(ctx) {\n\t}", "function endTest(saved){\n if(saved){\n settings['testNumber'] += 1;\n let settingsString = JSON.stringify(settings);\n\n //Updating json file containing test number\n fs.writeFile('data_settings.json', settingsString, 'utf8', function(err){\n if (err) throw err;\n console.log('Updated Test Number!');\n testNumber = settings['testNumber'];\n });\n }\n else{\n console.log(\"User terminated trial. No data saved.\")\n }\n\n //Both global variables are reset\n timeSamples = [timeHeaderToWrite];\n fftSamples = fftSamplesHeaders;\n}", "end() { }", "function endTest() {\n //When time is up or the last question is answered\n finalScore = time;\n timerEl.textContent = \"Time: \" + time;\n testEl.textContent = \"Your final score is: \" + finalScore;\n\n var space = document.createElement(\"br\");\n testEl.appendChild(space);\n\n var form = document.createElement(\"form\");\n form.textContent = \"Please enter your initials\";\n testEl.appendChild(form);\n\n var initials = document.createElement(\"input\");\n form.appendChild(initials);\n \n var submit = document.createElement(\"button\");\n submit.textContent = \"Submit\";\n form.appendChild(submit);\n\n feedbackEl.textContent = \"\";\n}", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"stimulus\": trial.stimulus,\n \"rating\": trial.rating,\n \"condition\": trial.condition,\n \"with loading\": trial.cognitive_loading,\n \"rating_rt\": trial.rating_rt,\n \"grid_rt\": trial.grid_rt,\n \"scale type\": trial.scale_type,\n \"correct anser\": trial.correct_answer,\n \"hits\": trial.hits,\n \"misses\": trial.misses,\n \"false alarms\": trial.false_alarms,\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function main() {\n showResult(47);\n showResult(88);\n showResult(34);\n showResult(3);\n showResult(-2);\n showResult(105);\n}", "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n const trial_data = {\n rt: response.rt,\n stimulus: trial.stimulus,\n button_pressed: response.button,\n switched_queries: response.switched_queries,\n confidence: response.confidence,\n choice: response.choice,\n correct: response.choice == trial.correct_query_choice,\n };\n\n // clear the display\n display_element.innerHTML = \"\";\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "exitComparison(ctx) {\n\t}", "static test02() {\n let cal = new Calc();\n cal.receiveInput(2);\n cal.receiveInput(Calc.OP.MINUS);\n cal.receiveInput(7);\n cal.receiveInput(Calc.OP.EQ);\n return cal.getDisplayedNumber() === 2 - 7;\n }", "finish(){\n model.stat.timer.stop();\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\n\t\tdocument.getElementById('nextBtn').disabled=true;\n\t\tdocument.getElementById('autoRunBtn').disabled=true;\n }", "async S91_finalTestResultOutput() {\n\t\t\n\t\t// Prepare the final result msg\n\t\tlet resultMsg = [\n\t\t\t\"----------------------------------------\",\n\t\t\t\">\",\n\t\t\t`> Test result: ${this.finalTestStatus}`,\n\t\t\t\">\"\n\t\t];\n\n\t\t// Get the test time taken (from CLI point of view)\n\t\tlet startTimeMS = this._startTimeMS;\n\t\tlet timeTakenMS = Date.now() - this._startTimeMS;\n\n\t\t// Inject the various URL links\n\t\tif( !this.assumeOnPremise ) {\n\t\t\t// Into the result message\n\t\t\tif( this.testCodeDir == null ) {\n\t\t\t\tresultMsg.push(`> See full results at : ${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`)\n\t\t\t}\n\t\t\tresultMsg.push(`> See result snippet at : ${this.privateSnippetURL}/${this.testID}`)\n\t\t\tresultMsg.push(\">\")\n\n\t\t\t// Or json\n\t\t\tthis.jsonOutputObj.webstudioURL = `${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`;\n\t\t\tthis.jsonOutputObj.snippetURL = `${this.privateSnippetURL}/${this.testID}`;\n\t\t} else {\n\t\t\t\n\t\t\t// This is the on-premise version !!!\n\n\t\t\t// Into the result message\n\t\t\tif( this.testCodeDir == null ) {\n\t\t\t\tresultMsg.push(`> See full results at : ${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`)\n\t\t\t}\n\t\t\tresultMsg.push(\">\")\n\n\t\t\t// Or json\n\t\t\tthis.jsonOutputObj.webstudioURL = `${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`;\n\t\t}\n\n\t\t// Lets add in the CLI debugging information\n\t\tthis.jsonOutputObj._cli = this.jsonOutputObj._cli || {};\n\t\tthis.jsonOutputObj._cli.testTimeTaken_ms = timeTakenMS;\n\t\tthis.jsonOutputObj._cli.firstStepTimeTaken_ms = this._firstStepTimeTakenMS;\n\n\t\t// Handle JSON output\n\t\tOutputHandler.json( this.jsonOutputObj )\n\n\t\t// Output final command status, and exit\n\t\tif( this.finalTestStatus == \"success\" ) {\n\t\t\tOutputHandler.standardGreen( resultMsg.join(\"\\n\") )\n\t\t\tprocess.exit(0)\n\t\t} else {\n\t\t\tOutputHandler.standardRed( resultMsg.join(\"\\n\") )\n\t\t\tprocess.exit(14)\n\t\t}\n\t}", "function afterTest() {\n console.info('Test beendet.');\n if (interval)\n clearInterval(interval);\n impl.clear();\n app.setFrameSize(null);\n app.clearErrors();\n }", "function tEnd(){\n\t\t\treturn tStart(true);\n\t\t}", "function final() { console.log('Done and Final'); process.exit() ; }", "function afterTest()\n{\n\tconsole.log(\"'afterTest' executed\");\n}", "function theEnd() {\n console.log(\"This is the end!\");\n}", "runTestCasesAndFinish()\n {\n this.runTestCases();\n InspectorTest.completeTest();\n }", "exitTestlist_comp(ctx) {\n\t}", "exitArith_expr(ctx) {\n\t}", "teardown (fn) {\n if (this.options.autoend !== false)\n this.autoend(true)\n return Test.prototype.teardown.apply(this, arguments)\n }", "function end_trial() {\n response.rt = performance.now() - start_time;\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(response);\n }", "function teste2(x, y){\n print(`total = ${x + y}`)\n}", "function MainTest()\n//Calculate and check result\n{\n //Opens Calculator\n Start('Microsoft.WindowsCalculator', 0);\n //Connects Excel\n ConnectExcel(GetFilePath())\n //Inputs values\n InputExpression(GetInputValue());\n //Compares Actual and expected result\n CompareActualExpectedResult(GetExpectedValue(), GetDislpayResult());\n //Disconnects Excel\n Excel.Quit();\n //Closes calculator\n Stop('Microsoft.WindowsCalculator');\n}", "function showEnd(){\n console.log(\"End\")\n}", "function endQuiz() {\n //calculate final score\n score = Math.max((timer * 10).toFixed(), 0);\n timer = 0;\n $timer.text(\"Timer: \" + timer.toFixed(1));\n //stop the timer\n clearInterval(interval);\n //write the end message, buttons, and scores\n setEndDOM();\n }", "function printEndResult(\n fileCount,\n timeTaken,\n checkCount,\n sourceLoc,\n destLoc,\n scanCount,\n acceptCount\n) {\n //Calculate the input and output file size\n let sourceFileSize = (fs.statSync(sourceLoc).size / 1024).toFixed(3);\n let destFileSize = (fs.statSync(destLoc).size / 1024).toFixed(3);\n\n console.log(\"\\n\");\n console.log(\"No of files merged = \", fileCount);\n console.log(\"Time taken in seconds = \", timeTaken / 1000);\n console.log(\"Total number of comparisions = \", checkCount);\n console.log(\"Total number of scanned classes = \", scanCount);\n console.log(\"Total number of accepted classes = \", acceptCount);\n console.log(\"Acceptance percentage = \", (acceptCount / scanCount) * 100);\n console.log(\"Input file = \", sourceLoc);\n console.log(\"Output file = \", destLoc);\n console.log(\"Input file size in Kb = \", sourceFileSize);\n console.log(\"Output file size in Kb = \", destFileSize);\n console.log(\"\\n\");\n}", "exitOld_test(ctx) {\n\t}", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": Math.round(performance.now() - trial_onset),\n \"digit_response\": digit_response,\n 'click_history': click_history\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n if (trial.post_trial_duration !== null) {\n jsPsych.pluginAPI.setTimeout(function () {\n jsPsych.finishTrial(trial_data);\n }, trial.post_trial_duration);\n } else {\n jsPsych.finishTrial(trial_data);\n }\n\n }", "function end_success(result) {\n console.log(\"End result: ---> \",result); // \"Stuff worked!\"\n}", "function endGame() {\n resetMainContainer();\n loadTemplate(\"result\", displayResults);\n}", "function showEnd() {\n console.log(\"showEnd ran\");\n getResult();\n $(\"#topright\").hide();\n $(\"#gamecontents\").hide();\n $(\"#end\").show();\n }", "function theEnd() {\n console.log('This is the end!');\n}", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function jscoverage_endLengthyOperation() {\n\tProgressBar.setPercentage(100, 'Done');\n\t// fadeToBackground\n\n\tsetTimeout(function () {\n\t\tjscoverage_inLengthyOperation = false;\n\t\tProgressBar.makeInvisible();\n\t}, 500);\n}", "function done(){\n\tconsole.log(\"Hyperbolic Sine Function Result: \"+sinh);\n\tconsole.log(\"Hyperbolic Cosine Function Result: \"+cosh);\n\tconsole.log(\"Euler's Function Result: \"+exp);\n\tconsole.log(\"Logarithmic Function Result: \"+log);\n\twriterStream.write(\"Hyperbolic Sine Function Result: \"+sinh+\"\\n\",'utf8');\n\twriterStream.write(\"Hyperbolic Cosine Function Result: \"+cosh+\"\\n\",'utf8');\n\twriterStream.write(\"Euler's Function Result: \"+exp+\"\\n\",'utf8');\n\twriterStream.write(\"Logarithmic Function Result: \"+log+\"\\n\",'utf8');\n\tconsole.log(\"Output has been saved to 'functions.txt'\");\n\tconsole.log(\"Function Ceased\");\n\tprocess.exit;\n}", "function done() {\n \tvar storage = config.storage;\n\n \tProcessingQueue.finished = true;\n\n \tvar runtime = now() - config.started;\n \tvar passed = config.stats.all - config.stats.bad;\n\n \temit(\"runEnd\", globalSuite.end(true));\n \trunLoggingCallbacks(\"done\", {\n \t\tpassed: passed,\n \t\tfailed: config.stats.bad,\n \t\ttotal: config.stats.all,\n \t\truntime: runtime\n \t});\n\n \t// Clear own storage items if all tests passed\n \tif (storage && config.stats.bad === 0) {\n \t\tfor (var i = storage.length - 1; i >= 0; i--) {\n \t\t\tvar key = storage.key(i);\n\n \t\t\tif (key.indexOf(\"qunit-test-\") === 0) {\n \t\t\t\tstorage.removeItem(key);\n \t\t\t}\n \t\t}\n \t}\n }", "endTransaction() {\n this.finished = true;\n\n performance.mark(`${this.uuid}-end`);\n performance.measure(\n `${this.uuid}-duration`,\n `${this.uuid}-start`,\n `${this.uuid}-end`\n );\n\n this.duration = (performance.getEntriesByName(\n `${this.uuid}-duration`\n )[0].duration)/100000000000;\n\n performance.clearMarks([`${this.uuid}-start`, `${this.uuid}-end`]);\n performance.clearMeasures(`${this.uuid}-duration`);\n }", "exitCallEnd(ctx) {\n\t}", "exitNot_test(ctx) {\n\t}", "function end(){\n return end;\n}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n jsPsych.pluginAPI.clearAllTimeouts();\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"rt\": response.rt,\r\n \"stimulus\": trial.stimulus,\r\n \"response\": response.response\r\n };\r\n\r\n // clear the display\r\n display_element.innerHTML = '';\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function quit() {\n console.log(\"---End of results. Thank you.---\");\n process.exit(0);\n }", "function unitTests() {\n\n\t// 10 + 23 = 33\n\n\tcalc.init();\n\n\t// 10\n\n\tcalc.num.push(1);\n\tcalc.num.push(0);\n\tconsole.log(\"calc.num\", calc.num);\n\n\t// +\n\n\tcalc.setOperator(\"plus\");\n\tconsole.log(\"calc.operator\", calc.operator);\n\tconsole.log(\"calc.num1\", calc.num1)\n\n\t// 23\n\n\tcalc.num.push(2);\t// num = [2];\n\tcalc.num.push(3);\t// num = [2, 3];\n\tconsole.log(\"calc.num\", calc.num);\n\n\t// =\n\n\tresult = calc.run(); // joinedNum = 23;\n\tconsole.log(\"calc.num2\", calc.num2);\n\tconsole.log(result);\n\n\t// Return true if the actual answer matches expected answer.\n\treturn (result === 33);\n}", "'CallExpression:exit'(node) {\n if ((0, _utils.isExpectCall)(node) && node.parent.type === _experimentalUtils.AST_NODE_TYPES.ExpressionStatement) {\n context.report({\n messageId: 'noAssertions',\n node\n });\n }\n }", "function subtracttest(v1, v2, expected) {\n results.total++;\n var r = calculator.subtraction(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "exitTestlist1(ctx) {\n\t}", "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n let trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"audio_data\": response.audio_data\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function showEnd(){\n console.log('End') //This is the function to print end\n}", "finalReport() {\n console.log(`\n==============================\n`);\n ok(`${this.successCount} passed`);\n if (this.failureCount !== 0) {\n error(`${this.failureCount} failed`);\n }\n console.log('==============================');\n this.erroredTask.forEach((task) => {\n error(`>>> In ${task.taskName}:`);\n if (task.error && task.error.stack) {\n error(task.error.stack);\n }\n });\n }", "function test_output(index, result, open_operator) {\n var numbers = tests[index];\n\n // Apply operation in the open to test\n\n var res = operations[open_operator](numbers[0], numbers[1]);\n res = mod(res, Zp);\n\n // Incorrect result\n if (res !== result) {\n has_failed = true;\n console.log(numbers.join(open_operator) + ' != ' + result);\n }\n}", "end(_endTime) { }", "function finish(bFailed) {\n\t\t\t\toTest.element.firstChild.classList.remove(\"running\");\n\t\t\t\tif (bFailed) {\n\t\t\t\t\toTest.element.firstChild.classList.add(\"failed\");\n\t\t\t\t\toFirstFailedTest = oFirstFailedTest || oTest;\n\t\t\t\t} else if (!mParameters.keepResults) {\n\t\t\t\t\t// remove iframe in order to free memory\n\t\t\t\t\tdocument.body.removeChild(oTest.frame);\n\t\t\t\t\toTest.frame = undefined;\n\t\t\t\t}\n\t\t\t\tif (bVisible && oTest === oSelectedTest) {\n\t\t\t\t\tselect(oTest); // unselect the test to make it invisible\n\t\t\t\t}\n\t\t\t\tiRunningTests -= 1;\n\t\t\t\tnext();\n\t\t\t}", "exitExpr(ctx) {\n\t}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n for (var i = 0; i < setTimeoutHandlers.length; i++) {\r\n clearTimeout(setTimeoutHandlers[i]);\r\n }\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"rt\": response.rt,\r\n \"stimulus\": trial.stimulus,\r\n \"button_pressed\": response.button\r\n };\r\n\r\n // clear the display\r\n display_element.html('');\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function gameEnd(){\n if (answer === \"end\") {\n stopTimer();\n showResetBtn();\n $(\"#timer-box, #question\").hide();\n $(\"#results\").show();\n $(\"#incorrect\").text(incorrect);\n $(\"#unanswered\").text(unanswered);\n index = 0;\n tweet = tweetArray[index].tweet;\n answer = tweetArray[index].answer;\n }\n }", "exitSuite(ctx) {\n\t}", "static test04() {\n let cal = new Calc();\n cal.receiveInput(2);\n cal.receiveInput(Calc.OP.DIV);\n cal.receiveInput(7);\n cal.receiveInput(Calc.OP.EQ);\n return cal.getDisplayedNumber() === 2 / 7;\n }", "endGame(){\n score.addToScore(this.result, 'somejsontoken');\n this.scene.pause();\n const sceneEnd = this.scene.get('end');\n sceneEnd.scene.start();\n //this.scene.add(\"end\", new End(this.result));\n }", "function endTrial() {\n \n // Kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n \n // Remove from bandit styles css (in case the next trial uses standard jspsych.css)\n content.classList.remove(\"bandit-grid-container\")\n \n // Clear the display\n display_element.innerHTML = '';\n \n // End trial and save responses\n jsPsych.finishTrial(responses);\n \n }", "exitAnd_expr(ctx) {\n\t}", "function endSimulation() {\n const endText = document.createElement(\"div\");\n endText.className = \"end-text\";\n endText.innerHTML += `<h2 id=\"title-end\">Simulation is over</h2>\n <p class=\"endPara\"><b>750 people died</b>. This is the number of people who have drowned in the central Mediterranean since the beginning of 2020, if only those who were trying to reach Italy are counted. Since 2014, nearly 20,000 people have died in these conditions, according to the UNHCR, throughout the Mediterranean Sea.\n <br /><br />This is the world's most deadly migration route.<br/ ><br />You should check <a href=\"https://www.sosmediterranee.org/\" target=\"_blank\">SOS MEDITERRANEE's</a> website.<br />#refugeeswelcome\n </p>`;\n mutawasea.appendChild(endText);\n }", "function gen_op_exit_tb()\n{\n gen_opc_ptr.push({func:op_exit_tb});\n}", "end() {\n process.exit();\n }", "function doit() {\n\n console.log(\"doit\");\n\n\n\n answerChecker.oldEvaluate = answerChecker.evaluate;\n\n //stops the code from submitting the answer\n console.log(\"wrap answerChecker\");\n answerChecker.evaluate = function(e, t) {\n result = answerChecker.oldEvaluate(e, t);\n if (result.passed === !0 && result.accurate === !1) {\n result.exception = !0;\n\n logMutations();\n\n }\n return result;\n };\n\n }" ]
[ "0.67453676", "0.633467", "0.62488323", "0.6161651", "0.60711", "0.6026529", "0.6020555", "0.5939121", "0.59347355", "0.59347355", "0.59039617", "0.58978814", "0.5882159", "0.5862182", "0.5859706", "0.5854346", "0.5841279", "0.58271235", "0.58224624", "0.5808726", "0.5800235", "0.578235", "0.5780536", "0.57802373", "0.5779121", "0.5779121", "0.5771739", "0.576068", "0.5756994", "0.5737778", "0.57377136", "0.5736051", "0.5727558", "0.57152337", "0.5706261", "0.5706261", "0.5702813", "0.56761676", "0.5657996", "0.56530285", "0.5651269", "0.5643581", "0.5628641", "0.56206715", "0.5611604", "0.5595696", "0.55843866", "0.55831444", "0.55831164", "0.557423", "0.557271", "0.55710256", "0.5567181", "0.5566929", "0.5563744", "0.5558673", "0.55516446", "0.55514246", "0.55465573", "0.5545346", "0.55449134", "0.5544171", "0.5541355", "0.55222464", "0.55151224", "0.5510708", "0.55101544", "0.55096924", "0.55063677", "0.55063677", "0.55053264", "0.5497749", "0.54821604", "0.54760987", "0.5475514", "0.54660445", "0.54639757", "0.5457228", "0.545548", "0.5423984", "0.5404306", "0.5404107", "0.54007024", "0.5399919", "0.5399599", "0.5399103", "0.53962797", "0.5391622", "0.5390424", "0.53783447", "0.53768903", "0.53668654", "0.53596026", "0.5352623", "0.5335885", "0.5324919", "0.53236514", "0.5316622", "0.53161806", "0.5293667", "0.5289802" ]
0.0
-1
this will be exposed
function Receiver() { this.connected = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "obtain(){}", "transient protected internal function m189() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "private internal function m248() {}", "constructor () {\r\n\t\t\r\n\t}", "transient final protected internal function m174() {}", "function _____SHARED_functions_____(){}", "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 }", "init() {\n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "function priv () {\n\t\t\t\n\t\t}", "transient final private internal function m170() {}", "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 }" ]
[ "0.68482375", "0.6719974", "0.6355039", "0.6346886", "0.633567", "0.6303481", "0.630318", "0.61465776", "0.6069259", "0.6068463", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.604749", "0.5992168", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.5956076", "0.59208393", "0.58848685", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863", "0.58685863" ]
0.0
-1
! Vue.js v2.4.4 (c) 20142017 Evan You Released under the MIT License.
function n(t){return void 0===t||null===t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {\n\n }", "created() {\n this.$nuxt = true\n }", "function vueTest() {\n new Vue({\n \n el: '#vueApp',\n \n data: {\n \"hello\" : \"Spinning Parrot\",\n image: 'img/spinning-parrot.gif'\n }\n \n });\n }", "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}", "mounted() {\n console.log('Mounted!')\n }", "ready() {\n this.vm = new Vue({\n el: 'body',\n components: {\n rootvue: require('./vue'),\n },\n });\n }", "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}", "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 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}", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function hM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"interaction.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "created() { }", "created() { }", "data() {\n return {};\n }", "created() {\n\n }", "created() {\n\n }", "created() {\n\n }", "created() {\n\n }", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "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}", "created(){\n\n }", "created() {\n }", "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}", "mounted(){\n console.log('Mounted');\n }", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "mounted() {\n console.log(this.element); // eslint-disable-line\n }", "mounted() {\n this.initialize()\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 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 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 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 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 p(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "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 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 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 loadVue(){\n\n\tlisteObjBoutons = loadVueObjects();\n\n\tmvButtons = new Vue({\n\t\tel:\"#boutonsMots\",\n\t\tdata:{\n\t\t\tlisteMots:listeObjBoutons,\n\t\t\tsize: MOTS_NUMBER,\n\t\t\tetendu: (MOTS_NUMBER>4),\n\t\t\tdisplay:\"flex\"\n\t\t},\n\t\tmethods:{\n\t\t\ttestAnswer: verification,\n\t\t\treInit: function(){\n\t\t\t\tfor (let i = 0; i < this.listeMots.length; i++) {\n\t\t\t\t\tthis.listeMots[i].tvalue = false;\n\t\t\t\t\tthis.listeMots[i].fvalue = false;\n\t\t\t\t\tthis.listeMots[i].disabled = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\nmvNextButton = new Vue({\n\t\tel:\"#nextButton\",\n\t\tdata:{\n\t\t\tmessage : \"Image suivante\",\n\t\t\tdisplay: \"none\"\n\t\t},\n\t\tmethods:{\n\t\t\tnext: chargementImageMot,\n\t\t\tactive: function () {\n\t\t\t\tthis.display=\"block\";\n\t\t\t}\n\t\t}\n\t});\n}", "created() {\r\n\r\n\t}", "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 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}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __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}", "data() {\n return {\n saludocomponent: \"hola desde vue\"\n };\n }", "function initVue() {\n\n new Vue({\n\n el: \"#containerId\",\n data: {\n \"h1title\": 0,\n \"url\": \"img/scotland.jpeg\"\n }, // END OF DATA\n\n methods: {\n increase: function() {\n this.h1title++;\n }, // END OF INCREASE\n\n decrease: function() {\n this.h1title--;\n } // END OF DECREASE\n\n } // END OF METHODS\n }); // END OF VUE\n\n} // END OF FUNCTION initVue", "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 annulerAffichage(){\r\n var app = new Vue({\r\n el: '#meteo',\r\n data: {\r\n message:'ATTENTION : probleme de geolocalisation veuillez l\\'activer dans votre navigateur'\r\n }\r\n })\r\n}", "mounted() {\n this.local()\n }", "ready() {\n let logCtrl = this.$logTextArea;\n let logListScrollToBottom = function () {\n setTimeout(function () {\n logCtrl.scrollTop = logCtrl.scrollHeight;\n }, 10);\n };\n\n\n window.plugin = new window.Vue({\n el: this.shadowRoot,\n created() {\n },\n init() {\n },\n data: {\n logView: \"\",\n findResName: \"\",\n },\n methods: {\n _addLog(str) {\n let time = new Date();\n // this.logView = \"[\" + time.toLocaleString() + \"]: \" + str + \"\\n\" + this.logView;\n this.logView += \"[\" + time.toLocaleString() + \"]: \" + str + \"\\n\";\n logListScrollToBottom();\n },\n onBtnClickFindReferenceRes() {\n console.log(\"1\");\n },\n onResNameChanged() {\n console.log(\"2\");\n },\n dropFile(event) {\n event.preventDefault();\n let files = event.dataTransfer.files;\n if (files.length > 0) {\n let file = files[0].path;\n console.log(file);\n } else {\n console.log(\"no file\");\n }\n },\n drag(event) {\n event.preventDefault();\n event.stopPropagation();\n // console.log(\"dragOver\");\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=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Vue(options) {\n var oberver = new Observer(options.data)\n var render = compile(options.el, oberver)\n render()\n}", "function wl(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "mounted() {\n\t\tvar h = document.createElement('DIV');\n\t\th.innerHTML = `<div>this is create append child</div>`;\n\t\tdocument.body.appendChild(h);\n\t\tconsole.log('this is log vue mounted function ', this.$el, this , this.el);\n\t}", "registerVmProperty() {\n const { vmProperty, modules } = this.options;\n this.Vue.prototype[vmProperty] = modules;\n }", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function WD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function a(e,t){'undefined'!=typeof console&&(console.warn('[vue-i18n] '+e),t&&console.warn(t.stack))}", "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "data() {\n return {\n saludo: '¡Hola! Soy Desiré, te saludo desde un componente'\n }\n }", "function la(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "function i(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "mounted() {\n store.commit('updateHash');\n }", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function q(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function Ht(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "registerVmProperty() {\n const { vmProperty, modules } = this.options;\n this.registerError(modules);\n this.Vue.prototype[vmProperty] = modules;\n }", "function bn(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "install(vue) {\n \n vue.prototype.$renderer = this;\n vue.prototype.$engine = this.engine;\n \n vue.prototype.$start = this.start.bind(this);\n vue.prototype.$stop = this.stop.bind(this);\n vue.prototype.$pipe = this.pipe.bind(this);\n vue.prototype.$unpipe = this.unpipe.bind(this);\n }", "ready() {\n this.vue = createVUE(this[\"$mainDiv\"]);\n Editor.log(\"ConvertHelper view ready\");\n }", "function vt(e,t){if(!e){throw new Error(\"[vue-router] \"+t)}}", "function ex(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 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}", "created () {\n this.classNames = this.getDefaultClassName(this.$options.name)\n }", "function e(t,n){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),n&&console.warn(n.stack))}", "function n(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}" ]
[ "0.6955927", "0.69108975", "0.6887381", "0.65383613", "0.650012", "0.6396106", "0.6396106", "0.6331549", "0.63254786", "0.63225925", "0.62985206", "0.6267245", "0.621706", "0.62166697", "0.621261", "0.61991906", "0.61987096", "0.61951864", "0.61951864", "0.6186692", "0.6175867", "0.6175867", "0.6175867", "0.6175867", "0.6153509", "0.61142755", "0.6085259", "0.60638314", "0.6053543", "0.6051117", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6045397", "0.6037181", "0.603515", "0.60246366", "0.5936276", "0.59216255", "0.5921277", "0.59166807", "0.5895565", "0.58911973", "0.5878357", "0.58634853", "0.5861428", "0.5848892", "0.5827824", "0.58239746", "0.5815674", "0.5801909", "0.57822406", "0.5779841", "0.57318103", "0.5730158", "0.5727379", "0.57222", "0.57194495", "0.5703685", "0.5695486", "0.56820476", "0.5679897", "0.5677342", "0.56701446", "0.5646581", "0.5631141", "0.56262326", "0.56262326", "0.56262326", "0.56262326", "0.5626076", "0.5620318", "0.56128854", "0.56101286", "0.55992025", "0.55992025", "0.5588793", "0.55835384", "0.55802196", "0.55732864", "0.557219", "0.55717784", "0.5571108", "0.5570057", "0.55610687", "0.55610687", "0.5552213", "0.55426556", "0.5541736", "0.5518218", "0.55130684", "0.54977244", "0.5495219", "0.5493989" ]
0.0
-1
Why you have asnc in componentWillMount?
async componentWillMount() { const dataProvider = dexieDataProxiver; this.setState({ dataProvider }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componenetDidMount() { }", "componenetWillMount() { }", "componentWillMount(){}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount() {}", "componentWillMount(){\n console.log(\">>>>in componentWillMount<<<<<\")\n }", "componentWillMount() {\n\t}", "componentWillMount() {\n this._doLoad();\n }", "componentWillMount() {\n \n }", "componentWillMount() { \n\n\t}", "componentWillMount(){\n console.log('nao ta montado');\n }", "UNSAFE_componentWillMount(){\n console.log('component will mount...');\n }", "componentWillMount() {\n // console.log(\"=========================> componentWillMount\");\n }", "componentWillMount() {\n if (this.props.isRehydrated) {\n this.props.init();\n }\n }", "componentWillMount(){\n console.log(\"In componentWillMount!!!\");\n }", "componentWillMount(){\n\t\tconsole.log(\"[Person.js] Inside componentWillMount \");\n\t}", "componentWillMount() {\n \n }", "UNSAFE_componentWillMount() {\n this._fetchData(false);\n }", "componentWillMount(){\n\n }", "componentWillMount(){\n\n }", "componentWillMount(){\n }", "componentWillMount() {\n }", "componentWillMount() {\n }", "componentWillMount() {\n \n \n }", "componentWillMount() {\n console.log('Before mount...');\n }", "UNSAFE_componentWillMount(){\n console.log(2)\n }", "componentWillMount() {\n //\n }", "componentWillMount() {\n //\n }", "componentWillMount() {\n console.log('[Person.js] Inside componentWillMount()');\n }", "componentWillMount(){\n console.log(\"ComponentWillMount Execution\");\n }", "componentWillMount() {\n }", "componentWillMount() {\n console.log('before initData call');\n this.initData(); \n\t}", "componentWillMount() {\n\n }", "componentWillMount() {\n\n }", "componentWillMount(){\n console.log(\"I am in Component Will Mount\");\n console.log(\"------------------------------------------\");\n }", "componentWillMount() {\n this.load();\n }", "componentWillMount() {\n console.log('Component WILL MOUNT!')\n }", "componentDidMount() {\n\t\tthis._loadInitialState().done();\n\t}", "function componentDidMount ()\n {\n\n }", "componentWillMount(){\n\t\tthis.fetchData('a');\n\t}", "UNSAFE_componentWillMount() {\n console.log(\"[Person.js] Inside componentWillMount\", this.props);\n }", "componentWillMount(){\n this.load();\n }", "componentWillMount() {\n\t\tconsole.log(\"componentWillMount\");\n\t\t\n\t\t//DEBUGGER: sirve para ver en el navegador, paso a paso lo que va sucediendo. (Pausa la carga, y tiene un botn PLAY para seguir)\n\t\t//debugger\n\n\n\t}", "componentWillMount() {\n console.log(\"Component will mount\");\n }", "componentDidMount() {\n this.props.onMount();\n }", "componentWillMount(){\n console.log('Component Will Mount')\n //fetch call\n //axios call\n //database call\n }", "componentWillMount() {\n console.log(\"Component will mount\");\n }", "componentWillMount() {\n //connect(props) do not get fetched properly before componenDIDmount. moved it there instead\n }", "componentWillMount() {\n //connect(props) do not get fetched properly before componenDIDmount. moved it there instead\n }", "componentWillMount() { //First method in the lifecycle hook that gets update.\n console.log(\"Component will mount\"); //if you cann setState in here then new render will take it into account. \n }", "componentWillMount() {\n this.addEvents();\n this.startConn();\n this.loadMap();\n }", "componentWillMount() {\n this.loadDatas();\n }", "componentWillMount() {\n this.getData();\n\t }", "didMount() {\n }", "UNSAFE_componentWillMount() {\n this.doFetching(this.props);\n }", "componentDidMount() {\n\t\tthis.init();\n\t}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentDidMount() {}", "componentWillMount() {\n console.info(\"componentWillMount()\");\n }", "componentWillMount() {\n let {title, datasourceUrl, path, xAxis, yAxis, aggregate, summary} = this.props.properties;\n this.initialize(title, datasourceUrl, path, xAxis, yAxis, aggregate, summary, function(){});\n }", "componentWillMount() {\n\t\tconsole.log('Function called: %s', 'componentWillMount');\n\t}", "componentDidMount(){\n console.log('Life Cycle A - componentDidMount');\n }", "componentDidMount() {\n if (this.props.loadOnMount) this.load()\n }", "componentWillMount(){\nconsole.log(\"componentWillMount\");\n}", "componentDidMount() {\n this.componentLoaded = true;\n }", "componentDidMount() {\n\n console.log(\"componentDidMount()\");\n\n window.readyForStuff = this.readyForStuff.bind(this);\n\n }", "function componentWillMount() {\n\t // Call this.constructor.gDSFP to support sub-classes.\n\t var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\t if (state !== null && state !== undefined) {\n\t this.setState(state);\n\t }\n\t}", "function componentWillMount() {\n\t // Call this.constructor.gDSFP to support sub-classes.\n\t var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\t if (state !== null && state !== undefined) {\n\t this.setState(state);\n\t }\n\t}", "function componentWillMount() {\n\t // Call this.constructor.gDSFP to support sub-classes.\n\t var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\t if (state !== null && state !== undefined) {\n\t this.setState(state);\n\t }\n\t}", "componentDidMount() {\n\t}", "componentDidMount() {\n\t}", "componentDidMount() {\n\t}", "componentDidMount() {\n if (!this.props.dispatch || this.state.hasInitBeenCalled) {\n this.initDataSource();\n } else {\n this.setState({isMounted: true});\n }\n }", "componentDidMount() {\n if (super.componentDidMount) super.componentDidMount();\n\n this.checkForStateChange(undefined, this.state);\n }", "componentWillMount(){\n\t\tconsole.log(\"The component will mount\");\n\t}", "componentWillMount() {\n\t\tthis.initSocket();\n\t}", "componentWillMount() {\n this.props.loadEntitiesIfNeeded();\n }", "componentDidMount() {\n\t\tthis.props.onLoad();\n\t}", "componentWillMount() {\n alert('AND NOW, FOR THE FIRST TIME EVER... FLASHY!!!!');\n }", "componentWillMount(){\n console.log(\"Before created\")\n \n }", "componentWillMount() {\n\t\tthis.checkExistence();\n\t\tthis.props.bringAuthors();\n\t\tthis.props.bringCourses();\n\t}", "componentDidMount(){\n \n }", "componentWillMount() {\n console.log('Component WILL MOUNT!', this.props);\n }", "componentWillMount() {\r\n this.fetchAlbumlists();\r\n }" ]
[ "0.80048066", "0.792289", "0.79153866", "0.7905511", "0.7905511", "0.7905511", "0.7905511", "0.7905511", "0.78670293", "0.7782888", "0.775963", "0.7722679", "0.77102256", "0.7655773", "0.76448786", "0.7594889", "0.75682914", "0.75662875", "0.7547183", "0.75446403", "0.7544119", "0.75334483", "0.75334483", "0.75278556", "0.75257117", "0.75257117", "0.7521217", "0.74983436", "0.7493002", "0.74896556", "0.74896556", "0.7487626", "0.7467199", "0.7465178", "0.7456465", "0.744657", "0.744657", "0.7443294", "0.74393815", "0.7432484", "0.74176073", "0.7404036", "0.7379942", "0.7378828", "0.7375422", "0.7372571", "0.7354408", "0.73452216", "0.73417085", "0.7340234", "0.73296255", "0.73296255", "0.73269707", "0.73222005", "0.7318212", "0.7310083", "0.7302744", "0.7298337", "0.7293079", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7286987", "0.7281744", "0.72608244", "0.72572297", "0.72551394", "0.7241107", "0.7239281", "0.7229165", "0.72216165", "0.7211999", "0.7211999", "0.7211999", "0.72119987", "0.72119987", "0.72119987", "0.720693", "0.7202104", "0.7197112", "0.71924573", "0.7174371", "0.7172634", "0.7153605", "0.71528125", "0.7151627", "0.71466553", "0.71402997", "0.7137443" ]
0.0
-1
const TaskManager = lazy(() => import('./containers/TaskManager/TaskManager'))
function App(props) { const { onAutoLogin } = props useEffect(() => { onAutoLogin() }, [onAutoLogin]) return ( <div className="App"> <BrowserRouter> <Suspense fallback={Spinner}> <Layout isAuth={props.isAuth} logout={props.onLogout}> <Switch> <Route path='/auth' component={Auth} /> <Route path='/supermarket' component={ShoppingCartManager} /> {/* <Route path='/tasks' component={TaskManager} /> */} <Redirect from='/' to='/auth' /> </Switch> </Layout> </Suspense> </BrowserRouter> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyWithPreload(importFunction) {\n const Component = lazy(importFunction)\n Component.preload = importFunction\n return Component\n}", "getComponent (nextState, cb) {\n /* Webpack - use 'System.import' to create a split point\n and embed an async module loader (jsonp) when bundling */\n Promise.all([\n import(/* webpackChunkName: \"thunk_demo\" */ './containers')\n ]).then(([Containers]) => {\n const modules = require('./modules')\n const reducer = modules.default\n injectReducer(store, { key: 'thunk_demo', reducer })\n /* Return getComponent */\n cb(null, Containers.default)\n })\n }", "function loadTask ( taskName ) {\n\n if( !config.gulp.lazy ) return log.error( {\n message: 'Trying to lazy load a task, but gulp is not set in lazy mode?!',\n sender: 'gulpDecorator'\n } );\n\n if( _loadedTasks[ taskName ] === undefined ) {\n\n\t\tvar taskPath = path.normalize( '../../../tasks/' + taskName );\n\n try {\n\n if( config.gulp.debug )log.debug( {\n sender: 'gulpDecorator',\n message: 'lazy loading:\\t\\'' + log.colors.cyan( taskName ) + '\\' ( ' + taskPath + ' )'\n } );\n\n _loadedTasks[ taskName ] = require( taskPath );\n\n\n } catch ( error ) {\n\n _loadedTasks[ taskName ] = false;\n \n // Some tasks won't be able to load if they are not in a separate file.\n // So if it fails it is not necessarily an error.\n if( config.gulp.debug )\n log.warn( {\n sender: 'gulpDecorator',\n message: 'warning: Failed to lazy load task: ' + taskPath + '.js',\n data: error\n } );\n\n }\n\n }\n}", "static load() {\n\t\t\treturn loader().then(ResolvedComponent => {\n\t\t\t\tComponent = ResolvedComponent.default || ResolvedComponent\n\t\t\t})\n\t\t}", "async loadLazy () {\n /**\n if(this.load && !this.loadComplete) {\n import('./lazy-element.js').then((LazyElement) => {\n this.loadComplete = true;\n console.log(\"LazyElement loaded\");\n }).catch((reason) => {\n console.log(\"LazyElement failed to load\", reason);\n });\n }\n */\n }", "load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }", "lateLoad() {\n\n }", "static LoadFromFileAsync() {}", "static getLoader() {\n return tpmModuleLoader;\n }", "function getLoader() {\n return mock.reRequire('../../lib/loader');\n}", "function asyncLoadAdminProvider (nextState, cb): Component {\n require.ensure([], () => {\n const AdminProvider = require('./providers/admin')\n cb(null, AdminProvider)\n })\n}", "lazy(middlewareFactory) {\n return this.use(async (ctx, next) => {\n const middleware = await middlewareFactory(ctx);\n const arr = toArray(middleware);\n await flatten(new Composer(...arr))(ctx, next);\n });\n }", "preloadFutureComponents(){\n try{\n switch(window.location.pathname){\n case '/':\n AsyncLogin.preload();\n AsyncSettings.preload();\n break;\n case '/login':\n AsyncResetPassword.preload();\n AsyncSignup.preload();\n break;\n case '/signup':\n AsyncLogin.preload();\n break;\n case '/settings':\n AsyncChangeEmail.preload();\n AsyncChangePassword.preload();\n break;\n default:\n break;\n }\n }catch(e){\n console.error(e);\n }\n }", "static LoadFromMemoryAsync() {}", "async load () {}", "async _instantiate() {\n const jobsInGraph = new SafeSet();\n\n const addJobsToDependencyGraph = async (moduleJob) => {\n if (jobsInGraph.has(moduleJob)) {\n return;\n }\n jobsInGraph.add(moduleJob);\n const dependencyJobs = await moduleJob.linked;\n return Promise.all(dependencyJobs.map(addJobsToDependencyGraph));\n };\n try {\n await addJobsToDependencyGraph(this);\n } catch (e) {\n if (!this.hadError) {\n this.error = e;\n this.hadError = true;\n }\n throw e;\n }\n try {\n if (this.inspectBrk) {\n const initWrapper = process.binding('inspector').callAndPauseOnStart;\n initWrapper(this.module.instantiate, this.module);\n } else {\n this.module.instantiate();\n }\n } catch (e) {\n decorateErrorStack(e);\n throw e;\n }\n for (const dependencyJob of jobsInGraph) {\n // Calling `this.module.instantiate()` instantiates not only the\n // ModuleWrap in this module, but all modules in the graph.\n dependencyJob.instantiated = resolvedPromise;\n }\n return this.module;\n }", "getComponent(nextState, cb) {\n /* Webpack - use 'require.ensure' to create a split point\n and embed an async module loader (jsonp) when bundling */\n require.ensure(\n [],\n require => {\n /* Webpack - use require callback to define\n dependencies for bundling */\n const EvaluateList = require('./components/EvaluateList').default\n const EvaluateListTitle = require('./title/EvaluateListTitle').default\n\n cb(null, {\n title: EvaluateListTitle,\n content: EvaluateList\n })\n\n /* Webpack named bundle */\n },\n 'EvalutateList'\n )\n }", "static loadComponent() {\n return Component;\n }", "function asAsync(options) {\n var Async = /** @class */ (function (_super) {\n (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(Async, _super);\n function Async() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n Component: _syncModuleCache ? _syncModuleCache.get(options.load) : undefined,\n };\n return _this;\n }\n Async.prototype.render = function () {\n // Typescript issue: the rest can't be pulled without the any cast, as TypeScript fails with rest on generics.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var _a = this.props, forwardedRef = _a.forwardedRef, Placeholder = _a.asyncPlaceholder, rest = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__rest)(_a, [\"forwardedRef\", \"asyncPlaceholder\"]);\n var Component = this.state.Component;\n return Component ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, rest), { ref: forwardedRef }))) : Placeholder ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement(Placeholder, null)) : null;\n };\n Async.prototype.componentDidMount = function () {\n var _this = this;\n var Component = this.state.Component;\n if (!Component) {\n options\n .load()\n .then(function (LoadedComponent) {\n if (LoadedComponent) {\n // Cache component for future reference.\n _syncModuleCache && _syncModuleCache.set(options.load, LoadedComponent);\n // Set state.\n _this.setState({\n Component: LoadedComponent,\n }, options.onLoad);\n }\n })\n .catch(options.onError);\n }\n };\n return Async;\n }(react__WEBPACK_IMPORTED_MODULE_0__.Component));\n return react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Async, (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, props, { forwardedRef: ref })); });\n}", "loadDependencies(){\n\n }", "function getComponent() {\n // 异步模块\n return import( /* webpackChunkName:\"test\" */ './test.js').then(({ default: _ }) => {\n var element = document.createElement('div');\n element.innerHTML = _.join(['Dell', 'Lee'], '-');\n return element;\n })\n}", "constructor() {\r\n let useCalled = false;\r\n\r\n this.run = async (...args) => {\r\n if (useCalled) {\r\n const next = args.pop();\r\n\r\n next();\r\n }\r\n return args;\r\n };\r\n\r\n addProp(this, 'use',\r\n /**\r\n * Agrega un middleware al workflow\r\n * @param {Function} fn - función middleware a agregar\r\n *\r\n * @return {this} - Retorna la actual instancia\r\n */\r\n (fn) => {\r\n useCalled = true;\r\n\r\n this.run = ((stack) => (async (...args) => {\r\n const next = args.pop();\r\n\r\n return stack.call(this, ...args, async () => fn.call(this, ...args, next.bind(this, ...args)));\r\n }).bind(this))(this.run);\r\n\r\n return this;\r\n }\r\n );\r\n }", "componentDidMount() {\n this.loadTasks();\n }", "function Loader(manager) {\n if (!manager) {\n throw new TypeError(\"Must provide a manager\");\n }\n\n this.manager = manager;\n this.context = manager.context || {};\n\n if (!this.context.loaded) {\n this.context.loaded = {};\n }\n }", "_load() {\n\n // if already loaded, do nothing\n if (this._loaded) {\n return;\n }\n\n // attempt to load\n this._lazyload();\n\n }", "function asAsync(options) {\n var Async = /** @class */ (function (_super) {\n tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"](Async, _super);\n function Async() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n Component: _syncModuleCache ? _syncModuleCache.get(options.load) : undefined\n };\n return _this;\n }\n Async.prototype.render = function () {\n // Typescript issue: the rest can't be pulled without the any cast, as TypeScript fails with rest on generics.\n // tslint:disable-next-line:no-any\n var _a = this.props, forwardedRef = _a.forwardedRef, Placeholder = _a.asyncPlaceholder, rest = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"](_a, [\"forwardedRef\", \"asyncPlaceholder\"]);\n var Component = this.state.Component;\n return Component ? react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](Component, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({ ref: forwardedRef }, rest)) : Placeholder ? react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](Placeholder, null) : null;\n };\n Async.prototype.componentDidMount = function () {\n var _this = this;\n var Component = this.state.Component;\n if (!Component) {\n options\n .load()\n .then(function (LoadedComponent) {\n if (LoadedComponent) {\n // Cache component for future reference.\n _syncModuleCache && _syncModuleCache.set(options.load, LoadedComponent);\n // Set state.\n _this.setState({\n Component: LoadedComponent\n }, options.onLoad);\n }\n })\n .catch(options.onError);\n }\n };\n return Async;\n }(react__WEBPACK_IMPORTED_MODULE_1__[\"Component\"]));\n return react__WEBPACK_IMPORTED_MODULE_1__[\"forwardRef\"](function (props, ref) { return (react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](Async, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, props, { forwardedRef: ref }))); });\n}", "async getModuleJob(specifier, parentURL = this.base) {\n const { url, format } = await this.resolve(specifier, parentURL);\n let job = this.moduleMap.get(url);\n if (job === undefined) {\n let loaderInstance;\n if (format === 'dynamic') {\n const { dynamicInstantiate } = this;\n if (typeof dynamicInstantiate !== 'function') {\n throw new errors.Error('ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK');\n }\n\n loaderInstance = async (url) => {\n const { exports, execute } = await dynamicInstantiate(url);\n return createDynamicModule(exports, url, (reflect) => {\n debug(`Loading custom loader ${url}`);\n execute(reflect.exports);\n });\n };\n } else {\n loaderInstance = ModuleRequest.loaders.get(format);\n }\n job = new ModuleJob(this, url, loaderInstance);\n this.moduleMap.set(url, job);\n }\n return job;\n }", "async componentDidMount() {\n }", "function IntegrationWaiter() {\n\treturn <Loader />;\n}", "function asAsync(options) {\r\n var Async = /** @class */ (function (_super) {\r\n tslib_es6[\"c\" /* __extends */](Async, _super);\r\n function Async() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.state = {\r\n Component: _syncModuleCache ? _syncModuleCache.get(options.load) : undefined\r\n };\r\n return _this;\r\n }\r\n Async.prototype.render = function () {\r\n // Typescript issue: the rest can't be pulled without the any cast, as TypeScript fails with rest on generics.\r\n // tslint:disable-next-line:no-any\r\n var _a = this.props, forwardedRef = _a.forwardedRef, Placeholder = _a.asyncPlaceholder, rest = tslib_es6[\"d\" /* __rest */](_a, [\"forwardedRef\", \"asyncPlaceholder\"]);\r\n var Component = this.state.Component;\r\n return Component ? FakeReact[\"createElement\"](Component, tslib_es6[\"a\" /* __assign */]({ ref: forwardedRef }, rest)) : Placeholder ? FakeReact[\"createElement\"](Placeholder, null) : null;\r\n };\r\n Async.prototype.componentDidMount = function () {\r\n var _this = this;\r\n var Component = this.state.Component;\r\n if (!Component) {\r\n options\r\n .load()\r\n .then(function (LoadedComponent) {\r\n if (LoadedComponent) {\r\n // Cache component for future reference.\r\n _syncModuleCache && _syncModuleCache.set(options.load, LoadedComponent);\r\n // Set state.\r\n _this.setState({\r\n Component: LoadedComponent\r\n }, options.onLoad);\r\n }\r\n })\r\n .catch(options.onError);\r\n }\r\n };\r\n return Async;\r\n }(FakeReact[\"Component\"]));\r\n return FakeReact[\"forwardRef\"](function (props, ref) { return (FakeReact[\"createElement\"](Async, tslib_es6[\"a\" /* __assign */]({}, props, { forwardedRef: ref }))); });\r\n}", "function asAsync(options) {\r\n var Async = /** @class */ (function (_super) {\r\n tslib_es6[\"c\" /* __extends */](Async, _super);\r\n function Async() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.state = {\r\n Component: _syncModuleCache ? _syncModuleCache.get(options.load) : undefined\r\n };\r\n return _this;\r\n }\r\n Async.prototype.render = function () {\r\n // Typescript issue: the rest can't be pulled without the any cast, as TypeScript fails with rest on generics.\r\n // tslint:disable-next-line:no-any\r\n var _a = this.props, forwardedRef = _a.forwardedRef, Placeholder = _a.asyncPlaceholder, rest = tslib_es6[\"d\" /* __rest */](_a, [\"forwardedRef\", \"asyncPlaceholder\"]);\r\n var Component = this.state.Component;\r\n return Component ? FakeReact[\"createElement\"](Component, tslib_es6[\"a\" /* __assign */]({ ref: forwardedRef }, rest)) : Placeholder ? FakeReact[\"createElement\"](Placeholder, null) : null;\r\n };\r\n Async.prototype.componentDidMount = function () {\r\n var _this = this;\r\n var Component = this.state.Component;\r\n if (!Component) {\r\n options\r\n .load()\r\n .then(function (LoadedComponent) {\r\n if (LoadedComponent) {\r\n // Cache component for future reference.\r\n _syncModuleCache && _syncModuleCache.set(options.load, LoadedComponent);\r\n // Set state.\r\n _this.setState({\r\n Component: LoadedComponent\r\n }, options.onLoad);\r\n }\r\n })\r\n .catch(options.onError);\r\n }\r\n };\r\n return Async;\r\n }(FakeReact[\"Component\"]));\r\n return FakeReact[\"forwardRef\"](function (props, ref) { return (FakeReact[\"createElement\"](Async, tslib_es6[\"a\" /* __assign */]({}, props, { forwardedRef: ref }))); });\r\n}", "componentDidMount() {\n this.props.fetchTasks();\n }", "import() {\n }", "load(module, { cache, requireCache } = {}) {\n const {\n cached,\n isCustom,\n setUseCache\n } = this\n\n // If the user disables the commonjs' cache\n // we reove that module from the cache array\n //\n // NOTE: The interal cache is still enabled\n if(!requireCache) {\n const _path = window.require.resolve(module)\n delete window.require.cache[_path]\n }\n\n // `__cache` is the value of cache before changing\n // it for this particular request\n const __cache = this.cache\n\n // Set the cache JUST FOR THIS REQUEST\n // Resetting in before resolving/rejecting\n if(typeof cache == 'boolean') setUseCache(cache)\n\n return new Promise((resolve, reject) => {\n try {\n\n // Load the module with\n // the native require function\n const _module = window.require(module)\n\n // If the user enable the cache,\n // Store the `_module` value inside of\n // our cache, and it will be avaible\n // for future use\n //\n // IMPORTANT:\n // We only cache the module if\n // it's not a custom one!!\n if(cache && !isCustom(module))\n // Then let's cache it\n cached[module] = _module\n\n // Reverting the cache value\n // back to the original one\n setUseCache(__cache)\n\n // If veverything went OK\n // let's resolve the promise\n resolve(_module)\n } catch (err) {\n // Reverting the cache value\n // back to the original one\n setUseCache(__cache)\n\n // Reject with the error\n reject(err)\n }\n })\n }", "async function bundleLazyModule(filePath) {\n\tconst result = await esbuild.build({\n\t\tentryPoints: [filePath],\n\t\tbundle: true,\n\t\tformat: \"cjs\",\n\t\twrite: false,\n\t\tabsWorkingDir: workerPath,\n\t\tdefine: {\n\t\t\tglobal: \"globalThis\",\n\t\t},\n\t\tplugins: [NodeModulesPolyfillPlugin()],\n\t});\n\n\tlet content = result.outputFiles[0].text;\n\n\t// Export the fetch handler (grabbing it from the global).\n\tcontent = \"const exports = {};\\n\" + content + \"\\nexport default exports\";\n\n\tawait fs.writeFile(path.resolve(workerPath, filePath), content);\n}", "function loadFoo() {\n // 这是懒加载 foo,原始的加载仅仅用来做类型注解\n var _foo = require('foo');\n // 现在,你可以使用 `_foo` 替代 `foo` 来作为一个变量使用\n}", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "componentDidMount() {\n if (this.props.loadOnMount) this.load()\n }", "function loader (opts) {\n return function loaderMiddleware (ctx, next) {\n ctx.assert(ctx.session, 500, 'A session is required to use @rill/load.')\n ctx.load = function load (name) {\n ctx.assert(_getters[name], 500, '@rill/load: Could not load [' + name + ']')\n return _getters[name](ctx, slice.call(arguments, 1))\n }\n\n return next()\n }\n}", "load() {\n\n let _this = this;\n\n return _this.project.load()\n .then(function() {\n return _this.meta.load();\n });\n }", "function useAsync() {\n var async = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return new _fluentui_utilities__WEBPACK_IMPORTED_MODULE_2__.Async(); });\n // Function that returns a function in order to dispose the async instance on unmount\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { return function () { return async.dispose(); }; }, [async]);\n return async;\n}", "function useAsync() {\n var async = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return new _fluentui_utilities__WEBPACK_IMPORTED_MODULE_2__.Async(); });\n // Function that returns a function in order to dispose the async instance on unmount\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { return function () { return async.dispose(); }; }, [async]);\n return async;\n}", "componentWillMount(){\n this.load();\n }", "_preload() {\n const preloader = new Preloader();\n preloader.run().then(() => {\n this._start();\n });\n }", "function lazyLoadView(AsyncView) {\n const AsyncHandler = () => ({\n component: AsyncView,\n // A component to use while the component is loading.\n loading: require('@views/_loading').default,\n // Delay before showing the loading component.\n // Default: 200 (milliseconds).\n delay: 400,\n // A fallback component in case the timeout is exceeded\n // when loading the component.\n // error: require('@views/_timeout').default,\n // Time before giving up trying to load the component.\n // Default: Infinity (milliseconds).\n timeout: 10000,\n })\n\n return Promise.resolve({\n functional: true,\n render(h, { data, children }) {\n // Transparently pass any props or children\n // to the view component.\n return h(AsyncHandler, data, children)\n },\n })\n}", "async componentDidMount() {\n \n }", "async function getComponent() {\n const { join } = await import(/* webpackChunkName:\"app\", webpackPrefetch: true */ './app.js');\n const element = document.createElement('div');\n element.innerHTML = join(['dell', 'lee'], '-');\n return element;\n}", "componentWillMount() {\n this.load();\n }", "resolveMiddleware(middleware) {\n return typeof middleware === 'function'\n ? {\n type: 'lazy-import',\n value: middleware,\n args: [],\n }\n : Object.assign(this.resolver.resolve(`${middleware}.handle`), { args: [] });\n }", "function loadTasks(){\n return fetch(\"/task/json\").then(response=>response.json());\n }", "loadModulesTasks () {\n let self = this\n\n // get all active modules\n self.api.modules.modulesPaths.forEach(modulePath => {\n // build the task folder path for the current module\n let tasksFolder = `${modulePath}/tasks`\n\n // load task files\n this.api.utils.recursiveDirectoryGlob(tasksFolder).forEach(f => self.loadFile(f))\n })\n }", "function load(req, res, next, id) {\n Manager.get(id)\n .then((manager) => {\n req.manager = manager; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function ComponentLoader(props) {\n if (!props.system) {\n return <h2>No system props specified</h2>;\n }\n\n if (!props.system.version) {\n return <h2>No version specified</h2>;\n }\n\n if (!props.manifestModule) {\n return <h2>No module specified</h2>;\n }\n\n if (!FluentManifest[props.system.version]) {\n return <h2>{FluentScope} {props.manifestModule} {props.system.version} not available</h2>;\n }\n\n const url = `http://localhost:${FluentManifest[props.system.version]}/remoteEntry.js`;\n const scope = FluentScope;\n\n const { ready, failed } = useDynamicScript({ url });\n\n if (!ready) {\n return <h2>Loading dynamic script: {url}</h2>;\n }\n\n if (failed) {\n // TODO: this doesn't seem to work on failure, doesn't work in original example either\n return <h2>Failed to load dynamic script: {url}</h2>;\n }\n\n const Component = React.lazy(\n loadComponent(FluentScope, props.manifestModule)\n );\n\n return (\n <React.Suspense>\n {props.system.version}\n <Component {...props} />\n </React.Suspense>\n );\n}", "constructor(fastify) {\n let { STAGE } = process.env;\n this.modules = require(\"../models/modules\")(fastify[`db.${STAGE}cardplay`]);\n // const self = this;\n // (async function () {\n // await self.user.sync({ alter: true });\n // })();\n }", "function lazyload(callback, name) {\n let me = this\n name.map((item) => {\n this._views[item] = () => {\n return new Promise((resolve, reject) => {\n if (this._views[item].lazy) {\n callback((module) => {\n if (module.models.multiple) {\n registerMultiple.call(me, module, resolve, item)\n } else {\n loadModule.call(me, module, resolve, item)\n }\n this._store.replaceReducer(getReducer.call(this))\n })\n } else {\n resolve(this._views[item])\n }\n })\n }\n this._views[item].lazy = true\n })\n }", "async loadModule() {\n const { state, actx } = this;\n try {\n await actx.audioWorklet.addModule(`worklet/${state.processor.module}.js`);\n this.setState({ moduleLoaded: true, status: null });\n console.log(`loaded module ${state.processor.module}`);\n } catch (e) {\n this.setState({ moduleLoaded: false });\n console.log(`Failed to load module ${state.processor.module}`);\n }\n }", "load() {}", "load() {}", "async function loader(\n args\n ) {\n try {\n const isCommonjs = args.namespace.endsWith('commonjs');\n \n const key = removeEndingSlash(args.path);\n const contents = polyfilledBuiltins.get(key) || polyfillLib[key + '.js'];\n const resolveDir = path.dirname(key);\n\n if (isCommonjs) {\n return {\n loader: 'js',\n contents: commonJsTemplate({\n importPath: args.path,\n }),\n resolveDir,\n };\n }\n return {\n loader: 'js',\n contents,\n resolveDir,\n };\n } catch (e) {\n console.error('node-modules-polyfill', e);\n return {\n contents: `export {}`,\n loader: 'js',\n };\n }\n }", "function makeAsyncComponent(LazyComponent) {\n return props => react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Suspense, {\n fallback: null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(LazyComponent, props));\n}", "@memoize\n get parser() {\n return new TaskList({\n name: `Parsing ${this.type}: ${this.projectName}`,\n tasks: [\n new Task({\n name: `Loading ${this.type}`,\n run: (parentScope) => {\n this.resetCompiled()\n const scope = this.getScope(parentScope)\n this.setState(\"scope\", scope)\n return this.load()\n }\n }),\n TaskList.forEach({\n name: `Parsing imports`,\n list: () => this.activeImports,\n getTask: (file) =>\n new Task({\n name: `Parsing import: ${file.file}`,\n run: () => file.parse(this.scope)\n })\n })\n ]\n })\n }", "componentWillMount() {\n this.props.loadEntitiesIfNeeded();\n }", "function runtime() {\n\t require(\"./runtime\");\n\t}", "getComponent(location, cb) { \n // React will fetch code for getComponent() and call the callback, cb\n System.import('./components/artists/ArtistCreate')\n .then(module => cb(null, module.default));\n // remember System.import('') - webpack will automatically modify the bundle that is generated to split off the module that is called\n // Gotcha's: cb(error argument,)\n // Note: Webpack manually scans for System.import() calls so a help function cannot be used to minimize this code whenusing webpack (b/c of limitations)\n }", "preload() {\n }", "constructor() {\n super();\n this.state = {\n tasks\n };\n }", "function Task() {\n return <div />;\n}", "componentWillMount() {\n if (this.props.isRehydrated) {\n this.props.init();\n }\n }", "install (Vue,/* options*/) {\n Vue.tasks = []\n Vue.task = null\n // create a mixin\n Vue.mixin({\n created() {\n Vue.prototype.$createTask = async function(task){\n console.log(\"task\",task)\n await Task.create(task);\n }\n\n Vue.prototype.$getTasks = async function(containerUrl){\n let url = store.state.solid.storage+store.state.table.privacy+'/table/tasks/'\n console.log(\"task url\",url)\n return await Task.from(containerUrl).all();\n }\n\n },\n\n });\n\n }", "async init () {\r\n return;\r\n }", "function withLazyLoading(WrappedComponent, selectData) {\n // ...and returns another component...\n return class extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n contentLoading: true\n };\n }\n \n componentDidMount() {\n window.addEventListener('load',()=>{\n console.log('in')\n this.setState({\n contentLoading: false\n })\n })\n }\n \n\n render() {\n\n return( \n this.state.contentLoading == true ?\n <div style={{display:'flex', justifyContent:'center', alignItems:'center'}}><Spin/></div>\n :\n <WrappedComponent {...this.props} />)\n }\n };\n }", "getComponent (nextState, cb) {\n require.ensure([], (require) => {\n const Favorite = require('./containers/FavoriteContainer').default\n const reducer = require('./modules/favorite').default\n injectReducer(store, { key: 'favorite', reducer })\n cb(null, Favorite)\n })\n }", "load( resolver ) {\n const nextToLoad = this.layers.find( ( { isready } ) => !isready );\n if( nextToLoad ) {\n const loader = Promise.all( nextToLoad.prop.use.map( ({ type = \"url\", ...use }) =>\n type === \"url\" ? Loader.default.obtain( use ) : this.get( use.path )\n ));\n loader.then(( packs ) => {\n packs.map( (pkj, index) => {\n const { type = \"url\" } = nextToLoad.prop.use[index];\n if(type === \"url\") {\n this.appendData( pkj, nextToLoad.src );\n }\n else {\n this.merge( pkj, true );\n }\n } );\n nextToLoad.isready = true;\n this.load( resolver );\n });\n }\n else {\n resolver( this );\n }\n }", "registerModules() {\n const { modules } = this.options;\n\n if (Object.keys(modules).length) {\n Object.keys(modules).forEach((moduleName) => {\n const module = modules[moduleName];\n const hasPromisse = typeof module.then === 'function';\n\n // Loaded module\n if (!hasPromisse) {\n this.registerModuleRoutes(module.routes);\n this.registerModuleStore(moduleName, module.store);\n\n return;\n }\n\n // Load lazy modules\n module.then((moduleLoaded) => {\n const { routes, store } = moduleLoaded.default;\n\n this.registerModuleRoutes(routes);\n this.registerModuleStore(moduleName, store);\n });\n });\n }\n }", "componentWillMount() {\n this._doLoad();\n }", "async startup() {\n }", "function load () {\n const modules = registerModules(api)\n\n api.modules = modules\n\n return Promise.resolve(modules)\n }", "_load() {\n if (this._loadingPromise) {\n return this._loadingPromise;\n }\n\n this._loadingPromise = Task.spawn(function*() {\n let jobs = [];\n\n let value = yield asyncStorage.getItem(\"simulators\");\n if (Array.isArray(value)) {\n value.forEach(options => {\n let simulator = new Simulator(options);\n Simulators.add(simulator, true);\n\n // If the simulator had a reference to an addon, fix it.\n if (options.addonID) {\n let job = promise.defer();\n AddonManager.getAddonByID(options.addonID, addon => {\n simulator.addon = addon;\n delete simulator.options.addonID;\n job.resolve();\n });\n jobs.push(job);\n }\n });\n }\n\n yield promise.all(jobs);\n yield Simulators._addUnusedAddons();\n Simulators.emitUpdated();\n return Simulators._simulators;\n });\n\n return this._loadingPromise;\n }", "function loadNodeSet(node) {\n var nodeDir = path.dirname(node.file);\n var nodeFn = path.basename(node.file);\n if (!node.enabled) {\n return when.resolve(node);\n } else {}\n try {\n var loadPromise = null;\n var r = requiredNodes[node.file]; //require(node.file);\n if (typeof r === \"function\") {\n\n var red = {};\n for (var i in RED) {\n if (RED.hasOwnProperty(i) && !/^(init|start|stop)$/.test(i)) {\n var propDescriptor = Object.getOwnPropertyDescriptor(RED, i);\n Object.defineProperty(red, i, propDescriptor);\n }\n }\n red[\"_\"] = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args[0] = node.namespace + \":\" + args[0];\n return i18n._.apply(null, args);\n };\n var promise = null; //r(red);\n if (promise != null && typeof promise.then === \"function\") {\n loadPromise = promise.then(function () {\n node.enabled = true;\n node.loaded = true;\n return node;\n }).catch(function (err) {\n node.err = err;\n return node;\n });\n }\n }\n if (loadPromise == null) {\n node.enabled = true;\n node.loaded = true;\n loadPromise = when.resolve(node);\n }\n return loadPromise;\n } catch (err) {\n node.err = err;\n return when.resolve(node);\n }\n}", "static load() {\n throw new Error(\"`EmberExamMochaTestLoader` doesn't support `load()`.\");\n }", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "function loadModule(loader, name, options) {\n return new Promise(asyncStartLoadPartwayThrough({\n step: options.address ? 'fetch' : 'locate',\n loader: loader,\n moduleName: name,\n // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091\n moduleMetadata: options && options.metadata || {},\n moduleSource: options.source,\n moduleAddress: options.address\n }));\n }", "load (api, next) {\n // load task features to the API object\n api.tasks = new TaskSatellite(api)\n\n // load modules tasks\n api.tasks.loadModulesTasks()\n\n // finish the satellite initialization\n next()\n }", "constructor() {\n super();\n this.state = {\n tasks: tasks,\n };\n }", "function require() { return {}; }", "async __prepareWorkflowManager () {\n\n\t\t// Inject the dependencies the workflow manager requires.\n\t\tthis.workflowManager.inject(`sharedLogger`, sharedLogger);\n\t\tthis.workflowManager.inject(`MessageObject`, MessageObject);\n\t\tthis.workflowManager.inject(`analytics`, this.analytics);\n\t\tthis.workflowManager.inject(`database`, this.database);\n\t\tthis.workflowManager.inject(`nlp`, this.nlp);\n\t\tthis.workflowManager.inject(`scheduler`, this.scheduler);\n\n\t\t// Start the workflow manager.\n\t\tawait this.workflowManager.start(this.options.directories);\n\n\t}", "function ShowList() {\n const getShow = useSetRecoilState(getShowState)\n\n const OutputShow = React.lazy(() => import('./OutputShow'))\n\n useEffect(() => {\n fetch('api/getShow')\n .then((res) => res.json())\n // .then((res) => console.log(res))\n .then((res) => getShow(res))\n })\n return (\n <div className=\"anime-list\">\n <Suspense fallback={<p>Loading...</p>}>\n <OutputShow />\n </Suspense>\n </div>\n );\n}", "function LocalLoader() { }", "function setup(): Component {\n console.disableYellowBox = true;\n\n// Parse.initialize('example');\n// Parse.serverURL = `${env.serverURL}/parse`;\n\n // Relay.injectNetworkLayer(\n // new Relay.DefaultNetworkLayer(`${env.serverURL}/graphql`, {\n // fetchTimeout: 30000,\n // retryDelays: [5000, 10000],\n // })\n // )\n\n class Root extends Component {\n constructor() {\n super();\n this.state = {\n isLoading: true,\n store: configureStore(() => this.setState({ isLoading: false })),\n };\n }\n render() {\n if (this.state.isLoading) {\n return null;\n }\n return (\n <Provider store={this.state.store}>\n <App />\n </Provider>\n );\n }\n }\n\n return Root;\n}", "async startup(){}", "function Import(manager) {\n if (!manager) {\n throw new TypeError(\"Must provide a manager\");\n }\n\n this.manager = manager;\n this.context = manager.context || {};\n\n if (!this.context.modules) {\n this.context.modules = {};\n }\n }", "function loadStories() {\n const req = require.context(__PACKAGES__, true, /story\\.jsx$/);\n req.keys().forEach(filename => req(filename));\n}", "function loadModule() {\n return Promise.resolve({\n on: function(name, callback) {\n addon.port.on(name, callback);\n },\n emit: function(name, data) {\n addon.port.emit(name, data);\n }\n });\n}", "getManager() {\n return this.props.manager;\n }", "loadState() {\n return Promise.resolve();\n }", "preload() {\n\n }", "preload() {\n\n }" ]
[ "0.6158638", "0.60862947", "0.5803672", "0.5782069", "0.5781536", "0.5711941", "0.5612272", "0.5602381", "0.5594645", "0.5583525", "0.55091685", "0.5483299", "0.54387265", "0.54212224", "0.54210836", "0.5409487", "0.5407641", "0.5386868", "0.5345556", "0.53403187", "0.533548", "0.5325713", "0.5317199", "0.5314562", "0.5294216", "0.5281428", "0.5242222", "0.52394736", "0.52226794", "0.5219044", "0.5219044", "0.51933897", "0.51928526", "0.51826185", "0.5174591", "0.5172382", "0.51697665", "0.51604056", "0.5149225", "0.51476026", "0.514125", "0.514125", "0.5140461", "0.5136996", "0.51357895", "0.51320696", "0.5132044", "0.51209724", "0.51178586", "0.511496", "0.5104769", "0.51012903", "0.50988233", "0.5097399", "0.5092469", "0.5086099", "0.5078162", "0.5058036", "0.5058036", "0.50512147", "0.5050413", "0.5036397", "0.50322855", "0.5017347", "0.50128293", "0.5009713", "0.49951723", "0.49851137", "0.49824634", "0.49815792", "0.49791747", "0.49740073", "0.49716857", "0.497103", "0.49678674", "0.4954007", "0.49538955", "0.49534866", "0.4950122", "0.4949425", "0.49460286", "0.49460083", "0.49460083", "0.49460083", "0.49460083", "0.49460083", "0.4945191", "0.49451208", "0.49428952", "0.49390236", "0.49378484", "0.4935722", "0.49333188", "0.49300137", "0.49230167", "0.49217448", "0.49183714", "0.49165905", "0.49127918", "0.49118468", "0.49118468" ]
0.0
-1
Generate an archive ID
_generateID() { this._getWestley().execute( Inigo.create(Inigo.Command.ArchiveID) .addArgument(encoding.getUniqueID()) .generateCommand(), false // prepend to history ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createId() {\r\n return (\r\n Math.floor(Math.random() * 10000000) +\r\n \"-\" +\r\n Math.floor(Math.random() * 10000000)\r\n );\r\n }", "function makeId() {\n return \"_\" + Math.random().toString(36).substr(2, 9);\n }", "function makeId() {\n return \"_\" + (\"\" + Math.random()).slice(2, 10); \n }", "function getID() {\n var id = 'bzm' + (new Date()).getTime();\n\n return id;\n }", "function createId() {\n ++id;\n const t = process.hrtime();\n const v = id ^ t[0] ^ t[1];\n const a = ('0' + v % 13).slice(-2);\n const b = v;\n const c = id;\n const d = (c + b) % 7;\n return `ID-${a}-${b}-${c}-${d}`;\n}", "function getID() {\n\tvar tmp = Math.round(Math.random() * 100000);\n\tvar str = \"OBJ\" + tmp;\n\treturn str;\n}", "function createID(){\n\treturn '_' + Math.random().toString(36).substr(2, 9);\n}", "generateId() {\n return `INV-${this.guid()}`;\n }", "function generateId() {\n return Math.floor(Math.random() * 10000000) + \"-\" + Math.floor(Math.random() * 10000000)\n}", "function generateId(){\n return String(Math.round(new Date().getTime()/1000));\n}", "function generateID () {\n return Date.now().toString(16)\n}", "function creatID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}", "function id() {\n return '_' + Math.random().toString(36).substr(2, 9);\n }", "function generateId() {\n return shortId.generate();\n}", "function generateID() {\n\t\tsID += 1;\n\t\treturn sID;\n\t}", "function id() {\n return shortid.generate();\n}", "generateId() {\n return'id' + Date.now().toString() + Math.floor(Math.random(1000)).toString();\n }", "function _makeId() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(\n /[xy]/g,\n function (c) {\n var r = (Math.random() * 16) | 0;\n var v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n },\n );\n }", "function makeId() {\n return Math.random().toString(36).substr(2, 5);\n}", "static createID() {\n return /*'_' + */Math.random().toString(36).substr(2, 9);\n }", "function id () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function generateId() {\n return `${PREFIX}-${uuid.v4()}`.substr(0, 30);\n}", "function generateID() {\n return v4();\n}", "function makeid() {\n\tvar result = '';\n\tvar characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\tvar charactersLength = characters.length;\n\t// add 12 characters - letters or digits\n\tfor ( var i = 0; i < 12; i++ ) {\n\t result += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t}\n\treturn result;\n}", "function getID() {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function getUniqueIdentifierStr() {\n return getIncrementalInteger() + Math.random().toString(16).substr(2);\n}", "function _id() {\n\t\tvar S4 = function() {\n\t\t return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n\t\t};\n\t\treturn (S4()+S4());\n\t}", "function generateUniqueId() {\n\t\t\tvar format = \"xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx\";\n\t\t\tvar result = \"\";\n\t\t\tfor(var i = 0; i < format.length; i++) {\n\t\t\t\tif(format.charAt(i) == \"-\") {\n\t\t\t\t\tresult += \"-\";\n\t\t\t\t} else {\n\t\t\t\t\tresult += Math.floor(Math.random() * 10);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "_id () {\n return (Math.random().toString(16) + '000000000').substr(2, 8)\n }", "function createID() {\n return (\"\" + 1e10).replace(/[018]/g, function(a) {\n return (a ^ Math.random() * 16 >> a / 4).toString(16)\n });\n}", "function _generateId() {\n\treturn Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36);\n}", "function generateId() {\n return (new Date()).getTime() - 1283136075795 + (_generateCounter++);\n }", "function makeId() {\r\n var rtn;\r\n\r\n rtn = String(Math.random());\r\n rtn = rtn.substring(2);\r\n rtn = parseInt(rtn).toString(36);\r\n\r\n return rtn;\r\n}", "function getUniqueID() {\n var id = new Date().valueOf();\n return id + \".\" + incrementID.increment();\n }", "_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }", "calculateID() {\n const serial = this.serialize(this.data);\n const hash = crypto.createHash('sha256');\n hash.update(serial);\n return hash.digest('hex'); // **Encoding the ID in hex**\n }", "function createID() {\n return 'xxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "function generateId() {\n return new Date().getTime();\n}", "function getId() {\n return sanitizeId(idGen.generateCombination(2, \"-\"));\n}", "idString() {\n return ( Date.now().toString( 36 ) + Math.random().toString( 36 ).substr( 2, 5 ) ).toUpperCase();\n }", "function generateId(content) { \n return content.toLowerCase().replace(/ /g,'-');\n}", "function createTripId() {\n const tripId = 'trip-' + tripIdCounter;\n tripIdCounter += 1;\n return tripId;\n}", "function createId(){\n return Math.round(Math.random()*1000000);\n }", "fileKeyMaker(fileObj) {\n return `${fileObj._id}.tar.gz`;\n }", "function createId() {\n\tvar id = Math.floor( Math.random() * 100000 ) + 1;\n\treturn id;\n}", "function generateId() {\n\t\treturn Math.floor(Math.random() * 1000000) + ((new Date).getTime()).toString();\n\t}", "function createId() {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < 22; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "generateId() {\n if (!this.constructor.generatedIdIndex) this.constructor.generatedIdIndex = 0;\n return '_generated' + this.$name + ++this.constructor.generatedIdIndex;\n }", "function createId() {\n\tvar text = \"\";\n\tvar possible = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n\tfor( var i=0; i < 10; i++ )\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\treturn text;\n}", "function generateUniqueID() {\r\n\treturn Date.now();\r\n}", "function getId () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function generateID (idx) {\n return ('jsrch_' + idx + '_' + new Date().getTime());\n }", "function createUniqueId() {\n return String((new Date()).valueOf()).slice(-4) + Math.floor(Math.random() * 1000);\n}", "generateId() {\n return this.constructor.generateId();\n }", "function generateId() {\n\treturn now() + parseInt(Math.random() * 999999);\n}", "function makeID() {\n var newId = \"\";\n var idOptions = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (var i = 0; i < 5; i++) {\n newId += idOptions.charAt(Math.floor(Math.random() * idOptions.length));\n } \n return newId;\n }", "function generateId() {\n return Date.now().toString(36) + \"#\" + Math.random().toString(36).substr(2, 9); \n}", "function id() {\r\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n}", "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 8; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "function makeId() {\n var result = \"\";\n var hexChars = \"0123456789abcdef\";\n for (var i = 0; i < 16; i += 1) {\n result += hexChars[Math.floor(Math.random() * 16)];\n }\n return result;\n}", "function makeId() {\n var result = \"\";\n var hexChars = \"0123456789abcdef\";\n for (var i = 0; i < 16; i += 1) {\n result += hexChars[Math.floor(Math.random() * 16)];\n }\n return result;\n}", "function generateId() {\r\n\tvar date = new Date();\r\n\treturn (\r\n\t\tdate.getFullYear() +\r\n\t\t(date.getMonth() + 1 < 9\r\n\t\t\t? '0' + (date.getMonth() + 1)\r\n\t\t\t: date.getMonth() + 1) +\r\n\t\t(date.getDate() < 9 ? '0' + date.getDate() : date.getDate()) +\r\n\t\t(date.getHours() < 9 ? '0' + date.getHours() : date.getHours()) +\r\n\t\t(date.getMinutes() < 9\r\n\t\t\t? '0' + date.getMinutes()\r\n\t\t\t: date.getMinutes() +\r\n\t\t\t (date.getSeconds() < 9\r\n\t\t\t\t\t? '0' + date.getSeconds()\r\n\t\t\t\t\t: date.getSeconds()))\r\n\t);\r\n}", "function generateNumericId(){\n var sid = shortid.generate().substr(0, 5); //short id, 5 chars long\n var iid = radix64.decodeToInt(sid); //integer id\n\n var iidString = iid + \"\";\n\n iidString = leftPad(iidString, 10);\n return iidString;\n}", "function MakeId (Tp = 13) {\n const Hmac = crypto.createHmac('sha256', 'something unique.');\n const TpMp = [ 13, 22, 32, 36, 64 ]; // type map.\n\n Hmac.update((new Date()).getTime().toString() + (++Cnt).toString());\n\n let Id = Hmac.digest('hex').toString();\n\n if (!Is.Number(Tp) || !TpMp.indexOf(Tp) < 0) { Tp = 13; }\n\n switch (Tp) {\n case 22:\n Id = Id.substr(0, 22);\n break;\n\n case 32:\n Id = Id.substr(0, 32);\n break;\n\n case 36:\n Id = Id.substr(0, 8) + '-' + Id.substr(8, 4) + '-' + Id.substr(12, 4) + '-' + Id.substr(16, 4) + '-' +\n Id.substr(20, 12);\n break;\n\n case 13:\n Id = Id.substr(0, 13);\n break;\n\n // default: // 64 don't do anything.\n }\n\n return Id.substr(0, Id.length - Cnt.toString().length) + Cnt.toString(); // use Cnt to make id unique.\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function guid() {return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();}", "generateId () {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n }", "function ID() {\n return Math.random().toString(36).substr(2, 10) + Math.random().toString(36).substr(2, 5);\n}", "upID(id)\r\n {\r\n try \r\n {\r\n return id.split('-')[0] + '-' + (parseInt(id.split('-')[1]) + 1);\r\n } \r\n catch (error) \r\n {\r\n //Return a custom ID\r\n return this.newCustomID()\r\n }\r\n }", "function makeid(){\n\t\tvar text = \"\";\n\t\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\t\tfor( var i=0; i < 4; i++ )\n\t\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\t\treturn text;\n\t}", "function makeId() {\n idNumber = idNumber + 1;\n const newId = ($tw.browser?'b':'s') + idNumber;\n return newId;\n }", "function makeId() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.filter(function (val) {\n return val != null;\n }).join(\"--\");\n}", "function createId(){\n return Math.floor(Math.random() * 10000)\n}", "generateResourceID(base=\"\"){function idPart(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return base+idPart()+idPart()+\"-\"+idPart()+\"-\"+idPart()+\"-\"+idPart()+\"-\"+idPart()+idPart()+idPart()}", "function generoiId() {\n\n let id = '';\n\n for (let i = 0; i < 16; i++) {\n id = id + (Math.floor(Math.random() * 10));\n }\n\n return parseInt(id);\n}", "function uniqueId() {\n return `a${Math.random().toString(36).substr(2, 9)}`;\n}", "function generateID() {\n\tvar chunkSize = 1 << 16; // 2^16\n\tvar now = new Date();\n\tvar part1 = new Number(now.getTime() % chunkSize);\n\tvar part2 = new Number(Math.floor(chunkSize*Math.random()));\n\treturn part1.toString(16) + part2.toString(16);\n}", "function genID() {\n return (+new Date() + Math.floor(Math.random() * 999999)).toString(36);\n}", "function generateUniqueId(identifier) {\n return identifier + '-' + Date.now() + '-' + Math.random();\n }", "function makeid() {\n\t\tvar text = \"\";\n\t\tvar possible =\n\t\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\t\tfor (var i = 0; i < 5; i++)\n\t\t\ttext += possible.charAt(\n\t\t\t\tMath.floor(Math.random() * possible.length)\n\t\t\t);\n\n\t\treturn text;\n\t}", "function getNewId() {\n\t\treturn (_idGen++).toString();\n\t}", "function generateId() {\n //http://forumsblogswikis.com/2008/05/26/how-to-generate-a-unique-id-in-javascript/\n var newDate = new Date;\n return newDate.getTime();\n}", "function generateUID(contentHash) {\n var timestamp = new Date().getTime().toString();\n return timestamp + contentHash;\n}", "generateId() { return this._get_uid() }", "function makeid() {\n const {possible, n} = makeid\n let alphaHex = n.toString(26).split(''), c, r = ''\n while(c = alphaHex.shift()) r += possible[parseInt(c, 26)]\n makeid.n++\n return r\n}", "function generateID(hexString) {\r\n const ObjectID = require(\"mongodb\").ObjectID;\r\n return new ObjectID(hexString);\r\n}", "function genID() {\n return Math.floor(Math.random() * 0x100000000).toString(16) + Math.floor(Math.random() * 0x100000000).toString(16);\n }", "function generateId(movie) {\n // the ID is generated from slugify'ing the movie title\n return slugify(movie.title);\n}", "function generateId(word) {\n\t\tvar prefix = 'note-';//default prefix if none supplied\n\t\tif(word) {\n\t\t\tprefix = word + '-';\n\t\t}\n\n\t\t function s4() {\n\t\t return Math.floor((1 + Math.random()) * 0x10000)\n\t\t .toString(16)\n\t\t .substring(1);\n\t\t }\n\t\t return prefix + s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n\t\t s4() + '-' + s4() + s4() + s4();\n\t\t\n\t\t\n\t}", "function createID() {\n return Math.floor(Math.random() * 100000000000);\n}", "generateID() {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n }", "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text + Math.floor(Math.random() * 99999);\n}", "function getObjectID()\r\n{\r\n\tvar objectID = \"\";\r\n\t\r\n\tfor ( var i=1; i<21; i++ )\r\n\t{\r\n\t\tobjectID += String.fromCharCode(Math.floor(Math.random()*26) + 97);\r\n\t\tif ( i<20 && (i % 5) == 0 )\r\n\t\t\tobjectID += \"-\";\r\n\t}\r\n\t\r\n\treturn objectID;\r\n\t\r\n}", "function makeId(){\n var text = ''\n , possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n ;\n\n for (var i = 0; i < 8; i++){\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function uniqueId(prefix) {\n var id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n }", "static generateID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000000).toString(16);\n }\n return s4();\n }", "function guid() {\n return s4() + s4() + s4() + s4() + '-' + (new Date()).getTime();\n }" ]
[ "0.6805413", "0.6689549", "0.66860694", "0.6650807", "0.66195965", "0.6614336", "0.6586084", "0.6574939", "0.6552549", "0.65487695", "0.65426826", "0.6525645", "0.6511555", "0.6510963", "0.651058", "0.6476448", "0.64746535", "0.6441118", "0.64378536", "0.6430925", "0.64286554", "0.64223254", "0.64115536", "0.6369337", "0.6352084", "0.6350381", "0.6348083", "0.6330679", "0.6328831", "0.63274586", "0.6322284", "0.6316993", "0.63135326", "0.62965214", "0.6296077", "0.6294529", "0.6292402", "0.6291567", "0.6280607", "0.6272224", "0.6270532", "0.6261142", "0.62478036", "0.62448305", "0.6240031", "0.622583", "0.6222769", "0.62124306", "0.62021095", "0.6198099", "0.61924934", "0.61912334", "0.61850655", "0.6178988", "0.6163922", "0.61612856", "0.61596715", "0.61575055", "0.61545724", "0.6145867", "0.6145867", "0.6145753", "0.61324805", "0.61308557", "0.61261845", "0.61252415", "0.61252415", "0.61252415", "0.6123989", "0.6120653", "0.6120356", "0.61189187", "0.6103954", "0.6103183", "0.60941136", "0.6091549", "0.608715", "0.60857534", "0.6071758", "0.606608", "0.60655004", "0.60628814", "0.6062086", "0.60615635", "0.605974", "0.60596704", "0.605305", "0.6049547", "0.6046584", "0.6045834", "0.6031251", "0.602922", "0.6024516", "0.60191166", "0.6010932", "0.6003586", "0.60032743", "0.60004604", "0.600045", "0.5998883" ]
0.8710402
0
Change content on user language
function ch_site_lang(lng='en') { $.getJSON( "lng/"+lng+".json", function( data ) { var $lang_tags = $('[data=lng-txt]'); $('[data=lng-txt]').each(function() { var lang_content = $.trim($(this).text().toLowerCase()); $(this).text(data[lng][lang_content]); }); $('[data=lng-place]').each(function() { var lang_content = $.trim($(this).attr("placeholder").toLowerCase()); $(this).attr("placeholder", data[lng][lang_content]); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeLanguage (language) {\n COMPONENT.innerHTML = DATA.lang[language];\n }", "function setlanguage(){\r\n\tif (getRequestParam(\"lang\") == \"de\") {\r\n\t\tshowGer()\r\n\t}\r\n\telse {\r\n\t\tshowEn()\r\n\t}\r\n}", "function switchLanguage()\r\n{\r\n\t$('[data-translation]').each(function ()\r\n\t{\r\n\t\tvar text = $(this).attr('data-translation');\r\n\t\tvar oldText = $(this).text();\r\n\t\t$(this).attr('data-translation', oldText);\r\n\t\t$(this).text(text);\r\n\t});\r\n}", "_loadWithCurrentLang() {\n i18n.changeLang(this.DOM.body, this.lang, this.DOM.domForTranslate, true);\n }", "function chlang() {\n\tif (lang.id == \"en\")\n\t\tlocalStorage.setItem(\"language\",\"de\");\n\telse\n\t\tlocalStorage.setItem(\"language\",\"en\");\n\n\tlocation.reload();\n}", "function changeLang(lang)\n{\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n changeContent(lang);\n }\n };\n xmlhttp.open(\"GET\", \"../../langs/index/\" + lang, true);\n xmlhttp.send();\n}", "function onchange() {\n\n updateLanguage();\n\n}", "function changeLanguage() {\r\n $('[data-lang]').each(function(index, el) {\r\n var $textLang = $(el).data('lang');\r\n $(el).text( lang [ localStorage.getItem('pageLang') || 'pl' ][ $textLang ] );\r\n });\r\n\r\n var activeButton = localStorage.getItem('pageLang');\r\n $('.btn-change-lang').removeClass('active');\r\n if(activeButton) {\r\n $('.btn-change-lang[data-language=' + activeButton + ']').addClass('active');\r\n } else {\r\n $('.btn-change-lang[data-language=pl]').addClass('active');\r\n }\r\n }", "function setUserLanguage(value){\n __params['ul'] = value;\n}", "function setLanguage(newLang){\r\n\tswitch (newLang) {\r\n\t\t// German - DE - by Stevieoo\r\n\t\tcase \"de\": \taLang = [\"Aktivieren\", \"Angriffs-Email\", \"Angriffs-Alarm\", \"Spionage-Alarm\", \"Nachrichten-Alarm\", \"Auto-Login\", \"Du musst Deine eMail Adresse am Anfang des Codes einfügen, wenn Du eine eMail bekommen möchtest, wenn Du angegriffen wirst.\", \"Es muss eine funktionierende Email Adresse definiert werden, damit Du bei einem Angriff benachrichtigt wirst.\", \"Angriff in \", \"Unbekannte Angriffs-Zeit\", \"Du wirst angegriffen, aber die Flottendetails nicht nicht verfügbar.\", \"Ankunfts-Zeit\", \"Schiffe\", \"Von\", \"Nach\", \"Angriff\", \"OGame Angriff\", \"Autologin kann in Chrome nicht abgeschaltet werden. Bitte deaktiviere das Addon zum ausschalten des Autologin.\", \"OGame@Alarme.Queijo\", \"Das ist eine Testmail\", \"Das ist ein OGame@Alarm.Cheese Test\", \"OGame Alarm w/ Cheese\", \"Email für eingehene Alarme\", \"Test\", \"Ogame Alarm by programer\", \"Minimale Reload-Zeit\", \"Maximale Reload-Zeit\", \"Prüfe auf alarme alle\", \"Speichern & Schließen\",\"Reload Typ Auswahl\",\"Sekunden\",\"Sprache\",\"\",\"[OGAbp] Löschen aller cookies\",\"Bist Du sicher das Du alle OGAbp Cookies löschen möchtest? Hiermit werden deine Logindaten gelöscht und alle Einstellungen auf standard zurück gesetzt.\", \"Reset alles\", \"AutoLogin Konten\", \"Server\", \"Spieler\", \"Passwort\", \"AutoLogin\", \"Es gibts keine AutoLogin informationen. Bitte ausloggen und neu einloggen zum speichern der informationen.\", \"Ungültige Email! Beispiel: someone@somewhere.abc\", \"Eine Test Email wurde versendet! Wenn Sie kein Firefox verwenden könnte es nicht funktionieren.\", \"Ungültige Einstellungen! Das minimum darf nicht kleiner als 30 Sekunden sein. Das Maximum darf nicht kleiner als 360 sein. Prüfen auf Angriffe darf nicht kleiner als 30 sein. Die Email Adresse muss ein @ und einen . und keine Leerzeichen enthalten.\", \"Übersicht\", \"Löschen\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 1;\r\n\t\t\t\t\tbreak;\r\n\t\t// Danish - DK - by Kin0x\r\n\t\tcase \"dk\": \taLang = [\"Aktiver\", \"Angrebs email\", \"Angrebs Alarm\", \"Spionage Alarm\", \"Besked Alarm\", \"Auto Login\", \"Mangler email!\", \"Du skal have en email indtastet i bunden for at kunne modtage beskeder omkring flåde angreb pr. mail.\", \"Indkommende angreb om \", \"Ukendt angrebs tid\", \"Du er under angreb, men der er ingen flåde detajler\", \"Ankommer kl.\", \"Skibe\", \"Fra\", \"Til\", \"Angreb\", \"OGame indkommende angreb\", \"AutoLogin kan ikke blive slået fra i Chrome!\", \"OGame@Alarm.Ost\", \"Dette er en test email!\", \"En test email så du kan se dit script virker!\", \"OGame Alarm med Ost\", \"Email for at modtage mails med angreb\", \"Send en test\", \"OGame Alarm Indstillinger\", \"Minimum opdateringstid (sek)\", \"Maksimum opdateringstid (sek)\", \"Check for alarms every\", \"Gem Indstillinger\", \"Select Reload Type\", \"sekund\", \"Sprog\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 2;\r\n \t\t\t\t\tbreak;\r\n\t\t// Portuguese - PL - by GL_notmypresident\r\n\t\tcase \"pt\": \taLang = [\"Recarregar\", \"Email de ataque\", \"Alarme de ataque\", \"Alarme de espião\", \"Alarme mensagem\", \"Login automático\", \"Tens que preencher a variável EmailURL no topo do código. Para usar a opção de Email de ataque.\", \"Tens que inserir o teu email no fim da página do OGame para usar a opção de Email de ataque.\", \"Ataque em \", \"Tempo para o ataque desconhecido\", \"Estás a ser atacado, mas os detalhes da frota atacante são desconhecidos.\", \"Tempo de chegada\", \"Naves\", \"De\", \"Para\", \"Ataque\", \"Ataque no OGame\", \"Não é possível desactivar o Login Automático no Chrome. Tens que ir à página das extensões e desactivar o script para desactivar o Login automático.\", \"OGame@Alarme.Queijo\", \"Email de teste\", \"Um teste com queijo\", \"Alarme do OGame com queijo\", \"Email para receberes notificações de ataque\", \"Teste\", \"Ogame Alarm by programer\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Salvar e Saída\", \"Select Reload Type\", \"segundo\", \"Linguagem\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 3;\r\n \t\t\t\t\tbreak;\r\n\t\t// Russian - RU - by programer\r\n\t\tcase \"ru\":\taLang = [\"Активировать\", \"Emailer атак\", \"Сирена при атаке\", \"Сигнал при скане\", \"Сигнал о сообщении\", \"Авто Вход\", \"Вы должны ввести адрес почтового ящика в начале кода скрипта для использования Входящие сообщения при атаке.\", \"Вы должны установить корректный почтовый ящик в опции Сигнал при атаке\", \"Атака через \", \"Неизвестное время атаки\", \"Обнаружена атака, но состав флотов не определен\", \"Время прилета\", \"Корабли\", \"с\", \"на\", \"Атака\", \"Атака в OGame\", \"Невозможно отключить Авто Вход в Chrome. Вы должны открыть расширения и отключить скрипт, чтобы отключить Авто Вход.\", \"OGame@Alarm.Cheese\", \"Тестовое сообщение\", \"Тест\", \"OGame Alarm by programer\", \"Почтовый ящик для отправки сигнального сообщения\", \"Тест\", \"Ogame Alarm by programer\", \"Минимальное время обновления\", \"Максимальное время обновления\", \"Проверять атаку каждые\", \"Сохранить & Выйти\", \"Выберите тип обновления\", \"секунд\", \"Язык\", \"\", \"[OGAbp] Удалить куки\", \"Вы действительно хотите удалить все OGAbp куки?\\n\\nЭто удалит адрес почтового ящика (и информацию авто входа в GreaseMonkey), как сброс всех настроек и опций по умолчанию.\", \"Сбросить все\", \"Аккаунты Авто входа\", \"Сервер\", \"Игрок\", \"Пароль\", \"Авто вход\", \"Не найдена информации об аккаунтах Авто входа. Пожалуйста выйдите и войдите обратно для сохранения информации об аккаунте для Авто входа\", \"Некорректный Email. Пожалуйста, используйте форму: someone@somewhere.abc\", \"Тестовое сообщение отправлено!\\n\\nЭто будет работать только в браузере FireFox.\", \"Некорректные настройки!\\n\\nМинимум не может быть менее 30 секунд.\\nМаксимум не может быть менее 360 секунд.\\nПроверка атак не может быть установлена менее 30.\\nАдрес почтового ящика должен содержать @ и . и не должен содержать пробелов.\\nПовторение сигнала должно быть чаще, чем проверка атак.\", \"Обзор\", \"Удалить\", \"Повторять последний сигнал\", \"После\", \"(Менее 10 = отключено)\"];\r\n\t\t\t\t\taLangIndex = 4;\r\n\t\t\t\t\tbreak;\r\n\t\t// English (Default) - ORG - by Pimp Trizkit\r\n\t\tcase \"org\": // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\r\n\t\tdefault:\taLang = [\"Activate\", \"Attack Emailer\", \"Attack Alarm\", \"Espionage Alarm\", \"Message Alarm\", \"Auto Login\", \"You need to set the EmailURL at the top of the code. To use the Incoming Attack Email Alarm.\", \"You need to set a proper email address in the options screen for the Incoming Attack alerts.\", \"Incoming Attack in \", \"Unknown Attack Time\", \"You have an Incoming attack, but the fleet details are not available\", \"Arrival Time\", \"Ships\", \"From\", \"To\", \"Attack\", \"OGame Incoming Attack\", \"Can not turn off AutoLogin in Chrome. You will have to goto your extensions and disable the script to disable AutoLogin.\", \"OGame@Alarm.Cheese\", \"This is a test email\", \"One Cheesy Test\", \"OGame Alarm w/ programer\", \"Email address to send Incoming Attack alerts\", \"Test\", \"Ogame Alarm by programer\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Save & Close\", \"Select Reload Type\", \"seconds\", \"Language\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email (and autologin information in GreaseMonkey) as well as reset all settings and options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\\nAlarm repeat must be less than Check for Alarms.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 0;\r\n\t\t\t\t\tbreak;\r\n\t}\r\n}", "function changeCurrentLanguage() {\n $cookies.put('language', vm.currentLanguage, {expires: new Date().addHours(1)});\n $translate.use(vm.currentLanguage);\n }", "changeTextOnDOM(){\n var keys = Object.keys(this.idsToLangKey)\n keys.forEach((value)=>{\n document.getElementById(value).innerHTML = this.localeModel.getCurrentLanguage(this.idsToLangKey[value])\n })\n }", "async setAppLanguage() {\n this.props.actions.getLanguage().then((lang) => {\n if (lang !== undefined && typeof lang.value === 'string') {\n this.props.actions.setContentStrings(lang.value);\n this.props.actions.setLanguage(lang.value);\n } else {\n this.props.actions.setContentStrings(\"no\");\n this.props.actions.setLanguage(\"no\");\n }\n });\n }", "function controlLanguage(langString) {\n localStorage.setItem(\"language\", langString);\n renderTranslation(eval(\"json\"+langString));\n }", "function setLang() {\n\n // first update text fields based on selected mode\n var selId = $(\"#mode-select\").find(\":selected\").attr(\"id\");\n setText(\"text-timedomain\",\n \"Zeitbereich: \" + lang_de.text[selId],\n \"Time domain: \" + lang_en.text[selId]);\n setText(\"text-headline-left\",\n \"Federpendel: \" + lang_de.text[selId],\n \"Spring Pendulum: \" + lang_en.text[selId]);\n\n // then loop over all ids to replace the text\n for(var id in Spring.langObj.text) {\n $(\"#\"+id).text(Spring.langObj.text[id].toLocaleString());\n }\n // finally, set label of language button\n // $('#button-lang').text(Spring.langObj.otherLang);\n $('#button-lang').button(\"option\", \"label\", Spring.langObj.otherLang);\n }", "function setLang(l) {\n lang = l;\n\n // set lang in the browser session cache\n sessionStorage.setItem(\"lang\", lang);\n \n // set lang class on body\n var body = document.getElementById(\"body\");\n body.className = lang;\n\n // redraw in the new language\n this.draw(((window.history || {}).state || {}).section || null);\n}", "function LanguageClickEventHandler(lang) {\r\n SetLanguage(lang);\r\n}", "function changeLanguage(lang){\n if (lang !== \"en\" && lang !== \"fr\" && lang !== \"sv\") {\n lang = \"fi\";\n }\n\n $.ajax({ \n url: './languages/' + localStorage.getItem('language') + '.json', \n dataType: 'json', \n async: false, \n dataType: 'json', \n success: function (lang) { \n arr = lang;\n $('.lang').each(function(index,element){\n $(this).text(arr[$(this).attr('key')]);\n }); \n $('.lang_alt').each(function(index,element){\n $(this).prop('alt', arr[$(this).attr('key_alt')]);\n });\n $('.lang_title').each(function(index,element){\n $(this).prop(\"title\", arr[$(this).attr('key_title')]);\n });\n $('.lang_aria').each(function(index,element){\n $(this).attr(\"aria-label\", arr[$(this).attr('key_aria')]);\n });\n updateHrefs();\n } \n });\n}", "onLanguageClicked(){\r\n\r\n }", "[consts.SET_B_SHOW_CONTENT_LANG](state, val) {\n state.bShowContentLang = val;\n }", "function setLanguage( lang ) {\n\n // set lang in localStorage, refresh\n localStorage.setItem( 'lang', lang );\n document.location.reload();\n\n }", "updateLocalizedContent() {\n this.i18nUpdateLocale();\n }", "updateLocalizedContent() {\n this.i18nUpdateLocale();\n }", "function changeLanguage(lang) {\n lang = lang || \"en\"; // if no language is set, use default (en)\n //console.log(\"Lang >> \"+lang);\n $.i18n.properties({\n path : 'languages/',\n mode : 'both',\n language: lang,\n callback: refresh_i18n\n });\n}", "function switchLanguage(lang) {\n // Set the language to our TEXT module, updateText and reloadTable\n TEXT.setLang(lang);\n updateText();\n loadTable();\n}", "function changeLanguage() {\n var curLanguage = this.id;\n applyLanguage(curLanguage);\n //delete check from previous language\n document.querySelector(\".check-language[data-check=true]\").setAttribute(\"data-check\", \"false\");\n document.getElementById(curLanguage).setAttribute(\"data-check\", \"true\");\n }", "function changeLanguage(language) {\n if (site_language != language){\n if (language == 'en'){\n changeCurrentLanguage('en');\n displayLanguage('en');\n document.getElementById('language-dropdown-text').innerHTML = \"English\";\n } else {\n displayLanguage('de');\n changeCurrentLanguage('de');\n document.getElementById('language-dropdown-text').innerHTML = \"Deutsch\";\n }\n\n if(window.location.href.indexOf(\"new_page\") > -1){ //new_page is name of html file\n getAllBehaviors(); //display behaviors with changed name again\n } else if (window.location.href.indexOf(\"index\") > -1 || location.href.split(\"/\").slice(-1) == \"#\" || location.href.split(\"/\").slice(-1) == \"\"){\n updateCards();\n }\n }\n}", "function changeLang(){\n\n //Changing language\n let langToChange = document.getElementsByClassName(\"langToChange\");\n let previousLang = langToChange[0].getAttribute(\"lang\");\n let lang;\n previousLang === \"es\" ? lang = \"en\" : lang = \"es\";\n\n //Set language selection in localStorage\n if (typeof(Storage) !== \"undefined\") {\n localStorage.setItem(\"lang\", JSON.stringify(lang));\n }\n \n for (i=0; i<langToChange.length; i++){\n langToChange[i].setAttribute(\"lang\", lang)\n }\n\n let zones = document.querySelectorAll('html [lang]');\n applyStrings(zones, lang);\n}", "function languageButton(lang) {\n if (lang == 1) {\n language = 1;\n sessionStorage.setItem(\"language\", \"fr\");\n changeLanguage();\n } else {\n location.href = location.href;\n sessionStorage.setItem(\"language\", \"eng\");\n }\n}", "function changeLang(l) {\r\n\tlang = l;\r\n\tlocalStorage.setItem('ow-lang',l);\r\n\t$('#chooseLangFlag').attr('src','img/flags/' + lang + '.svg');\r\n\tapplyLang();\r\n}", "function setLanguage(lang) {\n var inner = \"data-\" + lang;\n var title = \"data-\" + (lang == \"jp\" ? \"en\" : \"jp\");\n chrome.tabs.executeScript(null,\n {code:\"$(\\\".wanikanified\\\").each(function(index, value) { value.innerHTML = value.getAttribute('\" + inner + \"'); value.title = value.getAttribute('\" + title + \"'); })\"});\n}", "function appAdminPagesOnChangeLanguage() {\n\tvar elementLanguage = document.getElementById(appRun.kvs.admin.pages_form.fieldLanguage);\n\tvar language = elementLanguage.options[elementLanguage.selectedIndex].value;\n\n\t// Call the API to get the page\n\tvar jqXHR = $.ajax({\n\t\ttype: 'GET',\n\t\turl: appConf.api.url + '/admin_pages',\n\t\tdata: {q: JSON.stringify({language: language, page: appRun.kvs.admin.page})},\n\t\tbeforeSend: function (request) {appUtilAuthHeader(request);},\n\t})\n\t.done(function(data) {\n\t\t// Find which array element this value belongs to\n\t\tvar index = 0;\n\t\tfor (index=0; index < data.length; index++ ) {\n\t\t\tif (data[index].language_id == language)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tvar elementTitle = document.getElementById(appRun.kvs.admin.pages_form.fieldTitle);\n\t\telementTitle.value = data[index].title;\n\n\t\tvar elementContent = document.getElementById(appRun.kvs.admin.pages_form.fieldTitle);\n\t\telementContent.value = data[index].content;\n \t})\n\t.fail(function(jqXHR) {\n\t\tappUtilErrorHandler(jqXHR.status, \"Error getting page.\");\n\t});\n}", "function setLanguage(lang, pageLangSelector, metaLangSelector, dict) {\n // change lan of page\n $(metaLangSelector)\n .attr(\"lang\", lang);\n // change class=\"checked\"\n setLang(lang, pageLangSelector);\n // change lang of content\n translateContent(lang, dict);\n // translate meta description\n translateMetaDescription(lang, dict);\n}", "function changeLang(lang = 'en'){\n\n\tconst translations = {\n\t\t'en' : {\n\t\t\thtmlTitle : 'A Javascript restoration of «Pn=n!» (2006) by Iván Marino :: Marcelo Terreni',\n\t\t\ttitle: 'A Javascript restoration of <cite class=\"pn-title\">P<sub>n</sub>=n!</cite>&nbsp;(2006) by <span lang=\"es\">Iván Marino</span> built with ES6, CSS, MSE & the HandBrake CLI',\n\t\t\tdescription: '<p>First exhibited in March 2006, <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> was a media art installation developed in Flash by the argentinian artist <span lang=\"es\">Iván Marino</span>. A sequence from the film <cite lang=\"fr\">“La Passion de Jeanne d\\'Arc”</cite> (1928) by Carl T. Dreyer was divided into its constituent shots and repurposed to address the idea of torture as an algorithm, a piece of software. For every new sequence in the project, an individual shot from the film was randomly selected and reedited into a new progression that would fatally mirror the three semantic cornerstones present in several torture procedures: victims, victimizers and torture instruments.</p>\\n<p>For this conservation project I rewrote the code from scratch with ES6, used the Media Source API to manage video playback and built a responsive CSS layout to meet the requirements of the modern web. Although the source video was reprocessed with the HandBrake CLI from a more recent transfer of the film, I took care to mimic the look and feel of the original *.flv files in After Effects. A detailed tutorial of this new media restoration work is coming up soon. Meanwhile, <a href=\"http://terreni.com.ar\">check any of the other works in my personal portfolio</a>.</p>',\n\t\t\tviewwork : 'View <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> restoration',\n\t\t\tloadings : ['Loading <br />Judges', 'Loading <br />Jeanne', 'Loading <br />Machines'],\n\t\t\tcredits : 'Restored with ES6, CSS & the HandBrake&nbsp;CLI by <a href=\"http://terreni.com.ar\">Marcelo Terreni</a>',\n\t\t\tviewsource : 'View source in <strong>GitHub</strong>'\n\t\t},\n\t\t'es' : {\n\t\t\thtmlTitle : 'Una versión en Javascript de «Pn=n!» (2006) de Iván Marino :: Marcelo Terreni',\n\t\t\ttitle: 'Un ejercicio de preservación sobre <cite class=\"pn-title\">P<sub>n</sub>=n!</cite>&nbsp;(2006) de Iván Marino con ES6, CSS, MSE & la CLI de HandBrake',\n\t\t\tdescription: '<p>Exhibida por primera vez en marzo de 2006, <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> es una instalación programada en Flash por el artista argentino Iván Marino. El autor dividió una secuencia del film <cite lang=\"fr\">“La Passion de Jeanne d\\'Arc”</cite> (1928) de Carl T. Dreyer en sus planos constituitivos para luego resignificarlos en una meditación sobre la tortura como algoritmo, como un proceso suceptible de ser transformado en software. En cada nueva secuencia del proyecto, una toma individual del film era seleccionada y remontada en una nueva progresión de planos que sigue el orden de los tres pilares semánticos presentes en varios procedimientos de tortura: víctimas, victimarios e instrumentos de tortura.</p>\\n<p>Para este proyecto de restauración reescribí el código con ES6, use la API <span lang=\"en\">Media Source</span> para manejar la reproducción de video y construí vía CSS un diseño mejor adaptado a los requerimientos de la web moderna. Aunque el material fue recomprimido con la CLI de HandBrake a partir de un transfer más reciente del film, me tomé el trabajo de imitar el aspecto de los archivos *.flv originales en After Effects para conseguir una reproducción lo más fiel posible. Prontó escribiré un tutorial detallado sobre las soluciones que encontré durante el trabajo de restauración. Mientras tanto, <a href=\"http://terreni.com.ar\">te invito a navegar alguno de los otros trabajos exhibidos en mi portfolio personal</a>.</p>',\n\t\t\tviewwork : 'Ver <cite class=\"pn-title\">P<sub>n</sub>=n!</cite> restaurada',\n\t\t\tloadings : ['Cargando <br />Jueces', 'Cargando <br />Juana', 'Cargando <br />Instrumentos'],\n\t\t\tcredits : 'Restaurada con ES6, CSS & la CLI de HandBrake por <a href=\"http://terreni.com.ar\">Marcelo Terreni</a>',\n\t\t\tviewsource : 'Ver el código en <strong>GitHub</strong>'\n\t\t}\n\t};\n\n\tdocument.getElementsByTagName('html')[0].setAttribute('lang', lang);\n\tdocument.title = translations[lang].htmlTitle;\n\n\tconst pnIntroTitle = document.getElementsByClassName('intro-description-title')[0];\n\tconst pnIntroDescription = document.getElementsByClassName('intro-description-bio')[0];\n\tconst pnIntroCredits = document.getElementsByClassName('intro-description-credits')[0];\n\tconst pnIntroViewwork = document.querySelector('.intro-description-start-btn span');\n\tconst pnIntroLoadings = document.querySelectorAll('.intro-description-loading-list p');\n\tconst pnIntroViewsource = document.getElementsByClassName('intro-description-viewsource')[0];\n\n\t/* Text translation */\n\tpnIntroTitle.innerHTML = translations[lang].title;\n\tpnIntroDescription.innerHTML = translations[lang].description;\n\tpnIntroCredits.innerHTML = translations[lang].credits;\n\tpnIntroViewwork.innerHTML = translations[lang].viewwork;\n\tpnIntroViewsource.innerHTML = translations[lang].viewsource;\n\n\tfor(let i = 0; i < pnIntroLoadings.length; i++){\n\t\tpnIntroLoadings[i].innerHTML = translations[lang].loadings[i];\n\t}\n\n}", "function UpdateLanguage(event) {\n i18n.changeLanguage(event.target.value);\n }", "toggleLanguage(){\n\t\tconst langs = this.app.getService(\"locale\"); //dapatkan layanan lokal\n\t\t/*\n\t\tGunakan this.getRoot() untuk membuka widget Webix teratas di dalam JetView\n\t\tIni dia Toolbar\n\t\t*/\n\t\tconst value = this.getRoot().queryView(\"segmented\").getValue(); //dapatkan nilai tersegmentasi\n\t\tlangs.setLang(value); //atur nilai Lokal\n\t}", "handleLangChange() {\n let newLan = (getLanguage(this.props.user) + 1) % clientConfig.languages.length;\n this.props.changeLanguageLocal(newLan);\n }", "function changeLanguage() {\n \tvar e = document.getElementById(\"lang_select\");\n \tvar lang = e.options[e.selectedIndex].value;\n \tvar prevBox = document.getElementById('preview_div');\n\n\t// Choosing between rtl and ltr languages.\n\tif (lang == 'ar' || lang == 'he') {\n\t\tprevBox.setAttribute('dir', 'rtl');\n\t} else {\n\t\tprevBox.setAttribute('dir', 'ltr');\n\t}\n\n\t// We need to reset the WYSIWYG editor to change the language.\n\t// resetEditor(lang, getWirisEditorParameters());\n\twindow.location.search = 'language=' + lang;\n}", "function changeStoryLanguage(story, questions) {\r\n document.querySelector(\".main-text\").innerText = story;\r\n document.querySelector(\".questions-text\").innerHTML = questions;\r\n}", "function addLanguages() {}", "function reloadLanguage() {\n document.querySelectorAll(\"*\").forEach(function (node) {\n let translate = node.getAttribute(\"data-translate\");\n let translateTitle = node.getAttribute(\"data-translate-title\");\n let translatePlaceholder = node.getAttribute(\"data-translate-placeholder\");\n let languageList = node.getAttribute(\"data-languages-list\");\n let custom = node.getAttribute(\"data-languages-custom\");\n\n let languagePath = loadedTranslationData[currentLang];\n let fallbackPath = loadedTranslationData[defaultLang];\n\n if (translate)\n node.innerHTML = languagePath[translate]\n ? languagePath[translate]\n : fallbackPath[translate]\n ? fallbackPath[translate]\n : translate;\n if (translateTitle)\n node.title = languagePath[translateTitle]\n ? languagePath[translateTitle]\n : fallbackPath[translateTitle]\n ? fallbackPath[translateTitle]\n : translateTitle;\n if (translatePlaceholder)\n node.placeholder = languagePath[translatePlaceholder]\n ? languagePath[translatePlaceholder]\n : fallbackPath[translatePlaceholder]\n ? fallbackPath[translatePlaceholder]\n : translatePlaceholder;\n if (languageList) {\n node.innerHTML = \"\";\n for (const locale of availableLanguages) {\n const langCode = locale.baseName;\n const languageNames = new Intl.DisplayNames([langCode], {type: 'language'});\n const dispName = languageNames.of(langCode);\n const replace = languageList\n .replace(/%langCode%/g, langCode)\n .replace(/%langDispName%/g, dispName)\n .replace(/%langCodeQ%/g, '\"' + langCode + '\"')\n .replace(/%langDispName%/g, '\"' + dispName + '\"');\n node.innerHTML += replace;\n }\n }\n if (custom) {\n const pairs = custom.split(\";\");\n for (const p in pairs)\n if (pairs.hasOwnProperty(p)) {\n const pair = pairs[p].split(\":\");\n const attr = pair[0];\n const valueKey = pair[1];\n const value = languagePath[valueKey]\n ? languagePath[valueKey]\n : fallbackPath[valueKey]\n ? fallbackPath[valueKey]\n : valueKey;\n node.setAttribute(attr, value);\n }\n }\n });\n}", "function manageLang(){\n\n\t//change default language if \"es\" in URL\n\tconst langBtns = document.querySelectorAll('.intro-langmenu a');\n\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\tlet lang = urlParams.get('lang');\n\tchangeLang(lang || undefined);\n\n\tif(lang){\n\t\tfor(let e = 0; e < langBtns.length; e++){\n\t\t\tlangBtns[e].setAttribute('aria-current', '');\n\t\t}\n\t\tdocument.querySelector('.intro-langmenu a[lang=\"' + lang + '\"]').setAttribute('aria-current', 'true');\n\t}else{\n\t\tlang = 'en';\n\t}\n\n\t//add events to language buttons in about page\n\tfor( let i = 0; i < langBtns.length; i++){\n\t\tlangBtns[i].addEventListener('click', function(e){\n\t\t\te.preventDefault();\n\t\t\tfor(let e = 0; e < langBtns.length; e++){\n\t\t\t\tlangBtns[e].setAttribute('aria-current', '');\n\t\t\t}\n\t\t\te.currentTarget.setAttribute('aria-current', 'true');\n\t\t\tconst lang = langBtns[i].getAttribute('lang');\n\t\t\tchangeLang(lang);\t\n\t\t});\n\t}\n\n\treturn lang;\n\n}", "function translatePage() {\n\t\tif (translationData != undefined) {\n\t\t\tvar root = translationData.getElementsByTagName(settings.language).item(settings.language);\n\t\t\tif (root != null) {\n\t\t\t\t// Translate HTML attributes\n\t\t\t\ttranslateEntries(root, $(\"p, span, th, td, strong, dt, button, li.dropdown-header\"), \"textContent\");\n\t\t\t\ttranslateEntries(root, $(\"h1, h4, label, a, #main_content ol > li:first-child, ol.breadcrumb-directory > li:last-child\"), \"textContent\");\n\t\t\t\ttranslateEntries(root, $(\"input[type='text']\"), \"placeholder\");\n\t\t\t\ttranslateEntries(root, $(\"a, abbr, button, label, li, #chart_temp, input, td\"), \"title\");\n\t\t\t\ttranslateEntries(root, $(\"img\"), \"alt\");\n\n\t\t\t\t// This doesn't work with data attributes though\n\t\t\t\t$(\"button[data-content]\").each(function() {\n\t\t\t\t\t$(this).attr(\"data-content\", T($(this).attr(\"data-content\")));\n\t\t\t\t});\n\n\t\t\t\t// Update SD Card button caption\n\t\t\t\t$(\"#btn_volume > span.content\").text(T(\"SD Card {0}\", currentGCodeVolume));\n\n\t\t\t\t// Set new language on Settings page\n\t\t\t\t$(\"#btn_language\").data(\"language\", settings.language).children(\"span:first-child\").text(root.attributes[\"name\"].value);\n\t\t\t\t$(\"html\").attr(\"lang\", settings.language);\n\t\t\t}\n\t\t}\n\t}", "changeLanguage(e) {\n\t\tconst lang = e.target.value;\n\t\tif (lang !== undefined && possibleLanguages.indexOf(lang !== -1)) {\n\t\t\tcookie.save(\"lang\", lang, {path: cookiesPath, expires: new Date(new Date().getTime() +1000*60*60*24*365), sameSite: \"strict\"});\n\t\t\tthis.setState({language: lang});\n\t\t}\n\t}", "updateLocalizedContent() {\n // Reload the terms contents.\n $('oobe-eula-md').updateLocalizedContent();\n }", "function changeLanguage(pLang) {\n\twindow.location.href = updateURLParameter(window.location.href, 'lang', pLang);\n}", "function initLanguage() {\n if(getLanguage()) return;\n setItem('language', 'sv');\n}", "function translate(language) {\n if (language === \"es\") {\n return \"Hola, mundo!\";\n } else if (language === \"fr\") {\n return \"Bonjour le monde\";\n } else {\n return \"Hello, World\";\n }\n\n}", "function BrowserLanguage() {\n}", "function translatePageToFrench() {\n $(\"#title\").html(\"Les petits motifs d'inspiration\");\n $(\"#subtitle\").html(\"Remplis-toi avec l'inspiration du jour avec ce petit projet pour pratiquer les langues.\")\n $(\"#get-quote\").html(\"Dis-moi un autre\");\n $(\"#translate-english\").show();\n $(\"#translate-spanish\").show();\n $(\"#translate-french\").hide();\n quoteArray = quoteArrayFr;\n twitterHashtags = twitterHashtagsFr;\n displayRandomQuote();\n}", "function translatePageToEnglish() {\n $(\"#title\").html(\"Bite-Size Inspiration\");\n $(\"#subtitle\").html(\"Fill up on your daily inspiration with this mini-project for practicing languages.\")\n $(\"#get-quote\").html(\"Tell me another\");\n $(\"#translate-english\").hide();\n $(\"#translate-spanish\").show();\n $(\"#translate-french\").show();\n quoteArray = quoteArrayEn;\n twitterHashtags = twitterHashtagsEn;\n displayRandomQuote();\n}", "function change_language(ev)\n {\n cuelang = this.value;\n\n // Set the lang attribute of the cue_elt.\n cue_elt.setAttribute(\"lang\", cuelang);\n\n // Set the cue_elt to the current caption in the chosen language.\n let i = 0, len = subtitles.length;\n while (i < len && subtitles[i].language !== cuelang) i++;\n if (i == len) {\n cue_elt.innerHTML = \"\";\n } else {\n let t = subtitles[i];\n if (t.mode === \"disabled\") t.mode = \"hidden\"; // Ensure it will be loaded\n if (!t.activeCues || !t.activeCues.length) cue_elt.innerHTML = \"\";\n else cue_elt.innerHTML = t.activeCues[0].text;\n }\n }", "_setLanguage(language) {\n strings.setLanguage(global.lang[language].shortform)\n global.languageSelected = global.lang[language].shortform\n Alert.alert(strings.changeLanguage, strings.getString(global.lang[language].longform))\n }", "function setLang(langValue) {\n gCurrLang = langValue;\n}", "function returnLanguage() {\n var lang = document.location.href.split('/')[3];\n var uaText = {\n open: 'Читати далі',\n close: 'Згорнути'\n };\n var ruText = {\n open: 'Читать далее',\n close: 'Свернуть'\n };\n var enText = {\n open: 'Read more',\n close: 'Close'\n };\n if(lang=='ru') {\n return ruText;\n } else if(lang=='en') {\n return enText;\n } else {\n return uaText;\n }\n }", "function initializeLangVars() {\nswitch (Xlang) {\n// --------------------------------------------------------------------------------------------------------------------------------------------------------------------\n// - The 03/02/2010 ------------- by Ptitfred06\n// Modification : small word to have good view in tasklist\n// - Small modification on word (translation).\n// - comment what can be personnalise / and what can't \n// -----------------------------------------------------------------------\n\tcase \"fr\": // thanks Tuga\n// Texte détécté dans les page Travian (NE PAS CHANGER / No CHANGE !!!)\n\t\taLangAllBuildWithId = [\"Bûcheron\", \"Carrière de terre\", \"Mine de fer\", \"Ferme\", \"\", \"Scierie\", \"Usine de poteries\", \"Fonderie\", \"Moulin\", \"Boulangerie\", \"Dépôt de ressources\", \"Silo de céréales\", \"Armurerie\", \"Usine d'armures\", \"Place du tournoi\", \"Bâtiment principal\", \"Place de rassemblement\", \"Place du Marché\", \"Ambassade\", \"Caserne\", \"Écurie\", \"Atelier\", \"Académie\", \"Cachette\", \"Hôtel de ville\", \"Résidence\", \"Palais\", \"Chambre aux trésors\", \"Comptoir de commerce\", \"Grande Caserne\", \"Grande Écurie\", \"Mur d'enceinte\", \"Mur de terre\", \"Palissade\", \"Tailleur de Pierres\", \"Brasserie\", \"Fabricant de pièges\",\"Manoir du héros\", \"Grand dépôt de ressources\", \"Grand silo de céréales\", \"Merveille du monde\", \"Abreuvoir\"];\n\t\taLangAllBuildAltWithId = [/*\"Bûcheron\"*/, \"Carrière de Terre\", /*\"Mine de fer\"*/, \"Ferme de céréales\", \"\", /*\"Scierie\"*/, \"Usine de Poteries\", /*\"Fonderie\", \"Moulin\"*/,/* \"Boulangerie\"*/, /*\"Dépôt de ressources\"*/, /*\"Silo de céréales\"*/, /*\"Armurerie\"*/, /*\"Usine d'armures\"*/, /*\"Place du tournoi\"*/, \"Bâtiment Principal\", /*\"Place de rassemblement\"*/, \"Place du marché\", /*\"Ambassade\"*/, /*\"Caserne\"*/, /*\"Écurie\"*/, /*\"Atelier\"*/, /*\"Académie\"*/, /*\"Cachette\"*/, \"Hôtel de Ville\", /*\"Résidence\"*/, /*\"Palais\"*/, /*\"Chambre aux trésors\"*/, \"Comptoir de commerce\", \"Grande Caserne\", \"Grande Écurie\", \"Mur d'enceinte\", \"Mur de terre\", \"Palissade\", \"Tailleur de Pierres\", \"Brasserie\", \"Fabricant de pièges\",\"Manoir du Héros\", \"Grand dépôt de ressources\", \"Grand silo de céréales\", \"Merveille du monde\", \"Abreuvoir\"];\n\n// <-- Peu être modifié / can be personnalize\n\t\taLangAddTaskText = [\"Ajouter tache\", \"Type\", \"Village actif\", \"Cible\", \"Vers\", \"Mode\", \"Aide Const.\", \"Quantité de ress.\", \"Bouger vers le haut\", \"Bouger vers le bas\", \"Effacer\", \"&#160;&#160;&#160;Taches\", \"Bouger \", \"Eliminer toutes les tâches\"];\n\t\taLangTaskKind = [\"Évol \", \"N Cons \", \"Att \", \"Rech \", \"Entrai \", \"Trans \", \"NPC\", \"Dém \", \"Fête\"];\n// -->\n\n// <-- Peu être modifié / can be personnalize\n\t\taLangGameText = [\"Niv\", \"Marchands\", \"Id\", \"Capitale\", \"Temps début\", \"this timeseting is unuseful now.\", \"Vers\", \"Village\", \"Transport\", \"de\", \"Transport vers\", \"Transport de\", \"Retour de\", \"Ressources\", \"Bâtiment\", \"Construire un nouveau bâtiment\", \"Vide\", \"Niveau\"];\n// original \taLangGameText = [\"Niveau\", \"Marchands\", \"Identification\", \"Capitale\", \"Inicio\", \"this timeseting is unuseful now.\", \"Vers\", \"Village\", \"Transport\", \"de\", \"Transport vers\", \"Transport de\", \"Retour de\", \"Ressources\", \"Bâtiment\", \"Construire un nouveau bâtiment\", \"Vazio\", \"Niveau\"];\n// -->\tfin\t\n\n\t\taLangRaceName = [\"Romains\", \"Germains\",\"Gaulois\"];\n// <-- Peu être modifié\n\t\taLangTaskOfText = [\"Planifier evolution\", \"Planifier nouvelle construction\", \"RessUpD\", \"OFF\", \"Comencer\", \"ON\", \"Arreter\", \"La distribution des champs de ce village est \", \"AutoT\", \"Auto transport n est pas ouvert\", \"Ouvert\", \"Transport avec succès\", \"Taches\", \"Limit\", \"Defaut\", \"Modifier\", \"Bois/Terre/Fer\", \"Céréales\", \"Planification de demolition\", \"Planif.Attaque\", \"Type d´attaque\", \"Temps de voyage\", \"Repeter numero de fois\", \"Temps de intervales\",\"00:30:00\",\"Cible catapulte\",\"Aléatoire\", \"Inconnu\", \" Fois\", \"/\", \" \", \"Troupes envoyées\", \"Planification d´entrainement\",\"Train ubication\",\"Planification d´entrainement fini\",\"TransP\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default sont 20 minutes, Insérer nouveau temps:\\n\\n\",\"Remain\",\"Planifier fête\",\"petite fête\",\"grande fête\",\"Set Interval of Ressources concentration\",\"minutes\",\".\",\".\",\"START\",\"STOP\",\"Planifier entrainement\",\"Augmenter Attaque\",\"Augmenter Defense\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n// -->> fin\n// < ne pas change / no change !!! Detected for the feedback error.\n\t\taLangErrorText = [\"Pas assez de ressources\", \"Les ouvriers sont déjà au travail\", \"Construction complète\", \"Début de la construction\", \"Dans développement\", \"Son Dépôt de ressources est petit. Évolue son Dépôt de ressources pour continuer sa construction\", \"Son silo de céréales est petit. Évolue son Silo de céréales pour continuer sa construction\", \"Ressources suffisantes\",\"Une fête est déjà organisée\"];\n// -->> fin\n\t\taLangOtherText = [\"Il remarque important\", \"Seulement les champs de ressources du capitale <br/>peuvent être élevés à niveau 20. Son capital <br/> n'est pas décelable. S'il vous plaît il visite son profil.\", \"Raccourci ici ^_^\", \"Installation conclue\", \"Annulé\", \"Initier les tâches\", \"Upgrade avec succès\", \"Exécuter avec succès\", \"Sa race est inconnue, et son type de troupe aussi. <br/>Il visite son profil pour déterminer la race.<br/>\", \"S'il vous plaît il visite sa Manoir du héros pour déterminer<br/>la vitesse et le type de héros.\"];\n\t\taLangResources=[\"Bois\",\"Terre\",\"Fer\",\"Céréales\"];\n\t\taLangTroops[0] = [\"Légionnaire\", \"Prétorien\", \"Impérian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Bélier\", \"Catapulte de feu\", \"Sénateur\", \"Colon\", \"Héros\"];\n\t\taLangTroops[1] = [\"Combattant au gourdin\", \"Combattant à la lance\", \"Combattant à la hache\", \"Eclaireur\", \"Paladin\", \"Cavalier Teuton\", \"Bélier\", \"Catapulte\", \"Chef de tribu\", \"Colon\", \"Héros\"];\n\n// <-- NE PAS modifier // Utilisé dans plannification d'attaque, dans recherche de niveau suppèrieur / NO CHANGE !!\n\t\taLangTroops[2] = [\"Phalange\", \"Combattant à l'épée\", \"Eclaireur\", \"Eclair de Toutatis\", \"Cavalier druide\", \"Hédouin\", \"Bélier\", \"Catapulte de Guerre\", \"Chef\", \"Colon\", \"Héros\"];\n// original\taLangTroops[2] = [\"Phalange\", \"Combattant à l'épée\", \"Eclaireur\", \"Eclair de Toutatis\", \"Cavalier druide\", \"Hédouin\", \"Bélier\", \"Catapulte de Guerre\", \"Chef\", \"Colon\", \"Héros\"];\n\n// <-- Peu être modifié // Label des taches / CAN BE CHANGE\n// original\taLangAttackType = [\"Assistance\", \"Attaque\", \"Pillage\"];\n\t\taLangAttackType = [\"Ass.\", \"Att.\", \"Pill.\"];\n// -->\t\t\n\t\tbreak;\n// -------------------------------------------------------------------------------------------------------------------------------\n\n\tcase \"cc\": // 2011.02.13 -- yesren\n\tcase \"cn\": // 感谢K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木场\", \"黏土矿\", \"铁矿场\", \"农场\", \"\", \"木材厂\", \"砖块厂\", \"铸造厂\", \"磨坊\", \"面包房\", \"仓库\", \"粮仓\", \"铁匠铺\", \"军械库\", \"竞技场\", \"中心大楼\", \"集结点\", \"市场\", \"大使馆\", \"兵营\", \"马厩\", \"工场\", \"研发所\", \"山洞\", \"市政厅\", \"行宫\", \"皇宫\", \n\t\t\t\"宝库\", \"交易所\", \"大兵营\", \"大马厩\", \"罗马城墙\", \"日尔曼城墙\", \"高卢城墙\", \"石匠铺\", \"酿酒厂\", \"陷阱机\", \"英雄园\", \"大仓库\", \"大粮仓\", \"世界奇观\", \"饮马槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木场\", \"黏土矿\", \"铁矿场\", \"农场\", \"\", \"木材厂\", \"砖块厂\", \"铸造厂\", \"磨坊\", \"面包房\", \"仓库\", \"粮仓\", \"铁匠铺\", \"军械库\", \"竞技场\", \"中心大楼\", \"集结点\", \"市场\", \"大使馆\", \"兵营\", \"马厩\", \"工场\", \"研发所\", \"山洞\", \"市政厅\", \"行宫\", \"皇宫\", \n\t\t\t\"宝库\", \"交易所\", \"大兵营\", \"大马厩\", \"罗马城墙\", \"日尔曼城墙\", \"高卢城墙\", \"石匠铺\", \"酿酒厂\", \"陷阱机\", \"英雄园\", \"大仓库\", \"大粮仓\", \"世界奇观\", \"饮马槽\"];\n\t\taLangAddTaskText = [\"添加任务\", \"任务类型\", \"所在村\", \"任务对象\", \"目标\", \"模式\", \"支援建设\", \"资源集中\", \"上移\", \"下移\", \"删除\", \"任务内容\", \"移动\", \"清除所有任务\"];\n\t\taLangTaskKind = [\"升级\", \"新建\", \"攻击\", \"研发\", \"训练\", \"运输\", \"活动\", \"拆除\", \"定制运输\"];\n\t\taLangGameText = [\"等级\", \"商人\", \"坑号\", \"主村\", \"执行时间\", \"此时间设置目前无效\", \"到\", \"村庄\", \"运送\", \"回来\", \"向\", \"来自于\", \"从\", \"资源\", \"建筑\", \"建造新的建筑\", \"空\", \"等级\"];\n\t\taLangRaceName = [\"罗马人\", \"日尔曼人\", \"高卢人\"];\n\t\taLangTaskOfText = [\"预定升级\", \"预定新建\", \"资源自动升级\", \"尚未开启\", \"马上开启\", \"已经开启\", \"点击关闭\", \"该村资源田分布\", \"自动运输\", \"自动运输尚未设定\", \"已设定\", \"运送成功\", \"任务列表\", \"资源输入限额\", \"默认\", \"更改\", \"木/泥/铁\", \"粮食\", \"预定拆除\",\n\t\t\t\"预定发兵\", \"攻击类型\", \"到达所需时间\", \"重复次数\", \"间隔时间\", \"00:30:00\", \"投石目标\", \"随机\", \"未知\", \"次\", \"月\", \"日\", \"部队已发出\",\"预定训练\",\"训练设施\",\"训练任务已执行\",\"定制运输\",\"设定页面刷新间隔\",\n\t\t\t\"页面刷新的间隔时间,是指隔多久执行一次页面的自动载入。\\n此时间过短,会增加被系统侦测到的危险,过长则影响任务执行的效率。\\n默认为20分钟,请输入新的时间间隔:\\n\\n\",\"资源输出保留\",\"预定活动\",\"小型活动\",\"大型活动\",\"资源集中模式的运输间隔\",\n\t\t\t\"分钟\",\"暂停中\",\"开启中\",\"开启\",\"暂停\",\"预定改良\",\"改良攻击\",\"改良防御\", \"资源过剩检查\", \"已经开启\", \"已经关闭\", \"粮田自动升级\", \"切换\"];\n\t\taLangErrorText = [\"资源不足\", \"已经有建筑在建造中\", \"建造完成\", \"将马上开始全部建造\", \"在开发中\", \"建造所需资源超过仓库容量上限,请先升级你的仓库\", \"建造所需资源超过粮仓容量上限,请先升级你的粮仓\", \"资源何时充足时间提示\",\"粮食产量不足: 需要先建造一个农场\",\"一个活动正在举行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的资源田可以升级到20,<br />目前主村尚未识别,点击个人资料<br />页面可以解决这一问题\", \"五星级传送门^_^\", \"已经设置完成\", \"已经取消\", \"开始执行任务\", \"升级成功\", \"已顺利执行\", \"种族尚未确认,兵种也就无法确定,<br />请点击个人资料页面,以便侦测种族\", \"然后,请顺便访问英雄园,以便确认<br />英雄的种类和速度。<br />\"];\n\t\taLangResources=[\"木材\",\"泥土\",\"铁块\",\"粮食\"];\n\t\taLangTroops[0] = [\"古罗马步兵\", \"禁卫兵\", \"帝国兵\", \"使节骑士\", \"帝国骑士\", \"将军骑士\", \"冲撞车\", \"火焰投石器\", \"参议员\", \"拓荒者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧头兵\", \"侦察兵\", \"圣骑士\", \"日耳曼骑兵\", \"冲撞车\", \"投石器\", \"执政官\", \"拓荒者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方阵兵\", \"剑士\", \"探路者\", \"雷法师\", \"德鲁伊骑兵\", \"海顿圣骑士\", \"冲撞车\", \"投石器\", \"首领\", \"拓荒者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻击\", \"抢夺\"];\n\t\tbreak;\n\t\t\n\tcase \"hk\": // 感谢sean3808、K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\",\"\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬棚\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬棚\", \"城牆\", \"土牆\", \"木牆\", \"石匠鋪\", \"釀酒廠\", \"陷阱\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\",\"\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬棚\", \"工場\", \"研究院\", \"山洞\", \"城鎮廳\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬棚\", \"城牆\", \"土牆\", \"木牆\", \"石匠鋪\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAddTaskText = [\"添加任務\", \"任務類型\", \"所在村\", \"任務對象\", \"目標\", \"模式\", \"支援建設\", \"資源集中\", \"上移\", \"下移\", \"刪除\", \"任務內容\", \"移動\", \"清除所有任務\"];\n\t\taLangTaskKind = [\"升級\", \"新建\", \"攻擊\", \"研發\", \"訓練\", \"運輸\", \"平倉\", \"拆除\", \"活動\"];\n\t\taLangGameText = [\"等級\", \"商人\", \"坑號\", \"主村\", \"執行時間\", \"該時間設置尚未啟用\", \"到\", \"村莊\", \"運送\", \"回來\", \"運輸到\", \"從\", \"由\", \"資源\", \"建築\", \"建造新的建築物\", \"empty\", \"等級\"];\n\t\taLangRaceName = [\"羅馬人\", \"條頓人\", \"高盧人\"];\n\t\taLangTaskOfText = [\"預定升級\", \"預定建築\", \"資源自動升級\", \"尚未開啟\", \"馬上開啟\", \"已經開啟\", \"點擊關閉\", \"該村資源分布\", \"自動運輸\", \"自動運輸尚未設定\", \"已設定\", \"運送成功\", \"任務列表\", \"資源輸入限額\", \"默認\", \"更改\", \"木/磚/鐵\", \"穀物\", \"預定拆除\",\n\t\t\t\"預定發兵\", \"攻擊類型\", \"到達所需時間\", \"重複次數\", \"間隔時間\", \"00:30:00\", \"投石目標\", \"隨機\", \"未知\", \"次\", \"月\", \"日\", \"部隊已發出\",\"預定訓練\",\"訓練設施\",\"訓練任務已執行\",\"定制運輸\",\"設定頁面刷新間隔\",\"頁面刷新的間隔時間,是指隔多久執行一次頁面的自動載入。\\n此時間過短,會增加被系統偵測到的危險,過長則影響任務執行的效率。\\n默認為20分鐘,請輸入新的時間間隔:\\n\\n\",\"資源輸出保留\",\"預定活動\",\"小型活動\",\"大型活動\",\"資源集中模式的間隔時間\",\n\t\t\t\"分鐘\",\"暫停中\",\"開啟中\",\"開啟\",\"暫停\",\"預定改良\",\"改良攻擊\",\"改良防御\", \"資源過剩檢查\", \"已經開啟\", \"已經關閉\", \"糧田自動升級\", \"切換\"];\n\t\taLangErrorText = [\"資源不足\", \"工作正在進行中\", \"完全地開發\", \"將馬上開始全部建造\", \"在開發中\", \"倉庫需要升級\", \"糧倉需要升級\", \"資源何時充足時間提示\",\"糧食產量不足: 需要先建造一個農場\",\"派對進行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的資源田可以升級到20,<br/>目前主村尚未識別,點擊個人資料<br/>頁面可以解決這一問題\", \"五星級傳送門^_ ^\", \"已經設置完成\", \"已經取消\", \"開始執行任務\", \"升級成功\", \"已順利執行\", \"種族尚未確認,兵種也就無法確定,<br/>請點擊個人資料頁面,以便偵測種族\", \"然後,請順便訪問英雄園,以便確認<br/>英雄的種類和速度。<br/>\"];\n\t\taLangResources=[\"木材\",\"磚塊\",\"鋼鐵\",\"穀物\"];\n\t\taLangTroops[0] = [\"古羅馬步兵\", \"禁衛兵\", \"帝國兵\", \"使者騎士\", \"帝國騎士\", \"將軍騎士\", \"衝撞車\", \"火焰投石機\", \"參議員\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧頭兵\", \"偵察兵\", \"遊俠\", \"條頓騎士\", \"衝撞車\", \"投石機\", \"司令官\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方陣兵\", \"劍士\", \"探路者\", \"雷法師\", \"德魯伊騎兵\", \"海頓聖騎\", \"衝撞車\", \"投石機\", \"族長\", \"開拓者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻擊\", \"搶奪\"];\n\t\tbreak;\n\n\tcase \"tw\": // 感谢adobe、魎皇鬼、ieyp、K.C.Alvis\n\t\taLangAllBuildWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\", \"農田\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬廄\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬廄\", \"城牆\", \"土牆\", \"木牆\", \"石匠舖\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAllBuildAltWithId = [\"伐木場\", \"泥坑\", \"鐵礦場\", \"農場\", \"農田\", \"鋸木廠\", \"磚廠\", \"鋼鐵鑄造廠\", \"麵粉廠\", \"麵包店\", \"倉庫\", \"穀倉\", \"鐵匠\", \"盔甲廠\", \"競技場\", \"村莊大樓\", \"集結點\", \"市場\", \"大使館\", \"兵營\", \"馬廄\", \"工場\", \"研究院\", \"山洞\", \"村會堂\", \"行宮\", \"皇宮\", \"寶物庫\", \"交易所\", \"大兵營\", \"大馬廄\", \"城牆\", \"土牆\", \"木牆\", \"石匠舖\", \"釀酒廠\", \"陷阱機\", \"英雄宅\", \"大倉庫\", \"大穀倉\", \"世界奇觀\", \"放牧水槽\"];\n\t\taLangAddTaskText = [\"添加任務\", \"任務類型\", \"所在村\", \"任務對象\", \"目標\", \"模式\", \"支援建設\", \"資源集中\", \"上移\", \"下移\", \"刪除\", \"任務內容\", \"移動\", \"清除所有任務\"];\n\t\taLangTaskKind = [\"升級\", \"新建\", \"攻擊\", \"研發\", \"訓練\", \"運輸\", \"平倉\", \"拆除\", \"活動\"];\n\t\taLangGameText = [\"等級\", \"商人\", \"坑號\", \"主村\", \"執行時間\", \"該時間設置尚未啟用\", \"到\", \"村莊\", \"運送\", \"回來\", \"運送到\", \"從\", \"由\", \"資源\", \"建築\", \"建造新的建築物\", \"empty\", \"等級\"];\n\t\taLangRaceName = [\"羅馬人\", \"條頓人\", \"高盧人\"];\n\t\taLangTaskOfText = [\"預定升級\", \"預定建築\", \"資源自動升級\", \"尚未開啟\", \"馬上開啟\", \"已經開啟\", \"點擊關閉\", \"該村資源分布\", \"自動運輸\", \"自動運輸尚未設定\", \"已設定\", \"運送成功\", \"任務列表\", \"資源輸入限額\", \"默認\", \"更改\", \"木/磚/鐵\", \"穀物\", \"預定拆除\",\n\t\t\t\"預定發兵\", \"攻擊類型\", \"到達所需時間\", \"重複次數\", \"間隔時間\", \"00:30:00\", \"投石目標\", \"隨機\", \"未知\", \"次\", \"月\", \"日\", \"部隊已發出\",\"預定訓練\",\"訓練設施\",\"訓練任務已執行\",\"定制運輸\",\"設定頁面刷新間隔\",\"頁面刷新的間隔時間,是指隔多久執行一次頁面的自動載入。\\n此時間過短,會增加被系統偵測到的危險,過長則影響任務執行的效率。\\n默認為20分鐘,請輸入新的時間間隔:\\n\\n\",\"資源輸出保留\",\"預定活動\",\"小型活動\",\"大型活動\",\"資源集中模式的間隔時間\",\n\t\t\t\"分鐘\",\"暫停中\",\"開啟中\",\"開啟\",\"暫停\",\"預定改良\",\"改良攻擊\",\"改良防御\", \"資源過剩檢查\", \"已經開啟\", \"已經關閉\", \"糧田自動升級\", \"切換\"];\n\t\taLangErrorText = [\"資源不足\", \"已經有建築在建造中\", \"建造完成\", \"將馬上開始全部建造\", \"在開發中\", \"建造所需資源超過倉庫容量上限,請先升級你的倉庫\", \"建造所需資源超過糧倉容量上限,請先升級你的糧倉\", \"資源何時充足時間提示\",\"糧食產量不足: 需要先建造一個農場\",\"派對進行中\"];\n\t\taLangOtherText = [\"重要提示\", \"只有主村的資源田可以升級到20,<br/>目前主村尚未識別,點擊個人資料<br/>頁面可以解決這一問題\", \"五星級傳送門^_ ^\", \"已經設置完成\", \"已經取消\", \"開始執行任務\", \"升級成功\", \"已順利執行\", \"種族尚未確認,兵種也就無法確定,<br/>請點擊個人資料頁面,以便偵測種族\", \"然後,請順便訪問英雄園,以便確認<br/>英雄的種類和速度。<br/>\"];\n\t\taLangResources=[\"木材\",\"磚塊\",\"鋼鐵\",\"穀物\"];\n\t\taLangTroops[0] = [\"古羅馬步兵\", \"禁衛兵\", \"帝國兵\", \"使者騎士\", \"帝國騎士\", \"將軍騎士\", \"衝撞車\", \"火焰投石機\", \"參議員\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[1] = [\"棍棒兵\", \"矛兵\", \"斧頭兵\", \"偵察兵\", \"遊俠\", \"條頓騎士\", \"衝撞車\", \"投石機\", \"司令官\", \"開拓者\", \"英雄\"];\n\t\taLangTroops[2] = [\"方陣兵\", \"劍士\", \"探路者\", \"雷法師\", \"德魯伊騎兵\", \"海頓聖騎\", \"衝撞車\", \"投石機\", \"族長\", \"開拓者\", \"英雄\"];\n\t\taLangAttackType = [\"支援\", \"攻擊\", \"搶奪\"];\n\t\tbreak;\n\n\tcase \"fi\": // thanks Christer82\n\t\taLangAllBuildWithId = [\"Puunhakkaaja\", \"Savimonttu\", \"Rautakaivos\", \"Viljapelto\", \"\", \"Saha\", \"Tiilitehdas\", \"Rautavalimo\", \"Mylly\", \"Leipomo\", \"Varasto\", \"Viljasiilo\", \"Aseseppä\", \"Haarniskapaja\", \"Turnausareena\", \"Päärakennus\", \"Kokoontumispiste\", \"Tori\", \"Lähetystö\", \"Kasarmi\", \"Talli\", \"Työpaja\", \"Akatemia\", \"Kätkö\", \"Kaupungintalo\", \"Virka-asunto\", \"Palatsi\", \"Aarrekammio\", \"Kauppavirasto\", \"Suuri kasarmi\", \"Suuri talli\", \"Kaupungin muuri\", \"Maamuuri\", \"Paaluaita\", \"Kivenhakkaaja\", \"Panimo\", \"Ansoittaja\",\"Sankarin kartano\", \"Suuri varasto\", \"Suuri viljasiilo\", \"Maailmanihme\", \"Hevostenjuottoallas\"];\n\t\taLangAllBuildAltWithId = [\"Puunhakkaaja\", \"Savimonttu\", \"Rautakaivos\", \"Viljapelto\", \"\", \"Saha\", \"Tiilitehdas\", \"Rautavalimo\", \"Mylly\", \"Leipomo\", \"Varasto\", \"Viljasiilo\", \"Aseseppä\", \"Haarniskapaja\", \"Turnausareena\", \"Päärakennus\", \"Kokoontumispiste\", \"Tori\", \"Lähetystö\", \"Kasarmi\", \"Talli\", \"Työpaja\", \"Akatemia\", \"Kätkö\", \"Kaupungintalo\", \"Virka-asunto\", \"Palatsi\", \"Aarrekammio\", \"Kauppavirasto\", \"Suuri kasarmi\", \"Suuri talli\", \"Kaupungin muuri\", \"Maamuuri\", \"Paaluaita\", \"Kivenhakkaaja\", \"Panimo\", \"Ansoittaja\",\"Sankarin kartano\", \"Suuri varasto\", \"Suuri viljasiilo\", \"Maailmanihme\", \"Hevostenjuottoallas\"];\n\t\taLangAddTaskText = [\"Lisää tehtävä\", \"Tyyli\", \"Kohdistettu kylä\", \"Tehtävän kohde\", \"Minne:\", \"Tyyppi\", \"Rakennustuki\", \"Resurssien keskittäminen\", \"Siirry ylös\", \"Siirry alas\", \"Poista\", \"&#160;&#160;&#160;Tehtävän sisältö\", \"Siirry \", \"Poista kaikki tehtävät\"];\n\t\taLangTaskKind = [\"Päivitä\", \"Uusi rakennus\", \"Hyökkäys\", \"Tutkimus\", \"Koulutus\", \"Kuljetus\", \"NPC\", \"Hajotus\", \"Juhla\"];\n\t\taLangGameText = [\"Taso\", \"Kauppiaat\", \"ID\", \"Pääkaupunki\", \"Aloitusaika\", \"Tätä aika-asetusta ei voi nyt käyttää.\", \"minne:\", \"Kylä\", \"kuljetus\", \"mistä\", \"Kuljeta kylään\", \"Kuljeta kylästä\", \"Palaa kylästä\", \"Resurssit\", \"rakennus\", \"Rakenna uusi rakennus\", \"tyhjä\", \"taso\"];\n\t\taLangRaceName = [\"Roomalaiset\", \"Teutonit\", \"Gallialaiset\"];\n\t\taLangTaskOfText = [\"Aseta kentän päivitys\", \"Aseta uusi rakennuskohde\", \"Automaattinen resurssipäivitys\", \"Ei toimintaa\", \"Aloita\", \"Aloitettu\", \"Keskeytä\", \"Tämän kylän resurssikenttien jakauma on \", \"Automaattikuljetus\", \"automaattikuljetusta ei ole avattu\", \"Avattu\", \"Kuljetus onnistui\", \"Tehtäväluettelo\", \"Trans_In_limit\", \"Perusasetus\", \"Muokkaa\", \"Puu/Savi/Rauta\", \"vilja\", \"Tehtävälistan poisto\",\n\t\t\t\"Schedule attack\", \"Hyökkäystyyppi\", \"Kuljetusaika\", \"toistokerrat\", \"Hyökkäysaikaväli\",\"00:30:00\",\"Katapultin kohde\",\"Satunnainen\", \"Tuntematon\", \"kertaa\", \"Kuukausi\", \"Päivä\", \"Joukot on lähetetty\",\"Aseta koulutustehtävä\",\"Koulutuskohde\",\"Koulutustehtävä suoritettu\",\"waitForTranslate\",\"setup Hyökkäysaikaväli of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minutes\",\"pausing\",\"running\",\"run\",\"pause\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Liian vähän resursseja\", \"Työntekijät ovat jo töissä.\", \"Rakennuskohde valmis\", \"Aloitetaan rakentaminen\", \"Työ kesken\", \"Varastosi on liian pieni. Suurenna varastoa aloittaaksesi rakentamisen\", \"Viljasiilosi on liian pieni. Suurenna viljasiiloa aloittaaksesi rakentamisen\", \"Riittävästi resursseja\"];\n\t\taLangOtherText = [\"Tärkeä huomautus\", \"Vain pääkaupungin resurssikenttiä voidaan <br/>päivittää tasolle 20. Nyt pääkaupunkia<br/> ei voida todentaa. Päivitä profiiliasi, kiitos.\", \"Pikalinkki tähän ^_^\", \"Asennus valmis\", \"Peruttu\", \"Aloita tehtävät\", \"Päivitys valmis\", \"Tehty onnistuneesti\", \"Heimosi on määrittämätön, siksi joukkojesi tyyppiä <br/>Päivitä profiiliasi heimon määrittämiseksi.<br/>\", \"Käy Sankarin kartanossa määrittääksesi<br/> sankarisi tyypin ja nopeuden.\"];\n\t\taLangResources=[\"waitTranslate\",\"waitTranslate\",\"waitTranslate\",\"waitTranslate\"];\n\t\taLangTroops[0] = [\"Legioonalainen\", \"Pretoriaani\", \"Imperiaani\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Muurinmurtaja\", \"Tulikatapultti\", \"Senaattori\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangTroops[1] = [\"Nuijamies\", \"Keihäsmies\", \"Kirvessoturi\", \"Tiedustelija\", \"Paladiini\", \"Teutoniritari\", \"Muurinmurtaja\", \"Katapultti\", \"Päällikkö\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangTroops[2] = [\"Falangi\", \"Miekkasoturi\", \"Tunnustelija\", \"Teutateksen salama\", \"Druidiratsastaja\", \"Haeduaani\", \"Muurinmurtaja\", \"Heittokone\", \"Päällikkö\", \"Uudisasukas\", \"Sankari\"];\n\t\taLangAttackType = [\"Vahvistus\", \"Hyökkäys\", \"Ryöstö\"];\n\t\tbreak;\n\n\tcase \"us\": // by shadowx360\n\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armory\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"Town Hall\", \"Residence\", \"Palace\", \"Treasury\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason's Lodge\", \"Brewery\", \"Trapper\",\"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armory\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"Town Hall\", \"Residence\", \"Palace\", \"Treasury\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason's Lodge\", \"Brewery\", \"Trapper\",\"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is notuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Wheat\", \"Schedule demolition\",\n\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Too few resources.\", \"Your builders are already working\", \"completely upgraded\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\taLangResources=[\"lumber\",\"clay\",\"iron\",\"wheat\"];\n\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\tbreak;\n\n\tcase \"in\":\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armoury\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Armoury\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\t\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\t\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Too few resources.\", \"Your workers are already building something.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\", \"Food shortage: Upgrade a wheat field first\", \"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources = [\"lumber\", \"clay\", \"iron\", \"crop\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"Place for new building\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Smithy\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Woodcutter\", \"Clay Pit\", \"Iron Mine\", \"Wheat Field\", \"\", \"Sawmill\", \"Brickworks\", \"Iron Foundry\", \"Flour Mill\", \"Bakery\", \"Warehouse\", \"Granary\", \"Blacksmith\", \"Smithy\", \"Tournament Square\", \"Main Building\", \"Rally Point\", \"Marketplace\", \"Embassy\", \"Barracks\", \"Stable\", \"Siege Workshop\", \"Academy\", \"Cranny\", \"City Hall\", \"Residence\", \"Palace\", \"Treasure Chamber\", \"Trade Office\", \"Great Barracks\", \"Great Stable\", \"City Wall\", \"Earth Wall\", \"Palisade\", \"Stonemason\", \"Brewery\", \"Trapper\", \"Hero's Mansion\", \"Great Warehouse\", \"Great Granary\", \"Wonder Of The World\", \"Horse Drinking Pool\"];\n\t\t\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct a new building\", \"empty\", \"level\"];\n\t\t\t\taLangRaceName = [\"Romans\", \"Teutons\", \"Gauls\"];\n\t\t\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Too few resources.\", \"Your workers are already building something.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\", \"Food shortage: Upgrade a wheat field first\", \"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources = [\"lumber\", \"clay\", \"iron\", \"crop\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Reinforce\", \"Attack\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'in\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\tcase \"sk\": // by Zapo [ 2011.04.07 ]\n\t\taLangAllBuildWithId = [\"Drevorubač\", \"Hlinená baňa\", \"Železná baňa\", \"Obilné pole\", \"\", \"Píla\", \"Tehelňa\", \"Zlievareň\", \"Mlyn\", \"Pekáreň\", \"Sklad surovín\", \"Sýpka\", \"Kováč\", \"Zbrojnica\", \"Turnajové ihrisko\", \"Hlavná budova\", \"Zhromaždisko\", \"Trhovisko\", \"Ambasáda\", \"Kasárne\", \"Stajne\", \"Dielňa\", \"Akadémia\", \"Úkryt\", \"Radnica\", \"Rezidencia\", \"Palác\", \"Pokladnica\", \"Obchodná kancelária\", \"Veľké kasárne\", \"Veľká stajňa\", \"Mestské hradby\", \"Zemná hrádza\", \"Palisáda\", \"Kamenár\", \"Pivovar\", \"Pasti\",\"Dvor hrdinov\", \"Veľké dielne\", \"Veľká sýpka\", \"Div sveta\", \"Žriedlo\"];\n\t\taLangAllBuildAltWithId = [\"Drevorubač\", \"Hlinená baňa\", \"Železná baňa\", \"Obilné pole\", \"\", \"Píla\", \"Tehelňa\", \"Zlievareň\", \"Mlyn\", \"Pekáreň\", \"Sklad surovín\", \"Sýpka\", \"Kováč\", \"Zbrojnica\", \"Turnajové ihrisko\", \"Hlavná budova\", \"Zhromaždisko\", \"Trhovisko\", \"Ambasáda\", \"Kasárne\", \"Stajne\", \"Dielňa\", \"Akadémia\", \"Úkryt\", \"Radnica\", \"Rezidencia\", \"Palác\", \"Pokladnica\", \"Obchodná kancelária\", \"Veľké kasárne\", \"Veľká stajňa\", \"Mestské hradby\", \"Zemná hrádza\", \"Palisáda\", \"Kamenár\", \"Pivovar\", \"Pasti\",\"Dvor hrdinov\", \"Veľké dielne\", \"Veľká sýpka\", \"Div sveta\", \"Žriedlo\"];\n\t\taLangAddTaskText = [\"Pridaj úlohu\", \"Štýl\", \"Aktívna dedina\", \"Plánovaný cieľ\", \"To\", \"Mód\", \"Construction support\", \"Resources concentration\", \"Presuň hore\", \"Presuň dole\", \"Zmaž\", \" Obsah úloh\", \"Posun \", \"Zmaž všetky úlohy\"];\n\t\taLangTaskKind = [\"Upgrade\", \"Nová stavba\", \"Útok\", \"Výskum\", \"Trénovať\", \"Transport\", \"NPC\", \"Búrať\", \"Oslavy\"];\n\t\taLangGameText = [\"Lvl\", \"Obchodníci\", \"ID\", \"Hlavná dedina\", \"Start time\", \"nastavenie času je nepoužiteľný teraz.\", \"do\", \"Dedina\", \"transport\", \"od\", \"Transport do\", \"Transport od\", \"Návrat z\", \"suroviny\", \"budova\", \"Postaviť novú budovu\", \"prázdne\", \"úroveň\"];\n\t\taLangRaceName = [\"Rimania\", \"Germáni\", \"Galovia\"];\n\t\taLangTaskOfText = [\"Naplánovať Upgrade\", \"Naplánovať novú budovu\", \"Auto ResUpD\", \"Nebeží\", \"Štart\", \"Beží\", \"Suspend\", \"Surovinová distribúcia tejto dediny je \", \"Autotransport\", \"Autotransport nie je otvorený\", \"Otvorený\", \"Transport úspešný\", \"Zoznam úloh\", \"Trans In limit\", \"Default\", \"Zmeň\", \"Drevo/Hlina/Železo\", \"Obilie\", \"Naplánuj demolíciu\",\n\t\t\t\"Naplánuj útok\", \"Typ útoku\", \"Čas cesty\", \"opakovať\", \"časový interval\",\"00:30:00\",\"Cieľ Katapultu\",\"Náhodne\", \"Neznámy\", \"krát\", \"Mesiac\", \"Deň\", \"Poslať jednotky\",\n\t\t\t\"Naplánovať výcvik\",\"Výcvikové miesto\",\"Výcviková úloha hotová\",\"customTransport\",\"nastav časový interval obnovenia\",\"toto je interval obnovenia stránky ,\\n default je 20 minút, prosím vlož nový čas:\\n\\n\",\"Trans Out Rmn\",\"NaplánujOslavu\",\"malá slava\",\"veľká oslava\",\"nastavInterval surovinovej koncentrácie\",\n\t\t\t\"minút\",\"pozastavené\",\"spustené\",\"spusť\",\"pauza\",\"Naplánuj vylepšenie\",\"Vylepšiť Útok\",\"Vylepšiť Obranu\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Príliš málo surovín.\", \"Stavitelia majú momentálne veľa práce\", \"Stavanie kompletné\", \"Začína stavanie\", \"Vo vývoji\", \"Tvoj sklad je príliš malý. Prosím zvýš tvoj Sklad na pokračovanie stavania\", \"Tvoja Sýpka je príliš malá. Prosím zvýš tvoju Sýpku na pokračovanie stavania\", \"Dostatok surovín\",\"Nedostatok potravín: rozšír obilné polia najskôr!\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Dôležité poznámky\", \"Surovinové polia môžu byť len v hlavnej zvyšované na úroveň 20. Teraz nieje určená tvoja hlavná. Navštív tvoj Profil prosím.\", \"Skratka tu ^_^\", \"Nastavenie kompletné\", \"Zrušené\", \"Spusť úlohy\", \"Upgrade úspešný\", \"Spustenie úspešné\", \"Tvoj národ je neznámy, therefore your troop type. Navštív tvoj Profil na určenie tvojho národa.\", \"Prosím navštív tiež tvoj Dvor hrdinov na určenie rýchlosti a typu tvojho hrdinu.\"];\n\t\taLangResources = [\"drevo\",\"hlina\",\"železo\",\"obilie\"];\n\t\taLangTroops[0] = [\"Legionár\", \"Pretorián\", \"Imperián\", \"Equites Legáti\", \"Equites Imperátoris\", \"Equites Caesaris\", \"Rímske Baranidlo\", \"Ohnivý Katapult\", \"Senátor\", \"Osadník\", \"Hrdina\"];\n\t\taLangTroops[1] = [\"Pálkar\", \"Oštepár\", \"Bojovník so sekerou\", \"Špeh\", \"Rytier\", \"Teuton jazdec\", \"Germánske baranidlo\", \"Katapult\", \"Kmeňový vodca\", \"Osadník\", \"Hrdina\"];\n\t\taLangTroops[2] = [\"Falanx\", \"Šermiar\", \"Sliedič\", \"Theutates Blesk\", \"Druid jazdec\", \"Haeduan\", \"Drevené Baranidlo\", \"Vojnový Katapult\", \"Náčelník\", \"Osadník\", \"Hrdina\"];\n\t\taLangAttackType = [\"Podpora\", \"Útok\", \"Lúpež\"];\n\t\tbreak;\n\n\tcase \"id\":\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Penebangan Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Penggergajian\", \"Pabrik Bata\", \"Peleburan Besi\", \"Penggilingan Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Penggergajian\", \"Pabrik Bata\", \"Peleburan Besi\", \"Penggilingan Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAddTaskText = [\"Tambah Pengerjaan\", \"Jenis\", \"Desa Aktif\", \"Target Pengerjaan\", \"ke\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Menaikkan\", \"Dirikan\", \"Serang\", \"riset\", \"latih\", \"Kirim\", \"NPC\", \"Bongkar\", \"Perayaan\"];\n\t\t\t\taLangGameText = [\"Tk\", \"Pedagang\", \"ID\", \"Ibukota\", \"Waktu mulai\", \"jangan gunakan waktu di atas\", \"ke\", \"Desa\", \"kirim\", \"dari\", \"Kirim ke\", \"Kiriman dari\", \"Kembali dari\", \"sumberdaya\", \"bangunan\", \"Mendirikan Bangunan\", \"kosong\", \"tingkat\"];\n\t\t\t\taLangRaceName = [\"Romawi\", \"Teuton\", \"Galia\"];\n\t\t\t\taLangTaskOfText = [\"Jadwal Menaikkan\", \"Jadwal Dirikan\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Otomatis kirim\", \"Autotransport is not opened\", \"Opened\", \"Pengiriman Berhasil\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Kayu/Liat/Besi\", \"Gandum\", \"Jadwal Pembongkaran\",\n\t\t\t\t\t\"Jadwal Serangan\", \"Tipe serangan\", \"Waktu tiba\", \"diulang\", \"rentang waktu\", \"00:30:00\", \"Target catapult\", \"Acak\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Pasukan terkirim\",\n\t\t\t\t\t\"Jadwal Pelatihan\", \"Tempat latih\", \"Pelatihan selesai\", \"Atur kirim\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"Jadwal Perayaan\",\"Perayaan kecil\",\"Perayaan besar\",\"setInterval of Resources concentration\",\n\t\t\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Jadwal Pengembangan\",\"Pengembangan serangan\",\"Pengembangan pertahanan\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"sumberdaya cukup pada\", \"Pekerja sedang bekerja\", \"sepenuhnya telah dikembangkan\", \"Dirikan bangunan\", \"Sedang Membangun\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"sumberdaya cukup pada\",\"Kurang makanan: kembangkan ladang terlebih dahulu\",\"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources=[\"Kayu\",\"Liat\",\"Besi\",\"Gandum\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangAttackType = [\"Bantuan\", \"Serang\", \"Rampok\"];\n\t\t\t\tbreak; \n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Pemotong Kayu\", \"Pabrik Bata\", \"Pelebur Besi\", \"Penggiling Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Penebang Kayu\", \"Penggalian Tanah Liat\", \"Tambang Besi\", \"Ladang\", \"\", \"Pemotong Kayu\", \"Pabrik Bata\", \"Pelebur Besi\", \"Penggiling Gandum\", \"Toko Roti\", \"Gudang\", \"Lumbung\", \"Pandai Besi\", \"Pabrik Perisai\", \"Pusat Kebugaran\", \"Bangunan Utama\", \"Titik Temu\", \"Pasar\", \"Kedutaan\", \"Barak\", \"Istal\", \"Bengkel\", \"Akademi\", \"Cranny\", \"Balai Desa\", \"Kastil\", \"Istana\", \"Gudang Ilmu\", \"Kantor Dagang\", \"Barak Besar\", \"Istal Besar\", \"Pagar Batu\", \"Pagar Tanah\", \"Pagar kayu\", \"Tukang Batu\", \"Pabrik Bir\", \"Perangkap\",\"Padepokan\", \"Gudang Besar\", \"Lumbung Besar\", \"Keajaiban Dunia\", \"Tempat Minum Kuda\"];\n\t\t\t\taLangAddTaskText = [\"Tambah Pengerjaan\", \"Jenis\", \"Desa Aktif\", \"Target Pengerjaan\", \"ke\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t\t\taLangTaskKind = [\"Menaikkan\", \"Dirikan\", \"Serang\", \"riset\", \"latih\", \"Kirim\", \"NPC\", \"Bongkar\", \"Perayaan\"];\n\t\t\t\taLangGameText = [\"Tk\", \"Pedagang\", \"ID\", \"Ibukota\", \"Waktu mulai\", \"jangan gunakan waktu di atas\", \"ke\", \"Desa\", \"kirim\", \"dari\", \"Kirim ke\", \"Kiriman dari\", \"Kembali dari\", \"sumberdaya\", \"bangunan\", \"Mendirikan Bangunan\", \"kosong\", \"tingkat\"];\n\t\t\t\taLangRaceName = [\"Romawi\", \"Teuton\", \"Galia\"];\n\t\t\t\taLangTaskOfText = [\"Jadwal Menaikkan\", \"Jadwal Dirikan\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Otomatis kirim\", \"Autotransport is not opened\", \"Opened\", \"Pengiriman Berhasil\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Kayu/Liat/Besi\", \"Gandum\", \"Jadwal Pembongkaran\",\n\t\t\t\t\t\"Jadwal Serangan\", \"Tipe serangan\", \"Waktu tiba\", \"diulang\", \"rentang waktu\", \"00:30:00\", \"Target catapult\", \"Acak\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Pasukan terkirim\",\n\t\t\t\t\t\"Jadwal Pelatihan\", \"Tempat latih\", \"Pelatihan selesai\", \"Atur kirim\", \"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"Jadwal Perayaan\",\"Perayaan kecil\",\"Perayaan besar\",\"setInterval of Resources concentration\",\n\t\t\t\t\t\"minutes\", \".\",\".\",\"START\",\"STOP\",\"Jadwal Pengembangan\",\"Pengembangan serangan\",\"Pengembangan pertahanan\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"sumberdaya cukup pada\", \"Pekerja sedang bekerja\", \"sepenuhnya telah dikembangkan\", \"Dirikan bangunan\", \"Sedang Membangun\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"sumberdaya akan cukup pada\",\"Gandum anda dalam kondisi minus maka tidak akan pernah sampai pada jumlah sumber daya yang dibutuhkan.\",\"There is already a celebration going on\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t\t\taLangResources=[\"Kayu\",\"Liat\",\"Besi\",\"Gandum\"];\n\t\t\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\", \"Swordsman\", \"Pathfinder\", \"Theutates Thunder\", \"Druidrider\", \"Haeduan\", \"Ram\", \"Trebuchet\", \"Chieftain\", \"Settler\", \"Kesatria\"];\n\t\t\t\taLangAttackType = [\"Bantuan\", \"Serang\", \"Rampok\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'id\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\n\tcase \"au\":\t\n\tcase \"uk\":\t\n\tcase \"com\": // thanks ieyp\n\tdefault:\n\t\t// used for logic, translation required\n\t\taLangAllBuildWithId = aLangAllBuildWithIdComDef.slice(0);\n\t\t// used for logic, translation required\n\t\taLangAllBuildAltWithId = aLangAllBuildAltWithIdComDef.slice(0);\n\t\t// used for display only\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\t// used for display only\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\t// used for logic and display, translation required\n\t\taLangGameText = aLangGameTextComDef.slice(0);\n\t\t// used for getMainVillageid(), translation required\n\t\taLangRaceName = aLangRaceNameComDef.slice(0);\n\t\t// used for display only\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans In limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\",\n\t\t\t\t\"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\", \"00:30:00\", \"Catapult target\", \"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\",\n\t\t\t\t\"Schedule Train\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"ScheduleParty\", \"small party\", \"big party\", \"setInterval of Resources concentration\",\n\t\t\t\t\"minutes\", \".\", \".\", \"START\", \"STOP\", \"Schedule Improve\", \"Improve Attack\", \"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t// used for logic & display, translation required\n\t\taLangErrorText = aLangErrorTextComDef.slice(0);\n\t\t// used for display\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\t// used for display only, however translation can be done\n\t\taLangResources = aLangResourcesComDef.slice(0);\n\t\t// used for logic & display, translation required\n\t\taLangTroops[0] = aLangTroopsComDef[0].slice(0);\n\t\taLangTroops[1] = aLangTroopsComDef[1].slice(0);\n\t\taLangTroops[2] = aLangTroopsComDef[2].slice(0);\n\t\t// used for display only, however translation can be done\n\t\taLangAttackType = aLangAttackTypeComDef.slice(0);\n\t\tbreak;\n\n\tcase \"pl\": // partial translation by deFox\n\t\t// 2011.02.13 -- partial translation by Blaker\n\t\taLangAllBuildWithId = [\"Las\", \"Kopalnia gliny\", \"Kopalnia żelaza\", \"Pole zboża\", \"\", \"Tartak\", \"Cegielnia\", \"Huta stali\", \"Młyn\", \"Piekarnia\", \"Magazyn surowców\", \"Spichlerz\", \"Zbrojownia\", \"Kuźnia\", \"Plac turniejowy\", \"Główny budynek\", \"Miejsce zbiórki\", \"Rynek\", \"Ambasada\", \"Koszary\", \"Stajnia\", \"Warsztat\", \"Akademia\", \"Kryjówka\", \"Ratusz\", \"Rezydencja\", \"Pałac\", \"Skarbiec\", \"Targ\", \"Duże koszary\", \"Duża stajnia\", \"Mur obronny\", \"Wał ziemny\", \"Palisada\", \"Kamieniarz\", \"Browar\", \"Traper\",\"Dwór bohatera\", \"Duży magazyn surowców\", \"Duży spichlerz\", \"Cud świata\", \"Wodopój\"];\n\t\taLangAllBuildAltWithId = [\"Las\", \"Kopalnia gliny\", \"Kopalnia żelaza\", \"Pole zboża\", \"\", \"Tartak\", \"Cegielnia\", \"Huta stali\", \"Młyn\", \"Piekarnia\", \"Magazyn surowców\", \"Spichlerz\", \"Zbrojownia\", \"Kuźnia\", \"Plac turniejowy\", \"Główny budynek\", \"Miejsce zbiórki\", \"Rynek\", \"Ambasada\", \"Koszary\", \"Stajnia\", \"Warsztat\", \"Akademia\", \"Kryjówka\", \"Ratusz\", \"Rezydencja\", \"Pałac\", \"Skarbiec\", \"Targ\", \"Duże koszary\", \"Duża stajnia\", \"Mur obronny\", \"Wał ziemny\", \"Palisada\", \"Kamieniarz\", \"Browar\", \"Traper\",\"Dwór bohatera\", \"Duży magazyn surowców\", \"Duży spichlerz\", \"Cud świata\", \"Wodopój\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Upgrade\", \"NewBuild\", \"Attack\", \"Research\", \"Train\", \"Transport\", \"NPC\", \"Demolish\", \"Celebration\"];\n\t\taLangGameText = [\"Lvl\", \"Merchants\", \"ID\", \"Capital\", \"Start time\", \"this timeseting is unuseful now.\", \"to\", \"Village\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Construct new building\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Rzymianie\", \"Germanie\", \"Galowie\"];\n\t\taLangTaskOfText = [\"Zaplanuj Upgrade\", \"Zaplanuj Budowę\", \"Auto ResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Lista zadań\", \"Trans In limit\", \"Domyśl.\", \"Zmień\", \"Drewno/Glina/Żelazo\", \"Zboże\", \"Schedule demolition\",\n\t\t\t\"Zaplanuj atak\", \"Typ Ataku\", \"Czas podróży\", \"repeat times\", \"odstęp czasu\", \"00:30:00\",\"Cel dla katapult\", \"Losowy\", \"Nieznany\", \"times\", \"Mies.\", \"Dzień\", \"Troops sent\",\n\t\t\t\"Zaplanuj szkolenie\", \"Train site\", \"TrainTask done\", \"customTransport\", \"setup interval time of reload\",\"this is the interval of page reload,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans Out Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\n\t\t\t\"minut\", \".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Zbyt mało surowców.\", \"The workers are already at work.\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Ważna wiadomość\", \"Tylko w stolicy można rozbudować teren do poz. 20.<br/>Aktywna wioska nie została rozpoznana jako stolica.<br/>Wejdź w Ustawienia by wywołać aktualizację.\", \"Szybki link ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"Upgrade successfully\", \"Run successfully\", \"Nie udało się określić twojej rasy, stąd typy jednostek<br/>nie są znane. Wejdź w Ustawienia by skrypt wykrył twoją rasę.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\"];\n\t\taLangResources = [\"drewno\", \"glina\", \"żelazo\", \"zboże\"];\n\t\taLangTroops[0] = [\"Legionnaire\", \"Praetorian\", \"Imperian\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Battering Ram\", \"Fire Catapult\", \"Senator\", \"Settler\", \"Hero\"];\n\t\taLangTroops[1] = [\"Clubswinger\", \"Spearman\", \"Axeman\", \"Scout\", \"Paladin\", \"Teutonic Knight\", \"Ram\", \"Catapult\", \"Chief\", \"Settler\", \"Hero\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Miecznik\", \"Tropiciel\", \"Grom Teutatesa\", \"Jeździec druidzki\", \"Haeduan\", \"Taran\", \"Trebusz\", \"Herszt\", \"Osadnicy\", \"Bohater\"];\n\t\taLangAttackType = [\"Posiłki\", \"Atak normalny\", \"Grabież\"];\n\t\tbreak;\n\n\tcase \"ua\":\n\t\taLangAllBuildWithId = [\"Лісоповал\", \"Глиняний кар'єр\", \"Залізна копальня\", \"Ферма\", \"\", \"Деревообробний завод\", \"Цегляний завод\", \"Чавуноливарний завод\", \"Млин\", \"Пекарня\", \"Склад\", \"Зернова комора\", \"Кузня зброї\", \"Кузня обладунків\", \"Арена\", \"Головна будівля\", \"Пункт збору\", \"Ринок\", \"Посольство\", \"Казарма\", \"Стайня\", \"Майстерня\", \"Академія\", \"Схованка\", \"Ратуша\", \"Резиденція\", \"Палац\", \"Скарбниця\", \"Торгова палата\", \"Велика казарма\", \"Велика стайня\", \"Міська стіна\", \"Земляний вал\", \" Огорожа\", \"Каменяр\", \"Пивна\", \"Капканщик\",\"Таверна\", \"Великий склад\", \"Велика Зернова комора\", \"Чудо світу\", \"Водопій\"];\n\t\taLangAllBuildAltWithId = [\"Лісоповал\", \"Глиняний кар'єр\", \"Залізна копальня\", \"Ферма\", \"\", \"Деревообробний завод\", \"Цегляний завод\", \"Чавуноливарний завод\", \"Млин\", \"Пекарня\", \"Склад\", \"Зернова комора\", \"Кузня зброї\", \"Кузня обладунків\", \"Арена\", \"Головна будівля\", \"Пункт збору\", \"Ринок\", \"Посольство\", \"Казарма\", \"Стайня\", \"Майстерня\", \"Академія\", \"Схованка\", \"Ратуша\", \"Резиденція\", \"Палац\", \"Скарбниця\", \"Торгова палата\", \"Велика казарма\", \"Велика стайня\", \"Міська стіна\", \"Земляний вал\", \" Огорожа\", \"Каменяр\", \"Пивна\", \"Капканщик\",\"Таверна\", \"Великий склад\", \"Велика Зернова комора\", \"Чудо світу\", \"Водопій\"];\n\t\taLangAddTaskText = [\"Додати завдання\", \"Спосіб\", \"Активне поселення\", \"Ціль завдання\", \"| Ціль\", \"Тип\", \"Підтримка будівництва\", \"Концентрація ресурсів\", \"Вверх\", \"Вниз\", \"\", \"\", \"\", \"Видалити усі завдання\"];\n\t\taLangTaskKind = [\"Покращити:\", \"Нове завдання:\", \"Атакувати:\", \"Розвідати:\", \" наняти:\", \"Відправити ресурси:\", \"NPC:\", \"Зруйнувати:\", \"Урочистість:\"];\n\t\taLangGameText = [\" Рівень \", \"Торговці\", \"ID\", \"Столиця\", \"Час початку\", \"(тимчасово не працює)\", \"в\", \"Поселення\", \"Транспортування\", \"з\", \"Транспортування в\", \"Транспортування из\", \"Повернення з\", \"ресурси\", \"будівля\", \"Побудувати нову будівлю\", \"пусто\", \"рівень\"];\n\t\taLangRaceName = [\"Римляни\", \"Тевтонці\", \"Галли\"];\n\t\taLangTaskOfText = [\"Запланувати удосконалення\", \"Запланувати нове завдання\", \"Качати реурси\", \"Викл\", \"Старт\", \"Вкл\", \"стоп\", \"Розполілення полів в поселенні: \", \"Автовідправлення\", \"Автовідправлення викл.\", \"Вкл.\", \"Успішно відправленно\", \"* Задачі *\", \"Обмеження ввозу\", \"Ні\", \"Змінити \", \"Дерево/Глина/Залізо\", \"Зерно\", \"Запланувати зруйнування\",\n\t\t\t\"Запланувати атаку\", \"Тип атаки\", \"Час в дорозі\", \"повтори\", \"проміжок\",\"00:30:00\",\"Ціль катов\",\"Випадково\", \"Невідомо\", \" раз\", \"/\", \" :дата/час: \", \"Війска\",\n\t\t\t\"Запланувати найм\",\"Train site\",\"Навчання військ завершено\",\"цілеве відправлення\",\"Інтервал оновлення\",\"Це інтервал оновлення сторінки ,\\n по замовчуванню - 20 хвилин, Введіть новоий час:\\n\\n\",\"Обмеження вивозу\",\"Запланувати святкування\",\"Малий праздник\",\"Великий праздник\",\"Встановлення інтервала концентрації ресурсів\",\n\t\t\t\"хвилини\",\"зупинено\",\"працює\",\"старт\",\"пауза\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Недостатньо сировини\", \"Всі будівельники зараз зайняті\", \"Це завдання зупинено повністю\", \"Починаю будівництво\", \"Процес розвитку\", \"Недостатня місткість складу\", \"Недостатня місткість Зернової комори\", \"Достатньо ресурсів\",\"\",\"Проводится урочистість\"];\n\t\taLangOtherText = [\"Важливі замітки\", \"Тільки в столиці поля можуть бути до рівня 20. Столиця не визначена.Зайдіть в профіль будьласка\", \"Ссилка тут ^_^\", \"Настройка завершена\", \"Відмінено\", \"Почати завдання\", \"Удосконалення пройшло успішно\", \"Успішно\", \"Ваш народ невизначений.Будьласка зайдіть в профіль.\", \"Також будьласка зайдіть в таверну для визначення типу та скорості героя\"];\n\t\taLangResources=[\"Деревина\",\"Глина\",\"Залізо\",\"Зерно\"];\n\t\taLangTroops[0] = [\"Легіонер\", \"Преторіанець\", \"Імперіанець\", \"Кінний розвідник\", \"Кіннота імператора\", \"Кіннота Цезаря\", \"Таран\", \"Вогняна катапульта\", \"Сенатор\", \"Поселенець\", \"Герой\"];\n\t\taLangTroops[1] = [\"Дубинник\", \"Списник\", \"Сокирник\", \"Скаут\", \"Паладин\", \"Тевтонський вершник\", \"Стінобитне знаряддя\", \"Катапульта\", \"Ватажок\", \"Поселенець\", \"Герой\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мечник\", \"Слідопит\", \"Тевтацький грім\", \"Друїд-вершник\", \"Едуйська кіннота\", \"Таран\", \"Катапульта\", \"Лідер\", \"Поселенець\", \"Герой\"];\n\t\taLangAttackType = [\"Підкріплення\", \"Напад\", \"Набіг\"];\n\t\tbreak;\n\n\tcase \"tr\": // by karambol update the 27 Mar 2010 by SARLAK\n aLangAllBuildWithId = [\"Oduncu\", \"Tuğla Ocağı\", \"Demir Madeni\", \"Tarla\", \"\", \"Kereste Fabrikası\", \"Tuğla Fırını\", \"Demir Dökümhanesi\", \"Değirmen\", \"Ekmek Fırını\", \"Hammadde deposu\", \"Tahıl Ambarı\", \"Silah Dökümhanesi\", \"Zırh Dökümhanesi\", \"Turnuva Yeri\", \"Merkez Binası\", \"Askeri Üs\", \"Pazar Yeri\", \"Elçilik\", \"Kışla\", \"Ahır\", \"Tamirhane\", \"Akademi\", \"Sığınak\", \"Belediye\", \"Köşk\", \"Saray\", \"Hazine\", \"Ticari Merkez\", \"Büyük Kışla\", \"Büyük Ahır\", \"Sur\", \"Toprak Siper\", \"Çit\", \"Taşçı\", \"İçecek Fabrikası\", \"Tuzakçı\",\"Kahraman Kışlası\", \"Büyük Hammadde deposu\", \"Büyük Tahıl Ambarı\", \"Dünya Harikası\", \"Yalak\"];\n aLangAllBuildAltWithId = [\"Oduncu\", \"Tuğla Ocağı\", \"Demir Madeni\", \"Tarla\", \"\", \"Kereste Fabrikası\", \"Tuğla Fırını\", \"Demir Dökümhanesi\", \"Değirmen\", \"Ekmek Fırını\", \"Hammadde deposu\", \"Tahıl Ambarı\", \"Silah Dökümhanesi\", \"Zırh Dökümhanesi\", \"Turnuva Yeri\", \"Merkez Binası\", \"Askeri Üs\", \"Pazar Yeri\", \"Elçilik\", \"Kışla\", \"Ahır\", \"Tamirhane\", \"Akademi\", \"Sığınak\", \"Belediye\", \"Köşk\", \"Saray\", \"Hazine\", \"Ticari Merkez\", \"Büyük Kışla\", \"Büyük Ahır\", \"Sur\", \"Toprak Siper\", \"Çit\", \"Taşçı\", \"İçecek Fabrikası\", \"Tuzakçı\",\"Kahraman Kışlası\", \"Büyük Hammadde deposu\", \"Büyük Tahıl Ambarı\", \"Dünya Harikası\", \"Yalak\"];\n aLangAddTaskText = [\"Görev Ekle\", \"Stil\", \"Aktif Köy\", \"Görev Hedefi\", \"Hedef\", \"Türü\", \"İnşaat Desteği\", \"Hammadde karışımı\", \"Yukarı Taşı\", \"Aşağı Taşı\", \"Sil\", \"Görev İçeriği\", \"Sırala\", \"Tüm görevleri sil\"]; \n aLangTaskKind = [\"Geliştirilen Bina :\", \"Yeni Bina :\", \"Hücum\", \"Araştır\", \"Yetiştir\", \"Gönder\", \"NPC\", \"Yıkılan Bina :\", \"Festival\"]; \n aLangGameText = [\"Seviye \", \"Tüccar\", \"ID\", \"Başkent\", \"Başlangıç zamanı\", \"Değiştirilemez.\", \"buraya\", \"Aktif Köy\", \"gönder\", \"buradan\", \"Gönderiliyor\", \"Gönderildi\", \"Dönüş\", \"hammadde\", \"bina\", \"Yeni bina kur\", \"boş\", \"Seviye \"]; \n aLangRaceName = [\"Romalılar\", \"Cermenler\", \"Galyalılar\"]; \n aLangTaskOfText = [\"Geliştirme Zamanla\", \"Yeni Bina Kurulumu\", \"Otomatik hammadde güncelle\", \"Çalışmıyor\", \"Başlat\", \"Çalışıyor\", \"Durdur\", \"Bu köyün kaynak alanları dağılımıdır \", \"Otomatik Gönderme\", \"Otomatik gönderme açılmadı\", \"Açıldı\", \"Gönderme Tamamladı\", \"\", \"Gönderme limiti\", \"Varsayılan\", \"Değiştir\", \"Odun/Tuğla/Demir\", \"Tahıl\", \"Yıkımı zamanla\", \n \"Hücum zamanla\", \"Hücum Şekli\", \"Varış zamanı\", \"Tekrar Sayısı\", \"Tekrar Aralığı\",\"00:30:00\",\"Mancınık hedef\",\"Rastgele\", \"Bilinmeyen\", \"kere\", \"Ay\", \"Gün\", \"Asker gönder\", \"Asker Yetiştir\",\"Yetiştirilme Noktası\",\"Eğitim görevi tamamlandı\",\"Hammadde Gönderimi Zamanla\",\"Gerçekleşmeyen Kurulumu Tekrarlama Süresi\",\"Tekrar deneme süresini giriniz.\\n(Varsayılan Değer: 20 Dakika)\",\"Trans Out Rmn\",\"Festivalzamanla\",\"Küçük festival\",\"Büyük festival\",\"Hammadde Toplama Aralığı\", \n \"dakikalar\",\"Pasif\",\"Aktif\",\"Aktif Et\",\"Pasif Et\",\"Asker Gelişimi Zamanla\",\"Silah Gelişimi\",\"Zırh Gelişimi\",\"saati\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n aLangErrorText = [\"Çok az kaynak.\", \"Işçi zaten iş başında.\", \"İnşaat tamamlandı\", \"İnşaat başlatılıyor\", \"Araştırma yapılıyor\", \"İnşaata Hammadde deposunu geliştirip devam ediniz.\", \"İnşaata Tahıl ambarını geliştirip devam ediniz.\", \"Yeterli hammadde\",\"Kaynak eksikliği: önce Tarlanı geliştir\",\"Şu anda bir festival yapılıyor zaten\"]; \n aLangOtherText = [\"Önemli not\", \"Sadece başkent için hammadde üretebilirsiniz <br/>be Güncellendi seviye 20. Şimdi Başkentin<br/> tesbit edilemedi. Profilinizi ziyaret ediniz.\", \"Buraya kısa yol ^_^\", \"Kurulum tamamlandı\", \"Vazgeçildi\", \"Görevleri başlat\", \"Güncelleme tamamlandı\", \"Çalışma tamam\", \"Irkınız bilinmediğinden asker türünüz belilenemedi <br/>Profilinizi ziyaret edip ırkınızı belirleyin<br/>\", \"Ayrıca kahraman kışlasınıda ziyaret edin<br/> Kahramanınızın hızı ve tipi.\"]; \n aLangResources=[\"Odun\",\"Tuğla\",\"Demir\",\"Tahıl\"]; \n aLangTroops[0] = [\"Lejyoner\", \"Pretoryan\", \"Emperyan\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Koçbaşı\", \"Ateş Mancınığı\", \"Senatör\", \"Göçmen\", \"Kahraman\"]; \n aLangTroops[1] = [\"Tokmak Sallayan\", \"Mızrakçı\", \"Balta Sallayan\", \"Casus\", \"Paladin\", \"Toyton\", \"Koçbaşı\", \"Mancınık\", \"Reis\", \"Göçmen\", \"Kahraman\"]; \n aLangTroops[2] = [\"Phalanx\", \"Kılıçlı\", \"Casus\", \"Toytatın Şimşeği\", \"Druyid\", \"Heduan\", \"Koçbaşı\", \"Mancınık\", \"Kabile Reisi\", \"Göçmen\", \"Kahraman\"]; \n aLangAttackType = [\"Destek\", \"Saldırı: Normal\", \"Saldırı: Yağma\"]; \n break;\n\n\tcase \"br\":\n\t\taLangAllBuildWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serraria\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalaria\", \"Oficina\", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalaria\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAllBuildAltWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serraria\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalaria\", \"Oficina\", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalaria\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAddTaskText = [\"Adicionar tarefa\", \"Estilo\", \"Aldeia Activa\", \"Alvo\", \"Para\", \"Modo\", \"Ajuda na Construção\", \"Quantidade de recursos\", \"Mover para cima\", \"Mover para baixo\", \"Apagar\", \"&#160;&#160;&#160;Tarefas\", \"Mover \", \"Eliminar todas as tarefas\"];\n\t\taLangTaskKind = [\"Evolução\", \"Novo construção\", \"Ataque\", \"Pesquisa\", \"Treino\", \"Transporte\", \"NPC\", \"Demolição\", \"Celebração\"];\n\t\taLangGameText = [\"Lvl\", \"Mercadores\", \"Identificação\", \"Capital\", \"Inicio\", \"this timeseting is unuseful now.\", \"Para\", \"Aldeia\", \"Transporte\", \"de\", \"Transporte para\", \"Transporte de\", \"A regressar de\", \"Recursos\", \"Edificio\", \"Construir novo edifício\", \"Vazio\", \"Nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Teutões\", \"Gauleses\"];\n\t\taLangTaskOfText = [\"Agendar Evolução\", \"Agendar nova construção\", \"ResourcesUpD\", \"OFF\", \"Iniciar\", \"ON\", \"Parar\", \"A distribuição dos campos desta aldeia é \", \"Autotransporte\", \"Autotransporte não está aberto\", \"Aberto\", \"Transporte com sucesso\", \"Lista de agendamento\", \"Limit\", \"Default\", \"Alterar\", \"madeira/barro/ferro\", \"cereal\", \"Agendamento de demolição\",\n\t\t\t\"Agendamento de ataque\", \"Tipo de ataque\", \"Tempo de viagem\", \"Repetir número de vezes\", \"Tempo de intervalo\",\"00:30:00\",\"Alvo catapulta\",\"Aleatório\", \"Desconhecido\", \"Vezes\", \" Mês\", \" Dia\", \"Tropas enviadas\",\n\t\t\t\"Agendamento de treino\",\"localização de tropas\",\"Agendamento de treino feito\",\"Transporte personalizado\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default são 20 minutos, Insira novo tempo:\\n\\n\",\"Remain\",\"Agendar Celebração\",\"pequena celebração\",\"grande celebração\",\"Set Interval of Resources concentration\",\n\t\t\t\"minutos\",\"parado\",\"ligado\",\"ligar\",\"parar\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Poucos recursos.\", \"Os trabalhadores já estão a trabalhar.\", \"Construção completa\", \"Inicio da construção\", \"Em desenvolvimento\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Apenas os campos de recursos da capital <br/>podem ser elevados a nivel 20 . A sua capital <br/> nao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Instalação concluída\", \"Cancelado\", \"Iniciar as tarefas\", \"Upgrade com sucesso\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também. <br/>Visite o seu perfil para determinar as raça.<br/>\", \"Por favor visite a sua mansão do heroi para determinar<br/> a velocidade e o tipo de heroi.\"];\n\t\taLangResources=[\"Madeira\",\"Barro\",\"Ferro\",\"Cereais\"];\n\t\taLangTroops[0] = [\"Legionário\", \"Pretoriano\", \"Imperiano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Aríete\", \"Catapulta de Fogo\", \"Senador\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[1] = [\"Salteador\", \"Lanceiro\", \"Bárbaro\", \"Espião\", \"Paladino\", \"Cavaleiro Teutão\", \"Aríete\", \"Catapulta\", \"Chefe\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[2] = [\"Falange\", \"Espadachim\", \"Batedor\", \"Trovão Theutate\", \"Cavaleiro Druida\", \"Haeduano\", \"Aríete\", \"Trabuquete\", \"Chefe de Clã\", \"Colonizador\", \"Heroi\"];\n\t\taLangAttackType = [\"Reforço\", \"Ataque\", \"Assalto\"];\n\t\tbreak;\n\n\n case \"pt\": // thanks RASCO and Tuga\n\t\taLangAllBuildWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serração\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalariça\", \"Oficina \", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalariça\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAllBuildAltWithId = [\"Bosque\", \"Poço de Barro\", \"Mina de Ferro\", \"Campo de Cereais\", \"\", \"Serração\", \"Alvenaria\", \"Fundição\", \"Moinho\", \"Padaria\", \"Armazém\", \"Celeiro\", \"Ferreiro\", \"Fábrica de Armaduras\", \"Praça de torneios\", \"Edifício principal\", \"Ponto de reunião militar\", \"Mercado\", \"Embaixada\", \"Quartel\", \"Cavalariça\", \"Oficina \", \"Academia\", \"Esconderijo\", \"Casa do Povo\", \"Residência\", \"Palácio\", \"Tesouraria\", \"Companhia do Comércio\", \"Grande Quartel\", \"Grande Cavalariça\", \"Muralha\", \"Barreira\", \"Paliçada\", \"Pedreiro\", \"Cervejaria\", \"Fábrica de Armadilhas\",\"Mansão do Herói\", \"Grande armazém\", \"Grande Celeiro\", \"Maravilha do Mundo\", \"Bebedouro para cavalos\"];\n\t\taLangAddTaskText = [\"Adicionar tarefa\", \"Estilo\", \"Aldeia Activa\", \"Alvo\", \"Para\", \"Modo\", \"Ajuda na Construção\", \"Quantidade de recursos\", \"Mover para cima\", \"Mover para baixo\", \"Apagar\", \"&#160;&#160;&#160;Tarefas\", \"Mover \", \"Eliminar todas as tarefas\"];\n\t\taLangTaskKind = [\"Evolução\", \"Novo construção\", \"Ataque\", \"Pesquisa\", \"Treino\", \"Transporte\", \"NPC\", \"Demolição\", \"Celebração\"];\n\t\taLangGameText = [\"Lvl\", \"Mercadores\", \"Identificação\", \"Capital\", \"Inicio\", \"this timeseting is unuseful now.\", \"Para\", \"Aldeia\", \"Transporte\", \"de\", \"Transporte para\", \"Transporte de\", \"A regressar de\", \"Recursos\", \"Edificio\", \"Construir novo edifício\", \"Vazio\", \"Nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Teutões\", \"Gauleses\"];\n\t\taLangTaskOfText = [\"Agendar Evolução\", \"Agendar nova construção\", \"ResourcesUpD\", \"OFF\", \"Iniciar\", \"ON\", \"Parar\", \"A distribuição dos campos desta aldeia é \", \"Autotransporte\", \"Autotransporte não está aberto\", \"Aberto\", \"Transporte com sucesso\", \"Lista de agendamento\", \"Limit\", \"Default\", \"Alterar\", \"madeira/barro/ferro\", \"cereal\", \"Agendamento de demolição\",\n\t\t\t\"Agendamento de ataque\", \"Tipo de ataque\", \"Tempo de viagem\", \"Repetir número de vezes\", \"Tempo de intervalo\",\"00:30:00\",\"Alvo catapulta\",\"Aleatório\", \"Desconhecido\", \"Vezes\", \" Mês\", \" Dia\", \"Tropas enviadas\", \"Agendamento de treino\",\"localização de tropas\",\"Agendamento de treino feito\",\"Transporte personalizado\",\"Setup Interval Time of Reload\",\"This is the interval of page reload ,\\n default são 20 minutos, Insira novo tempo:\\n\\n\",\"Remain\",\"Agendar Celebração\",\"pequena celebração\",\"grande celebração\",\"Set Interval of Resources concentration\",\"minutos\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Poucos recursos.\", \"Os trabalhadores já estão a trabalhar.\", \"Construção completa\", \"Inicio da construção\", \"Em desenvolvimento\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Apenas os campos de recursos da capital <br/>podem ser elevados a nivel 20 . A sua capital <br/> nao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Instalação concluída\", \"Cancelado\", \"Iniciar as tarefas\", \"Upgrade com sucesso\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também. <br/>Visite o seu perfil para determinar as raça.<br/>\", \"Por favor visite a sua mansão do heroi para determinar<br/> a velocidade e o tipo de heroi.\"];\n\t\taLangResources = [\"Madeira\",\"Barro\",\"Ferro\",\"Cereais\"];\n\t\taLangTroops[0] = [\"Legionário\", \"Pretoriano\", \"Imperiano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Aríete\", \"Catapulta de Fogo\", \"Senador\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[1] = [\"Salteador\", \"Lanceiro\", \"Bárbaro\", \"Espião\", \"Paladino\", \"Cavaleiro Teutão\", \"Aríete\", \"Catapulta\", \"Chefe\", \"Colonizador\", \"Heroi\"];\n\t\taLangTroops[2] = [\"Falange\", \"Espadachim\", \"Batedor\", \"Trovão Theutate\", \"Cavaleiro Druida\", \"Haeduano\", \"Aríete\", \"Trabuquete\", \"Chefe de Clã\", \"Colonizador\", \"Heroi\"];\n\t\taLangAttackType = [\"Reforço\", \"Ataque\", \"Assalto\"];\n\t\tbreak;\n\n case \"my\":\n\t\taLangAllBuildWithId = [\"Kawasan Pembalakan\", \"Kuari Tanat Liat\", \"Lombong Bijih Besi\", \"Ladang\", \"\", \"Kilang Papan\", \"Kilang Bata\", \"Faundri Besi\", \"Pengisar Bijian\", \"Kilang Roti\", \"Gudang\", \"Jelapang\", \"Kedai Senjata\", \"Kedai Perisai\", \"Gelanggang Latihan\", \"Bangunan Utama\", \"Titik Perhimpunan\", \"Pasar\", \"Kedutaan\", \"Berek\", \"Kandang Kuda\", \"Bengkel\", \"Akademi\", \"Gua\", \"Dewan Perbandaran\", \"Residen\", \"Istana\", \"Perbendaharaan\", \"Pejabat Dagangan\", \"Berek Besar\", \"Kandang Kuda Besar\", \"Tembok Bandar\", \"Tembok Tanah\", \"Pagar Kubu\", \"Kedai Tukang Batu\", \"Kilang Bir\", \"Pemerangkap\",\"Rumah Agam Wira\", \"Gudang Besar\", \"Jelapang Besar\", \"Dunia Keajaiban\", \"Palung Kuda\"];\n\t\taLangAllBuildAltWithId = [\"Kawasan Pembalakan\", \"Kuari Tanat Liat\", \"Lombong Bijih Besi\", \"Ladang\", \"\", \"Kilang Papan\", \"Kilang Bata\", \"Faundri Besi\", \"Pengisar Bijian\", \"Kilang Roti\", \"Gudang\", \"Jelapang\", \"Kedai Senjata\", \"Kedai Perisai\", \"Gelanggang Latihan\", \"Bangunan Utama\", \"Titik Perhimpunan\", \"Pasar\", \"Kedutaan\", \"Berek\", \"Kandang Kuda\", \"Bengkel\", \"Akademi\", \"Gua\", \"Dewan Perbandaran\", \"Residen\", \"Istana\", \"Perbendaharaan\", \"Pejabat Dagangan\", \"Berek Besar\", \"Kandang Kuda Besar\", \"Tembok Bandar\", \"Tembok Tanah\", \"Pagar Kubu\", \"Kedai Tukang Batu\", \"Kilang Bir\", \"Pemerangkap\",\"Rumah Agam Wira\", \"Gudang Besar\", \"Jelapang Besar\", \"Dunia Keajaiban\", \"Palung Kuda\"];\n\t\taLangAddTaskText = [\"Add task\", \"Style\", \"Active village\", \"Task target\", \"To\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Move up\", \"Move down\", \"Del\", \" Task contents\", \"Move \", \"Delete all the tasks\"];\n\t\taLangTaskKind = [\"Tingkatkan\", \"Bina bangunan\", \"Serang\", \"Selidik\", \"latih\", \"Angkut\", \"NPC\", \"musnah\", \"Perayaan\"];\n\t\taLangGameText = [\"Tahap\", \"Pedagang\", \"ID\", \"Ibu Kota\", \"Waktu mula\", \"this timeseting is unuseful now.\", \"ke\", \"Kampung\", \"angkut\", \"dari\", \"Angkut ke\", \"Angkut dari\", \"Balik dari\", \"sumber\", \"bangunan\", \"Bina bangunan\", \"Kosong\", \"tahap\"];\n\t\taLangRaceName = [\"Rom\", \"Teuton\", \"Gaul\"];\n\t\taLangTaskOfText = [\"Schedule Upgrade\", \"Schedule NewBuild\", \"AutoResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Trans_In_limit\", \"Default\", \"Modify\", \"Wood/Clay/Iron\", \"Crop\", \"Schedule demolition\", \"Schedule attack\", \"Attack type\", \"Travel time\", \"repeat times\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Troops sent\", \"Schedule Train\",\"Train site\",\"TrainTask done\",\"customTransport\",\"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"small party\",\"big party\",\"setInterval of Resources concentration\",\"minutes\",\".\",\".\",\"START\",\"STOP\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Terlalu sedikit sumber\", \"Para pekerja sedang bekerja\", \"Construction completed\", \"Starting construction\", \"In development\", \"Your Warehouse is too small. Please upgrade your Warehouse to continue your construction\", \"Your Granary is too small. Please upgrade your Granary to continue your construction\", \"Enough resources\",\"Lack of food: extend cropland first\",\"There is already a celebration going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Cancelled\", \"Start the tasks\", \"Upgrade successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\"];\n\t\taLangResources=[\"kayu\",\"tanah liat\",\"besi\",\"tanaman\"];\n\t\taLangTroops[0] = [\"Askar Legion\", \"Pengawal Pertahanan\", \"Askar Empayar\", \"Kesatria Diplomatik\", \"Kesatria Empayar\", \"Kesatria Jeneral\", \"Kereta Pelantak\", \"Tarbil Api\", \"Senator\", \"Peneroka\", \"Wira\"];\n\t\taLangTroops[1] = [\"Askar Belantan\", \"Askar Lembing\", \"Askar Kapak\", \"Peninjau\", \"Kesatria Santo\",\"Kesatria Teutonik\", \"Kereta Pelantak\", \"Tarbil\", \"Penghulu\", \"Peneroka\", \"Wira\"];\n\t\taLangTroops[2] = [\"Falanks\", \"Askar Pedang\", \"Penjelajah\", \"Guruh Theutates\", \"Penunggang Druid\", \"Haeduan\", \"Kereta Pelantak\", \"Tarbil\", \"Pemimpin\", \"Peneroka\", \"Wira\"];\n\t\taLangAttackType = [\"Bantuan\", \"Serangan: Normal\", \"Serangan: Serbuan\"];\n\t\tbreak;\n\n\n case \"nl\":\n\t\taLangAllBuildWithId = [\"Houthakker\", \"Klei-afgraving\", \"IJzermijn\", \"Graanakker\", \"\", \"Zaagmolen\", \"Steenbakkerij\", \"Ijzersmederij\", \"Korenmolen\", \"Bakkerij\", \"Pakhuis\", \"Graansilo\", \"Wapensmid\", \"Uitrustingssmederij\", \"Toernooiveld\", \"Hoofdgebouw\", \"Verzamelenplaats\", \"Marktplaats\", \"Ambassade\", \"Barakken\", \"Stal\", \"Werkplaats\", \"Acedemie\", \"Schuilplaats\", \"Raadhuis\", \"Residentie\", \"Paleis\", \"Schatkamer\", \"Handelskantoor\", \"Grote Barakken\", \"Grote Stal\", \"Stadsmuur\", \"Muur van aarde\", \"Palissade\", \"Steenhouwerij\", \"Brouwerij\", \"Vallenzetter\",\"Heldenhof\", \"Groot Pakhuis\", \"Grote Graansilo\", \"Wereldwonder\", \"Drinkplaats\"];\n\t\taLangAllBuildAltWithId = [\"Houthakker\", \"Klei-afgraving\", \"IJzermijn\", \"Graanakker\", \"\", \"Zaagmolen\", \"Steenbakkerij\", \"Ijzersmederij\", \"Korenmolen\", \"Bakkerij\", \"Pakhuis\", \"Graansilo\", \"Wapensmid\", \"Uitrustingssmederij\", \"Toernooiveld\", \"Hoofdgebouw\", \"Verzamelenplaats\", \"Marktplaats\", \"Ambassade\", \"Barakken\", \"Stal\", \"Werkplaats\", \"Acedemie\", \"Schuilplaats\", \"Raadhuis\", \"Residentie\", \"Paleis\", \"Schatkamer\", \"Handelskantoor\", \"Grote Barakken\", \"Grote Stal\", \"Stadsmuur\", \"Muur van aarde\", \"Palissade\", \"Steenhouwerij\", \"Brouwerij\", \"Vallenzetter\",\"Heldenhof\", \"Groot Pakhuis\", \"Grote Graansilo\", \"Wereldwonder\", \"Drinkplaats\"];\n\t\taLangAddTaskText = [\"Taak toevoegen\", \"Type\", \"Gekozen dorp\", \"Taakdoel\", \"Naar\", \"Modus\", \"Bouwhulp\", \"Grondstofconcentratie\", \"Naar boven\", \"Naar benenden\", \"Del\", \"&#160;&#160;&#160;Doelen\", \"Bewegen \", \"Verwijder alle taken\"]; \n\t\taLangTaskKind = [\"Verbeteren\", \"Gebouw bouwen\", \"Aanvallen\", \"Onderzoeken\", \"Trainen\", \"Handel\", \"NPC\", \"Slopen\", \"Vieren\"]; \n\t\taLangGameText = [\"Niveau\", \"Handelaren\", \"ID\", \"Hoofddorp\", \"Start tijd\", \"Deze tijdsinstelling is onbruikbaar op dit moment.\", \"Naar\", \"Dorp\", \"transport\", \"Van\", \"Transporteren naar\", \"Transporteren van\", \"Terugkeren van\", \"Grondstoffen\", \"Gebouw\", \"Nieuw gebouw bouwen\", \"Leeg\", \"Niveau\"]; \n aLangRaceName = [\"Romeinen\", \"Germanen\", \"Galliërs\"]; \n\t\taLangTaskOfText = [\"Upgrade plannen\", \"Nieuwbouw plannen\", \"Auto ResUpD\", \"Inactief\", \"Start\", \"Bezig\", \"Stop\", \"De grondverdeling van dit dorp is \", \"Autotransport\", \"Autotransport is niet gestart\", \"Gestart\", \"Transport succesvol\", \"Takenlijst\", \"Trans In limit\", \"Standaard\", \"Aanpassen\", \"Hout/Klei/Ijzer\", \"Graan\", \"Slopen plannen\", \n \"Aanval plannen\", \"Aanvalssoort\", \"Tijdsduur\", \"Herhalen\", \"tussentijd\",\"00:30:00\",\"Katapult doel\",\"Random\", \"Onbekend\", \"keren\", \"Maand\", \"Dag\", \"Troepen verstuurd\", \n \"Training plannen\", \"Trainingkant\", \"Trainingstaak voltooid\", \"Handmatig Transport\", \"Stel de tussentijd in\",\"Dit is de tussentijd van de pagina herladen ,\\n standaard is 20 minuten, stel a.u.b. een nieuwe tijd in:\\n\\n\",\"Trans Out Rmn\",\"Feest plannen\",\"Klein Feest\",\"Groot Feest\",\"Stel tussentijd in voor grondstofconcentratie\", \n \"minuten\", \".\",\".\",\"START\",\"STOP\",\"Verbetering plannen\",\"Verbeter aanval\",\"Verbeter uitrusting\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n aLangErrorText = [\"Te weinig grondstoffen.\", \"Je bouwvakkers zijn al aan het werk.\", \"Bouwopdracht voltooid\", \"Bouwopdracht begint\", \"Bezig\", \"Je pakhuis is te klein. Verbeter je pakhuis om de bouwopdracht voort te zetten.\", \"Je graansilo is te klein. Verbeter je graansilo om de bouwopdracht voort te zetten\", \"Genoeg grondstoffen\",\"Te weinig graanproductie: Verbeter eerst een graanveld\",\"Er is al een feest gaande\"]; \n\t\taLangOtherText = [\"Belangrijk bericht\", \"Alleen de grondstofvelden van het hoofddorp kunnen <br/>verbeterd worden tot niveau 20. Nu is je hoofddorp<br/> niet vastgesteld. Bezoek je profiel a.u.b.\", \"Afkorting hier ^_^\", \"Instellingen succesvol\", \"Geannuleerd\", \"Start de taken\", \"Verbetering succesvol\", \"Start succesvol\", \"Je ras is onbekend, daardoor ook je troeptype. <br/>Bezoek je profiel om je ras vast te stellen<br/>\", \"Bezoek a.u.b. ook je heldenhof om <br/> de snelheid en type van je held vast te stellen.\"]; \n\t\taLangResources=[\"Hout\",\"Klein\",\"Ijzer\",\"Graan\"]; \n\t\taLangTroops[0] = [\"Legionair\", \"Praetoriaan\", \"Imperiaan\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Ram\", \"Vuurkatapult\", \"Senator\", \"Kolonist\", \"Held\"]; \n\t\taLangTroops[1] = [\"Knuppelvechter\", \"Speervechter\", \"Bijlvechter\", \"Verkenner\", \"Paladijn\", \"Germaanse Ridder\", \"Ram\", \"Katapult\", \"Leider\", \"Kolonist\", \"Held\"]; \n\t\taLangTroops[2] = [\"Phalanx\", \"Zwaardvechter\", \"Padvinder\", \"Toetatis donder\", \"Druideruiter\", \"Haeduaan\", \"Ram\", \"Trebuchet\", \"Onderleider\", \"Kolonist\", \"Held\"]; \n\t\taLangAttackType = [\"Versterking\", \"Aanval\", \"Overval\"]; \n\t\tbreak;\n\n\ncase \"hu\": //Harrerp\n\n\t\taLangAllBuildWithId = [\"Favágó\", \"Agyagbánya\", \"Vasércbánya\", \"Búzafarm\", \"\", \"Fűrészüzem\", \"Agyagégető\", \"Vasöntöde\", \"Malom\", \"Pékség\", \"Raktár\", \"Magtár\", \"Fegyverkovács\", \"Páncélkovács\", \"Gyakorlótér\", \"Főépület\", \"Gyülekezőtér\", \"Piac\", \"Követség\", \"Kaszárnya\", \"Istálló\", \"Műhely\", \"Akadémia\", \"Rejtekhely\", \"Tanácsháza\", \"Rezidencia\", \"Palota\", \"Kincstár\", \"Kereskedelmi központ\", \"Nagy Kaszárnya\", \"Nagy Istálló\", \"Kőfal\", \"Földfal\", \"Cölöpfal\", \"Kőfaragó\", \"Sörfőzde\", \"Csapdakészítő\", \"Hősök háza\", \"Nagy Raktár\", \"Nagy Magtár\", \"Világcsoda\",\"Lóitató\"];\n\t\taLangAllBuildAltWithId = [\"Favágó\", \"Agyagbánya\", \"Vasércbánya\", \"Búzafarm\", \"\", \"Fűrészüzem\", \"Agyagégető\", \"Vasöntöde\", \"Malom\", \"Pékség\", \"Raktár\", \"Magtár\", \"Fegyverkovács\", \"Páncélkovács\", \"Gyakorlótér\", \"Főépület\", \"Gyülekezőtér\", \"Piac\", \"Követség\", \"Kaszárnya\", \"Istálló\", \"Műhely\", \"Akadémia\", \"Rejtekhely\", \"Tanácsháza\", \"Rezidencia\", \"Palota\", \"Kincstár\", \"Kereskedelmi központ\", \"Nagy Kaszárnya\", \"Nagy Istálló\", \"Kőfal\", \"Földfal\", \"Cölöpfal\", \"Kőfaragó\", \"Sörfőzde\", \"Csapdakészítő\", \"Hősök háza\", \"Nagy Raktár\", \"Nagy Magtár\", \"Világcsoda\",\"Lóitató\"];\n\t\taLangAddTaskText = [\"Feladat hozzáadása\", \"Feladat\", \"Aktív falu\", \"Feladat célja\", \"Ide\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Fel\", \"Le\", \"Törlés\", \" Feladatok\", \"Sorrend\", \"Összes feladat törlése\"];\n\t\taLangTaskKind = [\"Kiépítés\", \"Új épület\", \"Támadás\", \"Fejlesztés\", \"Kiképzés\", \"Szállítás\", \"NPC\", \"Bontás\", \"Ünnep\"];\n\t\taLangGameText = [\"Szint\", \"Kereskedők\", \"ID\", \"Capital\", \"Indítási idő\", \"az időbeállítás nem szükséges.\", \"ide\", \"Falu\", \"szállítás\", \"innen\", \"Szállítás ide\", \"Szállítás innen\", \"Visszaérkezés\", \"nyersanyag\", \"épület\", \"Új épület építése\", \"empty\", \"szint\"];\n\t\taLangRaceName = [\"Római\", \"Germán\", \"Gall\"];\n\t\taLangTaskOfText = [\"Időzített kiépítés\", \"Időzített építés\", \"AutoResUpD\", \"Not_run\", \"Start\", \"Started\", \"Suspend\", \"The resource fields distribution of this village is \", \"Auto szállítás\", \"Autotransport is not opened\", \"Opened\", \"Szállítás kész\", \"Feladat lista\", \"Trans_In_limit\", \"Default\", \"Módosítás\", \"Fa/Agyag/Vasérc\", \"Búza\", \"Időzített bontás\",\n\t\t\t\"Időzítet támadás\", \"Támadás típus\", \"Utazási idő\", \"Ismétlés\", \"Idő intervallum\",\"00:30:00\",\"Katapult célpont\",\"Véletlen\", \"Ismeretlen\", \"ismétlés\", \"Hónap\", \"Nap\", \"Egységek küldése\",\n\t\t\t\"Időzített kiképzés\",\"Kiképzőhely\",\"Kiképzés befejezve\",\"Egyedi szállítás\",\"Frissítési időintervallum beállítás\",\"Ez az oldalfrissítési időintervallum,\\n az alap 20 perc, írd be az új időt:\\n\\n\",\"Trans_Out_Rmn\",\"Időzített ünnepség\",\"Kis ünnepség\",\"Nagy ünnepség\",\"setInterval of Resources concentration\",\n\t\t\t\"perc\",\"áll\",\"fut\",\"indulj\",\"állj\",\"Időzített fejlesztés\",\"Fegyver fejlesztés\",\"Páncél fejlesztés\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Too few resources.\", \"The workers are already at work.\", \"Építés kész\", \"Építés indul\", \"Fejlesztés folyamatban\", \"A raktárad túl kicsi. Építsd tovább a raktárt, hogy folytathasd az építést\", \"A magtárad túl kicsi. Építsd tovább a magtárt, hogy folytathasd az építést\", \"Elég nyersanyag\",\"Élelemhiány: Előtte egy búzafarmot kell építened \",\"Jelenleg is ünnepelnek\",\"There is already research going on\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can be upgraded to level 20. Now your capital is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Beállítás kész\", \"Cancelled\", \"Start the tasks\", \"Kiépítés kész\", \"Run successfully\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Hero's Mansion to determine the speed and the type of your hero.\"];\n\t\taLangResources= [\"fa\",\"agyag\",\"vasérc\",\"búza\"];\n\t\taLangTroops[0] = [\"Légiós\", \"Testőr\", \"Birodalmi\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Faltörő kos\", \"Tűzkatapult\", \"Szenátor\", \"Telepes\", \"Hős\"]; //Római\n\t\taLangTroops[1] = [\"Buzogányos\", \"Lándzsás\", \"Csatabárdos\", \"Felderítő\", \"Paladin\", \"Teuton lovag\", \"Faltörő kos\", \"Katapult\", \"Törzsi vezető\", \"Telepes\", \"Hős\"]; //Germán\n\t\taLangTroops[2] = [\"Phalanx\", \"Kardos\", \"Felderítő\", \"Theutat villám\", \"Druida lovas\", \"Haeduan\", \"Falromboló\", \"Harci-katapult\", \"Főnök\", \"Telepes\", \"Hős\"]; //Gall\n\t\taLangAttackType = [\"Támogatás\", \"Támadás\", \"Rablás\"];\n\t\tbreak;\t\t\n\n\ncase \"lv\": //by sultāns updated the 16/04/2010\n\t\taLangAllBuildWithId = [\"Cirsma\", \"Māla Karjers\", \"Dzelzs Raktuves\", \"Labības Lauks\", \"\", \"Kokzāģētava\", \"Ķieģelu Fabrika\", \"Dzelzs Lietuve\", \"Dzirnavas\", \"Maiznīca\", \"Noliktava\", \"Klēts\", \"Ieroču kaltuve\", \"Bruņu kaltuve\", \"Turnīru laukums\", \"Galvenā ēka\", \"Pulcēšanās Vieta\", \"Tirgus laukums\", \"Vēstniecība\", \"Kazarmas\", \"Stallis\", \"Darbnīca\", \"Akadēmija\", \"Paslēptuve\", \"Rātsnams\", \"Rezidence\", \"Pils\", \"Dārgumu glabātuve\", \"Tirdzniecības Birojs\", \"Lielās Kazarmas\", \"Lielais Stallis\", \"Pilsētas Mūris\", \"Zemes Mūris\", \" Palisāde\", \"Akmeņlauztuve\", \"Alus Darītava\", \"Mednieku māja\",\"Varoņu Savrupmāja\", \"Lielā Noliktava\", \"Liela Klēts\", \"Pasaules Brīnums\"];\n\t\taLangAllBuildAltWithId = [\"Cirsma\", \"Māla Karjers\", \"Dzelzs Raktuves\", \"Labības Lauks\", \"\", \"Kokzāģētava\", \"Ķieģelu Fabrika\", \"Dzelzs Lietuve\", \"Dzirnavas\", \"Maiznīca\", \"Noliktava\", \"Klēts\", \"Ieroču kaltuve\", \"Bruņu kaltuve\", \"Turnīru laukums\", \"Galvenā ēka\", \"Pulcēšanās Vieta\", \"Tirgus laukums\", \"Vēstniecība\", \"Kazarmas\", \"Stallis\", \"Darbnīca\", \"Akadēmija\", \"Paslēptuve\", \"Rātsnams\", \"Rezidence\", \"Pils\", \"Dārgumu glabātuve\", \"Tirdzniecības Birojs\", \"Lielās Kazarmas\", \"Lielais Stallis\", \"Pilsētas Mūris\", \"Zemes Mūris\", \" Palisāde\", \"Akmeņlauztuve\", \"Alus Darītava\", \"Mednieku māja\",\"Varoņu Savrupmāja\", \"Lielā Noliktava\", \"Liela Klēts\", \"Pasaules Brīnums\"];\n\t\taLangAddTaskText = [\"Izveidot uzdevumu\", \"Veids\", \"Aktīvais ciems\", \"Uzdevuma mērķis\", \"| Mērķis\", \"Tips\", \"Celtniecības atbalsts\", \"Resursu koncentrācija\", \"Uz augšu\", \"Uz leju\", \"Izdzēst\", \" Uzdevuma stāvoklis\", \"Pārvietot\", \"Dzēst visus uzdevumus\"];\n\t\taLangTaskKind = [\"Uzlabot\", \"Jauna ēka\", \"Uzbrukt\", \"Izpētīt\", \"Apmācīt\", \"Nosūtīt resursus\", \"NPC\", \"Nojaukt\", \"Svinības\"];\n\t\taLangGameText = [\"Līmenis\", \"Tirgotāji\", \"ID\", \"Galvaspilsēta\", \"Sākuma laiks\", \"Īslaicīgi nestrādā\", \"uz\", \"Ciems\", \"Transportēt\", \"no\", \"Transportēt uz\", \"Transportēt no\", \"Atgriezties no\", \"resursi\", \"ēka\", \"Būvēt jaunu ēku\", \"tukšs\", \"līmenis\"];\n\t\taLangRaceName = [\"Romieši\", \"Ģermāņi\", \"Galli\"];\n\t\taLangTaskOfText = [\"Ieplānot uzlabojumus\", \"Ieplānot jaunas ēkas celtniecību\", \"Uzlabot resursu laukus\", \"Izslēgt\", \"Uzsākt\", \"Ieslēgts\", \"Stop\", \"Resursu lauku izvietojums šajā ciemā\", \"Automātiska nosūtīšana\", \"Automātiska nosutīšana atslēgta\", \"Ieslēgts\", \"Veiksmīgi nosūtīts\", \"* Uzdevumi *\", \"Ienākošais limits\", \"Default\", \"Izmainīt\", \"Koks/Māls/Dzelzis\", \"Labība\", \"Ieplānot nojaukšanu\",\n\t\t\t\"Ieplānot uzbrukumu\", \"Uzbrukuma veids\", \"Laiks ceļā\", \"Atkartošanas laiks\", \"laika intervāls\",\"00:30:00\",\"Ar katapultām massēt\",\"Pofig pa ko\", \"Nezināms\", \"laiki\", \"Mēnesis\", \"Diena\", \"Kareivji nosūtīti\",\n\t\t\t\"Ieplānot apmācību\",\"Train site\",\"Kareivju apmācība pabeigta\",\"optimizēt transportēšanu\",\"Ievadīt laiku pēc kura atkārtot iekraušanu\",\"Šis ir intervāls lapas parlādēšanai ,\\n pēc noklusējuma - 20 min., Lūdzu ievadiet jaunu laiku:\\n\\n\",\"Izejošais limits\",\"Ieplānot svinības\",\"mazās svinības\",\"lielās svinības\",\"Uzstādīt laika intervālu resursu sūtīšanai\",\n\t\t\t\"minūtes\", \".\",\".\",\"Start\", \"Stop\", \"Ieplānot uzdevumus\",\"Ieplānot uzbrukumus\",\"Ieplanot aizsardzību\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Nepietiek resursu\", \"Strādnieki jau strādā\", \"Būvniecība pabeigta\", \"Ir uzsākta būvniecība\", \"Attīstības stadija\", \"Nepietiek vietas noliktavā, lūdzu paplašiniet to\", \"Nepietiek vietas klētī, ludzu paplašinoiet to\", \"Pietiekoši resursu\",\"\",\"Svinības jau notiek\"];\n\t\taLangOtherText = [\"Svarīgi\", \"Tikai galvaspilsētā resursu laukus var uzlabot uz 20Lvl. Galvaspilsāta nav noteikta. Ieejiet lūdzu savā profilā\", \"Shortcut here ^_^\", \"Iestatījumi pabeigti\", \"Atcelts\", \"Sākt uzdevumus\", \"Uzlabots veiksmīgi\", \"Viss notiek\", \"Jūsu rase ir unknown. Lūdzu ieejiet profilā.\", \"Kā arī, lūdzu ieejiet varoņu majā, lai noteiktu varoņa veidu un ātrumu\"];\n\t\taLangResources=[\"Koks\",\"Māls\",\"Dzelzs\",\"Labība\"];\n\t\taLangTroops[0] = [\"Leģionārs\", \"Pretorietis\", \"Iekarotājs\", \"Ziņnesis\", \"Romas Jātnieks\", \"Romas Bruņinieks\", \"Mūra Brucinātājs\", \"Uguns Katapulta\", \"Senators\", \"Kolonists\", \"Varonis\"];\n\t\taLangTroops[1] = [\"Rungas Vēzētājs\", \"Šķēpnesis\", \"Karacirvja Vēzētājs\", \"Izlūks\", \"Bruņinieks\", \"Ģermāņu Bruņinieks\", \"Postītājs\", \"Katapultas\", \"Virsaitis\", \"Kolonists\", \"Varonis\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Zobenbrālis\", \"Pēddzinis\", \"Zibens Jātnieks\", \"Priesteris - Jātnieks\", \"Edujs\", \"Tarāns\", \"Trebušets\", \"Barvedis\", \"Kolonists\", \"Varonis\"];\n\t\taLangAttackType = [\"Papildspēki\", \"Uzbrukums\", \"Iebrukums\"];\n\t\tbreak;\n\tcase \"cl\":\n\tcase \"mx\":\n\tcase \"net\": // thanks Renzo\n\t\taLangAllBuildWithId = [\"Leñador\", \"Barrera\", \"Mina\", \"Granja\", \"\", \"Serrería\", \"Ladrillar\", \"Fundición de Hierro\", \"Molino\", \"Panadería\", \"Almacén\", \"Granero\", \"Herrería\", \"Armería\", \"Plaza de torneos\", \"Edif. principal\", \"Plaza reuniones\", \"Mercado\", \"Embajada\", \"Cuartel\", \"Establo\", \"Taller\", \"Academia\", \"Escondite\", \"Ayuntamiento\", \"Residencia\", \"Palacio\", \"Tesoro\", \"Oficina de Comercio\", \"Cuartel Grande\", \"Establo Grande\", \"Muralla\", \"Terraplén\", \"Empalizada\", \"Cantero\", \"Cervecería\", \"Trampero\",\"Hogar del héroe\", \"Almacén Grande\", \"Granero Grande\", \"Maravilla\", \"Abrevadero\"];\n\t\taLangAllBuildAltWithId = [\"Leñador\", \"Barrera\", \"Mina\", \"Granja\", \"\", \"Serrería\", \"Ladrillar\", \"Fundición de Hierro\", \"Molino\", \"Panadería\", \"Almacén\", \"Granero\", \"Herrería\", \"Armería\", \"Plaza de torneos\", \"Edif. principal\", \"Plaza reuniones\", \"Mercado\", \"Embajada\", \"Cuartel\", \"Establo\", \"Taller\", \"Academia\", \"Escondite\", \"Ayuntamiento\", \"Residencia\", \"Palacio\", \"Tesoro\", \"Oficina de Comercio\", \"Cuartel Grande\", \"Establo Grande\", \"Muralla\", \"Terraplén\", \"Empalizada\", \"Cantero\", \"Cervecería\", \"Trampero\",\"Hogar del héroe\", \"Almacén Grande\", \"Granero Grande\", \"Maravilla\", \"Abrevadero\"];\n\t\taLangAddTaskText = [\"Añadir tarea\", \"Estilo\", \"Aldea activa\", \"Objetivo de Tarea\", \"Para\", \"Modo\", \"Soporte de Construcción\", \"Concentración de Recursos\", \"Ir arriba\", \"Ir abajo\", \"Borrar\", \" Contenido de tarea\", \"Mover \", \"Borrar todas las tareas\"];\n\t\taLangTaskKind = [\"Subir\", \"Construir edificio nuevo\", \"Atacar\", \"Mejorar\", \"Entrenar\", \"Transportar\", \"NPC\", \"Demoler\", \"Fiesta\"];\n\t\taLangGameText = [\"Nivel\", \"Comerciantes\", \"ID\", \"Capital\", \"Tiempo de Inicio\", \"esta prueba de tiempo no es útil.\", \"para\", \"Aldea\", \"transportar\", \"de\", \"Transportar a\", \"Transporte de\", \"Regreso de\", \"recursos\", \"edificio\", \"Construir nuevo edificio\", \"vacío\", \"nivel\"];\n\t\taLangRaceName = [\"Romanos\", \"Germanos\", \"Galos\"];\n\t\taLangTaskOfText = [\"Programar subida\", \"Programar nueva Construcción\", \"AutoResUpD\", \"OFF\", \"Empezar\", \"ON\", \"Suspender\", \"La distribución de campos de recursos de esta aldea es \", \"Autotransporte\", \"Autotransporte no está abierto\", \"Abierto\", \"Transporte exitoso\", \"Lista de Tareas\", \"Trans_In_limit\", \"Por Defecto\", \"Modificar\", \"Madera/Barro/Hierro\", \"Cereal\", \"Programar demolición\",\"Programar ataque\", \"Tipo de Ataque\", \"Tiempo de Viaje\", \"Número de Repeticiones\", \"Tiempo de intervalo\",\"00:30:00\",\"Objetivo de Catapulta\",\"Al Azar\", \"Desconocido\", \"Veces\", \"Mes\", \"Día\", \"Tropas enviadas\", \"Programar Cadena\",\"Sitio de Cadena\",\"Tarea de Cadena completada\",\"Transporte Custom\",\"Establecer tiempo de intervalo de la recarga\",\"este es el tiempo de intervalo entre cada recarga de la página,\\n Por defecto es 20 minutos, por favor introduza el nuevo tiempo:\\n\\n\",\"Trans_Out_Rmn\",\"Programar Fiesta\",\"fiesta pequeña\",\"fiesta grande\",\"Establecer intervalo de concentración de recursos\",\"minutos\",\".\",\".\",\"START\",\"STOP\", \"Programar Mejora\", \"Mejorar Ataque\", \"Mejorar Defensa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Muy pocos recursos.\", \"Los aldeanos ya están trabajando.\", \"Construcción completa\", \"Empezando construcción\", \"En desarrollo\", \"Su almacén es muy pequeño. Por favor amplíe su almacén para continuar su construcción\", \"Su almacén es muy pequeño. Por favor amplíe su almacén para continuar su construcción\", \"Suficientes Recursos\",\"Falta de Alimento: Amplíe una granja primero\",\"Ya hay una fiesta en progreso\",\"Ya hay una exploración en progreso\"];\n\t\taLangOtherText = [\"Nota importante\", \"Solo los campos de recurso de la capital pueden ser ampliados a nivel 20. Su capital no ha sido detectada. Por favor visite su perfil.\", \"Atajo aquí ^_^\", \"Configuración completada\", \"Cancelado\", \"Empezar tareas\", \"Mejora Exitosa\", \"Ejecución exitosa\", \"Su raza es desconocida, asimismo su tipo de tropas. Visite su Perfil para determinar su raza.\", \"Por favor visite su Hogar del Heroe para determinar la velocidad y tipo de su heroe.\"];\n\t\taLangResources = [\"madera\", \"barro\", \"hierro\", \"cereal\"];\n\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperano\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Carnero\", \"Catapulta de Fuego\", \"Senador\", \"Colono\", \"Héroe\"];\n\t\taLangTroops[1] = [\"Luchador de Porra\", \"Lancero\", \"Luchador de Hacha\", \"Emisario\", \"Paladín\", \"Jinete Teutón\", \"Ariete\", \"Catapulta\", \"Cabecilla\", \"Colono\", \"Héroe\"];\n\t\taLangTroops[2] = [\"Falange\", \"Luchador de Espada\", \"Batidor\", \"Rayo de Teutates\", \"Jinete Druida\", \"Jinete Eduo\", \"Ariete\", \"Catapulta de Guerra\", \"Cacique\", \"Colono\", \"Héroe\"];\n\t\taLangAttackType = [\"Refuerzo\", \"Ataque\", \"Atraco\"];\n\t\tbreak;\n\n\tcase \"se\": // thanks to Arias\n\t\taLangAllBuildWithId = [\"Skogshuggare\", \"Lergrop\", \"Järngruva\", \"Vetefält\", \"\", \"Sågverk\", \"Murbruk\", \"Järngjuteri\", \"Vetekvarn\", \"Bageri\", \"Magasin\", \"Silo\", \"Smedja\", \"Vapenkammare\", \"Tornerplats\", \"Huvudbyggnad\", \"Samlingsplats\", \"Marknadsplats\", \"Ambassad\", \"Baracker\", \"Stall\", \"Verkstad\", \"Akademi\", \"Grotta\", \"Stadshus\", \"Residens\", \"Palats\", \"Skattkammare\", \"Handelskontor\", \"Stor barack\", \"Stort stall\", \"Stadsmur\", \"Jordvall\", \"Palisad\", \"Stenmurare\", \"Bryggeri\", \"Fälla\", \"Hjältens egendom\", \"Stort magasin\", \"Stor silo\", \"Världsunder\", \"Vattenbrunn\"];\n\t\taLangAllBuildAltWithId = [\"Skogshuggare\", \"Lergrop\", \"Järngruva\", \"Vetefält\", \"\", \"Sågverk\", \"Murbruk\", \"Järngjuteri\", \"Vetekvarn\", \"Bageri\", \"Magasin\", \"Silo\", \"Smedja\", \"Vapenkammare\", \"Tornerplats\", \"Huvudbyggnad\", \"Samlingsplats\", \"Marknadsplats\", \"Ambassad\", \"Baracker\", \"Stall\", \"Verkstad\", \"Akademi\", \"Grotta\", \"Stadshus\", \"Residens\", \"Palats\", \"Skattkammare\", \"Handelskontor\", \"Stor barack\", \"Stort stall\", \"Stadsmur\", \"Jordvall\", \"Palisad\", \"Stenmurare\", \"Bryggeri\", \"Fälla\", \"Hjältens egendom\", \"Stort magasin\", \"Stor silo\", \"Världsunder\", \"Vattenbrunn\"];\n\t\taLangAddTaskText = [\"Lägg till uppgift\", \"Stil\", \"Aktiv by\", \"Task target\", \"Till\", \"Läge\", \"Kontruktions stöd\", \"Råvaro koncentration\", \"Flytta upp\", \"Flytta ner\", \"Radera\", \"Uppgifter\", \"Flytta \", \"Radera alla uppgifterna\"];\n\t\taLangTaskKind = [\"Uppgradering:\", \"Ny byggnad:\", \"Attack:\", \"Forskning:\", \"Träning:\", \"Transport:\", \"NPC:\", \"Demolish:\", \"Celebration:\"];\n\t\taLangGameText = [\"Nivå \", \"Handel\", \"ID\", \"Capital\", \"Start time\", \"this timesetting is unuseful now.\", \"till\", \"By\", \"Transport\", \"från\", \"Transport till\", \"Transport från\", \"Återvänder från\", \"Råvaror\", \"Byggnad\", \"Konstruera en ny byggnad\", \"Tom\", \"Nivå\"];\n\t\taLangRaceName = [\"Romare\", \"Germaner\", \"Galler\"];\n\t\taLangTaskOfText = [\"Schemalägg uppgradering\", \"Schemalägg ny byggnad\", \"Uppgradera fält\", \"Ej Aktiv\", \"Starta\", \"Startad\", \"Avbryt\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport lyckades\", \"Uppgifter\", \"Trans_In_limit\", \"Standard\", \"Ändra \", \"Trä/Lera/Järn\", \"Vete\", \"Schemalägg demolition\",\n\t\t\t\"Schemalägg attack\", \"Attack type\", \"Res tid\", \"antal upprepningar\", \"interval time\",\"00:30:00\",\"Catapult target\",\"Random\", \"Okänd\", \"times\", \"Månad\", \"Dag\", \"Trupper skickade\", \"Schemalägg Träning\",\"Tränings plats\",\"Träningen klar\",\"Anpassad transport\",\"Sätt intervallen för omladdning av sidan\",\"Detta är intevallen för omladdning av sida,\\n standard är 20 minuter, vänligen ange ny intervall:\\n\\n\",\"Trans_Out_Rmn\",\"Schemalägg fest\",\"Liten fest\",\"Stor fest\",\"Sätt intervall av råvarukoncentration\",\n\t\t\t\"minuter\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"För få råvaror\", \"Dina arbetare är redan ute på jobb\", \"Byggnad klar\", \"Påbörjar byggnad\", \"Under utveckling\", \"Ditt magasin är för litet. Vänligen uppgradera ditt magasin för att fortsätta ditt byggnadsarbete.\", \"Din silo är för liten. Vänligen uppgradera din silo för att fortsätta ditt byggnadsarbete.\", \"Tillräckligt med resurser\", \"Brist på mat: utöka vetefälten först\", \"En fest pågår redan.\"];\n\t\taLangOtherText = [\"Important note\", \"Only the resource fields of the capital can <br/>be upgraded to level 20. Now your capital<br/> is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup klar\", \"Avbruten\", \"Starta uppgifterna\", \"successfully\", \"Run successfully\", \"Your race is unknown, therefore your troop type. <br/>Visit your Profile to determine your race.<br/>\", \"Please also visit your Hero's Mansion to determine<br/> the speed and the type of your hero.\" , \"Upgrade\"];\n\t\taLangResources=[\"Trä\",\"Lera\",\"Järn\",\"Vete\"];\n\t\taLangTroops[0] = [\"Legionär\", \"Praetorian\", \"Imperiesoldat\", \"Spårare\", \"Imperieriddare\", \"Ceasarriddare\", \"Murbräcka\", \"Eld Katapult\", \"Senator\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangTroops[1] = [\"Klubbman\", \"Spjutman\", \"Yxman\", \"Scout\", \"Paladin\", \"Germansk Knekt\", \"Murbräcka\", \"Katapult\", \"Stamledare\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangTroops[2] = [\"Falanx\", \"Svärdskämpe\", \"Spårare\", \"Theutates Blixt\", \"Druidryttare\", \"Haeduan\", \"Murbräcka\", \"Krigskatapult\", \"Hövding\", \"Nybyggare\", \"Hjälte\"];\n\t\taLangAttackType = [\"Förstärkning\", \"Normal\", \"Plundring\"];\n\t\tbreak;\n\n\tcase \"it\": // thanks Hamkrik, corrections by baldo 2011.04.08\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\t// 2011.02.16 -- provided by Psea\n\t\t\t\taLangAllBuildWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di Mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fabbro\", \"Armeria\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura Cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fabbro\", \"Armeria\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAddTaskText = [\"Aggiungere Compito\", \"Tipo\", \"Villaggio Attivo\", \"Obiettivo del Compito\", \"Coordinate\", \"Modalita'\", \"Supporto ampliamento risorse\", \"Concentrazione risorse\", \"SU\", \"GIU\", \"Cancella\", \" Contenuto del Compito\", \"Muovere\", \"Cancella tutti i Compiti\"]; \n\t\t\t\taLangTaskKind = [\"Amplia\", \"Nuovo Edificio\", \"Attacco\", \"Ricerca\", \"Addestra\", \"Trasporto\", \"NPC\", \"Demolire\", \"Festa\"]; \n\t\t\t\taLangGameText = [\"Livello\", \"Mercanti\", \"ID\", \"Capitale\", \"Tempo di Inizio\", \"questa impostazione di tempo non si usa.\", \"Coordinate\", \"Villaggio\", \"trasporto\", \"dalla\", \"Trasporto alla\", \"Trasporto dalla\", \"Ritorno dalla\", \"risorse\", \"edifici\", \"Costruisci nuovo edificio\", \"vuoto\", \"livello\"]; \n\t\t\t\taLangRaceName = [\"Romani\", \"Teutoni\", \"Galli\"]; \n\t\t\t\taLangTaskOfText = [\"Programma Ampliamento\", \"Programma Nuovo Edificio\", \"AutoResUpD\", \"Non_attivo\", \"Start\", \"Iniziato\", \"Sospeso\", \"La distribuzione delle risorse di questo villaggio e' \", \"Autotrasporto\", \"Autotrasporto non e aperto\", \"Aperto\", \"Trasportato con successo\", \"Lista Compiti\", \"Trans_In_limit\", \"Default\", \"Modificare\", \"Legno/Argilla/Ferro\", \"Grano\", \"Demolire\",\n\t\t\t\t\t\"Programma Attacco\", \"Tipo Attacco\", \"Tempo Percorso\", \"ripeti\", \"intervallo di tempo\", \"00:30:00\", \"Obiettivo Catapulta\", \"Random\", \"Sconosciuto\", \"volte\", \"Mese\", \"Giorno\", \"Truppe Inviate\", \"Programma Addestramento\", \"Edificio di addestramento\", \"Addestramento Finito\", \"Transporto Diverso\", \"ripeti numero volte\", \"questo é l'intervallo di ricarica pagina,\\n default é 20 minuti, per favore inserire nuovo tempo:\\n\\n\", \"Trans_Out_Rmn\", \"Programma la Festa\", \"festa piccola\", \"Festa grande\", \"Imposta l'Intervallo di Concentrazione delle Risorse\",\n\t\t\t\t\t\"minuti\", \"in attesa\", \"corrente\", \"fare\", \"pausa\", \"Schedula Miglioria\", \"Migliora l'attacco\", \"Migliora la difesa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n\t\t\t\taLangErrorText = [\"Mancano le risorse.\", \"I Lavoratori Sono Pronti per Lavorare\", \"Edificio Completo\", \"Inizia Edificio\", \"Nella Ricerca\", \"Il tuo Magazzino é piccolo. Per favore amplia il magazzino per continuare la costruzione\", \"Il tuo Granaio e piccolo. Per favore amplia il granaio per continuare la costruzione\", \"Risorse sufficienti\", \"Mancanza di Cibo: Amplia i Campi di grano\", \"Pronta la Festa\"]; \n\t\t\t\taLangOtherText = [\"Nota Importante \", \"Solo i Campi della Capitale possono essere ampliati al livello 20. La tua capitale non é determinata. Visita il tuo Profilo per favore.\", \"Shortcut here ^_^\", \"Setup compiuto\", \"Cancellato\", \"Inizia i Compiti\", \"Ampliato con successo\", \"Iniziato con successo\", \"La tua razza e' sconosciuta, anche il tipo di truppe. Visita il tuo Profilo per determinare la razza.\", \"Per favore visita Circolo degli eroi per determinare la velocita e il tipo di eroe.\"];\n\t\t\t\taLangResources = [\"legno\", \"argilla\", \"ferro\", \"grano\"]; \n\t\t\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperiano\", \"Emissario a cavallo\", \"Cavaliere del Generale\", \"Cavaliere di Cesare\", \"Ariete\", \"Onagro\", \"Senatore\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[1] = [\"Combattente\", \"Alabardiere\", \"Combattente con ascia\", \"Esploratore\", \"Paladino\", \"Cavaliere Teutonico\", \"Ariete\", \"Catapulta\", \"Comandante\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[2] = [\"Falange\", \"Combattente con spada\", \"Ricognitore\", \"Fulmine di Teutates\", \"Cavaliere druido\", \"Paladino di Haeduan\", \"Ariete\", \"Trabucco\", \"Capo tribù\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangAttackType = [\"Rinforzi\", \"Attacco\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\t// 2011.03.28 -- provided by Psea\n\t\t\t\taLangAllBuildWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di Mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fucina\", \"Fucina\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande caserma\", \"Grande Scuderia\", \"Mura Cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio Civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Bosco\", \"Pozzo d'argilla\", \"Miniera di ferro\", \"Campo di grano\", \"\", \"Segheria\", \"Fabbrica di mattoni\", \"Fonderia\", \"Mulino\", \"Forno\", \"Magazzino\", \"Granaio\", \"Fucina\", \"Fucina\", \"Arena\", \"Palazzo Pubblico\", \"Base militare\", \"Mercato\", \"Ambasciata\", \"Caserma\", \"Scuderia\", \"Officina\", \"Accademia\", \"Deposito Segreto\", \"Municipio\", \"Reggia\", \"Castello\", \"Camera del tesoro\", \"Ufficio Commerciale\", \"Grande Caserma\", \"Grande Scuderia\", \"Mura cittadine\", \"Fortificazioni\", \"Palizzata\", \"Genio Civile\", \"Birrificio\", \"Esperto di trappole\", \"Dimora dell'Eroe\", \"Grande Magazzino\", \"Grande Granaio\", \"Meraviglia\", \"Fonte Equestre\"];\n\t\t\t\taLangAddTaskText = [\"Aggiungere Compito\", \"Tipo\", \"Villaggio Attivo\", \"Obiettivo del Compito\", \"Coordinate\", \"Modo\", \"Supporto di Costruzione\", \"Concentrazione risorse\", \"SU\", \"GIU\", \"Cancella\", \" Contenuto del Compito\", \"Muovere\", \"Cancella tutti i Compiti\"]; \n\t\t\t\taLangTaskKind = [\"Amplia\", \"Nuovo Edificio\", \"Attacco\", \"Ricerca\", \"Addestra\", \"Trasporto\", \"NPC\", \"Demolire\", \"Festa\"]; \n\t\t\t\taLangGameText = [\"Livello\", \"Mercanti\", \"ID\", \"Capitale\", \"Tempo di Inizio\", \"Questa impostazione di tempo non si usa.\", \"Coordinate\", \"Villaggio\", \"Trasporto\", \"dalla\", \"Trasporto a\", \"Trasporto da\", \"In ritorno da\", \"Risorse\", \"Edifici\", \"Costruisci nuovo edificio\", \"vuoto\", \"livello\"]; \n\t\t\t\taLangRaceName = [\"Romani\", \"Teutoni\", \"Galli\"]; \n\t\t\t\taLangTaskOfText = [\"Programma Ampliamento\", \"Programma Nuovo Edificio\", \"AutoResUpD\", \"Non_attivo\", \"Start\", \"Iniziato\", \"Sospeso\", \"La distribuzione delle risorse di questo villaggio e' \", \"Autotrasporto\", \"Autotrasporto non aperto\", \"Aperto\", \"Trasportato con successo\", \"Lista Compiti\", \"Trans_In_limit\", \"Default\", \"Modificare\", \"Legno/Argilla/Ferro\", \"Grano\", \"Demolire\",\n\t\t\t\t\t\"Programma Attacco\", \"Tipo Attacco\", \"Tempo Percorso\", \"ripeti\", \"intervallo di tempo\", \"00:30:00\", \"Obiettivo Catapulta\", \"Random\", \"Sconosciuto\", \"volte\", \"Mese\", \"Giorno\", \"Truppe Inviate\", \"Programma Addestramento\", \"Edificio addestramento\", \"Addestramento Finito\", \"Transporto Diverso\", \"Ripeti numero volte\", \"Questo é l'intervallo di ricarica pagina,\\n default é 20 minuti, per favore inserisci il nuovo tempo:\\n\\n\", \"Trans_Out_Rmn\", \"Programma la Festa\", \"Festa piccola\", \"Festa grande\", \"Imposta l'Intervallo di Concentrazione delle Risorse\",\n\t\t\t\t\t\"minuti\", \"in attesa\", \"corrente\", \"fare\", \"pausa\", \"Schedula miglioria\", \"Migliora attacco\", \"Migliora difesa\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"]; \n\t\t\t\taLangErrorText = [\"Mancano le risorse.\", \"I tuoi costruttori sono già occupati nella costruzione di un altro edificio\", \"Livello massimo raggiunto\", \"Inizia Edificio\", \"Nella Ricerca\", \"Il tuo Magazzino \", \"Il tuo Granaio \", \"Risorse disponibili\", \"Mancanza di cibo\", \"Pronta la Festa\"]; \n\t\t\t\taLangOtherText = [\"Nota Importante \", \"Solo i Campi della Capitale possono essere ampliati al livello 20. La tua capitale non é determinata. Visita il tuo Profilo per favore.\", \"Shortcut here ^_^\", \"Setup compiuto\", \"Cancellato\", \"Inizia i Compiti\", \"Ampliato con successo\", \"Iniziato con successo\", \"La tua razza e' sconosciuta, anche il tipo di truppe. Visita il tuo Profilo per determinare la razza.\", \"Per favore visita il Circolo degli eroi per determinare la velocita e tipo di eroe.\"];\n\t\t\t\taLangResources = [\"legno\", \"argilla\", \"ferro\", \"grano\"]; \n\t\t\t\taLangTroops[0] = [\"Legionario\", \"Pretoriano\", \"Imperiano\", \"Emissario a cavallo\", \"Cavaliere del Generale\", \"Cavaliere di Cesare\", \"Ariete\", \"Onagro\", \"Senatore\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[1] = [\"Combattente\", \"Alabardiere\", \"Combattente con ascia\", \"Esploratore\", \"Paladino\", \"Cavaliere Teutonico\", \"Ariete\", \"Catapulta\", \"Comandante\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangTroops[2] = [\"Falange\", \"Combattente con spada\", \"Ricognitore\", \"Fulmine di Teutates\", \"Cavaliere druido\", \"Paladino di Haeduan\", \"Ariete\", \"Trabucco\", \"Capo tribù\", \"Colono\", \"Eroe\"]; \n\t\t\t\taLangAttackType = [\"Rinforzi\", \"Attacco\", \"Raid\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'it\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\n\tcase \"si\": // thanks Bananana and Tuga\n\t\taLangAllBuildWithId = [\"Gozdar\", \"Glinokop\", \"Rudnik železa\", \"Žitno polje\", \"\", \"Žaga\", \"Opekarna\", \"Talilnica železa\", \"Mlin\", \"Pekarna\", \"Skladišče\", \"Žitnica\", \"Izdelovalec orožja\", \"Izdelovalec oklepov\", \"Vadbišče\", \"Gradbeni ceh\", \"Zbirališče\", \"Tržnica\", \"Ambasada\", \"Barake\", \"Konjušnica\", \"Izdelovalec oblegovalnih naprav\", \"Akademija\", \"Špranja\", \"Mestna hiša\", \"Rezidenca\", \"Palača\", \"Zakladnica\", \"Trgovski center\", \"Velike barake\", \"Velika konjušnica\", \"Mestno obzidje\", \"Zemljen zid\", \"Palisada\", \"Kamnosek\", \"Pivnica\", \"Postavljalec pasti\", \"Herojeva rezidenca\", \"Veliko skladišče\", \"Velika žitnica\", \"Čudež sveta\"];\n\t\taLangAllBuildAltWithId = [\"Gozdar\", \"Glinokop\", \"Rudnik železa\", \"Žitno polje\", \"\", \"Žaga\", \"Opekarna\", \"Talilnica železa\", \"Mlin\", \"Pekarna\", \"Skladišče\", \"Žitnica\", \"Izdelovalec orožja\", \"Izdelovalec oklepov\", \"Vadbišče\", \"Gradbeni ceh\", \"Zbirališče\", \"Tržnica\", \"Ambasada\", \"Barake\", \"Konjušnica\", \"Izdelovalec oblegovalnih naprav\", \"Akademija\", \"Špranja\", \"Mestna hiša\", \"Rezidenca\", \"Palača\", \"Zakladnica\", \"Trgovski center\", \"Velike barake\", \"Velika konjušnica\", \"Mestno obzidje\", \"Zemljen zid\", \"Palisada\", \"Kamnosek\", \"Pivnica\", \"Postavljalec pasti\", \"Herojeva rezidenca\", \"Veliko skladišče\", \"Velika žitnica\", \"Čudež sveta\"];\n\t\taLangAddTaskText = [\"Dodaj nalogo\", \"Style\", \"Aktivna vas\", \"Nadgradi\", \"Na\", \"Mode\", \"Construction support\", \"Resources concentration\", \"Prestavi gor\", \"Prestavi dol\", \"Izbriši\", \" Naloge\", \"Premakni \", \"Izbriši vse naloge\"];\n\t\taLangTaskKind = [\"Nadgradi\", \"Zazidljiva parcela\", \"Napad\", \"Razišči\", \"Uri\", \"Transport\", \"NPC\", \"Demolish\", \"Festival\"];\n\t\taLangGameText = [\"Stopnja\", \"Merchants\", \"ID\", \"Prestolnica\", \"Začetek ob\", \"Nastavitev časa ni pomembna.\", \"to\", \"Vas\", \"transport\", \"from\", \"Transport to\", \"Transport from\", \"Return from\", \"resources\", \"building\", \"Postavi nov objekt\", \"empty\", \"level\"];\n\t\taLangRaceName = [\"Rimljani\", \"Tevtoni\", \"Galci\"];\n\t\taLangTaskOfText = [\"Nadgradi kasneje\", \"Postavi nov objekt\", \"Surovine gor\", \"Pauza\", \"Začetek\", \"Začeto\", \"Prekliči\", \"The resource fields distribution of this village is \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Naloge\", \"Trans_In_limit\", \"Osnovno\", \"Spremeni\", \"Les/Glina/Železo\", \"Crop\", \"Podri kasneje\",\n\t\t\t\"Napadi kasneje\", \"Tip napada\", \"Do napada\", \"Ponovi\", \"Vrnitev čez\",\"00:30:00\",\"Tarča katapultov\",\"Naključno\", \"Unknown\", \"times\", \"Month\", \"Day\", \"Enote poslane\", \"Uri kasneje\",\"Mesto urjenja\",\"Urjenje končano\",\"customTransport\",\"setup interval time of reload\",\"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\",\"Trans_Out_Rmn\",\"ScheduleParty\",\"mali festival\",\"veliki festival\",\"setInterval of Resources concentration\",\n\t\t\t\"minute\",\".\",\".\",\"START\",\"STOP\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Primankljaj surovin.\", \"Delavci so že na delu.\", \"Zgrajeno\", \"Začnem z gradnjo\", \"V razvoju\", \"Seu Armazém é pequeno. Evolua o seu armazém para continuar a sua construção\", \"Seu Celeiro é pequeno. Evolua o seu Celeiro para continuar a sua construção\", \"Recursos suficientes\",\"Já se encontra uma celebração em curso\"];\n\t\taLangOtherText = [\"Pomembno!\", \"Samo polja v prestolnicigredo do stopnje 20 . A sua capitalnao está detectavel. Por favor visite o seu perfil.\", \"Atalho aqui ^_^\", \"Naloga uspešno dodana\", \"Preklicano\", \"Začni z nalogo\", \"Uspešno nadgrajeno\", \"Executar com sucesso\", \"Sua raça é desconhecida, e o seu tipo de tropa também.Visite o seu perfil para determinar as raça.\", \"Por favor visite a sua mansão do heroi para determinara velocidade e o tipo de heroi.\"];\n\t\taLangResources=[\"Les\",\"Glina\",\"Železo\",\"Žito\"]; \n\t\taLangTroops[0] = [\"Legionar\", \"Praetorijan\", \"Imperijan\", \"Izvidnik\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Oblegovalni oven\", \"Ognjeni katapult\", \"Senator\", \"Kolonist\", \"Heroj\"];\n\t\taLangTroops[1] = [\"Gorjačar\", \"Suličar\", \"Metalec sekir\", \"Skavt\", \"Paladin\", \"Tevtonski vitez\", \"Oblegovalni oven\", \"Mangonel\", \"Vodja\", \"Kolonist\", \"Heroj\" ];\n\t\taLangTroops[2] = [\"Falanga\", \"Mečevalec\", \"Stezosledec\", \"Theutatesova Strela\", \"Druid\", \"Haeduan\", \"Oblegovalni oven\", \"Trebušet\", \"Poglavar\", \"Kolonist\", \"Heroj\"];\n\t\taLangAttackType = [\"Okrepitev\", \"Napad\", \"Ropanje\"];\n\t\tbreak;\n\n\tcase \"vn\": // thanks Tuga\n\t\taLangAllBuildWithId = [\"Tiều Phu\", \"Mỏ Đất Sét\", \"Mỏ sắt\", \"Ruộng lúa\", \"\", \"Xưởng Gỗ\", \"Lò Gạch\", \"Lò Rèn\", \"Nhà Xay Lúa\", \"Lò Bánh\", \"Nhà Kho\", \"Kho Lúa\", \"Thợ Rèn\", \"Lò Luyện Giáp\", \"Võ Đài\", \"Nhà Chính\", \"Binh Trường\", \"Chợ\", \"Đại Sứ Quán\", \"Trại Lính\", \"Chuồng Ngựa\", \"Xưởng\", \"Học Viện\", \"Hầm Ngầm\", \"Tòa Thị Chính\", \"Lâu Đài\", \"Cung Điện\", \"Kho Bạc\", \"Phòng Thương Mại\", \"Doanh Trại Lớn\", \"Trại Ngựa\", \"Tường Thành\", \"Tường Đất\", \"Tường Rào\", \"Thợ Xây Đá\", \"Quán bia\", \"Hố Bẫy\",\"Lâu đài tướng\", \"Nhà Kho Lớn\", \"Kho Lúa Lớn\", \"Kỳ Quan\", \"Tàu ngựa\"];\n\t\taLangAllBuildAltWithId = [\"Tiều Phu\", \"Mỏ Đất Sét\", \"Mỏ sắt\", \"Ruộng lúa\", \"\", \"Xưởng Gỗ\", \"Lò Gạch\", \"Lò Rèn\", \"Nhà Xay Lúa\", \"Lò Bánh\", \"Nhà Kho\", \"Kho Lúa\", \"Thợ Rèn\", \"Lò Luyện Giáp\", \"Võ Đài\", \"Nhà Chính\", \"Binh Trường\", \"Chợ\", \"Đại Sứ Quán\", \"Trại Lính\", \"Chuồng Ngựa\", \"Xưởng\", \"Học Viện\", \"Hầm Ngầm\", \"Tòa Thị Chính\", \"Lâu Đài\", \"Cung Điện\", \"Kho Bạc\", \"Phòng Thương Mại\", \"Doanh Trại Lớn\", \"Trại Ngựa\", \"Tường Thành\", \"Tường Đất\", \"Tường Rào\", \"Thợ Xây Đá\", \"Quán bia\", \"Hố Bẫy\",\"Lâu đài tướng\", \"Nhà Kho Lớn\", \"Kho Lúa Lớn\", \"Kỳ Quan\", \"Tàu ngựa\"];\n\t\taLangAddTaskText = [\"Thêm nhiệm vụ\", \"Loại\", \"Tại làng\", \"Mục tiêu\", \"Tới\", \"Phương thức\", \"Tự động\", \"Tùy chỉnh\", \"Di chuyển lên\", \"Di chuyển xuống\", \"Xóa\", \"&#160;&#160;&#160;Nội dung công việc\", \"Di chuyển\", \"Xóa tất cả danh mục\"];\n\t\taLangTaskKind = [\"Nâng cấp\", \"Kiến Trúc Mới\", \"Tấn công\", \"Nghiên cứu\", \"Huấn luyện\", \"Vận chuyển\", \"NPC\", \"Phá hủy\", \"ăn mừng\"];\n\t\taLangGameText = [\"Cấp \", \"Lái Buôn\", \"Tại vị trí\", \"Thủ đô\", \"Bắt đầu tại\", \"Chưa dùng được chức năng này.\", \"đến\", \"Làng\", \"vận chuyển\", \"từ\", \"Vận chuyển đến\", \"Vận chuyển từ\", \"Trở về từ\", \"Tài nguyên\", \"Kiến trúc\", \"Xây Kiến Trúc Mới\", \"không có gì\", \"Cấp\"];\n\t\taLangRaceName = [\"Tộc Romans\", \"Tộc Teutons\", \"Tộc Gauls\"];\n\t\taLangTaskOfText = [\"Lên lịch nâng cấp kiến trúc này\", \"Lên lịch xây kiến trúc này\", \"Tự động nâng cấp các mỏ\", \"Chưa kích hoạt\", \"Kích hoạt\", \"Đã kích hoạt\", \"Hủy\", \"Đây là làng loại \", \"Tự động gửi tài nguyên\", \"Tự động gửi tài nguyên chưa được kích hoạt\", \"Đã được kích hoạt\", \"Gủi thành công\", \"Danh mục\", \"Tài nguyên bạn muốn nhận\", \"Mặc định\", \"Tùy chỉnh \", \"Gỗ/Đất sét/Sắt\", \"Lúa\", \"Lên lịch phá hủy công trình\",\n\t\t\t\"Lên lịch tấn công làng này\", \"Loại tấn công\", \"Thời gian để đến nơi\", \"Số lần lặp lại\", \"Khoảng cách giữa các lần lặp lại\",\"00:30:00\",\"Mục tiêu cata\",\"Ngẫu nhiên\", \"Chưa biết\", \"Giờ\", \"Tháng\", \"Ngày\", \"Đã gửi lính\", \"Lên lịch huấn luyện lính này\",\"Train ubication\",\"Lính đang được huấn luyện\",\"Tùy chỉnh gửi tài nguyên\",\"Thiết lập thời gian tải lại trang web\",\"Đây là khoảng thởi gian tải lại trang web ,\\n Mặc định là 20 phút, hãy điền vào số phút bạn muốn thay đổi:\\n\\n\",\"Tài nguyên bạn muốn chừa lại\",\"Lên lịch ăn mừng\",\"Ăn mừng nhỏ\",\"Ăn mừng lớn\",\"Thiết lập khoảng thời gian bạn muốn gửi tài nguyên\",\n\t\t\t\"Phút\",\"Đang tạm dừng\",\"Đang thi hanh\",\"Thi hành\",\"Tạm dừng\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Quá ít tài nguyên.\", \"Công nhân đang làm nhiệm vụ khác.\", \"Kiến trúc đã hoàn thiên\", \"Bắt đầu xây dựng\", \"Đang xây dựng\", \"Nhà kho quá nhỏ. Hãy nâng cấp nhà kho mới xây dựng được kiến trúc\", \"Kho lúa quá nhỏ. Hãy nâng cấp kho lúa mới xây được kiến trúc\", \"Quá ít tài nguyên\",\"\",\"Hiện đang có buổi lễ ăn mừng\"];\n\t\taLangOtherText = [\"Chú thích quan trọng\", \"Chỉ thủ đô mới có thể<br/>nâng cấp các mỏ lên level 20. THủ đô của bạn<br/> chưa thấy. hãy vào phần hồ sơ của bạn.\", \"Click vào đây\", \"Cài đặt hoàn tất\", \"Đã hủy\", \"Bắt đầu công việc\", \"Nâng cấp thành công\", \"Kích hoạt thành công\", \"CHưa biết bạn thuộc tộc nào. <br/>Vì vậy bạn nên vào hồ sơ để cập nhật thông tin.<br/>\", \"Bạn cũng nên vào Lâu Đài Tướng để cập nhật<br/> tốc đọ và loại tướng.\"];\n\t\taLangResources=[\"Gỗ\",\"Đất sét\",\"Sắt\",\"Lúa\"];\n\t\taLangTroops[0] = [\"Lính Lê Dương\", \"Thị Vệ\", \"Chiến Binh Tinh Nhuệ\", \"Kỵ Binh Do Thám\", \"Kỵ Binh\", \"Kỵ Binh Tinh Nhuệ\", \"Xe Công Thành\", \"Máy Phóng Lửa\", \"Nguyên Lão\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangTroops[1] = [\"Lính Chùy\", \"Lính Giáo\", \"Lính Rìu\", \"Do Thám\", \"Hiệp Sĩ Paladin\", \"Kỵ Sĩ Teutonic\", \"Đội Công Thành\", \"Máy Bắn Đá\", \"Thủ Lĩnh\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangTroops[2] = [\"Lính Pha Lăng\", \"Kiếm Sĩ\", \"Do Thám\", \"Kỵ Binh Sấm Sét\", \"Tu Sĩ\", \"Kỵ Binh\", \"Máy Nện\", \"Máy Bắn Đá\", \"Tù Trưởng\", \"Dân Khai Hoang\", \"Tướng\"];\n\t\taLangAttackType = [\"Tiếp viện\", \"Tấn công\", \"Cướp bóc\"];\n\t\tbreak;\n\n\tcase \"ru\": // by MMX\n\t\taLangAllBuildWithId = [\"Лесопилка\", \"Глиняный карьер\", \"Железный рудник\", \"Ферма\", \"\", \"Лесопильный завод\", \"Кирпичный завод\", \"Чугунолитейный завод\", \"Мукомольная мельница\", \"Пекарня\", \"Склад\", \"Амбар\", \"Кузница оружия\", \"Кузница доспехов\", \"Арена\", \"Главное здание\", \"Пункт сбора\", \"Рынок\", \"Посольство\", \"Казарма\", \"Конюшня\", \"Мастерская\", \"Академия\", \"Тайник\", \"Ратуша\", \"Резиденция\", \"Дворец\", \"Сокровищница\", \"Торговая палата\", \"Большая казарма\", \"Большая конюшня\", \"Стена\", \"Земляной вал\", \"Изгородь\", \"Каменотес\", \"Пивная\", \"Капканщик\",\"Таверна\", \"Большой склад\", \"Большой амбар\", \"Чудо света\", \"Водопой\"];\n\t\taLangAllBuildAltWithId = [\"Лесопилка\", \"Глиняный карьер\", \"Железный рудник\", \"Ферма\", \"\", \"Лесопильный завод\", \"Кирпичный завод\", \"Чугунолитейный завод\", \"Мукомольная мельница\", \"Пекарня\", \"Склад\", \"Амбар\", \"Кузница оружия\", \"Кузница доспехов\", \"Арена\", \"Главное здание\", \"Пункт сбора\", \"Рынок\", \"Посольство\", \"Казарма\", \"Конюшня\", \"Мастерская\", \"Академия\", \"Тайник\", \"Ратуша\", \"Резиденция\", \"Дворец\", \"Сокровищница\", \"Торговая палата\", \"Большая казарма\", \"Большая конюшня\", \"Стена\", \"Земляной вал\", \"Изгородь\", \"Каменотес\", \"Пивная\", \"Капканщик\",\"Таверна\", \"Большой склад\", \"Большой амбар\", \"Чудо света\", \"Водопой\"];\n\t\taLangAddTaskText = [\"Добавить задание\", \"Тип задания\", \"Активная деревня\", \"Цель задания\", \" Цель\", \"Тип\", \"Поддержка строительства\", \"Концентрация ресурсов\", \"Вверх\", \"Вниз\", \"\", \"\", \"\",\"Снять все задания\"];\n\t\taLangTaskKind = [\"Улучшить:\", \"Строим:\", \"Атаковать:\", \"Исследовать:\", \" нанять:\", \"Отправить ресурсы:\", \"NPC:\", \"Разрушить:\", \"Торжество:\"];\n\t\taLangGameText = [\" \", \"Торговцы\", \"ID\", \"Столица\", \"Время запуска\", \"временно не работает\", \"в\", \"Деревня\", \"Транспортировка\", \"из\", \"Транспортировка в\", \"Транспортировка из\", \"Отправка из\", \"ресурсы\", \"здание\", \"Построить новое здание\", \"пусто\", \"уровень\"];\n\t\taLangRaceName = [\"Римляне\", \"Германцы\", \"Галлы\"];\n\t\taLangTaskOfText = [\"Запланировать улучшение\", \"Запланировать новое здание\", \"Качать ресурсы\", \"Выкл\", \"(►)\", \"Вкл\", \"(■)\", \"Распределение полей в деревне: \", \"Автоотправка\", \"Автоотправка выкл.\", \"Вкл.\", \"Успешно отправлено\", \"/Задания/\", \"Лимит ввоза\", \"Нет\", \"Правка \", \"Дерево/Глина/Железо\", \"Зерно\", \"Запланировать разрушение\",\n\t\t\t\"Запланировать атаку\", \"Тип атаки\", \"Време в пути\", \"повторы\", \"через\", \"00:30:00\", \"Цель катов\", \"Случайно\", \"Неизвестно\", \" раз\", \"/\", \" :дата/время: \", \"Войска\",\n\t\t\t\"Запланировать найм\",\"Выбранное здание \", \"Обучение войск завершено\",\"Поставки\", \"Задать интревал обновления\", \"Это интервал обновления страницы ,\\n по умолчанию - 20 минут, Введите новое время:\\n\\n\", \"Лимит вывоза\", \"Запланировать празднование\", \"Малый праздник\", \"Большой праздник\", \"Установка интервала концентрации ресов\",\n\t\t\t\"минуты\", \"Выключен\", \"Включено\", \"(►)\", \"(■)\",\"Запланировать улучшение\",\"Улучшить атаку\",\"Улучшить защиту\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Недостаточно сырья\", \"Все строители сейчас заняты\", \"Это здание отстроено полностью\", \"Начинаю строительство\", \"Процесс развития\", \"Недостаточна вместимость склада\", \"Недостаточна вместимость амбара\", \"Достаточно ресурсов\", \"Недостаток продовольствия: развивайте фермы.\",\"Проводится торжество\"];\n\t\taLangOtherText = [\"Важные заметки\", \"Только в столице поля могут быть до уровня 20.<br/>Столица не определена.Зайдите в профиль\", \"Ссылка тут ^_^\", \"<br/>Настройка завершена\", \"Отменено\", \"Начать задачи\", \" Улучшение прошло успешно\", \"Успешно\", \"Ваш народ неопределен.Пожалуйста зайдите в профиль.\", \"Также пожалуйста зайдите в таверну<br/>для определения типа и скорости героя\"];\n\t\taLangResources = [\"Древесина\",\"Глина\",\"Железо\",\"Зерно\"];\n\t\taLangTroops[0] = [\"Легионер\", \"Преторианец\", \"Империанец\", \"Конный разведчик\", \"Конница императора\", \"Конница Цезаря\", \"Таран\", \"Огненная катапульта\", \"Сенатор\", \"Поселенец\", \"Герой\"];\n\t\taLangTroops[1] = [\"Дубинщик\", \"Копьеносец\", \"Топорщик\", \"Скаут\", \"Паладин\", \"Тевтонская конница\", \"Стенобитное орудие\", \"Катапульта\", \"Вождь\", \"Поселенец\", \"Герой\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мечник\", \"Следопыт\", \"Тевтатский гром\", \"Друид-всадник\", \"Эдуйская конница\", \"Таран\", \"Требушет\", \"Предводитель\", \"Поселенец\", \"Герой\"];\n\t\taLangAttackType = [\"Подкрепление\", \"Нападение\", \"Набег\"];\n\t\tbreak; \n\n\tcase \"rs\": // by rsinisa\n\t\taLangAllBuildWithId = [\"Дрвосеча\", \"Рудник глине\", \"Рудник гвожђа\", \"Њива\", \"\", \"Пилана\", \"Циглана\", \"Ливница гвожђа\", \"Млин\", \"Пекара\", \"Складиште\", \"Силос\", \"Ковачница оружја\", \"Ковачница оклопа\", \"Витешка арена\", \"Главна зграда\", \"Место окупљања\", \"Пијаца\", \"Амбасада\", \"Касарна\", \"Штала\", \"Радионица\", \"Академија\", \"Склониште\", \"Општина\", \"Резиденција\", \"Палата\", \"Ризница\", \"Трговачки центар\", \"Велика касарна\", \"Велика штала\", \"Градски зид\", \"Земљани зид\", \"Палисада\", \"Каменорезац\", \"Пивница\", \"Постављач замки\",\"Дворац хероја\", \"Велико складиште\", \"Велики силос\", \"Светско чудо\", \"Појилиште\"];\n\t\taLangAllBuildAltWithId = [\"Дрвосеча\", \"Рудник глине\", \"Рудник гвожђа\", \"Њива\", \"\", \"Пилана\", \"Циглана\", \"Ливница гвожђа\", \"Млин\", \"Пекара\", \"Складиште\", \"Силос\", \"Ковачница оружја\", \"Ковачница оклопа\", \"Витешка арена\", \"Главна зграда\", \"Место окупљања\", \"Пијаца\", \"Амбасада\", \"Касарна\", \"Штала\", \"Радионица\", \"Академија\", \"Склониште\", \"Општина\", \"Резиденција\", \"Палата\", \"Ризница\", \"Трговачки центар\", \"Велика касарна\", \"Велика штала\", \"Градски зид\", \"Земљани зид\", \"Палисада\", \"Каменорезац\", \"Пивница\", \"Постављач замки\",\"Дворац хероја\", \"Велико складиште\", \"Велики силос\", \"Светско чудо\", \"Појилиште\"];\n\t\taLangAddTaskText = [\"Додај задатак\", \"Начин\", \"Активна села\", \"Задата мета\", \"на\", \"Мод\", \"Подршка изградње\", \"Концентрација ресурса\", \"Помери горе\", \"Помери доле\", \"Бриши\", \" Списак задатака\", \"Помери \", \"Обриши све задатке\"];\n\t\taLangTaskKind = [\"Надогради\", \"Нова градња\", \"Напад\", \"Истраживање\", \"Обучи\", \"Транспорт\", \"НПЦ\", \"Рушити\", \"Забава\"];\n\t\taLangGameText = [\"ниво \", \"Трговци\", \"ID\", \"Главни град\", \"Време почетка\", \"ово временско подешавање је бескорисно\", \" према\", \"Село\", \"транспорт\", \"из\", \"Пребацивање према\", \"Пребацивање из\", \"повратак из\", \"ресурси\", \"изградња\", \"Направи нову зграду\", \"празно\", \"ниво\"];\n\t\taLangRaceName = [\"Римљани\", \"Тевтонци\", \"Гали\"];\n\t\taLangTaskOfText = [\"Распоред за надоградњу\", \"Направи нови распоред\", \"Ауто надоградња ресурса\", \"Неактивно\", \"Покрени\", \"Активно\", \"Заустави\", \"Дистрибуција ресурсних поља овог села је \", \"Аутотранспорт\", \"Аутотранспорт није отворен\", \"Отворен\", \"Транспорт успешан\", \"Листа задатака\", \"Транспорт са лимитом\", \"Подразумевано\", \"Измени\", \"Дрво/Гллина/Гвожђе\", \"Њива\", \"Листа рушења\", \"Листа напада\", \"Врста напада\", \"Време превоза\", \"број понављања\", \"Временски интервал\",\"00:30:00\",\"Мета катапулта\",\"Насумично\", \"Непознат\", \" пута\", \". месец, \", \". дан, у \", \"Слање трупа\", \"Листа обуке\",\"Место обуке\",\"Тренинг задатак урадити\",\"прилагођен транспорт\",\"подеси време поновног учитавања \",\" ово је интервал поновног учитавања стране, \\n подразумевана вредност је 20 минута, молимо Вас убаците ново време:\\n \\n\",\"Остатак одлазног транспорта\",\"Листа забава\",\"мала забава\",\"велика забава\",\" Подесите интервал концентрације ресурса \", \"минути\", \"заустављено\", \"активно\", \"покрени\", \"паузирај\",\"Распоред унапређења\",\"Унапреди напад\",\"Унапреди одбрану\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Премало ресурса.\", \"Радници су већ на послу.\", \"Изградња завршена\", \"Покретање изградње\", \"У изградњи\", \"Складиште је премало. Проширите складиште како би наставили са изградњом\", \"Силос је премали. Проширите силос како би наставили са изградњом\", \"Довољно ресурса\",\"Премало жита: прошири прво њиве\",\"Прослава је већ у току\"];\n\t\taLangOtherText = [\"Важна напомена\", \"Само у главном граду ресурсна поља могу бити проширена на ниво 20. Твој главни град није детектован, погледај свој профил.\", \"Пречица овде ^_^\", \"Подешавања готова\", \"Отказано\", \"Покрени задатке\", \"Надоградња успешна\", \"Покретање успешно\", \"Ваше племе је непознато, стога и врста трупа. Погледајте свој профил да видите који сте народ.\",\"Такође посетите дворац хероја да сазнате брзину и тип свог хероја \"];\n\t\taLangResources=[\"дрво\",\"глина\",\"гвожђе\",\"жито\"];\n\t\taLangTroops[0] = [\"Легионар\", \"Преторијанац\", \"Империјанац\", \"Извиђач\", \"Императорова коњица\", \"Цезарева коњица\", \"Ован\", \"Ватрени катапулт\", \"Сенатор\", \"Насељеник\", \"Херој\"];\n\t\taLangTroops[1] = [\"Батинар\", \"Копљаник\", \"Секираш\", \"Извиђач\", \"Паладин\", \"Тевтонски витез\", \"Ован\", \"Катапулт\", \"Поглавица\", \"Насељеник\", \"Херој\"];\n\t\taLangTroops[2] = [\"Фаланга\", \"Мачевалац\", \"Извиђач\", \"Галски витез\", \"Друид\", \"Коњаник\", \"Ован\", \"Катапулт\", \"Старешина\", \"Насељеник\", \"Херој\"];\n\t\taLangAttackType = [\"Појачање\", \"Нормалан\", \"Пљачка\"];\n\t\tbreak;\n\n\tcase \"ba\": // thanks ieyp\n\t\taLangAllBuildWithId = [\"Drvosječa\", \"Rudnik gline\", \"Rudnik željeza\", \"Poljoprivredno imanje\", \"\", \"Pilana\", \"Ciglana\", \"Livnica\", \"Mlin\", \"Pekara\", \"Skladište\", \"Silos\", \"Oruzarnica\", \"Kovacnica oklopa\", \"Mejdan\", \"Glavna zgrada\", \"Mesto okupljanja\", \"Pijaca\", \"Ambasada\", \"Kasarna\", \"Stala\", \"Radionica\", \"Akademija\", \"Skloniste\", \"Opstina\", \"Rezidencija\", \"Palata\", \"Riznica\", \"Trgovacki centar\", \"Velika kasarna\", \"Velika stala\", \"Gradski zid\", \"Zemljani zid\", \"Taraba\", \"Kamenorezac\", \"Pivnica\", \"Zamkar\",\"Dvorac heroja\", \"Veliko skladiste\", \"Veliki silos\", \"WW\", \"Pojiliste\"];\n\t\taLangAllBuildAltWithId = [\"Drvosječa\", \"Rudnik gline\", \"Rudnik željeza\", \"Poljoprivredno imanje\", \"\", \"Pilana\", \"Ciglana\", \"Livnica\", \"Mlin\", \"Pekara\", \"Skladište\", \"Silos\", \"Oruzarnica\", \"Kovacnica oklopa\", \"Mejdan\", \"Glavna zgrada\", \"Mesto okupljanja\", \"Pijaca\", \"Ambasada\", \"Kasarna\", \"Stala\", \"Radionica\", \"Akademija\", \"Skloniste\", \"Opstina\", \"Rezidencija\", \"Palata\", \"Riznica\", \"Trgovacki centar\", \"Velika kasarna\", \"Velika stala\", \"Gradski zid\", \"Zemljani zid\", \"Taraba\", \"Kamenorezac\", \"Pivnica\", \"Zamkar\",\"Dvorac heroja\", \"Veliko skladiste\", \"Veliki silos\", \"WW\", \"Pojiliste\"];\n\t\taLangAddTaskText = [\"Dodaj zadatak\", \"Nacin\", \"Aktivna sela\", \"Zadata meta\", \"Prema\", \"Mod\", \"Podrska izgradnje\", \"Koncentracija resursa\", \"Pomeri gore\", \"Pomeri dole\", \"Del\", \"&#160;&#160;&#160;Task contents\", \"Pomeri \", \"Obrisi sve zadatke\"];\n\t\taLangTaskKind = [\"Unapredi\", \"Nova izgradnja\", \"Napad\", \"Istrazivanje\", \"Obuci\", \"Transport\", \"NPC\", \"Rusiti\", \"Zabava\"];\n\t\taLangGameText = [\"Lvl\", \"Trgovci\", \"ID\", \"Glavni grad\", \"Vreme pocetka\", \"ovo vremensko podesavanje je beskorisno\", \"prema\", \"Selo\", \"transport\", \"iz\", \"Prebacivanje prema\", \"Prebacivanje iz\", \"povratak iz\", \"resursi\", \"izgradnja\", \"Napravi novu zgradu\", \"prazno\", \"nivo\"];\n\t\taLangRaceName = [\"Rimljani\", \"Teutonci\", \"Gali\"];\n\t\taLangTaskOfText = [\"Raspored za nadogradnju\", \"Napravi novi raspored\", \"AutoResUpD\", \"Not_run\", \"Pokreni\", \"Pokrenuto\", \"Zaustavi\", \"Distribucija resursnih polja ovog sela je \", \"Autotransport\", \"Autotransport is not opened\", \"Opened\", \"Transport successfully\", \"Task List\", \"Transport sa limitom\", \"Podrazumevano\", \"Izmeni\", \"Drvo/Glina/Gvozdje\", \"Njiva\", \"Lista rusenja\",\n\t\t\t\"Lista napada\", \"Vrsta napada\", \"Vreme prevoza\", \"broj ponavljanja\", \"Vremenski interval\",\"00:30:00\",\"Meta katapulta\",\"Nasumicno\", \"Nepoznat\", \"times\", \"Mesec\", \"Dan\", \"Slanje trupa\", \"Lista obuke\",\"Mesto obuke\",\"TreningZadatak uraditi\",\"prilagodenTransport\",\"podesi vreme ponovnog ucitavanja \",\" ovo je interval ponovnog ucitavanja strane, \\n podrazumevan vrednost je 20 minuta, molimo vas ubacite novo vreme:\\n \\n\",\"Trans_Out_Rmn\",\"Lista zabava\",\"mala zabava\",\"velika zabava\",\" Podesite interval koncentracie resursa \",\n\t\t\t\"minuti\", \"zaustavljanje\", \"pokrece se\", \"pokreni\", \"pauza\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"Premalo resursa. Buahaha :D\", \"Radnici su vec na poslu :P\", \"Izgradnja zavrsena\", \"Pokretanje izgradnje\", \"U izgradnji\", \"Skladiste je premalo. Prosirite skladiste kako bi nastavili sa izgradnjom\", \"Silos je malecak. Prosirite silos kako bi nastavili sa izgradnjom\", \"Dovoljno resursa\",\"Premalo zita, prvo prosiri njive\",\"Proslava je u toku\"];\n\t\taLangOtherText = [\"Vazna napomena\", \"Samo u glavnom gradu mozete <br/> prosiriti resursna polja preko nivoa 10. Tvoj glavni grad <br/> nije otkriven, poseti svoj profil.\", \"Precica ovde ^^\", \"Podesavanja gotova\", \"Otkazano\", \"Pokreni zadatke\", \"Nadogradnja uspesna\", \"Pokretanje uspesno\", \"Vase pleme je nepoznato, stoga I tip trupa. Posetite <br/> svoj profil da vidite pleme. <br/>\",\"Posetite dvorac heroja da saznate <br/> brzinu I tip svog heroja \"];\n\t\taLangResources=[\"drvo\",\"glina\",\"gvozdje\",\"zito\"];\n\t\taLangTroops[0] = [\"Legionar\", \"Pretorijanac\", \"Imperijanac\", \"Izvidjac\", \"Imperatorova konjica\", \"Cezareva konjica\", \"Ovan\", \"Vatreni katapult\", \"Senator\", \"Naseljenik\", \"Heroj\"];\n\t\taLangTroops[1] = [\"Batinar\", \"Kopljanik\", \"Sekiras\", \"Izvidjac\", \"Paladin\", \"Tetutonski vitez\", \" Ovan \", \"Katapult\", \"Poglavica\", \"Naseljenik\", \"Heroj\"];\n\t\taLangTroops[2] = [\"Falanga\", \"Macevalac\", \"Izvidjac\", \"Teutateov grom\", \"Druid\", \"Heduan\", \" Ovan \", \"Katapult\", \"Staresina\", \"Naseljenik\", \"Heroj\"];\n\t\taLangAttackType = [\"Pojacanje\", \"Normalan\", \"Pljacka\"];\n\t\tbreak;\n\n\tcase \"org\":\n\tcase \"de\": // by LohoC et al.\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Rüstungsschmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Rüstungsschmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAddTaskText = [\"Aufgabe hinzufügen\",\"Style\",\"Aktives Dorf\",\"Aufgaben Ziel\",\"nach\",\"Modus\",\"Baubetreuung\",\"Ressourcenkonzentration\",\"Rauf\",\"Runter\",\"Entfernen\",\" Aufgaben Inhalte\",\"Bewegen \",\"alle Aufgaben Löschen\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\",\"Neues Gebäude\",\"Angriff\",\"Forschung\",\"ausbilden\",\"Transport\",\"NPC\",\"Zerstören\",\"Fest\"];\n\t\t\t\taLangGameText = [\"Lvl\",\"Händler\",\"ID\",\"Hauptdorf\",\"Startzeit\",\"diese Zeiteinstellung ist nicht sinnvoll.\",\"nach\",\"Dorf\",\"Transport\",\"von\",\"Transport nach\",\"Transport von\",\"Rückkehr aus\",\"Rohstoffe\",\"Gebäude\",\"Neues Gebäude errichten\",\"leer\",\"Stufe\"];\n\t\t\t\taLangRaceName = [\"Römer\",\"Germane\",\"Gallier\"];\n\t\t\t\taLangTaskOfText = [\"Zeitplan Upgrade\",\"Zeitplan Neu Bauen\",\"AutoResRauf\",\"Pausiert\",\"Start\",\"Laufend\",\"Unterbrechen\",\"Es wird Gebaut \",\"Autotransport\",\"Autotransport ist nicht An\",\"AN\",\"Transport Erfolgreich\",\"Aufgabenliste\",\"Transportlimit (-)\",\"Vorgabe\",\"Ändern \",\"Holz/Lehm/Eisen\",\"G3D\",\"Zeitplan Abriss\",\n\t\t\t\t\t\"Zeitplan Angriff\",\"Angriffsart\",\"Laufzeit\",\"Wiederholungen\",\"Intervalzeit\",\"00:30:00\",\"Katapultziel\",\"Zufall\",\"Unbekannt\",\"mal\",\"Monat\",\"Tag\",\"Truppen senden\",\"Zeitplan Ausbildung\",\"Ausbildungsseite\",\"Ausbildungsauftrag abgeschlossen\",\"Manueller Transport\",\"Setzte Intervalzeit für Reload\",\"Dies ist der Interval zum Seitenreload ,\\n Standard sind 20 Minuten, Bitte trage eine neue ein:\\n\\n\",\"Transportlimit (+)\",\"Partyplanung\",\"Kleine Party\",\"Große Party\",\"Setzte den Interval der Ressourcenkonzentration\",\n\t\t\t\t\t\"Minuten\",\".\",\".\",\"START\",\"STOP\",\"Zeitplan Verbessern\",\"Angriff verbessern\",\"Verteidigung verbessern\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Zu wenig Rohstoffe\",\"Es wird bereits gebaut\",\"vollständig ausgebaut\",\"Starte Konstruktion\",\"In Entwicklung\",\"Zuerst Rohstofflager ausbauen\",\"Zuerst Kornspeicher ausbauen\",\"Genug Rohstoffe\",\"Nahrungsmangel: Erst eine Getreidefarm ausbauen\",\"Es wird bereits gefeiert.\"];\n\t\t\t\taLangOtherText = [\"Wichtige Notiz\",\"Nur die Ressourcenfelder der Hauptstadt können<br/>bis Stufe 20 ausgebaut werden. Zur zeit ist deine Hauptstadt<br/>nicht identifiziert. Bitte besuche dein Profil.\",\"Shortcut here ^_^\",\"Setup fertiggestellt\",\"Abgebrochen\",\"Starte die Aufgaben\",\"Upgrade war erfolgreich\",\"Starten war erfolgreich\",\"Deine Rasse ist unbekannt.<br/>Bitte besuche dein Profil.<br/>\",\"Bitte besuche auch deinen Heldenhof um<br/>die Geschwindigkeit und die Art deines Helden zu bestimmen.\"];\n\t\t\t\taLangResources = [\"Holz\",\"Lehm\",\"Eisen\",\"Getreide\"];\n\t\t\t\taLangTroops[0] = [\"Legionär\",\"Prätorianer\",\"Imperianer\",\"Equites Legati\",\"Equites Imperatoris\",\"Equites Caesaris\",\"Rammbock\",\"Feuerkatapult\",\"Senator\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[1] = [\"Keulenschwinger\",\"Speerkämpfer\",\"Axtkämpfer\",\"Kundschafter\",\"Paladin\",\"Teutonen Reiter\",\"Ramme\",\"Katapult\",\"Stammesführer\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\",\"Schwertkämpfer\",\"Späher\",\"Theutates Blitz\",\"Druidenreiter\",\"Haeduaner\",\"Rammholz\",\"Kriegskatapult\",\"Häuptling\",\"Siedler\",\"Held\"];\n\t\t\t\taLangAttackType = [\"Unterstützung\",\"Angriff: Normal\",\"Angriff: Raubzug\"];\n\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Schmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Holzfäller\",\"Lehmgrube\",\"Eisenmine\",\"Getreidefarm\",\"\",\"Sägewerk\",\"Lehmbrennerei\",\"Eisengießerei\",\"Getreidemühle\",\"Bäckerei\",\"Rohstofflager\",\"Kornspeicher\",\"Waffenschmiede\",\"Schmiede\",\"Turnierplatz\",\"Hauptgebäude\",\"Versammlungsplatz\",\"Marktplatz\",\"Botschaft\",\"Kaserne\",\"Stall\",\"Werkstatt\",\"Akademie\",\"Versteck\",\"Rathaus\",\"Residenz\",\"Palast\",\"Schatzkammer\",\"Handelskontor\",\"Große Kaserne\",\"Großer Stall\",\"Stadtmauer\",\"Erdwall\",\"Palisade\",\"Steinmetz\",\"Brauerei\",\"Fallensteller\",\"Heldenhof\",\"Großes Rohstofflager\",\"Großer Kornspeicher\",\"Weltwunder\",\"Pferdetränke\"];\n\t\t\t\taLangAddTaskText = [\"Aufgabe hinzufügen\",\"Style\",\"Aktives Dorf\",\"Aufgaben Ziel\",\"nach\",\"Modus\",\"Baubetreuung\",\"Ressourcenkonzentration\",\"Rauf\",\"Runter\",\"Entfernen\",\" Aufgaben Inhalte\",\"Bewegen \",\"alle Aufgaben Löschen\"];\n\t\t\t\taLangTaskKind = [\"Upgrade\",\"Neues Gebäude\",\"Angriff\",\"Forschung\",\"ausbilden\",\"Transport\",\"NPC\",\"Zerstören\",\"Fest\"];\n\t\t\t\taLangGameText = [\"Lvl\",\"Händler\",\"ID\",\"Hauptdorf\",\"Startzeit\",\"diese Zeiteinstellung ist nicht sinnvoll.\",\"nach\",\"Dorf\",\"Transport\",\"von\",\"Transport nach\",\"Transport von\",\"Rückkehr aus\",\"Rohstoffe\",\"Gebäude\",\"Neues Gebäude errichten\",\"leer\",\"Stufe\"];\n\t\t\t\taLangRaceName = [\"Römer\",\"Germane\",\"Gallier\"];\n\t\t\t\taLangTaskOfText = [\"Zeitplan Upgrade\",\"Zeitplan Neu Bauen\",\"AutoResRauf\",\"Pausiert\",\"Start\",\"Laufend\",\"Unterbrechen\",\"Es wird Gebaut \",\"Autotransport\",\"Autotransport ist nicht An\",\"AN\",\"Transport Erfolgreich\",\"Aufgabenliste\",\"Transportlimit (-)\",\"Vorgabe\",\"Ändern \",\"Holz/Lehm/Eisen\",\"G3D\",\"Zeitplan Abriss\",\n\t\t\t\t\t\"Zeitplan Angriff\",\"Angriffsart\",\"Laufzeit\",\"Wiederholungen\",\"Intervalzeit\",\"00:30:00\",\"Katapultziel\",\"Zufall\",\"Unbekannt\",\"mal\",\"Monat\",\"Tag\",\"Truppen senden\",\"Zeitplan Ausbildung\",\"Ausbildungsseite\",\"Ausbildungsauftrag abgeschlossen\",\"Manueller Transport\",\"Setzte Intervalzeit für Reload\",\"Dies ist der Interval zum Seitenreload ,\\n Standard sind 20 Minuten, Bitte trage eine neue ein:\\n\\n\",\"Transportlimit (+)\",\"Partyplanung\",\"Kleine Party\",\"Große Party\",\"Setzte den Interval der Ressourcenkonzentration\",\n\t\t\t\t\t\"Minuten\",\".\",\".\",\"START\",\"STOP\",\"Zeitplan Verbessern\",\"Angriff verbessern\",\"Verteidigung verbessern\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Zu wenig Rohstoffe\",\"Es wird bereits gebaut\",\"vollständig ausgebaut\",\"Starte Konstruktion\",\"In Entwicklung\",\"Zuerst Rohstofflager ausbauen\",\"Zuerst Kornspeicher ausbauen\",\"Genug Rohstoffe\",\"Nahrungsmangel: Erst eine Getreidefarm ausbauen\",\"Es wird bereits gefeiert.\"];\n\t\t\t\taLangOtherText = [\"Wichtige Notiz\",\"Nur die Ressourcenfelder der Hauptstadt können<br/>bis Stufe 20 ausgebaut werden. Zur zeit ist deine Hauptstadt<br/>nicht identifiziert. Bitte besuche dein Profil.\",\"Shortcut here ^_^\",\"Setup fertiggestellt\",\"Abgebrochen\",\"Starte die Aufgaben\",\"Upgrade war erfolgreich\",\"Starten war erfolgreich\",\"Deine Rasse ist unbekannt.<br/>Bitte besuche dein Profil.<br/>\",\"Bitte besuche auch deinen Heldenhof um<br/>die Geschwindigkeit und die Art deines Helden zu bestimmen.\"];\n\t\t\t\taLangResources = [\"Holz\",\"Lehm\",\"Eisen\",\"Getreide\"];\n\t\t\t\taLangTroops[0] = [\"Legionär\",\"Prätorianer\",\"Imperianer\",\"Equites Legati\",\"Equites Imperatoris\",\"Equites Caesaris\",\"Rammbock\",\"Feuerkatapult\",\"Senator\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[1] = [\"Keulenschwinger\",\"Speerkämpfer\",\"Axtkämpfer\",\"Kundschafter\",\"Paladin\",\"Teutonen Reiter\",\"Ramme\",\"Katapult\",\"Stammesführer\",\"Siedler\",\"Held\"];\n\t\t\t\taLangTroops[2] = [\"Phalanx\",\"Schwertkämpfer\",\"Späher\",\"Theutates Blitz\",\"Druidenreiter\",\"Haeduaner\",\"Rammholz\",\"Kriegskatapult\",\"Häuptling\",\"Siedler\",\"Held\"];\n\t\t\t\taLangAttackType = [\"Unterstützung\",\"Angriff: Normal\",\"Angriff: Raubzug\"];\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrowLogicError ( \"initializeLangVars():: Travian Version not set, when initializing language variables for \\'de\\' or \\'org\\'!!\" );\n\t\t}\n\t\tbreak;\n\n\tcase \"ir\": // mrreza\n\t\taLangAllBuildWithId = [\"هیزم شکن\", \"آجرسازی\", \"معدن آهن\", \"گندم زار\", \"محل احداث ساختمان\", \"چوب بری\", \"آجرپزی\", \"ذوب آهن\", \"آسیاب\", \"نانوایی\", \"انبار\", \"انبار غذا\", \"آهنگری\", \"زره سازی\", \"میدان تمرین\", \"ساختمان اصلی\", \"اردوگاه\", \"بازار\", \"سفارت\", \"سربازخانه\", \"اصطبل\", \"کارگاه\", \"دارالفنون\", \"مخفیگاه\", \"تالار\", \"اقامتگاه\", \"قصر\", \"خزانه\", \"تجارتخانه\", \"سربازخانه‌ی بزرگ\", \"اصطبل بزرگ\", \"دیوار شهر\", \"دیوار گلی\", \"پرچین\", \"سنگ تراشی\", \"قهوه خانه\", \"تله ساز\",\"عمارت قهرمان\", \"انبار بزرگ\", \"انبارغذای بزگ\", \"شگفتی جهان\", \"آبشخور اسب\"];\n\t\taLangAllBuildAltWithId = [\"هیزم شکن\", \"آجر سازی\", \"معدن آهن\", \"گندم زار\", \"محل\", \"چوب بری\", \"آجرپزی\", \"ذوب آهن\", \"آسیاب\", \"نانوایی\", \"انبار\", \"انبارغذا\", \"آهنگری\", \"زره سازی\", \"میدان تمرین\", \"ساختمان اصلی\", \"اردوگاه\", \"بازار\", \"سفارت\", \"سربازخانه\", \"اصطبل\", \"کارگاه\", \"دارالفنون\", \"مخفیگاه\", \"تالار\", \"اقامتگاه\", \"قصر\", \"خزانه\", \"تجارتخانه\", \"سربازخانه‌ی بزرگ\", \"اصطبل بزرگ\", \"دیوار شهر\", \"دیوار گلی\", \"پرچین\", \"سنگ تراشی\", \"قهوه خانه\", \"تله ساز\",\"عمارت قهرمان\", \"انبار بزرگ\", \"انبار غذای بزرگ\", \" شگفتی جهان\", \"آبشخور اسب\"];\n\t\taLangAddTaskText = [\"اضافه کردن وظیفه\", \"شیوه\", \"دهکده فعال\", \"هدف کاری\", \"به سوی\", \"روش\", \"پشتیبانی از سازه ها\", \"ارسال معمولی (تمرکز منابع)\", \"بالا بردن\", \"پایین آوردن\", \"حذف\", \"&#160;&#160;&#160;محتوای وظیفه\", \"حرکت کردن\", \"پاک کردن تمام وظایف\"];\n\t\taLangTaskKind = [\"ارتقاء دادن\", \"بنای جدید\", \"حمله\", \"تحقیق\", \"تربیت کردن\", \"ارسال منابع\", \"تعدیل منابع\", \"تخریب کردن\", \"برگزاری جشن\"];\n\t\taLangGameText = [\"سطح\", \"بازرگانان\", \"شماره\", \"رئیس\", \"زمان شروع\", \"این تنظیم زمان در حال حاضر بی فایده است.\", \"به سوی\", \"دهکده\", \"انتقال دادن\", \"از\", \"ارسال به\", \"دریافت از\", \"بازگشت از\", \"منابع\", \"ساخنمان\", \"احداث ساختمان جدید\", \"خالی کردن\", \"سطح\" , \"منابع ارسال شدند.\"];\n\t\taLangRaceName = [\"رومی‌ها\" ,\"توتن‌ها\" ,\"گول‌ها\"];\n\t\taLangTaskOfText = [\"برنامه ارتقاء\", \"برنامه ساختمان جدید\", \"ارتقا خودکار منابع\", \"در حال اجرا نمی باشد\", \"شروع\", \"شروع شده\", \"معلق کردن\", \"جدول توزیع منابع در این روستا هست \", \"ارسال خودکار منابع\", \"حمل و نقل خودکار باز نمی باشد\", \"باز شده\", \"حمل و نقل با موفقیت\", \"لیست وظایف\", \"سقف ورود منابع\", \"پیشفرض\", \"اصلاح کردن\", \"چوب/خشت/آهن\", \"گندم\", \"برنامه تخریب\",\n\t\t\t\"برنامه حمله\", \"نوع حمله\", \"زمان سفر\", \"زمان تکرار\", \"فاصله زمانی\",\"00:30:00\",\"هدف منجنیق\",\"تصادفی\", \"نامعلوم\", \"زمان\", \"ماه\", \"روز\", \"سربازان فرستاده شدند\", \"برنامه آموزش\",\"محل آموزش\",\"وظیفه آموزش انجام شد\",\"ارسال سفارشی منابع\",\" فاصله زمانی از زمان راه اندازی مجدد\",\" این فاصله زمانی از صفحه بارگذاری شده است,\\n پیشفرض 20 دقیقه می باشد, لطفا مقدار جدید را وارد کنید زمان:\\n\\n\",\"سقف نگه داشتن منابع\",\"برنامه جشن\",\"جشن کوچک\",\"جشن بزرگ\",\" تنظیم فاصله زمانی حمل معمولی در قسمت ارسال خودکار\",\n\t\t\t\"دقیقه\", \"در حال مکث\", \"در حرکت\", \"ادامه دادن\", \"مکث\",\"ارتقا قدرت نظامی\",\"ارتقا قدرت حمله\",\"ارتقا قدرت دفاع\", \"کنترل سرریز منابع\", \"فعال\", \"غیر فعال\", \"ارتقا خودکار گندمزار\", \"تغییر\"];\n\t\taLangErrorText = [\"کمبود منابع.\", \"کارگران مشغول کار هستند.\", \"به سطح آخر ممکن رسید.\", \"ساخت و ساز شروع شد\", \"در حال توسعه\", \"اول انبار را ارتقا دهید.\", \"اول انبارغذا را ارتقا دهید.\", \"پیش نیازها:\",\"کمبود غذا: اول گندم زار را ارتقا دهید!\",\"در حال حاضر یک جشن در حال برگذاری است\",\"یک جشن هم‌اکنون در حال برگزاری است.\",\"در حال رسیدن به سطح نهایی خود می‌باشد.\"];\n\t\taLangOtherText = [\"توجه داشته باشید\", \"فقط منابع در دهکده پایتخت می توانند <br/>تا سطح 20 ارتقاء یابند. اکنون پایتخت شما<br/> تشخیص داده نشده است. لطفا از پروفایل خود دیدن کنید.\", \"دسترسی آسان در اینجا ^_^\", \"تنظیمات کامل شد\", \"لغو شد\", \"وظیفه آغاز شد\", \"با موفقیت انجام شد\" , \"حرکت با موفقیت انجام شد\", \"نژاد شما معلوم نیست, بنابراین نوع لشکرتون مشخص نیست. <br/>برای مشخص شدن نژادتون از پروفایل خود دیدن کنید.<br/>\", \"همچنین لطفا دیدن کنید از عمارت قهرمان برای مشخص شدن <br/> سطح و نوع آن.\" , \"ارتقاء\"];\n\t\taLangResources=[\"چوب\",\"خشت\",\"آهن\",\"گندم\"];\n\t\taLangTroops[0] = [\"سرباز لژیون\", \"محافظ\", \"شمشیرزن\", \"خبرچین\", \"شوالیه\", \"شوالیه سزار\", \"دژکوب\", \"منجنیق آتشین\", \"سناتور\", \"مهاجر\", \"قهرمان\"];\n\t\taLangTroops[1] = [\"گرزدار\", \"نیزه دار\", \"تبرزن\", \"جاسوس\", \"دلاور\", \"شوالیه‌ی توتن\", \"دژکوب\", \"منجنیق\", \"رئیس\", \"مهاجر\", \"قهرمان\"];\n\t\taLangTroops[2] = [\"سرباز پیاده\", \"شمشیرزن\", \"ردیاب\", \"رعد\", \"کاهن سواره\", \"شوالیه گول\", \"دژکوب\", \"منجنیق\", \"رئیس قبیله\", \"مهاجر\", \"قهرمان\"];\n\t\taLangAttackType = [\"پشتیبانی\", \"حمله عادی\", \"حمله غارت\"];\n\t\tbreak;\n\n\tcase \"ae\": // By Dream1, SnTraL (2011.02.24)\n\t\taLangAllBuildWithId = [\"الحطاب\", \"حفرة الطين\", \"منجم حديد\", \"حقل القمح\", \"\", \"معمل النجاره\", \"مصنع البلوك\", \"مصنع الحديد\", \"المطاحن\", \"المخابز\", \"المخزن\", \"مخزن الحبوب\", \"الحداد\", \"مستودع الدروع\", \"ساحة البطولة\", \"المبنى الرئيسي\", \"نقطة التجمع\", \"السوق\", \"السفارة\", \"الثكنه\", \"الإسطبل\", \"المصانع الحربية\", \"الأكاديمية الحربية\", \"المخبأ\", \"البلدية\", \"السكن\", \"القصر\", \"الخزنة\", \"المكتب التجاري\", \"الثكنة الكبيرة\", \"الإسطبل الكبير\", \"حائط المدينة\", \"الحائط الأرضي\", \"الحاجز\", \"الحجّار\", \"المعصرة\", \"الصياد\", \"قصر الأبطال\", \"المخزن الكبير\", \"مخزن الحبوب الكبير\", \"معجزة العالم\", \"بِئْر سقي الخيول\"];\n\t\taLangAllBuildAltWithId = [\"الحطاب\", \"حفرة الطين\", \"منجم حديد\", \"حقل القمح\", \"\", \"معمل النجاره\", \"مصنع البلوك\", \"مصنع الحديد\", \"المطاحن\", \"المخابز\", \"المخزن\", \"مخزن الحبوب\", \"الحداد\", \"مستودع الدروع\", \"ساحة البطولة\", \"المبنى الرئيسي\", \"نقطة التجمع\", \"السوق\", \"السفارة\", \"الثكنه\", \"الإسطبل\", \"المصانع الحربية\", \"الأكاديمية الحربية\", \"المخبأ\", \"البلدية\", \"السكن\", \"القصر\", \"الخزنة\", \"المكتب التجاري\", \"الثكنة الكبيرة\", \"الإسطبل الكبير\", \"حائط المدينة\", \"الحائط الأرضي\", \"الحاجز\", \"الحجّار\", \"المعصرة\", \"الصياد\", \"قصر الأبطال\", \"المخزن الكبير\", \"مخزن الحبوب الكبير\", \"معجزة العالم\", \"بِئْر سقي الخيول\"];\n\t\taLangAddTaskText = [\"أضافة مهمة\", \"النمط\", \"القرية النشطة\", \"المهمة المستهدفة\", \"الى\", \"نمط\", \"دعم للبناء\", \"تكثيف الموارد\", \"تحريك للاعلى\", \"تحريك للاسفل\", \"حذف\", \"&#160;&#160;&#160;محتوى المهمه\", \"تحريك \", \"حذف جميع المهام\"];\n\t\taLangTaskKind = [\"تطوير\", \"تشييد مبنى\", \"هجوم\", \"بحث\", \"تدريب\", \"نقل\", \"تاجر المبادله\", \"هدم\", \"الاحتفال\"];\n\t\taLangGameText = [\"مستوى\", \"التجار\", \"المعرف\", \"العاصمة\", \"بداية الوقت\", \"هذا الاعداد في الوقت الحالي عديم الفائدة.\", \" إلى\", \"القرية\", \"نقل\", \"من\", \"نقل الى\", \"نقل من\", \"العودة من\", \"الموارد\", \"المباني\", \"تشييد\", \"فارغ\", \"المستوى\"];\n\t\taLangRaceName = [\"الرومان\", \"الجرمان\", \"الإغريق\"];\n\t\taLangTaskOfText = [\"الجدول الزمني للترقية\", \"الجدول الزمني لبناء جديد\", \"التطوير التلقائي\", \"لايعمل\", \"بدأ\", \"أبتداء\", \"توقف مؤقتا\", \"الحقول / المباني توزيع لقرية \", \"النقل التلقائي\", \"لم يتم فتح النقل التلقائي\", \"فتح\", \"تم النقل بنجاح\", \"قائمة المهام\", \"Trans_In_limit\", \"أفتراضي\", \"تعديل\", \"خشب/طين/حديد\", \"قمح\", \"الجدول الزمني للهدم\",\n\t\t\t\"الجدول الزمني للهجوم\", \"نوع الهجوم\", \"وقت الذهاب\", \"عدد مرات التكرار\", \"الفاصل الزمني\",\"00:30:00\",\"هدف المقاليع\",\"عشوائي\", \"غير معروف\", \"مرات\", \"شهر\", \"يوم\", \"القوات ارسلت\", \"الجدول الزمني للتدريب\",\"مكان تدريب\",\"مهمة التدريب تمت\",\"الجدول الزمني للنقل\",\"إعداد الفاصل الزمني للتحديث\",\"هذا هو الفاصل الزمني لتحديث الصفحة ,\\n الافتراضي هو 20 دقيقة,يرجى وضع فاصل زمني جديد:\\n\\n\",\"Trans_Out_Rmn\",\"الجدول الزمني للإحتفال\",\"إحتفال صغير\",\"إحتفال كبير\",\"تعيين الفاصل الزمني لتركيز الموارد\",\n\t\t\t\"دقائق\", \"متوقف\", \"يعمل\", \"تشغيل\", \"أيقاف\",\"Schedule Improve\",\"Improve Attack\",\"Improve defence\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\taLangErrorText = [\"الموارد قليلة جداً.\", \"العمال مشغولون الآن.\", \"البناء منجز\", \"بدء البناء\", \"في التطوير\", \"يجب رفع مستوى المخزن أولاً \", \"يجب رفع مستوى مخزن الحبوب أولاً \", \"الموارد كافية\",\"\",\"يوجد احتفال جارية بالفعل\"];\n\t\taLangOtherText = [\"ملاحظات هامه\", \"فقط حقول الموارد في العاصمة <br/>يتم ترقيتهم الى مستوى 20 .<br/> لم يتم معرفة العاصمه. يرجاء زيارة بطاقة العضويه.\", \"الاختصار هنا ^_^\", \"أكتمال الإعدادات\", \"ألغي\", \"بدء المهام\", \"تم التطوير بنجاح\", \"تم التشغيل بنجاح\", \"القبيلة غير معروفه, لابد من معرفة نوع القوات. <br/>يرجاء زيارة بطاقة العضويه لتحديد نوع القبيله.<br/>\", \"يرجاء ايضاً زيارة قصر الابطال<br/> لتحديد سرعة ونوع بطلك.\"];\n\t\taLangResources=[\"الخشب\",\"الطين\",\"الحديد\",\"القمح\"];\n\t\taLangTroops[0] = [\"جندي أول\", \" حراس الإمبراطور\", \"جندي مهاجم\", \"فرقة تجسس\", \"سلاح الفرسان\", \"فرسان القيصر\", \"الكبش\", \"المقلاع الناري\", \"حكيم\", \"مستوطن\", \"البطل\"]; //الرومان\n\t\taLangTroops[1] = [\"مقاتل بهراوة\", \"مقاتل برمح\", \"مقاتل بفأس\", \"الكشاف\", \"مقاتل القيصر\", \"فرسان الجرمان\", \"محطمة الأبواب\", \"المقلاع\", \"الزعيم\", \"مستوطن\", \"البطل\"]; //الجرمان\n\t\taLangTroops[2] = [\"الكتيبة\", \"مبارز\", \"المستكشف\", \"رعد الجرمان\", \"فرسان السلت\", \"فرسان الهيدوانر\", \"محطمة الأبواب الخشبية\", \"المقلاع الحربي\", \"رئيس\", \"مستوطن\", \"البطل\"]; //الإغريق\n\t\taLangAttackType = [\"مساندة\", \"هجوم: كامل\", \"هجوم: للنهب\"];\n\t\tbreak;\n\n\tcase \"gr\": // by adonis_gr (2011.03.30)\n\t\tswitch ( aTravianVersion ) {\n\t\t\tcase \"3.6\": // translations for travian version 3.6\n\t\t\t\taLangAllBuildWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Οπλοποιείο\", \"Πανοπλοποιείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκεντρώσεως\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Οπλοποιείο\", \"Πανοπλοποιείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκέντρωσης\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAddTaskText = [\"Προσθηκη Εργασίας\", \"Style\", \"Ενεργό χωριό\", \"στοχος εργασίας\", \"Προς\", \"λειτουργία\", \"Construction support\", \"Resources concentration\", \"Μετακίνηση πάνω\", \"Μετακίνηση κάτω\", \"Διαγραφή\", \" Περιεχομενο εργασιών\", \"Move \", \"Διαγραφή όλων των εργασιών\"];\n\t\t\t\taLangTaskKind = [\"αναβάθμισης\", \"Κατασκευή κτηρίου\", \"Επίθεση\", \"Έρευνα\", \"εκπαίδευση\", \"αποστολή\", \"NPC\", \"κατεδάφιση\", \"γιορτή\"];\n\t\t\t\taLangGameText = [\"επίπεδο\", \"Έμποροι\", \"ID\", \"Πρωτεύουσα\", \"Start time\", \"this timeseting is unuseful now.\", \"προς\", \"χωριό\", \"αποστολή\", \"από\", \"αποστολή προς\", \"αποστολή απο\", \"Επιστροφή απο\", \"πρώτες ύλες\", \"κτήριο\", \"Κατασκευή νέου κτηρίου\", \"κενό\", \"επίπεδο\"];\n\t\t\t\taLangRaceName = [\"Ρωμαίοι\", \"Τεύτονες\", \"Γαλάτες\"];\n\t\t\t\taLangTaskOfText = [\"Πρόγραμμα αναβάθμισης\", \"Πρόγραμμα Κατασκευή νέου κτηρίου\", \"Αυτοματη Αναβ. Υλών\", \"Not_run\", \"Έναρξη\", \"Ξεκίνησε\", \"Αναστολή\", \"The resource fields distribution of this village is \", \"Αυτοματη αποστολή\", \"αύτοματη αποστολή είναι ανενεργή\", \"Ανοιχτό\", \"αποστολή επιτυχής\", \"Λίστα Εργασιών\", \"Trans In limit\", \"Προεπιλογή\", \"Τροποποίηση\", \"Ξύλο/Πηλός/Σιδήρος\", \"Σιτάρι\", \"Πρόγραμμα κατεδάφισης\",\n\t\t\t\t\t\t\"Προγραμματισμος επίθεσης\", \"Τυπος επίθεσης\", \"διάρκεια\", \"επανάληψεις\", \"Ενδιάμεσο χρονικό διάστημα\", \"00:30:00\", \"Στόχος καταπέλτη\", \"Τυχαίος\", \"Άγνωστο\", \"φορές\", \"Μήνας\", \"Ημέρα\", \"Στρατεύματα εστάλησαν\",\n\t\t\t\t\t\t\"Προγραμματησμος εκπαίδευσης\", \"Μέρος εκπαίδευσης\", \"εκπαίδευση Ολοκληρώθηκε\", \"προσαρμοσμένη αποστολή\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"Προγραμματισμος γιορτων\", \"Μικρή γιορτή\", \"Μεγάλη Γιορτή\", \"Set Interval of Resources concentration\",\n\t\t\t\t\t\t\"λεπτά\", \".\", \".\", \"Έναρξη\", \"Διακοπή\", \"Schedule Improve\", \"Βελτίωση Επίθεσης\", \"Βελτίωση άμυνας\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Πάρα πολύ λίγες πρώτες ύλες\", \"Ήδη εκτελούνται εργασίες\", \"Κατασκευή ολοκληρώθηκε\", \"Εναρξη Κατασκευής\", \"Σε εξέλιξη\", \"Η Αποθήκη πρώτων υλών σας ειναι πολύ μικρή. Παρακαλώ αναβάθμιστε την Αποθήκη πρώτων υλών για να συνεχιστεί η κατασκευή σας\", \"Η Σιταποθήκη σας ειναι πολύμικρή. Παρακαλώ αναβάθμιστε την σιταποθήκη για να συνεχιστεί η κατασκευή σας\", \"Αρκετες Πρώτες ύλες\", \"Έλλειψη τροφής: Αναβαθίστε πρώτα ενα Χωράφι σιταριού\", \"Πραγματοποιείται ήδη μία γιορτή\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Μονο οι ύλες της Πρωτεύουσας μπορούν να αναβάθμιστουν στο επίπεδο 20. Now your Πρωτεύουσα is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Ακυρωμένο\", \"Έναρξη των εργασιών\", \"Επιτυχής αναβάθμιση\", \"Εκτελέστηκε με επιτυχία\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Περιοχή ηρώων to determine the speed and the type of your hero.\"];\n\t\t\t\taLangResources = [\"Ξύλο\", \"Πηλός\", \"Σίδερο\", \"Σιτάρι\"];\n\t\t\t\taLangTroops[0] = [\"Λεγεωνάριοι\", \"Πραιτοριανός\", \"Ιμπεριανός\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Πολιορκητικός κριός\", \"Καταπέλτης φωτιάς\", \"Γερουσιαστής\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Μαχητές με ρόπαλα\", \"Μαχητής με Ακόντιο\", \"Μαχητής με Τσεκούρι\", \"Ανιχνευτής\", \"Παλατινός\", \"Τεύτονας ιππότης\", \"Πολιορκητικός κριός\", \"Καταπέλτης\", \"Φύλαρχος\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Φάλαγγες\", \"Μαχητής με Ξίφος\", \"Ανιχνευτής\", \"Αστραπή του Τουτατή\", \"Δρυίδης\", \"Ιδουανός\", \"Πολιορκητικός κριός\", \"Πολεμικός καταπέλτης\", \"Αρχηγός\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Ενίσχυση\", \"Επίθεση: Κανονική\", \"Επίθεση: Επιδρομή\"];\n\t\t\t\tbreak;\n\t\t\tcase \"4.0\": // translations for travian version 4.0\n\t\t\t\taLangAllBuildWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Σιδηρουργείο\", \"Σιδηρουργείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκεντρώσεως\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAllBuildAltWithId = [\"Ξυλοκόπος\", \"Ορυχείο πηλού\", \"Ορυχείο σιδήρου\", \"Χωράφι σιταριού\", \"Περιοχή\", \"Πριονιστήριο\", \"Πηλοποιείο\", \"Χυτήριο σιδήρου\", \"Μύλος σιταριού\", \"Αρτοποιείο\", \"Αποθήκη πρώτων υλών\", \"Σιταποθήκη\", \"Σιδηρουργείο\", \"Σιδηρουργείο\", \"Πλατεία αθλημάτων\", \"Κεντρικό κτίριο\", \"Πλατεία συγκέντρωσης\", \"Αγορά\", \"Πρεσβεία\", \"Στρατόπεδο\", \"Στάβλος\", \"Εργαστήριο\", \"Ακαδημία\", \"Κρυψώνα\", \"Δημαρχείο\", \"Μἐγαρο\", \"Παλάτι\", \"Θησαυροφυλάκιο\", \"Εμπορικό γραφείο\", \"Μεγάλο Στρατόπεδο\", \"Μεγάλος Στάβλος\", \"Τείχος Πόλεως\", \"Χωμάτινο τεἰχος\", \"Τείχος με πάσσαλους\", \"Λιθοδὀμος\", \"Ζυθοποιείο\", \"Τοποθέτης παγίδων\", \"Περιοχή ηρώων\", \"Μεγάλη Αποθήκη\", \"Μεγάλη Σιταποθήκη\", \"Παγκόσμιο Θαύμα\", \"Μέρος ποτίσματος αλόγων\"];\n\t\t\t\taLangAddTaskText = [\"Προσθηκη Εργασίας\", \"Style\", \"Ενεργό χωριό\", \"στοχος εργασίας\", \"Προς\", \"λειτουργία\", \"Construction support\", \"Resources concentration\", \"Μετακίνηση πάνω\", \"Μετακίνηση κάτω\", \"Διαγραφή\", \" Περιεχομενο εργασιών\", \"Move \", \"Διαγραφή όλων των εργασιών\"];\n\t\t\t\taLangTaskKind = [\"αναβάθμισης\", \"Κατασκευή κτηρίου\", \"Επίθεση\", \"Έρευνα\", \"εκπαίδευση\", \"αποστολή\", \"NPC\", \"κατεδάφιση\", \"γιορτή\"];\n\t\t\t\taLangGameText = [\"επίπεδο\", \"Έμποροι\", \"ID\", \"Πρωτεύουσα\", \"Start time\", \"this timeseting is unuseful now.\", \"προς\", \"χωριό\", \"αποστολή\", \"από\", \"αποστολή προς\", \"αποστολή απο\", \"Επιστροφή απο\", \"πρώτες ύλες\", \"κτήριο\", \"Κατασκευή νέου κτηρίου\", \"κενό\", \"επίπεδο\"];\n\t\t\t\taLangRaceName = [\"Ρωμαίοι\", \"Τεύτονες\", \"Γαλάτες\"];\n\t\t\t\taLangTaskOfText = [\"Πρόγραμμα αναβάθμισης\", \"Πρόγραμμα Κατασκευή νέου κτηρίου\", \"Αυτοματη Αναβ. Υλών\", \"Not_run\", \"Έναρξη\", \"Ξεκίνησε\", \"Αναστολή\", \"The resource fields distribution of this village is \", \"Αυτοματη αποστολή\", \"αύτοματη αποστολή είναι ανενεργή\", \"Ανοιχτό\", \"αποστολή επιτυχής\", \"Λίστα Εργασιών\", \"Trans In limit\", \"Προεπιλογή\", \"Τροποποίηση\", \"Ξύλο/Πηλός/Σιδήρος\", \"Σιτάρι\", \"Πρόγραμμα κατεδάφισης\",\n\t\t\t\t\t\t\"Προγραμματισμος επίθεσης\", \"Τυπος επίθεσης\", \"διάρκεια\", \"επανάληψεις\", \"Ενδιάμεσο χρονικό διάστημα\", \"00:30:00\", \"Στόχος καταπέλτη\", \"Τυχαίος\", \"Άγνωστο\", \"φορές\", \"Μήνας\", \"Ημέρα\", \"Στρατεύματα εστάλησαν\",\n\t\t\t\t\t\t\"Προγραμματησμος εκπαίδευσης\", \"Μέρος εκπαίδευσης\", \"εκπαίδευση Ολοκληρώθηκε\", \"προσαρμοσμένη αποστολή\", \"setup interval time of reload\", \"this is the interval of page reload ,\\n default is 20 minutes, please insert new time:\\n\\n\", \"Trans Out Rmn\", \"Προγραμματισμος γιορτων\", \"Μικρή γιορτή\", \"Μεγάλη Γιορτή\", \"Set Interval of Resources concentration\",\n\t\t\t\t\t\t\"λεπτά\", \".\", \".\", \"Έναρξη\", \"Διακοπή\", \"Schedule Improve\", \"Βελτίωση Επίθεσης\", \"Βελτίωση άμυνας\", \"ResOvrFlow Chk\", \"Enabled\", \"Disabled\", \"AutoRes Crop Upgrd\", \"Toggle\"];\n\t\t\t\taLangErrorText = [\"Πάρα πολύ λίγες πρώτες ύλες\", \"Ήδη εκτελούνται εργασίες\", \"Κατασκευή ολοκληρώθηκε\", \"Εναρξη Κατασκευής\", \"Σε εξέλιξη\", \"Η Αποθήκη πρώτων υλών σας ειναι πολύ μικρή. Παρακαλώ αναβάθμιστε την Αποθήκη πρώτων υλών για να συνεχιστεί η κατασκευή σας\", \"Η Σιταποθήκη σας ειναι πολύμικρή. Παρακαλώ αναβάθμιστε την σιταποθήκη για να συνεχιστεί η κατασκευή σας\", \"Αρκετές πρώτες\", \"Έλλειψη τροφής : Αναβαθμίστε πρώτα ένα χωράφι σιταριού\", \"Πραγματοποιείται ήδη μία γιορτή\"];\n\t\t\t\taLangOtherText = [\"Important note\", \"Μονο οι ύλες της Πρωτεύουσας μπορούν να αναβάθμιστουν στο επίπεδο 20. Now your Πρωτεύουσα is not detected. Visit your Profile please.\", \"Shortcut here ^_^\", \"Setup completed\", \"Ακυρωμένο\", \"Έναρξη των εργασιών\", \"Επιτυχής αναβάθμιση\", \"Εκτελέστηκε με επιτυχία\", \"Your race is unknown, therefore your troop type. Visit your Profile to determine your race.\", \"Please also visit your Περιοχή ηρώων to determine the speed and the type of your hero.\"];\n\t\t\t\taLangResources = [\"Ξύλο\", \"Πηλός\", \"Σίδερο\", \"Σιτάρι\"];\n\t\t\t\taLangTroops[0] = [\"Λεγεωνάριοι\", \"Πραιτοριανός\", \"Ιμπεριανός\", \"Equites Legati\", \"Equites Imperatoris\", \"Equites Caesaris\", \"Πολιορκητικός κριός\", \"Καταπέλτης φωτιάς\", \"Γερουσιαστής\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[1] = [\"Μαχητές με ρόπαλα\", \"Μαχητής με Ακόντιο\", \"Μαχητής με Τσεκούρι\", \"Ανιχνευτής\", \"Παλατινός\", \"Τεύτονας ιππότης\", \"Πολιορκητικός κριός\", \"Καταπέλτης\", \"Φύλαρχος\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangTroops[2] = [\"Φάλαγγες\", \"Μαχητής με Ξίφος\", \"Ανιχνευτής\", \"Αστραπή του Τουτατή\", \"Δρυίδης\", \"Ιδουανός\", \"Πολιορκητικός κριός\", \"Πολεμικός καταπέλτης\", \"Αρχηγός\", \"Άποικος\", \"Hero\"];\n\t\t\t\taLangAttackType = [\"Ενίσχυση\", \"Επίθεση: Κανονική\", \"Επίθεση: Επιδρομή\"];\n\t\t\t\tbreak;\n\t\t}\n}\n\nJOINEDaLangAllBuildWithId = aLangAllBuildWithId.slice(0) ;\nJOINEDaLangAllBuildWithId = cleanString(JOINEDaLangAllBuildWithId);\n\t\t\nJOINEDaLangAllBuildAltWithId = aLangAllBuildAltWithId.slice(0);\nJOINEDaLangAllBuildAltWithId = cleanString(JOINEDaLangAllBuildAltWithId);\ninitializeLangSpecificDependentVars();\n\n}", "function translate(lang, first) {\n if (lang && user && user.name) {\n //send preference to the server (async)\n let domain = domainName !== '' ? domainName : '';\n $.ajax({\n type: \"POST\",\n url: domain + '/user/update-lang',\n data: {\n lang: lang\n },\n success: (data) => {\n //console.log(\"Language successfully updated! \" + data);\n },\n error: e => {\n console.error('Error: ' + e.responseText);\n }\n });\n }\n if (typeof (Storage) !== \"undefined\" && lang) {\n localStorage.setItem(\"languagePref\", lang);\n }\n if (lang || (typeof (Storage) !== \"undefined\" && localStorage.getItem(\"languagePref\"))) {\n lang = localStorage.getItem(\"languagePref\");\n currentLang = lang;\n let domain = domainName !== '' ? domainName : '';\n $.ajax({\n type: \"GET\",\n url: domain + '/static/lang/' + lang + '.json',\n data: {},\n success: (data) => {\n $('[transl-id]').each(function () {\n let path;\n try {\n path = $(this).attr(\"transl-id\").split(/[\\.\\[\\]]/);\n let dictObj = data;\n for (i in path) {\n if (path[i])\n dictObj = dictObj[path[i]];\n }\n if (!dictObj) {\n throw \"Missing translation\";\n }\n $(this).html(dictObj);\n } catch (e) {\n console.warn(\"Missing translation! (\" + lang + ')', path);\n }\n });\n $('[transl-id-placeholder]').each(function () {\n let path;\n try {\n path = $(this).attr(\"transl-id-placeholder\").split(/[\\.\\[\\]]/);\n let dictObj = data;\n for (i in path) {\n if (path[i])\n dictObj = dictObj[path[i]];\n }\n if (!dictObj) {\n throw \"Missing translation\";\n }\n\n $(this).attr('placeholder', dictObj);\n\n // Deal with select2 elements\n if ($(this).is('select')) {\n if ($(this).hasClass('select2-hidden-accessible')) {\n $(this).select2('destroy');\n }\n $(this).select2({\n minimumResultsForSearch: 20,\n dropdownParent: $(this).next('.dropDownSelect2'),\n placeholder: $(this).attr('placeholder')\n });\n }\n } catch (e) {\n console.warn(\"Missing translation!! (\" + lang + ')', path);\n }\n });\n $('[transl-id-validate]').each(function () {\n let path;\n try {\n path = $(this).attr(\"transl-id-validate\").split(/[\\.\\[\\]]/);\n let dictObj = data;\n for (i in path) {\n if (path[i])\n dictObj = dictObj[path[i]];\n }\n if (!dictObj) {\n throw \"Missing translation\";\n }\n $(this).attr('data-validate', dictObj);\n } catch (e) {\n console.warn(\"Missing translation!! (\" + lang + ')', path);\n }\n });\n $('[transl-id-option]').each(function () {\n let optionType = $(this).attr('transl-id-option');\n switch (optionType) {\n case \"securityfeature\":\n //find correct feature\n for (i in mySecurityFeatures) {\n if ($(this).attr('value') === mySecurityFeatures[i]['@id']) {\n $(this).html(mySecurityFeatures[i]['label'][lang]);\n }\n }\n break;\n case \"generalfeature\":\n //find correct feature\n for (i in myGeneralFeatures) {\n if ($(this).attr('value') === myGeneralFeatures[i]['@id']) {\n $(this).html(myGeneralFeatures[i]['label'][lang]);\n }\n }\n break;\n case \"biketypes\":\n //find correct type\n for (i in myBikeTypes) {\n if ($(this).attr('value') === myBikeTypes[i]['@id']) {\n $(this).html(myBikeTypes[i]['label'][lang]);\n }\n }\n break;\n case \"parkingtypes\":\n //find correct type\n for (i in myParkingTypes) {\n if ($(this).attr('value') === myParkingTypes[i]['@id']) {\n $(this).html(myParkingTypes[i]['label'][lang]);\n }\n }\n break;\n default:\n console.warn('Translation: Unknown option type \"' + optionType + '\"');\n break;\n }\n });\n\n // Trigger change on data input language to adapt languages names\n $('#language-selection-container #dutch').trigger('change');\n\n handleResize();\n\n //fix select2\n let select2El = $('.js-select2');\n select2El.each(function () {\n $(this).select2('destroy');\n });\n select2El.each(function () {\n $(this).select2({\n minimumResultsForSearch: 20,\n dropdownParent: $(this).next('.dropDownSelect2'),\n placeholder: $(this).attr('placeholder')\n });\n });\n select2El.change();\n // Fix placeholder of alerted selects\n $('.alert-validate').each(function () {\n $(this).find('.select2-selection__arrow').hide();\n $(this).find('.select2-selection__placeholder').hide();\n });\n\n // Regions filter translation\n if ($('#filterByRegion').length > 0 && !first) {\n populateRegions().then(() => {\n insertParkingRegions();\n });\n }\n },\n error: e => {\n console.error('Error: ' + e.responseText);\n }\n });\n } else {\n //Set standard language to dutch\n translate('nl'); //TODO: replace all text in html files to the dutch versions, since dutch should be default. This is a temporary hack.\n }\n}", "function switchContent(e) {\n hideContent()\n toggleMenu()\n clearSelected()\n\n // Get selected language\n currentLang = this.id\n\n // Set flag image to currently selected\n lngBtn.classList.add(currentLang)\n\n // Set selected state on menu item\n this.classList.add('selected')\n\n // Set area to display\n const content = get(`#${currentLang}-content`)\n content && content.classList.add('show')\n\n // Remember language selection\n lastSelected = currentLang\n}", "function lang(local){\n localStorage.local = local;\n location.reload();\n return false;\n}", "function helloWorld()\r\n{\r\n var language = document.project2.lang.value;\r\n var language = language.toLowerCase();\r\n//create logic that outputs \"hello world\" different depending on language selected\r\n if (language == 'ru') //case of russia\r\n {\r\n return \"Privet Mir\";\r\n }\r\n else if (language == 'pt')\r\n {\r\n return \"Olá mundo!\";\r\n }\r\n else if(language == 'en')\r\n {\r\n return \"Hello world!\";\r\n }\r\n else if(language == 'fr')\r\n {\r\n return \"Bonjour le monde!\";\r\n }\r\n else if (language == 'es')\r\n {\r\n return \"Hola mundo\";\r\n }\r\n else\r\n {\r\n return \"HELLO MURICA.\";\r\n }\r\n\r\n\r\n}", "function set_language(lang) {\r\n\r\n if (_lang_code in _lang.strings)\r\n _lang_code = lang;\r\n\r\n }", "function changeLanguage(event) {\r\n sessionStorage.setItem('language', event.target.value);\r\n window.location.reload();\r\n}", "function changeLanguage(newLanguage){\n if (newLanguage == \"Malay\")\n language = \"ms\";\n else if (newLanguage == \"Chinese (Simplified)\")\n language = \"zh-CN\";\n else if (newLanguage == \"Thai\")\n language = \"th\"\n else\n language = \"en\"\n\n // save language for the user upon login\n localStorage.setItem(LANGUAGE_KEY, language);\n\n setAuthLanguage();\n\n recaptchaVerifier.reset()\n // window.location = window.location // refresh the page to reinitialize captcha\n}", "function onLanguageChange(lang){\n window.location.href=baseUrl+'/language/'+lang;\n}", "function switchLanguage() {\n currentLang = (currentLang === 'en') ? 'ja' : 'en';\n return currentLang;\n}", "function multilanguageMessage(\r\n myMessageSpanish,\r\n myMessageEnglish,\r\n timeToShowSeconds\r\n ) {\r\n /*!!!!SET TO ENGLISH BY DEFAULT!!!!!!!*/\r\n var myuserlanguage = \"English\"; //localStorage[\"poorbuk.myuserlanguage\"];\r\n //alert(myuserlanguage);\r\n if (!myuserlanguage) {\r\n myuserlanguage = \"Spanish\";\r\n }\r\n\r\n if (myuserlanguage == \"\") {\r\n myuserlanguage = \"Spanish\";\r\n }\r\n\r\n if (myuserlanguage == \"Spanish\") {\r\n var myMessage = myMessageSpanish;\r\n }\r\n if (myuserlanguage == \"English\") {\r\n var myMessage = myMessageEnglish;\r\n }\r\n //alert(myMessage);\r\n var divAllMessages = \"divAllMessages\";\r\n var myTimeout = timeToShowSeconds * 1000;\r\n messagesWriteNewMessage(myMessage, divAllMessages, myTimeout);\r\n }", "function changeLang(language)\n{\n if(language == \"eng\")\n {\n $(\"#english_terms_of_use\").css(\"display\",\"block\")\n $(\"#germany_terms_of_use\").css(\"display\",\"none\")\n $(\"#russian_terms_of_use\").css(\"display\",\"none\")\n }\n else if(language == \"ger\")\n {\n $(\"#english_terms_of_use\").css(\"display\",\"none\")\n $(\"#germany_terms_of_use\").css(\"display\",\"block\")\n $(\"#russian_terms_of_use\").css(\"display\",\"none\")\n }\n else \n {\n $(\"#english_terms_of_use\").css(\"display\",\"none\")\n $(\"#germany_terms_of_use\").css(\"display\",\"none\")\n $(\"#russian_terms_of_use\").css(\"display\",\"block\")\n }\n console.log(\"Language = \"+document.cookie.your_lang)\n $.ajax({\n type: \"GET\",\n\t\tcache: false,\n\t\turl: \"data/data.json\",\n\t\tdataType: \"json\",\n\t\terror: function (request, error) {\n\t\t\tconsole.log(arguments);\n\t\t\talert(\"Cannot get request from DATA: \" + error);\n\t\t},\n\t\tsuccess: function (data) {\n\t\t\tdocument.cookie = \"your_lang=\"+language\n\t\t\tconsole.log(\"Language = \"+document.cookie.your_lang)\n\t\t\tvar stringy = JSON.stringify(data)\n\t\t\tjson = JSON.parse(stringy)\n\t\t\tresetLang(json[language])\n\t\t}\n\t }); \n}", "langChange(evt) {\n const lang = evt.target.value;\n app.setLang(lang);\n window.location.reload(true);\n this.setState({ lang: lang });\n }", "function changeCurrentLanguage( newLanguage )\n{\n // set CKAN current language\n ckan_server.setCurrentLanguage(newLanguage);\n\n // set i18n o language\n i18nStrings.setBaseLanguage(newLanguage);\n i18nStrings.setCurrentLanguage(newLanguage);\n\n // clear map and details\n clearAllDatasets();\n\n // reload filters\n generateFilterCategories();\n \n}", "function FC_ChangeLanguage(strLanguage)\n{\n\tChangeLanguage(\"english\");\n\twriteCookie(\"CurrentLanguage\", \"english\", 30);\n}", "function toggleCurrentValue(lang)\n{\n var currents = document.querySelectorAll('.lang-toggle-current');\n currents.forEach((item, i) => {\n item.innerHTML = lang;\n });\n}", "function setAttribute(lang) {\n $(\"html\").attr(\"lang\", lang);\n}", "function translatePageToSpanish() {\n $(\"#title\").html(\"Bocaditos de inspiración\");\n $(\"#subtitle\").html(\"Llenáte con inspiración al día con este pequeño proyecto para practicar idiomas.\")\n $(\"#get-quote\").html(\"Decíme otra\");\n $(\"#translate-english\").show();\n $(\"#translate-spanish\").hide();\n $(\"#translate-french\").show();\n quoteArray = quoteArrayEs;\n twitterHashtags = twitterHashtagsEs;\n displayRandomQuote();\n}", "function changeLanguage(language) {\n var currentLanguage = document.getElementById(\"userLanguage\").value;\n if (language !== currentLanguage) {\n var userLanguage = {\"userLanguage\": language, \"typeOperation\": \"UPDATE\"};\n postServletJSON('/homeServlet', userLanguage);\n if (language === \"en_US\") {\n window.location.href = '/';\n } else {\n window.location.href = '/html/ru/index.html';\n }\n }\n}", "renderAboutUs(language) {\n switch(language) {\n case 'en':\n this.setState({aboutUs: 'About Us'});\n break;\n case 'is':\n this.setState({aboutUs: 'Um Okkur'});\n break;\n default:\n break;\n }\n }", "function checkLanguage() {\n\t\tvar code = localStorage.getItem(\"languageCode\");\n\t\tif (code == null) {\n\t\t\tcode = \"en\";\n\t\t}\n\t\t$(\".language-code\").val(code);\n\n\t\ttranslate(code);\n\t}", "function setLanguage() {\n services.tts.then(function(tts) {\n\tif (game.german) tts.setLanguage('German');\n\telse tts.setLanguage('English');\n });\n}", "function defineLanguage(request){\n\tswitch(window.location.href.split(\"/\")[2].split(\".\")[0]){\n\t\tcase \"br\":\n\t\t\trequest.language = 0;\n\t\t\tbreak;\n\t\tcase \"en\":\n\t\t\trequest.language = 1;\n\t\t\tbreak;\n\n\t\tdefault: break;\n\t}\n\trequest.act = defaultAct.setRequestData;\n\tsendRequest(request);\n}", "function loadLanguagesConfigContent(){\n\tloadContent(SERVICES.getLanguagesConfigData, {}, TEMPLATES.languagesConfig, $content, loadLanguagesConfigContentCallback);\n}", "setLanguage(language = 'en') {\n get(this, '_elevio').lang = language;\n }", "function translateContent(lang, dict) {\n $(\"[translate-key]\")\n .each(function () {\n $(this)\n .text(dict[lang][$(this)\n .attr(\"translate-key\")\n ]);\n });\n}", "renderAboutUsTitle(language) {\n switch(language) {\n case 'en':\n this.setState({aboutUsTitle: 'The story of STORMRIDER'});\n break;\n case 'is':\n this.setState({aboutUsTitle: 'Um Okkur STORMRIDER'});\n break;\n default:\n break;\n }\n }", "function FC_ChangeLanguage(strLanguage)\n{\n\t//alert(\"ChangeLanguage : \" + strLanguage);\n ChangeLanguage(strLanguage);\n\twriteCookie(\"CurrentLanguage\", strLanguage, 30);\n}", "async toggleLanguages() {\n let languageCode = await AsyncStorage.getItem('languageCode')\n\n if (languageCode === defaultLanguageCode) {\n languageCode = 'en'\n } else {\n languageCode = defaultLanguageCode\n }\n await this.switchTo(languageCode)\n }", "setLanguage(language) {\n\t\tlocalStorage.setItem(\"language\", language); //Write changes to localStorage\n\t\tthis.language = language; //Set the current language in memory\n\t\treturn this.loadContent(); //Reload the language list\n\t}", "function setLanguage() {\n var languageString=(getQueryVariable(\"setLng\"));\n if (languageString == '') {\n languageString = 'en';\n localStorage.setItem(\"fmlang\",languageString);\n }\n else {\n localStorage.setItem(\"fmlang\",languageString);\n }\n}", "@action(Action.INIT_LANGUAGE)\n @dispatches(Action.UI_LANGUAGE_READY)\n async initUiLanguage (store) {\n await $.getScript(`${basepath}/i18n/${this.getLanguage(store).code}.js`)\n\n t10.scan() // translate\n }", "onTranslation() {\n }", "renderAboutUsMessage(language) {\n switch(language) {\n case 'en':\n this.setState({aboutUsMessage: 'Message about STORMRIDER'});\n break;\n case 'is':\n this.setState({aboutUsMessage: 'Bulbulbul asfgwthyt STORMRIDER'});\n break;\n default:\n break;\n }\n }", "function updateLanguage() {\n var rootBlock = getRootBlock();\n if (!rootBlock) {\n return;\n }\n var blockType = rootBlock.getFieldValue('NAME').trim().toLowerCase();\n if (!blockType) {\n blockType = UNNAMED;\n }\n blockType = blockType.replace(/\\W/g, '_').replace(/^(\\d)/, '_\\\\1');\n switch (document.getElementById('format').value) {\n case 'JSON':\n var code = formatJson_(blockType, rootBlock);\n break;\n case 'JavaScript':\n var code = formatJavaScript_(blockType, rootBlock);\n break;\n }\n injectCode(code, 'languagePre');\n updatePreview();\n}", "function _ajaxSwitchLanguage ()\n // --------------------------------------------------------------------\n {\n Ext.Ajax.request\n (\n {\n url:\"proxy\",\n method:\"POST\",\n params:\n {\n type: \"lang\",\n lang:sLang\n },\n success: function ()\n {\n maskWC ();\n try\n {\n // Set the url for the main page and forward to it\n var sURL = \"main.jsp?sessionid=\"+WindowStorage.get(\"sessionID\") + (g_aSettings.debug === true ? \"&debug=true\" : \"\");\n\n document.location.href = sURL;\n }\n catch (aEx)\n {\n displayErrorMessage (aEx);\n unmaskWC ();\n }\n }\n }\n );\n }", "function setLanguage(storage){\n \n let lang;\n storage ? lang = storage: lang = findLocaleMatch();\n\n let langToChange = document.getElementsByClassName(\"langToChange\");\n for (i=0; i<langToChange.length; i++){\n\n langToChange[i].setAttribute(\"lang\", lang)\n \n langToChange[i].classList.add('lang-match');\n }\n\n let zones = document.querySelectorAll('html [lang]');\n applyStrings(zones,lang);\n}", "function applyLanguage() {\n\t\t//nav bar on top\n\t\t$('#menuLinkSitePrefs').html(p.translate('sitePreferences'));\n\t\t$('#menuLinkInfo').html(p.translate('contact'));\n\n\t\t//sidebar left\n\t\t$('#routeLabel').html(p.translate('routePlanner'));\n\t\t$('#searchLabel').html(p.translate('search'));\n\n\t\t//route options\n\t\t$('#routeOptions').html(p.translate('routeOptions') + ':' + '<br/>');\n\t\t$('#fastestLabel').html(p.translate('Fastest'));\n\t\t$('#shortestLabel').html(p.translate('Shortest'));\n\t\t$('#BicycleLabel').html(p.translate('Bicycle'));\n\t\t$('#BicycleSafetyLabel').html(p.translate('BicycleSafety'));\n\t\t$('#BicycleRouteLabel').html(p.translate('BicycleRoute'));\n\t\t$('#BicycleMtbLabel').html(p.translate('BicycleMTB'));\n\t\t$('#BicycleRacerLabel').html(p.translate('BicycleRacer'));\n\t\t$('#PedestrianLabel').html(p.translate('Pedestrian'));\n\t\t$('#avoidMotorLabel').html(p.translate('avoidMotorways'));\n\t\t$('#avoidTollLabel').html(p.translate('avoidTollways'));\n\t\t$('#avoidAreasTitle').html(p.translate('avoidAreas'));\n\n\t\t//routing\n\t\t$('#resetRoute').html(p.translate('resetRoute'));\n\t\t$('.searchWaypoint').attr('placeholder', p.translate('enterAddress'));\n\t\t$('#addWaypoint').html(p.translate('addWaypoint'));\n\t\t$('#routeSummaryHead').html(p.translate('routeSummary') + ':');\n\t\t$('#routeInstructionHead').html(p.translate('routeInstructions') + ':');\n\t\t$('#zoomToRouteButton').html(p.translate('zoomToRoute'));\n\n\t\t//route extras\n\t\t$('#routeExtrasHead').html(p.translate('routeExtras') + ':');\n\t\t//permalink\n\t\t$('#permalinkLabel').html(p.translate('routeLinkText'));\n\t\t$('#fnct_permalink').html(p.translate('permalinkButton'));\n\t\t//accessibility\n\t\t$('#accessibilityAnalysisLabel').html(p.translate('accessibilityAnalysis'));\n\t\t$('#accessibilityAnalysisMinutes').html(p.translate('setAccessibilityMinutes'));\n\t\t$('#analyzeAccessibility').html(p.translate('analyze'));\n\t\t$('#accessibilityCalculation').html(p.translate('calculatingAccessibility'));\n\t\t$('#accessibilityError').html(p.translate('accessibilityError'));\n\t\t//export/ import\n\t\t$('#imExportLabel').html('<b>' + p.translate('imExport') + '</b>');\n\t\t$('#exportInfoLabel').html(p.translate('gpxDownloadText'));\n\t\t$('#exportRouteGpx').html(p.translate('gpxDownloadButton'));\n\t\t$('#exportGpxError').html(p.translate('gpxDownloadError'));\n\t\t$('#importRouteInfoLabel').html(p.translate('gpxUploadRouteText'));\n\t\t$('#importTrackInfoLabel').html(p.translate('gpxUploadTrackText'));\n\t\t$('#importGpxError').html(p.translate('gpxUploadError'));\n\t\t$('.fileUploadNewLabel').html(p.translate('selectFile'));\n\t\t$('.fileUploadExistsLabel').html(p.translate('changeFile'));\n\n\t\t//geolocation\n\t\t$('#geolocationHead').html(p.translate('currentLocation'));\n\t\t$('#fnct_geolocation').html(p.translate('showCurrentLocation'));\n\n\t\t//search address\n\t\t$('#searchAddressHead').html(p.translate('searchForPoints'));\n\t\t$('#fnct_searchAddress').attr('placeholder', p.translate('enterAddress'));\n\n\t\t//search POI\n\t\t$('#searchPoiHead').html(p.translate('searchForPoi'));\n\t\t$('#searchPoiWithin1').html('&nbsp;' + p.translate('poiNearRoute1'));\n\t\t$('#searchPoiWithin2').html(p.translate('poiNearRoute2'));\n\t\t$('#fnct_searchPoi').attr('placeholder', p.translate('enterPoi'));\n\n\t\t//preference popup\n\t\t$('#sitePrefs').html(p.translate('sitePreferences'));\n\t\t$('#versionLabel').html(p.translate('version'));\n\t\t$('#versionText').html(p.translate('versionText'));\n\t\t$('#languageLabel').html(p.translate('language'));\n\t\t$('#languageText').html(p.translate('languageText'));\n\t\t$('#routingLanguageLabel').html(p.translate('routingLanguage'));\n\t\t$('#routingLanguageText').html(p.translate('routingLanguageText'));\n\t\t$('#distanceUnitLabel').html(p.translate('distance'));\n\t\t$('#distanceUnitText').html(p.translate('distanceText'));\n\t\t$('#preferencesClose').html(p.translate('closeBtn'));\n\t\t$('#savePrefsBtn').html(p.translate('saveBtn'));\n\n\t\t//context menu\n\t\t$('#contextStart').html(p.translate('useAsStartPoint'));\n\t\t$('#contextVia').html(p.translate('useAsViaPoint'));\n\t\t$('#contextEnd').html(p.translate('useAsEndPoint'));\n\t}", "function switchLanguage( language ) {\n langCode = language;\n $.qLabel.switchLanguage( language );\n console.log( 'Selected: ' + language + ' (' +\n\t\t\t\t $.uls.data.getDir(language) +\n\t\t\t ')' );\n $( '.row' ).css( 'direction', $.uls.data.getDir( language ) );\n if ( $.uls.data.getDir( language ) == 'rtl' ) {\n\t $( '.row' ).css( 'text-align', 'right' );\n }\n else {\n\t $( '.row' ).css( 'text-align', 'left' );\n }\n}", "function lang_propose() {\n // exit if this is not first visit\n if ($.cookie('DOBOVO_OLDUSER')) {\n return;\n }\n // set DOBOVO_OLDUSER cookie\n $.cookie('DOBOVO_OLDUSER', 1, {\n expires: 10, //days\n path: '/', \n });\n\n // current site lang\n var siteLang = $('#dbv_lang_selector').parent().find('.currency__text').text().toUpperCase();\n // user browser language \n var userLang = navigator.language || navigator.userLanguage;\n userLang = userLang.substr(0,2).toUpperCase(); // in case of en_GB or so\n // Exit if Lang is set correctly already\n if (siteLang == userLang) { \n return;\n }\n // get available langs\n var html;\n $('#dbv_lang_selector>li').each(function() {\n var lang_code = $('a', this).text();\n // Proceed to the next one if it's not what are we looking for\n if (lang_code != userLang) { \n return;\n }\n var text = $(this).attr('title');\n var lang_name = text.split(' ').pop(); // last word\n text = text.replace(/\\S+\\s*$/,''); // delete last word (it'll be a URL)\n html = text + '<a href=\"' + $('a', this).attr('href') + '\">' + lang_name + '</a>';\n });\n // if we have anything to propose\n if (html.length > 0) { \n $('body').prepend('<div id=dbv_lang_propose></div>');\n $('#dbv_lang_propose').html('<button onClick=\"$(this).parent().hide()\"></button>' + html).slideDown(1000);\n }\n}", "function changeAllRequests () {\n var selected_lang = $(this).text(),\n request_reference,\n visible_requests = $('.formatted-requests:visible');\n\n $('.active-lang').text(selected_lang);\n\n try {\n localStorage.setItem('lang_preference', selected_lang);\n }\n catch (err) {\n Raven.captureException(err);\n }\n\n getExamples(renderExamples);\n}", "function setScpLanguage () {\n\t//PDN 12/03/15 DO NOT test for LanguageP to skip function as breaks selected langauge\n\t//if (sessionScope.LanguageP == \"\" || sessionScope.LanguageP == null) {\n\t/* 11/04/2016 changes made - changes are marked with //11-04-2016 after code\n\t * made browserLocale all lower case\n\t * \n\t*/\n\t//println(\"=+=+=+=+=+=+=\");\n\t\tdBar.info(\"session.getServerName = \" + session.getServerName());\n\t\tvar languageDefault = \"eme-en\";\n\t\tvar languageSel = new String(\"initialze as String object then set to null string\");\n\t\tvar languageSel = \"\";\n\t\t\n\t\tif (cookie.containsKey(\"languagePref\")) {\n\t\t\tlanguageSel = cookie.get(\"languagePref\").getValue();\n\t\t\tdBar.info(\"languageSel = \" + languageSel);\n\t\t};\n\t\tvar browserLocale = context.getLocaleString().toLowerCase(); //11-04-2016\n\t\tdBar.info(\"***** context.getLocaleString() : \"+ browserLocale);\n\t\t//println(\"browserLocale: \"+browserLocale);\n\t\t\n\t\t//var languageLocal = new String(\"americas-en\");\n\t\tvar languageLocal = new String(\"eme-intl\");\n\t \n\t\tswitch (browserLocale) {\n\t\t\tcase \"en_us\": //11-04-2016\n\t\t\tcase \"en_ca\": //11-04-2016\n\t\t\tcase \"fr_ca\": //11-04-2016\n\t\t\tcase \"es_ca\": //11-04-2016\n\t\t\tcase \"es_bo\": //11-04-2016\n\t\t\tcase \"es_cl\": //11-04-2016\n\t\t\tcase \"es_co\": //11-04-2016\n\t\t\tcase \"es_cr\": //11-04-2016\n\t\t\tcase \"es_do\": //11-04-2016\n\t\t\tcase \"es_ec\": //11-04-2016\n\t\t\tcase \"es_sv\": //11-04-2016\n\t\t\tcase \"es_gt\": //11-04-2016\n\t\t\tcase \"es_hn\": //11-04-2016\n\t\t\tcase \"es_mx\": //11-04-2016\n\t\t\tcase \"es_ni\": //11-04-2016\n\t\t\tcase \"es_pa\": //11-04-2016\n\t\t\tcase \"es_py\": //11-04-2016\n\t\t\tcase \"es_pe\": //11-04-2016\n\t\t\tcase \"es_uy\": //11-04-2016\n\t\t\tcase \"es_ve\": //11-04-2016\n\t\t\t\tlanguageLocal = \"americas-en\"; \n\t\t\t\tbreak;\n\t\t\tcase \"de\":\n\t\t\tcase \"de_de\": //11-04-2016\n\t\t\tcase \"de_at\": //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-de\";\t\n\t\t\t\tbreak;\n\t\t\tcase \"en_gb\": //11-04-2016\n\t\t\tcase \"en_ie\": // English (Ireland) //11-04-2016\n\t\t\tcase \"ga_ie\": // Irish //11-04-2016\n\t\t\tcase \"ga\": // Irish\n\t\t\tcase \"gd\": // Scots Gaelic\n\t\t\t\tlanguageLocal = \"eme-en\";\n\t\t\t\tbreak;\n\t\t\tcase \"es\":\n\t\t\tcase \"ca_es\": // Catalan //11-04-2016\n\t\t\tcase \"es_es\": // Spain //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-es\";\t\n\t\t\t\tbreak;\n\t\t\tcase \"fi\":\n\t\t\tcase \"fi_fi\": // Finland //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-fi\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"fr\":\n\t\t\tcase \"fr_fr\": // France //11-04-2016\n\t\t\tcase \"fr_be\": // Belgium //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-fr\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"it\":\n\t\t\tcase \"it_it\": //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-it\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"nl\":\n\t\t\tcase \"nl_nl\": //11-04-2016\n\t\t\tcase \"nl_be\": //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-nl\";\t\n\t\t\t\tbreak;\n\t\t\tcase \"sv\":\n\t\t\tcase \"sv_se\": // Sweden //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-se\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"zh\":\n\t\t\tcase \"zh-hh\":\n\t\t\tcase \"zh-cn\":\n\t\t\tcase \"zh-sg\":\n\t\t\tcase \"zh-tw\":\n\t\t\tcase \"zh_hh\":\n\t\t\tcase \"zh_cn\":\n\t\t\tcase \"zh_sg\":\n\t\t\tcase \"zh_tw\":\n\t\t\tcase \"ko\":\n\t\t\tcase \"ko-kp\":\n\t\t\tcase \"ko-kr\":\n\t\t\tcase \"ko_kp\":\n\t\t\tcase \"ko_kr\":\n\t\t\tcase \"au\":\n\t\t\tcase \"en-au\":\n\t\t\tcase \"en_au\":\n\t\t\tcase \"ja\":\n\t\t\t\tlanguageLocal = \"eme-intl\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//dBar.info(\"case default\");\n\t\t\t\tlanguageLocal = \"eme-intl\";\t\n\t\t};\n\t\t\n\t\tdBar.info(\"languageLocal = \" + languageLocal);\n\t\t\t\n\t\tvar langURL = languageLocal.replace(\"-\",\"/\") + \"/\" ;\n\t\tdBar.info(\"langURL = \" + langURL);\n\t\n\t\tif (!!languageSel) {\n\t\t\t\tsessionScope.LanguageP = languageSel ;\n\t\t\t\tsessionScope.LanguageURL = languageSel.replace(\"-\",\"/\") + \"/\" ;\n\t\t\t\tsessionScope.isBrowserLocaleSupported = true ;\t\n\t\t\t} else if (languageLocal != \"eme-intl\"){\n\t\t\t\tsessionScope.LanguageP = languageLocal ;\n\t\t\t\tsessionScope.LanguageURL = langURL ;\n\t\t\t\tsessionScope.isBrowserLocaleSupported = true ;\t\n\t\t\t} else if (languageLocal == \"eme-intl\"){\n\t\t\t\tsessionScope.LanguageP = \"eme-en\";\n\t\t\t\tsessionScope.LanguageURL = \"eme/en/\" ;\t\n\t\t\t\tsessionScope.isBrowserLocaleSupported = false ;\t\n\t\t\t\treturn facesContext.getExternalContext().redirect(\"/international\");\n\t\t\t} else {\n\t\t\t\t// should never get here\n\t\t\t\tsessionScope.LanguageP = \"americas-en\";\n\t\t\t\tsessionScope.LanguageURL = \"americas/en/\" ;\t\t\t\n\t\t};\n\t\n\t\tdBar.info(\"sessionScope.LanguageP = \" + sessionScope.LanguageP);\n\t\tdBar.info(\"sessionScope.LanguageURL = \" + sessionScope.LanguageURL);\n\n\t\t//println(\"=+=+=+=+=+=+=\");\n\t//};\n\t//dBar.info(\"SKIPPED function, sessionScope.LanguageP = \" + sessionScope.LanguageP);\n\t//dBar.info(\"sessionScope.LanguageURL = \" + sessionScope.LanguageURL);\n}", "function changeLanguage(currentLang) {\n state.currentLang = currentLang;\n setTabToContent();\n\n // replace brackets with hidden span tags and store lang tags in state\n function replaceLanguageLabels() {\n const languageLabels = $('ul[class=\"objects\"]').find('label:contains(\" [\")');\n if (languageLabels.length) {\n // if state is undefined, set the language labels in state\n if (typeof state.languageLabels === 'undefined') {\n state.languageLabels = languageLabels;\n } else {\n for (let label in languageLabels) {\n state.languageLabels.push(languageLabels[label]);\n }\n }\n // replace brackets with hidden span tags\n languageLabels.each(function() {\n this.innerHTML = this.innerHTML.replace(\n '[',\n \" <span style='display:none;'>\",\n );\n this.innerHTML = this.innerHTML.replace(']', '</span>');\n });\n }\n }\n replaceLanguageLabels();\n\n // TODO: refactor into a function, evaluate performance\n let labelList = state.languageLabels;\n for (let label of labelList) {\n if (label.querySelector) {\n let languageTag = label.querySelector('span').innerText;\n // 'rah-static rah-static--height-auto c-sf-block__content' is the classList associated with\n // react-streamfields. If the element is not in the streamfield div, then we need to access\n // its grandparent and hide that. If it is in the streamfield div, we hide its parent.\n // if the classlist changes, or other fields are nested in different ways, there is the\n // potential for regressions\n if (\n label.parentElement.parentElement.parentElement.classList\n .value !== 'rah-static rah-static--height-auto c-sf-block__content'\n ) {\n const translatedElement = label.parentElement.parentElement;\n if (languageTag != null && languageTag != currentLang) {\n translatedElement.classList.add('hidden');\n } else {\n translatedElement.classList.remove('hidden');\n }\n /*\n While the first condition checks for 'struct-blocks' with language tags,\n it doesn't catch the case where there are 'struct-blocks' with language\n tags WITHIN the element itself. The following condition checks for those conditions.\n - This is not currently being used for streamfields, but could be used again\n if we decide to hide different fields */\n// if (translatedElement.classList.contains('struct-block')) {\n// const fieldlabels = translatedElement.querySelectorAll('[for]');\n// fieldlabels.forEach(fieldlabel => {\n// const attrFor = fieldlabel.getAttribute('for').split('_');\n// fieldlabel.parentNode.classList.remove('hidden');\n// // Adding a failsafe to make sure we don't remove non translated fields\n// const attrLang = attrFor[attrFor.length - 1];\n// if (['en', 'es', 'vi', 'ar'].includes(attrLang)) {\n// if (attrLang !== currentLang) {\n// fieldlabel.parentNode.classList.add('hidden');\n// translatedElement.classList.remove('hidden'); // only re-reveal the parent class if we find this case.\n// }\n// }\n// });\n// }\n } else {\n const translatedElement = label.parentElement;\n if (languageTag != null && languageTag != currentLang) {\n translatedElement.classList.add('hidden');\n } else {\n translatedElement.classList.remove('hidden');\n }\n }\n }\n }\n\n // ----\n // Switch the language for janisPreviewUrl in state\n // ----\n const janisPreviewUrl = getPreviewUrl(currentLang);\n state.janisPreviewUrl = janisPreviewUrl;\n\n const mobilePreviewSidebarButton = $('#mobile-preview-sidebar-button');\n const sharePreviewUrl = $('#share-preview-url');\n\n // Update link for \"Mobile Preview\" button on sidebar\n mobilePreviewSidebarButton.attr('href', janisPreviewUrl);\n sharePreviewUrl.text(janisPreviewUrl);\n\n // force reload of Mobile Preview iframe if its already open\n if (\n _.includes(\n mobilePreviewSidebarButton[0].classList,\n 'coa-sidebar-button--active',\n )\n ) {\n $('#mobile-preview-iframe').attr('src', janisPreviewUrl);\n }\n }", "changeLanguageStrings () {\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_modal_header_text\", this.labels.modal_header_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_ok_text\", this.labels.btn_ok_text);\n\t\tthis.emojiInformationModalMarkup = \tthis.emojiInformationModalMarkup.replace(\"REPLACE_btn_all_text\", this.labels.btn_all_text);\n\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesicon-label\", this.labels.modal_titlesicon_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesname_text\", this.labels.modal_titlesname_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlestotal_text\", this.labels.modal_titlestotal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlesglobal_text\", this.labels.modal_titlesglobal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titleslocal_text\", this.labels.modal_titleslocal_text);\n\t\tthis.emojiserverTitlesMarkup = \t\tthis.emojiserverTitlesMarkup.replace(\"REPLACE_modal_titlescopies_text\", this.labels.modal_titlescopies_text);\n\t}", "function resetText() {\n var $lang = $('html').attr('lang');\n $('.main-content .btn').each(function() {\n $(this).html($(this).data($lang));\n });\n}" ]
[ "0.767244", "0.7516967", "0.733786", "0.73239005", "0.73006535", "0.7261426", "0.7250456", "0.71893054", "0.7168067", "0.71115166", "0.7111437", "0.71046364", "0.7086491", "0.7075087", "0.7060249", "0.7055246", "0.7022591", "0.70057553", "0.69953865", "0.6995386", "0.69898695", "0.69664335", "0.69664335", "0.6959548", "0.69424874", "0.6905147", "0.6898148", "0.68893844", "0.6875243", "0.6875206", "0.68748283", "0.68685824", "0.684913", "0.6805647", "0.6749315", "0.6737313", "0.671171", "0.6704061", "0.6702985", "0.6699943", "0.66885287", "0.6662346", "0.6652855", "0.66349864", "0.663334", "0.6630292", "0.6600154", "0.6592222", "0.6586796", "0.6568794", "0.6566611", "0.6561952", "0.6547071", "0.6544155", "0.6543925", "0.6531891", "0.6529407", "0.6527171", "0.6512419", "0.6502964", "0.648031", "0.646511", "0.6463525", "0.6448327", "0.64342487", "0.6419886", "0.64174896", "0.64007354", "0.6399038", "0.6377218", "0.63693184", "0.63616616", "0.6357641", "0.6354477", "0.63373774", "0.633631", "0.63348585", "0.6334806", "0.6330177", "0.6322941", "0.6322385", "0.6316958", "0.63053524", "0.6300292", "0.62975144", "0.6297091", "0.6294498", "0.6280734", "0.6276217", "0.6273244", "0.6248922", "0.62352914", "0.6231346", "0.6230707", "0.62144727", "0.6209307", "0.62068635", "0.6199643", "0.61762136", "0.6144495" ]
0.68045586
34
Create popup for language choise button
function create_lang_pop() { $.each( lang_code, function( key, value ) { $('.lang_pop .selector ul').append('<li data-lang="'+key+'">'+value+'</li>'); $('[data-lang='+key+']').click(function(){ set_lang(key.toUpperCase()); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function languageSelect(l){\n var locale = l10n[l.getAttribute('data-locale')];\n document.getElementById('dropButton').innerHTML = l.innerHTML + \" ▾\"; // set the button text to the selected option\n document.getElementById('translatorCredit').innerHTML = locale.translator ? locale.translator : l10n['en'].translator;\n document.getElementById('standardDescription').innerHTML = locale.standard ? locale.standard : l10n['en'].standard;\n document.getElementById('uniqueDescription').innerHTML = locale.unique ? locale.unique : l10n['en'].unique;\n document.getElementById('curatorString').innerHTML = locale.curators ? locale.curators : l10n['en'].curators;\n}", "onLanguageClicked(){\r\n\r\n }", "function toggleButtonTooltipLanguage(){\n\n document.getElementById(\"english-button\").title = $.i18n(\"english_submenu_option_title_id\");\n document.getElementById(\"spanish-button\").title = $.i18n(\"spanish_submenu_option_title_id\");\n document.getElementById(\"clear-map-button\").title = $.i18n(\"clear_map_menu_option_title_id\");\n\n}", "function popUpLanguageChoice(){\r\n\td3.select('body')\r\n\t\t.append('div')\r\n\t\t.attr('class', 'big_overall')\r\n\t\t.selectAll('div')\r\n\t\t.data(['简体中文', 'English'])\r\n\t\t.enter()\r\n\t\t.append('div')\r\n\t\t.attr('class', 'language_choice')\r\n\t\t.text(function(d){\r\n\t\t\treturn d;\r\n\t\t}).on('click', function(){\r\n\t\t\ttxt = d3.select(this).text();\r\n\t\t\tif(txt == '简体中文'){\r\n\t\t\t\tlocalStorage.setItem('language', 'zh');\r\n\t\t\t\tlanguage = 'zh';\r\n\t\t\t\tload_data();\r\n\t\t\t} else{\r\n\t\t\t\tlocalStorage.setItem('language', 'en');\r\n\t\t\t\tlanguage = 'en';\r\n\t\t\t\tload_data();\r\n\t\t\t}\r\n\t\t\tstr_resource = string_box[language];\r\n\t\t\td3.select('.big_overall').remove();\r\n\t\t});\r\n}", "function LanguageClickEventHandler(lang) {\r\n SetLanguage(lang);\r\n}", "function languageSwitcher () {\r\n\tif ($(\"#polyglot-language-options\").length) {\r\n\t\t\t$('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({\r\n\t\t\t\teffect: 'fade',\r\n testMode: true,\r\n onChange: function(evt){\r\n alert(\"The selected language is: \"+evt.selectedItem);\r\n }\r\n// ,afterLoad: function(evt){\r\n// alert(\"The selected language has been loaded\");\r\n// },\r\n// beforeOpen: function(evt){\r\n// alert(\"before open\");\r\n// },\r\n// afterOpen: function(evt){\r\n// alert(\"after open\");\r\n// },\r\n// beforeClose: function(evt){\r\n// alert(\"before close\");\r\n// },\r\n// afterClose: function(evt){\r\n// alert(\"after close\");\r\n// }\r\n\t\t\t});\r\n\t};\r\n}", "function setLang() {\n\n // first update text fields based on selected mode\n var selId = $(\"#mode-select\").find(\":selected\").attr(\"id\");\n setText(\"text-timedomain\",\n \"Zeitbereich: \" + lang_de.text[selId],\n \"Time domain: \" + lang_en.text[selId]);\n setText(\"text-headline-left\",\n \"Federpendel: \" + lang_de.text[selId],\n \"Spring Pendulum: \" + lang_en.text[selId]);\n\n // then loop over all ids to replace the text\n for(var id in Spring.langObj.text) {\n $(\"#\"+id).text(Spring.langObj.text[id].toLocaleString());\n }\n // finally, set label of language button\n // $('#button-lang').text(Spring.langObj.otherLang);\n $('#button-lang').button(\"option\", \"label\", Spring.langObj.otherLang);\n }", "function makePopupSolicitud(){ \n\n}", "function buttonClicked(tab) {\n var lang = executed[tab.id];\n if (lang) {\n lang = (lang == \"jp\" ? \"en\" : \"jp\");\n executed[tab.id] = lang;\n setLanguage(lang);\n } else {\n executeScripts(tab.id);\n }\n}", "function selectLanguage(e){\n id = e.target.parentNode.id.replace(\"ddn\", \"btn\");\n if (document.getElementById(id).innerHTML===\"add language\"){\n var learn = id[3];\n add_ddn(learn)\n }; \n if (e.target.innerHTML===\"other...\"){\n document.getElementsByName(id.replace(\"btn\",\"other\" ))[0].style.display = \"inline\";\n }\n else{\n document.getElementsByName(id.replace(\"btn\",\"other\" ))[0].style.display = \"none\";\n }\n document.getElementById(id.replace(\"btn\",\"radios\" )).style.display = \"inline\";\n document.getElementById(id).innerHTML = e.target.innerHTML; \n document.getElementById(id).style.backgroundColor = \"rgb( 73,175, 55)\";\n}", "function chooseLanguage(wordID) {\n\t\tsendButton('What language would you like to learn the word in?',\n\t\t\t[{title: 'A. 🇦🇪', payload: 'AR' + wordID}, {title: 'B. 🇨🇳', payload: 'CN' + wordID},\n\t\t\t{title: 'C. 🇫🇷', payload: 'FR' + wordID}, {title: 'D. 🇮🇹', payload: 'IT' + wordID},\n\t\t\t{title: 'E. 🇯🇵', payload: 'JP' + wordID}, {title: 'F. 🇪🇸', payload: 'ES' + wordID}]\n\t\t\t);\n\t}", "function languageChange() {\n if (hamburgerOuterText_div.innerHTML == \" Menü \") {\n hamburgerOuterText_div.innerHTML = \" Menu \";\n hamburgerLanguageButton_div.innerHTML = \"Magyar\";\n hamburgerWelcomeButton_div.innerHTML = \"Welcome\";\n hamburgerProjectsButton_div.innerHTML = \"Projects\";\n hamburgerContactsButton_div.innerHTML = \"Contacts\";\n\n welcomeH1_div.innerHTML = \"Hey! I am John.\";\n welcomeH2_div.innerHTML = \" A web developer\";\n welcomeP1_div.innerHTML =\n \"I'm a junior developer ready to enter the major leagues. I try my best to create great user experience with performant and well designed apps and websites. And to keep up with the newest techniques and tools in development.\";\n welcomeP2_div.innerHTML =\n \"I am interested in all aspects of the creation of web applications, and eager to hit the ground running in an established team.\";\n welcomePopupOpenerText_button.innerHTML = \"Hire Me\";\n\n popupP1_div.innerHTML = \"Grab my CV here:\";\n popupCVDownloadButton_div.innerHTML = \"Download\";\n popupP2_div.innerHTML = \"You can find all my projects below:\";\n\n projectsH1_div.innerHTML = \"Projects\";\n projectsP1_div.innerHTML =\n \"I belive that in programming, to fully comprehend new knowledge it have to be used in practice. I wite code every day and allways have at least one work in progress project that exceeds my current abilities.\";\n projectsP2_div.innerHTML =\n \"I created several projects, from small algorithms to more comprehensive applications. Some of the completed applications can be found below.\";\n projectsH2_div.innerHTML = \"Recent projects:\";\n projectsFirstProjectText_div.innerHTML = \"Random quote\";\n projectsSecondProjectText_div.innerHTML = \"Task manager\";\n projectsThirdProjectText_div.innerHTML = \"Wizard duel\";\n\n contactsH1_div.innerHTML = \"Contacts\";\n contactsP1_div.innerHTML =\n \"Feel free to contact me on any of the channels found here or in my CV. You can find my Skype and email address below.\";\n contactsH2_div.innerHTML = \"Let's work together!\";\n } else {\n hamburgerOuterText_div.innerHTML = \" Menü \";\n hamburgerLanguageButton_div.innerHTML = \"English\";\n hamburgerWelcomeButton_div.innerHTML = \"Üdvözlet\";\n hamburgerProjectsButton_div.innerHTML = \"Projektek\";\n hamburgerContactsButton_div.innerHTML = \"Elérhetőségek\";\n\n welcomeH1_div.innerHTML = \"Üdvözlet! János vagyok.\";\n welcomeH2_div.innerHTML = \"Webfejlesztő\";\n welcomeP1_div.innerHTML =\n \"Korábbi munkáim során főként üzleti kapcsolattartással foglalkoztam. Azonban egyre inkább magával ragadott a programozás világa, ezért most front end webfejlesztőként keresek állást.\";\n welcomeP2_div.innerHTML =\n \"A webes technológiák terén minden érdekel, igyekszem lépést tartani az újdonságokkal. Célom a gyors, felhasználóbarát weboldalak és appok készítése. \";\n welcomePopupOpenerText_button.innerHTML = \"Keress bátran\";\n\n popupP1_div.innerHTML = \"Töltsd le az önéletrajzom:\";\n popupCVDownloadButton_div.innerHTML = \"Letöltés\";\n popupP2_div.innerHTML = \"Itt megtalálod a projekjteim:\";\n\n projectsH1_div.innerHTML = \"Projektjeim\";\n projectsP1_div.innerHTML =\n \"Bár még nem rendelkezem professzionális tapasztalatokkal, úgy gondolom, hogy a megszerzett tudás akkor válik igazán hasznossá, ha gyakorlatban is alkalmazható. Ezért mindíg szánok időt arra, hogy az új ismereteket egy-egy projekt keretében is kipróbáljam.\";\n projectsP2_div.innerHTML =\n \"Számos projektet készítettem, amelyek közül néhány alább elérhető.\";\n projectsH2_div.innerHTML = \"Friss projektjeim:\";\n projectsFirstProjectText_div.innerHTML = \"Idézet generátor\";\n projectsSecondProjectText_div.innerHTML = \"Feladat menedzser\";\n projectsThirdProjectText_div.innerHTML = \"Varázsló párbaj\";\n\n contactsH1_div.innerHTML = \"Elérhetőségeim\";\n contactsP1_div.innerHTML =\n \"Elérhető vagyok az önéletrajzomban megadott elérhetőségek mindegyikén. De itt megtalálod a Skype profilom és az email címem is.\";\n contactsH2_div.innerHTML = \"Dolgozzunk együtt!\";\n }\n}", "onClickLanguages() {\n if(!User.current.isAdmin) { return; }\n\n let languageEditor = new LanguageEditor({ projectId: this.model.id });\n \n languageEditor.on('change', (newLanguages) => {\n this.model.settings.language.selected = newLanguages;\n\n this.fetch();\n });\n }", "function languageButton(lang) {\n if (lang == 1) {\n language = 1;\n sessionStorage.setItem(\"language\", \"fr\");\n changeLanguage();\n } else {\n location.href = location.href;\n sessionStorage.setItem(\"language\", \"eng\");\n }\n}", "changeLanguage (language) {\n COMPONENT.innerHTML = DATA.lang[language];\n }", "function enhanceLanguageSelector() {\n var $dialog = $(\"[data-component='language-selector-dialog']\");\n dit.components.languageSelector.enhanceDialog($dialog, {\n $controlContainer: $(\"#international-header-bar .container\")\n });\n\n languageSelectorViewInhibitor(false);\n }", "renderSubmit(language) {\n return language==='english'? 'Submit':'Envie';\n }", "function translateButtonClicked(element) {\n var languages = document.getElementById(\"LanguageSelection\");\n var languageCode = languages.options[languages.selectedIndex].value;\n var id = element.target.parentElement.parentElement.id;\n var description = document.getElementById(id).getElementsByTagName(\"td\")[2].innerHTML;\n translateAPI = new TextTranslator(token_config['Yandex']);\n if (languageCode === \"\") {\n window.alert(\"First select language to translate.\");\n element.stopPropagation();\n } else {\n translateAPI.translateText(description, languageCode, id, translatedText);\n element.stopPropagation();\n }\n return;\n}", "function onOpen() {\n FormApp.getUi()\n .createMenu('TSTranslateKhmer')\n .addItem('Create Form', 'createForm')\n .addItem('Enable Submit Trigger', 'enableSubmitTrigger')\n .addSubMenu(FormApp.getUi().createMenu('Utilities')\n .addItem('Translate Form Text to Khmer', 'translateToKhmer')\n .addItem('Translate Form Text to English', 'translateToEnglish'))\n .addSeparator()\n .addItem('About', 'about')\n .addToUi();\n}", "function setlanguage(){\r\n\tif (getRequestParam(\"lang\") == \"de\") {\r\n\t\tshowGer()\r\n\t}\r\n\telse {\r\n\t\tshowEn()\r\n\t}\r\n}", "function spanishLanguageClickFunction(){\n switchLanguage(\"es\");\n document.getElementById(\"spanish-button\").src = \"img/side-bar-icon/spanish_language_enabled_icon.png\";\n document.getElementById(\"english-button\").src = \"img/side-bar-icon/english_language_icon.png\";\n document.getElementById(\"dancing-rivers-logo-overlay\").src = \"img/Piura/logos/dancing_rivers_spanish.png\";\n toggleButtonTooltipLanguage();\n}", "function ls_buildWidget(language) {\n // set up the floating form\n var form = document.createElement('form');\n form.className = 'lang_info';\n form.onsubmit = function() {\n if (this.elements[2].ls_mul_flag) {\n this.elements[2].ls_mul_flag = false;\n var language = 'mul';\n var temporary = true;\n } else {\n ls_setCookieLanguage(this.elements[0].value);\n var language = this.elements[0].value;\n var temporary = false;\n }\n ls_applyLanguageSelect(language, temporary);\n return false; // don't perform action\n };\n form.appendSpace = function() {\n this.appendChild(document.createTextNode(' '));\n };\n \n // link to language select description page\n var link = document.createElement('a');\n link.href = ls_help_url;\n link.className = 'ls_link';\n link.appendChild(document.createTextNode(ls_string_help));\n form.appendChild(link);\n form.appendSpace();\n \n // input box for the language\n var input = document.createElement('input');\n input.setAttribute('type', 'text');\n input.setAttribute('size', '2');\n input.setAttribute('maxlength', '3');\n input.onclick = function() { this.select(); };\n input.className = 'ls_input';\n input.value = language;\n form.appendChild(input);\n form.appendSpace();\n \n // save button\n var submit = document.createElement('input');\n submit.setAttribute('type', 'submit');\n submit.value = ls_string_select;\n submit.className = 'ls_select';\n form.appendChild(submit);\n form.appendSpace();\n \n // show all button \n // equivalent to setting input box to \"mul\" and pressing save\n var showall = document.createElement('input');\n showall.setAttribute('type', 'submit');\n showall.value = ls_string_showall;\n showall.onclick = function() {\n this.ls_mul_flag = true;\n };\n form.appendChild(showall);\n \n return form; \n}", "function engliishLanguageClickFunction(){\n switchLanguage(\"en\");\n document.getElementById(\"english-button\").src = \"img/side-bar-icon/english_language_enabled_icon.png\";\n document.getElementById(\"spanish-button\").src = \"img/side-bar-icon/spanish_language_icon.png\";\n document.getElementById(\"dancing-rivers-logo-overlay\").src = \"img/Piura/logos/dancing_rivers_english.png\";\n toggleButtonTooltipLanguage();\n}", "renderSubmit(language) {\n return language === \"english\" ? \"Submit\" : \"Voorleggen\";\n }", "renderSubmit(language) {\n return language === 'english' ? 'Submit' : 'Voorleggen';\n }", "function createLanguageSwitcher(lang) {\n return new Ext.form.FormPanel({\n renderTo: 'lang-form',\n width: 95,\n border: false,\n layout: 'hbox',\n hidden: GeoNetwork.Util.locales.length === 1 ? true : false,\n items: [new Ext.form.ComboBox({\n mode: 'local',\n triggerAction: 'all',\n width: 95,\n store: new Ext.data.ArrayStore({\n idIndex: 2,\n fields: ['id', 'name', 'id2'],\n data: GeoNetwork.Util.locales\n }),\n valueField: 'id2',\n displayField: 'name',\n value: lang,\n listeners: {\n select: function (cb, record, idx) {\n window.location.replace('?hl=' + cb.getValue());\n }\n }\n })]\n });\n }", "renderSubmit(language){\n return language === 'english' ? 'Submit' : 'Voorleggen';\n }", "function setLanguage(lang) {\n var inner = \"data-\" + lang;\n var title = \"data-\" + (lang == \"jp\" ? \"en\" : \"jp\");\n chrome.tabs.executeScript(null,\n {code:\"$(\\\".wanikanified\\\").each(function(index, value) { value.innerHTML = value.getAttribute('\" + inner + \"'); value.title = value.getAttribute('\" + title + \"'); })\"});\n}", "changeTextOnDOM(){\n var keys = Object.keys(this.idsToLangKey)\n keys.forEach((value)=>{\n document.getElementById(value).innerHTML = this.localeModel.getCurrentLanguage(this.idsToLangKey[value])\n })\n }", "function onchange() {\n\n updateLanguage();\n\n}", "function changeLanguage() {\r\n $('[data-lang]').each(function(index, el) {\r\n var $textLang = $(el).data('lang');\r\n $(el).text( lang [ localStorage.getItem('pageLang') || 'pl' ][ $textLang ] );\r\n });\r\n\r\n var activeButton = localStorage.getItem('pageLang');\r\n $('.btn-change-lang').removeClass('active');\r\n if(activeButton) {\r\n $('.btn-change-lang[data-language=' + activeButton + ']').addClass('active');\r\n } else {\r\n $('.btn-change-lang[data-language=pl]').addClass('active');\r\n }\r\n }", "function setLocalizedLabel() {\n var getI18nMsg = chrome.i18n.getMessage;\n\n $('save_button').innerText = 'save'; //getI18nMsg('save');\n// $('delete_button').value = 'delete'; //getI18nMsg('deleteTitle');\n deleteLabel = 'delete';\n $('submit_button').value = 'add'; //getI18nMsg('submitButton');\n}", "renderSubmit(language) {\n return language === 'english' ? 'Submit' : 'Voorleggen'\n }", "function changeLanguage(evt, language) {\n\tdocument.body.className = language;\n\t\n\tlangBtns = document.getElementsByClassName(\"langBtn\");\n\tfor (i = 0; i < langBtns.length; i++) {\n\t\tlangBtns[i].className = langBtns[i].className.replace(\" active\", \"\");\n\t}\n\n\tevt.currentTarget.className += \" active\";\n\n}", "renderSubmit(language) {\n return language === 'english' ? 'Submit' : 'Voorleggen';\n }", "function createPopUp() {\n\n}", "function showMoreButtonClicked() {\r\n var languageElemsList = document.evaluate('/html/body/div[4]/div[2]/div[@id=\"p-lang\"]/div/ul', document.body, null, XPathResult.ANY_TYPE, null).iterateNext()\r\n var languageElems = languageElemsList.getElementsByTagName('li');\r\n for (var i = 0; i < languageElems.length; ++i) {\r\n var lang = languageElems[i].children[0].getAttribute('lang')\r\n if (isPreferredLanguage(lang)) {\r\n // do nothing for languages that are already shown\r\n } else {\r\n // show again the ones that were hidden\r\n languageElems[i].style.display = 'inherit'\r\n }\r\n }\r\n // finally hide the 'more'-button\r\n buttonElement.style.display = 'none'\r\n}", "renderSubmit(language) {\n if (language === 'english') {\n return 'Submit'\n } else if (language === 'italian') {\n return 'Inviare'\n } else if (language === 'dutch') {\n return 'Voorleggen'\n }\n }", "createLanguageButton(language, textColor, onLanguageChange, className=\"\"){\n return (<React.Fragment>\n <React.Fragment>{(language === \"french\") && <span className=\"nav-item nav-link btn navText\" onClick={() => onLanguageChange(\"english\")}><span className={className} style={{\"color\":textColor}}>English</span></span>}</React.Fragment>\n <React.Fragment>{(language === \"english\") && <span className=\"nav-item nav-link btn navText\" onClick={() => onLanguageChange(\"french\")}><span className={className} style={{\"color\":textColor}}>Français </span></span>}</React.Fragment>\n </React.Fragment>)\n\n }", "function changeLanguage() {\n \tvar e = document.getElementById(\"lang_select\");\n \tvar lang = e.options[e.selectedIndex].value;\n \tvar prevBox = document.getElementById('preview_div');\n\n\t// Choosing between rtl and ltr languages.\n\tif (lang == 'ar' || lang == 'he') {\n\t\tprevBox.setAttribute('dir', 'rtl');\n\t} else {\n\t\tprevBox.setAttribute('dir', 'ltr');\n\t}\n\n\t// We need to reset the WYSIWYG editor to change the language.\n\t// resetEditor(lang, getWirisEditorParameters());\n\twindow.location.search = 'language=' + lang;\n}", "function country(selectedCountry) {\n // Select the country dropdown button and set text equal to selection\n country_button.text(selectedCountry)\n}", "function configButton() {\n background.console.log('executing configButton');\n document.getElementById('buttonSearch').addEventListener('click', submitSearch);\n document.getElementById('buttonSearch').innerHTML=chrome.i18n.getMessage(\"popup_button_text\");\n}", "function showNewToOrsPopup() {\n\t\t\tvar label = new Element('label');\n\t\t\tlabel.insert(preferences.translate('infoTextVersions'));\n\t\t\t$('#newToOrs').append(label);\n\t\t\t$('#newToOrs').show();\n\t\t}", "toggleLanguage(){\n\t\tconst langs = this.app.getService(\"locale\"); //dapatkan layanan lokal\n\t\t/*\n\t\tGunakan this.getRoot() untuk membuka widget Webix teratas di dalam JetView\n\t\tIni dia Toolbar\n\t\t*/\n\t\tconst value = this.getRoot().queryView(\"segmented\").getValue(); //dapatkan nilai tersegmentasi\n\t\tlangs.setLang(value); //atur nilai Lokal\n\t}", "function helloWorld()\r\n{\r\n var language = document.project2.lang.value;\r\n var language = language.toLowerCase();\r\n//create logic that outputs \"hello world\" different depending on language selected\r\n if (language == 'ru') //case of russia\r\n {\r\n return \"Privet Mir\";\r\n }\r\n else if (language == 'pt')\r\n {\r\n return \"Olá mundo!\";\r\n }\r\n else if(language == 'en')\r\n {\r\n return \"Hello world!\";\r\n }\r\n else if(language == 'fr')\r\n {\r\n return \"Bonjour le monde!\";\r\n }\r\n else if (language == 'es')\r\n {\r\n return \"Hola mundo\";\r\n }\r\n else\r\n {\r\n return \"HELLO MURICA.\";\r\n }\r\n\r\n\r\n}", "function createAboutMenu() { // create menu with all cipher catergories\r\n\tvar o = document.getElementById(\"calcOptionsPanel\").innerHTML\r\n\r\n\to += '<div class=\"dropdown\">'\r\n\to += '<button class=\"dropbtn\">About</button>'\r\n\to += '<div class=\"dropdown-content\">'\r\n\r\n\to += '<center>'\r\n\to += '<div style=\"display: flex; justify-content: center;\"><img src=\"res/logo.svg\" style=\"height: 10px\"></div>'\r\n\to += '<div style=\"display: flex; justify-content: center;\"><span style=\"font-size: 70%; color: rgb(186,186,186);\">by Saun Virroco</span></div>'\r\n\to += '</center>'\r\n\to += '<div style=\"margin: 0.5em;\"></div>'\r\n\to += '<input class=\"intBtn\" type=\"button\" value=\"GitHub Repository\" onclick=\"gotoGitHubRepo()\">'\r\n\to += '<div style=\"margin: 0.5em;\"></div>'\r\n\to += '<input class=\"intBtn\" type=\"button\" value=\"Quickstart Guide\" onclick=\"displayQuickstartGuide()\">'\r\n\r\n\to += '</div></div>'\r\n\r\n\tdocument.getElementById(\"calcOptionsPanel\").innerHTML = o\r\n}", "function selectedLanguage(){\n if(languageOnPage === \"en-US\"){\n return English\n } else if(languageOnPage === \"jp\"){\n return Japanese\n }\n }", "function buildButtonDef(trumbowyg) {\n return {\n fn: function () {\n var $modal = trumbowyg.openModal('Code', [\n '<div class=\"' + trumbowyg.o.prefix + 'highlight-form-group\">',\n ' <select class=\"' + trumbowyg.o.prefix + 'highlight-form-control language\">',\n (function () {\n var options = '';\n\n for (var lang in Prism.languages) {\n if (Prism.languages[lang].comment) {\n options += '<option value=\"' + lang + '\">' + lang + '</option>';\n }\n }\n\n return options;\n })(),\n ' </select>',\n '</div>',\n '<div class=\"' + trumbowyg.o.prefix + 'highlight-form-group\">',\n ' <textarea class=\"' + trumbowyg.o.prefix + 'highlight-form-control code\"></textarea>',\n '</div>',\n ].join('\\n')),\n $language = $modal.find('.language'),\n $code = $modal.find('.code');\n\n // Listen clicks on modal box buttons\n $modal.on('tbwconfirm', function () {\n trumbowyg.restoreRange();\n trumbowyg.execCmd('insertHTML', highlightIt($code.val(), $language.val()));\n trumbowyg.execCmd('insertHTML', '<p><br></p>');\n\n trumbowyg.closeModal();\n });\n\n $modal.on('tbwcancel', function () {\n trumbowyg.closeModal();\n });\n }\n };\n }", "function setup() {\n document.getElementById(\"translated\").style.color = \"black\";\n\n // Get Current translator, and change first letter to Capital for the title, and update title\n var lttr = select.split(\"\");\n var charlttr = lttr[0].toUpperCase(lttr[0]);\n lttr[0] = \"\";\n lttr = charlttr + lttr.toString();\n\n for (var i = 0; i < lttr.length; i++) {\n lttr = lttr.replace(\",\", \"\");\n } // for\n\n document.getElementById(\"lang\").innerHTML = lttr;\n BASE_URL2 =\n \"https://api.funtranslations.com/translate/\" + select + \".json?text=\";\n} // setup", "function showCustomAlert(type, titlePL, textPL, titleEN, textEN){\n\t\n\tvar userLang = document.documentElement.lang;\n\t\n\tif(userLang == \"pl_PL\")\n \tshowToastrAlert(type, textPL ,titlePL);\n else \n \tshowToastrAlert(type, textEN , titleEN);\n}", "function change_language(ev)\n {\n cuelang = this.value;\n\n // Set the lang attribute of the cue_elt.\n cue_elt.setAttribute(\"lang\", cuelang);\n\n // Set the cue_elt to the current caption in the chosen language.\n let i = 0, len = subtitles.length;\n while (i < len && subtitles[i].language !== cuelang) i++;\n if (i == len) {\n cue_elt.innerHTML = \"\";\n } else {\n let t = subtitles[i];\n if (t.mode === \"disabled\") t.mode = \"hidden\"; // Ensure it will be loaded\n if (!t.activeCues || !t.activeCues.length) cue_elt.innerHTML = \"\";\n else cue_elt.innerHTML = t.activeCues[0].text;\n }\n }", "function CustomizeAlertOpen_Language(mess, title, width, height, option, name, recognize) {\n try {\n var Pagesize = getPageSize();\n if (cstAlertOver == null) {\n cstAlertOver = document.createElement('div');\n document.body.appendChild(cstAlertOver);\n cstAlertWin = document.createElement('div');\n document.body.appendChild(cstAlertWin);\n }\n else {\n cstAlertOver = document.getElementById('pAlertOver');\n cstAlertWin = document.getElementById('pAlertWin');\n }\n\n var _top = 0;\n if (recognize == '1')\n _top = (Pagesize.height - height) / 2 + Pagesize.scrollTop - 200;\n else\n _top = (Pagesize.height - height) / 2 + Pagesize.scrollTop;\n \n var _left = (Pagesize.width - width) / 2;\n\n var sb = new Sys.StringBuilder();\n var _Wtd1 = parseInt(width) - 25;\n var iHeight = height - 10;\n sb.append(\"<table cellSpacing=0 cellPadding=0 border=0 style='z-index:10020; width:100%;height:\" + iHeight + \"px;'>\");\n // set background cho header cua windown\n var headClass = '';\n if (parseInt(width) <= 325)\n headClass = 'MessageBox_325px';\n else if (parseInt(width) > 325 && parseInt(width) <= 410)\n headClass = 'MessageBox_410px';\n else if (parseInt(width) > 410 && parseInt(width) <= 450)\n headClass = 'MessageBox_450px';\n else if (parseInt(width) > 450 && parseInt(width) <= 500)\n headClass = 'MessageBox_500px';\n else if (parseInt(width) > 500 && parseInt(width) <= 550)\n headClass = 'MessageBox_550px';\n else\n headClass = 'MessageBox_788px';\n\n sb.append(\"<tr class=\" + headClass + \" valign='middle' style=\\\"width:100%\\\"><td style='cursor:move;width:\" + _Wtd1 + \"px;'><span style='margin-left:5px;' class='fontStylePopup_Header'>\" + title + \"</span></td>\");\n sb.append(\"<td style='text-align:center;width: 24px;' valign='middle'><img id='btnCloseCustomPanel' src='../images/btn_close_panel.jpg' onclick='CustomizeAlertClose(); return false;' /></td></tr>\");\n sb.append(\"<tr><td id='bodyContains' width='100%' colspan=2 style='padding:16px 14px 0px;text-align:center;color:#000000;font-size:10.5pt'>\" + mess + \"</td></tr>\");\n sb.append(\"<tr><td id='tdControlButton' width='100%' colspan=2 style='padding-top:11px;padding-bottom:15px; text-align:center; height:30px;' vAlign='middle'></td></tr>\");\n sb.append(\"</table>\");\n\n $(cstAlertOver).attr('id', 'pAlertOver').removeClass('GctOverLayClass').addClass('GctOverLayClass').css({ width: Pagesize.pageWidth, height: Pagesize.pageHeight, zIndex: 10009 });\n $(cstAlertWin).attr('id', 'pAlertWin').removeClass('gctPopupHeight').addClass('gctPopupHeight').css({ minWidth: width, width: 'auto !important', width: width, width: width, minHeight: height, height: 'auto !important', height: height, top: _top, left: _left, border: '1px solid black', zIndex: 10015, backgroundColor: '#D8E1F0' }).html(sb.toString()).draggable();\n\n // add buttons \n if (option == null) {\n try {\n var _btnOkCustomizeAlert = document.createElement('input');\n $(_btnOkCustomizeAlert).attr({ 'class': option[i].css, id: 'btnOkCustomizeAlert', 'value': name, type: 'button' }).click(CustomizeAlertClose);\n $('#tdControlButton').append(_btnOkCustomizeAlert); \n }\n catch (e) { }\n }\n else if (option != null && option.length > 0) {\n try {\n var Ctrl = null;\n for (var i = 0; i < option.length; i++) {\n Ctrl = document.createElement('input');\n $(Ctrl).attr({ 'class': option[i].css, id: 'btnControl_' + i, value: option[i].name, type: 'button' }).click(option[i].fClick).css({ marginRight: '5px' });\n $('#tdControlButton').append(Ctrl); \n }\n }\n catch (e) { }\n }\n\n $('#btnCloseCustomPanel').click(function() {\n CustomizeAlertClose();\n });\n \n $get('pAlertOver').style.display = '';\n $get('pAlertWin').style.display = '';\n }\n catch (e) { }\n}", "function languageChecks(name) {\n if (language === '1') {\n prompt(jsonMessages['English'][name]);\n } else if (language === '2') {\n prompt(jsonMessages['Spanish'][name]);\n }\n}", "function showCustomAlert(type, titlePL, textPL, titleEN, textEN){\n\t\n\tvar userLang = document.documentElement.lang;\n\n\tif(userLang == \"pl_PL\")\n \tshowToastrAlert(type, textPL ,titlePL);\n else \n \tshowToastrAlert(type, textEN , titleEN);\n}", "initializeLanguage(languages) {\n for(var k in languages) {\n let opt = Utility.createNode('option', { \n value: k, innerHTML: languages[k]\n });\n $('#select-language').append(opt);\n }\n /*Translate.google_translate_support_lang().then(data => {\n const langs = data.data.languages;\n langs.forEach(e => {\n let opt = Utility.createNode('option');\n opt.value = e.language;\n opt.innerHTML = e.name;\n $('#select-language').append(opt);\n });\n $('#select-language').selectpicker('refresh');\n $('#select-language').selectpicker('val', 'en');\n });*/\n }", "function manageLang(){\n\n\t//change default language if \"es\" in URL\n\tconst langBtns = document.querySelectorAll('.intro-langmenu a');\n\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\tlet lang = urlParams.get('lang');\n\tchangeLang(lang || undefined);\n\n\tif(lang){\n\t\tfor(let e = 0; e < langBtns.length; e++){\n\t\t\tlangBtns[e].setAttribute('aria-current', '');\n\t\t}\n\t\tdocument.querySelector('.intro-langmenu a[lang=\"' + lang + '\"]').setAttribute('aria-current', 'true');\n\t}else{\n\t\tlang = 'en';\n\t}\n\n\t//add events to language buttons in about page\n\tfor( let i = 0; i < langBtns.length; i++){\n\t\tlangBtns[i].addEventListener('click', function(e){\n\t\t\te.preventDefault();\n\t\t\tfor(let e = 0; e < langBtns.length; e++){\n\t\t\t\tlangBtns[e].setAttribute('aria-current', '');\n\t\t\t}\n\t\t\te.currentTarget.setAttribute('aria-current', 'true');\n\t\t\tconst lang = langBtns[i].getAttribute('lang');\n\t\t\tchangeLang(lang);\t\n\t\t});\n\t}\n\n\treturn lang;\n\n}", "function onChangeTargetCountry(event) {\n\tvar available_languages = {\n\t\t'AR' : {es: 'Spanish'},\n 'AU' : {en: 'English',zh: 'Chinese'},\n 'AT' : {de: 'German', en: 'English'},\n 'BE' : {en: 'English', fr: 'French', nl: 'Dutch'},\n 'BR' : {pt: 'Portuguese'},\n 'CA' : {en: 'English', fr: 'French', zh: 'Chinese'},\n 'CL' : {es: 'Spanish'},\n 'CN' : {zh: 'Chinese'},\n 'CO' : {es: 'Spanish'},\n 'CZ' : {cs: 'Czech', en: 'English'},\n 'DK' : {da: 'Danish', en: 'English'},\n 'FR' : {fr: 'French'},\n 'DE' : {de: 'German', en: 'English'},\n 'HK' : {en: 'English', zh: 'Chinese'},\n 'IN' : {en: 'English'},\n 'ID' : {en: 'English', id: 'Indonesian'},\n 'IE' : {en: 'English'},\n 'IT' : {it: 'Italian'},\n 'JP' : {ja: 'Japanese'},\n 'MY' : {en: 'English', ms: 'Malay', zh: 'Chinese'},\n 'MX' : {en: 'English', es: 'Spanish'},\n 'NL' : {en: 'English', nl: 'Dutch'},\n 'NZ' : {en: 'English'},\n 'NO' : {en: 'English', no: '\tNorwegian'},\n 'PH' : {en: 'English', tl: 'Filipino'},\n 'PL' : {pl: 'Polish'},\n 'PT' : {pt: 'Portuguese'},\n 'RW' : {ru: 'Russian'},\n 'SG' : {en: 'English', zh: 'Chinese'},\n 'ZA' : {en: 'English'},\n 'ES' : {es: 'Spanish'},\n 'SE' : {en: 'English', sv: 'Swedish'},\n 'CH' : {en: 'German', en: 'English', fr: 'French', it: 'Italian'},\n 'TW' : {en: 'English', zh: 'Chinese'},\n 'TR' : {en: 'English', tr: 'Turkish'},\n 'AE' : {ar:'Arabic', en: 'English'},\n 'GB' : {en: 'English'},\n 'US' : {en: 'English', zh: 'Chinese'}\n\t};\n\n\t$('.googleshopping-feed-container select.feed-language')\n\t\t.find('option')\n \t.remove();\n\n\tif(available_languages.hasOwnProperty(event)) {\n\t\t$.each(available_languages[event], function(key, value) {\n\t\t\t$('.googleshopping-feed-container select.feed-language')\n\t\t\t\t.append($(\"<option></option>\")\n\t\t\t\t\t.attr(\"value\",key)\n\t\t\t\t\t.text(value));\n\t\t});\n\t}\n}", "function addLanguages() {}", "function __dlg_translate(_1){\r\nvar _2=[\"span\",\"option\",\"td\",\"th\",\"button\",\"div\",\"label\",\"a\",\"img\",\"legend\"];\r\nfor(var _3=0;_3<_2.length;++_3){\r\nvar _4=document.getElementsByTagName(_2[_3]);\r\nfor(var i=_4.length;--i>=0;){\r\nvar _6=_4[i];\r\nif(_6.firstChild&&_6.firstChild.data){\r\nvar _7=Xinha._lc(_6.firstChild.data,_1);\r\nif(_7){\r\n_6.firstChild.data=_7;\r\n}\r\n}\r\nif(_6.title){\r\nvar _7=Xinha._lc(_6.title,_1);\r\nif(_7){\r\n_6.title=_7;\r\n}\r\n}\r\nif(_6.alt){\r\nvar _7=Xinha._lc(_6.alt,_1);\r\nif(_7){\r\n_6.alt=_7;\r\n}\r\n}\r\n}\r\n}\r\ndocument.title=Xinha._lc(document.title,_1);\r\n}", "function onRestoreOriginal() {\n alert(\"The page was reverted to the original language. This message is not part of the widget.\");\n}", "function switchLanguageBtn() {\n let langBtn = document.querySelectorAll('.languages')[0];\n\n langBtn.addEventListener('click', (event) => {\n let btn = event.target;\n\n if (btn.children.length) return;\n if (btn.innerHTML.length < 2) return;\n\n btn.classList.toggle(\"underline\");\n let otherBtn;\n\n if (btn.nextElementSibling == null) {\n otherBtn = btn.parentElement.firstElementChild;\n } else {\n otherBtn = btn.parentElement.lastElementChild;\n }\n\n otherBtn.classList.toggle(\"underline\");\n });\n}", "function popupFunction(subject, option) {\n var popup = document.getElementById(subject + option + \"PopupText\");\n popup.classList.toggle(\"show\");\n document.getElementById(subject + option).click();\n}", "function changeLang(l) {\r\n\tlang = l;\r\n\tlocalStorage.setItem('ow-lang',l);\r\n\t$('#chooseLangFlag').attr('src','img/flags/' + lang + '.svg');\r\n\tapplyLang();\r\n}", "function showLanguageOption(item) {\n document.getElementById(\"dropdownLanguageOption\").innerHTML = item.innerHTML;\n}", "function showPopupOrder(tittle, content, nameButton){\n\tvar d = new Date;\n\tcheckin_time = [d.getFullYear(), d.getMonth()+1, d.getDate()].join('/')+' '+\n [d.getHours(), d.getMinutes(), d.getSeconds()].join(':');\n\tsetMessagePopup('Thông báo đặt phòng', 'Hãy xác nhận đặt phòng <br></br>'\n\t\t\t+'Giờ checkin là: '+ checkin_time, 'Đặt phòng')\n\t$('#popup-message').modal('show');\n\t$('#btn-success-popup').removeAttr('disabled');\n}", "@action(Action.INIT_LANGUAGE)\n @dispatches(Action.UI_LANGUAGE_READY)\n async initUiLanguage (store) {\n await $.getScript(`${basepath}/i18n/${this.getLanguage(store).code}.js`)\n\n t10.scan() // translate\n }", "showSpecificOptions(){\n return(\n <Popup trigger={<button className=\"settings_button\">...</button>}\n closeOnDocumentClick\n position={\"left top\"}\n >\n\n <div className={\"events_option\"}>Action 1</div>\n <div className={\"events_option\"}>Action 2</div>\n <div className={\"events_option\"}>Action 3</div>\n\n </Popup>\n )\n }", "function getByLanguage(){\r\n var x = document.getElementById(\"by_language_argument\").value;\r\n sessionStorage.setItem(\"byLanguage\",x);\r\n sessionStorage.setItem(\"mode\",\"byLanguage\");\r\n setCheckboxValues();\r\n window.open(\"html/result.html\");\r\n}", "function OpenDialog_Upd_CategoryLevel1(IDCategoryLevel1) {\n var title = \"\";\n var width = 1200;\n var height = 900;\n if ($(\"#PositionShowDialog\").length <= 0) {\n $(\"body\").append('<div id=\"PositionShowDialog\" style=\"display:none; overflow-x:hidden; overflow-y:scroll;\" title=\"' + title + '\"></div>');\n }\n\n Fill_CategoryLevel1_Dialog_Upd(IDCategoryLevel1);\n\n $(\"#PositionShowDialog\").dialog({\n modal: true,\n width: width,\n //open: setTimeout('Change_TextareaToTinyMCE_OnPopup(\"#txt_InfoAlbumLang1\")', 2000), // Cần phải có settimeout,\n \n height: height,\n resizable: false,\n show: {\n effect: \"clip\",\n duration: 1000\n },\n hide: {\n effect: \"explode\",\n duration: 1000\n },\n\n buttons: {\n 'Đóng': function () {\n $(this).dialog('close');\n },\n 'Sửa': function () {\n //Save_Multi_TinyMCE(\"txt_Info_Lang\", sys_NumLang);\n Upd_CategoryLevel1(IDCategoryLevel1);\n \n $(this).dialog('close');\n }\n },\n close: function () {\n\n }\n });\n}", "function display() {\n lang = document.getElementById(\"selectedEngorHin\").value;\n\n if (lang == \"\") {\n $('#dropdown2').hide();\n $('#input_table').hide();\n $('#instruction').hide();\n $('#answers').hide();\n document.getElementById(\"ans_button\").innerHTML = \"Get Answer\";\n alert(\"Select Language\");\n }\n\n if (lang == \"English\") {\n $('#dropdown2').show();\n $('#input_table').hide();\n $('#instruction').hide();\n $('#answers').hide();\n document.getElementById(\"ans_button\").innerHTML = \"Get Answer\";\n $('#selectword').empty();\n let temp = Array.from(eng_words);\n var dropdown2_content = document.getElementById(\"selectword\");\n dropdown2_content[dropdown2_content.length] = new Option(\"---Select Word---\", \"\");\n for (i = 0; i < temp.length; i++) {\n dropdown2_content[dropdown2_content.length] = new Option(temp[i], temp[i]);\n }\n }\n\n if (lang == \"Hindi\") {\n $('#dropdown2').show();\n $('#input_table').hide();\n $('#instruction').hide();\n $('#answers').hide();\n document.getElementById(\"ans_button\").innerHTML = \"Get Answer\";\n $('#selectword').empty();\n let temp = Array.from(hin_words);\n var dropdown2_content = document.getElementById(\"selectword\");\n dropdown2_content[dropdown2_content.length] = new Option(\"---Select Word---\", \"\");\n for (i = 0; i < temp.length; i++) {\n dropdown2_content[dropdown2_content.length] = new Option(temp[i], temp[i]);\n }\n }\n}", "function selectLocallyStoredLanguage(langCode){\n document.getElementById('languages').value = langCode;\n }", "function BrowserLanguage() {\n}", "openPopUp(){\r\n // Hide the back panel.\r\n const element = document.getElementsByClassName(StylesPane.HideBackPanel)[0]\r\n element.className = StylesPane.BackPanel\r\n // Show the settings panel.\r\n }", "function setLanguage(newLang){\r\n\tswitch (newLang) {\r\n\t\t// German - DE - by Stevieoo\r\n\t\tcase \"de\": \taLang = [\"Aktivieren\", \"Angriffs-Email\", \"Angriffs-Alarm\", \"Spionage-Alarm\", \"Nachrichten-Alarm\", \"Auto-Login\", \"Du musst Deine eMail Adresse am Anfang des Codes einfügen, wenn Du eine eMail bekommen möchtest, wenn Du angegriffen wirst.\", \"Es muss eine funktionierende Email Adresse definiert werden, damit Du bei einem Angriff benachrichtigt wirst.\", \"Angriff in \", \"Unbekannte Angriffs-Zeit\", \"Du wirst angegriffen, aber die Flottendetails nicht nicht verfügbar.\", \"Ankunfts-Zeit\", \"Schiffe\", \"Von\", \"Nach\", \"Angriff\", \"OGame Angriff\", \"Autologin kann in Chrome nicht abgeschaltet werden. Bitte deaktiviere das Addon zum ausschalten des Autologin.\", \"OGame@Alarme.Queijo\", \"Das ist eine Testmail\", \"Das ist ein OGame@Alarm.Cheese Test\", \"OGame Alarm w/ Cheese\", \"Email für eingehene Alarme\", \"Test\", \"Ogame Alarm by programer\", \"Minimale Reload-Zeit\", \"Maximale Reload-Zeit\", \"Prüfe auf alarme alle\", \"Speichern & Schließen\",\"Reload Typ Auswahl\",\"Sekunden\",\"Sprache\",\"\",\"[OGAbp] Löschen aller cookies\",\"Bist Du sicher das Du alle OGAbp Cookies löschen möchtest? Hiermit werden deine Logindaten gelöscht und alle Einstellungen auf standard zurück gesetzt.\", \"Reset alles\", \"AutoLogin Konten\", \"Server\", \"Spieler\", \"Passwort\", \"AutoLogin\", \"Es gibts keine AutoLogin informationen. Bitte ausloggen und neu einloggen zum speichern der informationen.\", \"Ungültige Email! Beispiel: someone@somewhere.abc\", \"Eine Test Email wurde versendet! Wenn Sie kein Firefox verwenden könnte es nicht funktionieren.\", \"Ungültige Einstellungen! Das minimum darf nicht kleiner als 30 Sekunden sein. Das Maximum darf nicht kleiner als 360 sein. Prüfen auf Angriffe darf nicht kleiner als 30 sein. Die Email Adresse muss ein @ und einen . und keine Leerzeichen enthalten.\", \"Übersicht\", \"Löschen\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 1;\r\n\t\t\t\t\tbreak;\r\n\t\t// Danish - DK - by Kin0x\r\n\t\tcase \"dk\": \taLang = [\"Aktiver\", \"Angrebs email\", \"Angrebs Alarm\", \"Spionage Alarm\", \"Besked Alarm\", \"Auto Login\", \"Mangler email!\", \"Du skal have en email indtastet i bunden for at kunne modtage beskeder omkring flåde angreb pr. mail.\", \"Indkommende angreb om \", \"Ukendt angrebs tid\", \"Du er under angreb, men der er ingen flåde detajler\", \"Ankommer kl.\", \"Skibe\", \"Fra\", \"Til\", \"Angreb\", \"OGame indkommende angreb\", \"AutoLogin kan ikke blive slået fra i Chrome!\", \"OGame@Alarm.Ost\", \"Dette er en test email!\", \"En test email så du kan se dit script virker!\", \"OGame Alarm med Ost\", \"Email for at modtage mails med angreb\", \"Send en test\", \"OGame Alarm Indstillinger\", \"Minimum opdateringstid (sek)\", \"Maksimum opdateringstid (sek)\", \"Check for alarms every\", \"Gem Indstillinger\", \"Select Reload Type\", \"sekund\", \"Sprog\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 2;\r\n \t\t\t\t\tbreak;\r\n\t\t// Portuguese - PL - by GL_notmypresident\r\n\t\tcase \"pt\": \taLang = [\"Recarregar\", \"Email de ataque\", \"Alarme de ataque\", \"Alarme de espião\", \"Alarme mensagem\", \"Login automático\", \"Tens que preencher a variável EmailURL no topo do código. Para usar a opção de Email de ataque.\", \"Tens que inserir o teu email no fim da página do OGame para usar a opção de Email de ataque.\", \"Ataque em \", \"Tempo para o ataque desconhecido\", \"Estás a ser atacado, mas os detalhes da frota atacante são desconhecidos.\", \"Tempo de chegada\", \"Naves\", \"De\", \"Para\", \"Ataque\", \"Ataque no OGame\", \"Não é possível desactivar o Login Automático no Chrome. Tens que ir à página das extensões e desactivar o script para desactivar o Login automático.\", \"OGame@Alarme.Queijo\", \"Email de teste\", \"Um teste com queijo\", \"Alarme do OGame com queijo\", \"Email para receberes notificações de ataque\", \"Teste\", \"Ogame Alarm by programer\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Salvar e Saída\", \"Select Reload Type\", \"segundo\", \"Linguagem\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email and autologin information as well as reset all options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 3;\r\n \t\t\t\t\tbreak;\r\n\t\t// Russian - RU - by programer\r\n\t\tcase \"ru\":\taLang = [\"Активировать\", \"Emailer атак\", \"Сирена при атаке\", \"Сигнал при скане\", \"Сигнал о сообщении\", \"Авто Вход\", \"Вы должны ввести адрес почтового ящика в начале кода скрипта для использования Входящие сообщения при атаке.\", \"Вы должны установить корректный почтовый ящик в опции Сигнал при атаке\", \"Атака через \", \"Неизвестное время атаки\", \"Обнаружена атака, но состав флотов не определен\", \"Время прилета\", \"Корабли\", \"с\", \"на\", \"Атака\", \"Атака в OGame\", \"Невозможно отключить Авто Вход в Chrome. Вы должны открыть расширения и отключить скрипт, чтобы отключить Авто Вход.\", \"OGame@Alarm.Cheese\", \"Тестовое сообщение\", \"Тест\", \"OGame Alarm by programer\", \"Почтовый ящик для отправки сигнального сообщения\", \"Тест\", \"Ogame Alarm by programer\", \"Минимальное время обновления\", \"Максимальное время обновления\", \"Проверять атаку каждые\", \"Сохранить & Выйти\", \"Выберите тип обновления\", \"секунд\", \"Язык\", \"\", \"[OGAbp] Удалить куки\", \"Вы действительно хотите удалить все OGAbp куки?\\n\\nЭто удалит адрес почтового ящика (и информацию авто входа в GreaseMonkey), как сброс всех настроек и опций по умолчанию.\", \"Сбросить все\", \"Аккаунты Авто входа\", \"Сервер\", \"Игрок\", \"Пароль\", \"Авто вход\", \"Не найдена информации об аккаунтах Авто входа. Пожалуйста выйдите и войдите обратно для сохранения информации об аккаунте для Авто входа\", \"Некорректный Email. Пожалуйста, используйте форму: someone@somewhere.abc\", \"Тестовое сообщение отправлено!\\n\\nЭто будет работать только в браузере FireFox.\", \"Некорректные настройки!\\n\\nМинимум не может быть менее 30 секунд.\\nМаксимум не может быть менее 360 секунд.\\nПроверка атак не может быть установлена менее 30.\\nАдрес почтового ящика должен содержать @ и . и не должен содержать пробелов.\\nПовторение сигнала должно быть чаще, чем проверка атак.\", \"Обзор\", \"Удалить\", \"Повторять последний сигнал\", \"После\", \"(Менее 10 = отключено)\"];\r\n\t\t\t\t\taLangIndex = 4;\r\n\t\t\t\t\tbreak;\r\n\t\t// English (Default) - ORG - by Pimp Trizkit\r\n\t\tcase \"org\": // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\r\n\t\tdefault:\taLang = [\"Activate\", \"Attack Emailer\", \"Attack Alarm\", \"Espionage Alarm\", \"Message Alarm\", \"Auto Login\", \"You need to set the EmailURL at the top of the code. To use the Incoming Attack Email Alarm.\", \"You need to set a proper email address in the options screen for the Incoming Attack alerts.\", \"Incoming Attack in \", \"Unknown Attack Time\", \"You have an Incoming attack, but the fleet details are not available\", \"Arrival Time\", \"Ships\", \"From\", \"To\", \"Attack\", \"OGame Incoming Attack\", \"Can not turn off AutoLogin in Chrome. You will have to goto your extensions and disable the script to disable AutoLogin.\", \"OGame@Alarm.Cheese\", \"This is a test email\", \"One Cheesy Test\", \"OGame Alarm w/ programer\", \"Email address to send Incoming Attack alerts\", \"Test\", \"Ogame Alarm by programer\", \"Minimum reload time\", \"Maximum reload time\", \"Check for alarms every\", \"Save & Close\", \"Select Reload Type\", \"seconds\", \"Language\", \"\", \"[OGAbp] Delete all cookies\", \"Are you sure you want to delete all OGAbp cookies?\\n\\nThis will delete your email (and autologin information in GreaseMonkey) as well as reset all settings and options to default.\", \"Reset All\", \"AutoLogin Accounts\", \"Server\", \"Player\", \"Password\", \"AutoLogin\", \"No AutoLogin account information. Please log out and log back in to save account information for AutoLogin.\", \"Improper Email. Please use the form: someone@somewhere.abc\", \"Test Email sent!\\n\\nThis may not work in non-FireFox browsers.\", \"Improper settings!\\n\\nMinimum cannot be set lower than 30 seconds.\\nMaximum cannot be set lower than 360 seconds.\\nCheck for Attacks cannot be set lower than 30.\\nThe email address must contain @ and . and no spaces.\\nAlarm repeat must be less than Check for Alarms.\", \"Overview\", \"Delete\", \"Repeat last audio alarm\", \"After\", \"(Less than 10 = OFF)\"];\r\n\t\t\t\t\taLangIndex = 0;\r\n\t\t\t\t\tbreak;\r\n\t}\r\n}", "function pickLanguage(array){\n\n if(document.getElementById('french').selected ){\n\t return Translator.translateToFrench(array);\n\t}\n\telse if(document.getElementById('spanish').selected ){\n\t return\tTranslator.translateToSpanish(array);\n\t}\n\telse if (document.getElementById('german').selected ){\n\t\treturn Translator.translateToGerman(array);\n\t}\n\telse\n\t\treturn 'Please select a language';\n}", "function addtexttopopup (response) {\n \t\t\tvar popUptext = response.articles;\n \t\t\tvar popup = parseResults(popUptext);\n \t\t\taddArticlesToPage(popup);\n\t \t\t// add an onclick event to be able to close the pop up\n\t \t\t}", "static get BUTTON_L() {\n return \"tl\";\n }", "function postWindowInit() {\n \n // Hide disabled books on chooser\n useFirstAvailableBookIf();\n ViewPort.disableMissingBooks(getPrefOrCreate(\"HideDisabledBooks\", \"Bool\", false));\n \n // Open language menu if a new locale was just installed\n if ((!document.getElementById(\"sub-lang\").disabled && XS_window.NewModuleInfo.showLangMenu) || \n XS_window.NewModuleInfo.NewLocales.length) {\n var opmenu = getDataUI(\"menu.options\");\n var lamenu = getDataUI(\"menu.options.language\");\n var result={};\n var dlg = window.openDialog(\"chrome://xulsword/content/dialogs/dialog/dialog.xul\", \"dlg\", DLGSTD, result, \n fixWindowTitle(getDataUI(\"menu.options.language\")),\n XSBundle.getFormattedString(\"LangSelectMsg\", [opmenu, lamenu]), \n DLGINFO,\n DLGOK);\n openLanguageMenu();\n }\n \n // Enable help email address\n var email = null;\n try {email = prefs.getCharPref(\"HelpEmailAddress\");}\n catch (er) {}\n if (email) {\n var menu = document.getElementById(\"emailus\");\n menu.setAttribute(\"label\", email);\n menu.removeAttribute(\"hidden\");\n document.getElementById(\"emailus-sep\").removeAttribute(\"hidden\");\n }\n \n createHelpVideoMenu();\n \n checkCipherKeys();\n \n initBookmarksLocale(BM, BMDS);\n \n refreshAudioCatalog();\n for (var w=1; w<=NW; w++) {\n BibleTexts.updateAudioLinks(w);\n }\n updateBibleNavigatorAudio();\n\n}", "showGeneralOptions(){\n return(\n <Popup trigger={<button className=\"selection_action_button settings_button\">...</button>}\n closeOnDocumentClick\n position={\"left top\"}\n >\n\n <div className={\"events_option\"}>Action 1 ({this.state.selection.length})</div>\n <div className={\"events_option\"}>Action 2 ({this.state.selection.length})</div>\n\n </Popup>\n )\n }", "_setLanguage(language) {\n strings.setLanguage(global.lang[language].shortform)\n global.languageSelected = global.lang[language].shortform\n Alert.alert(strings.changeLanguage, strings.getString(global.lang[language].longform))\n }", "function returnLanguage() {\n var lang = document.location.href.split('/')[3];\n var uaText = {\n open: 'Читати далі',\n close: 'Згорнути'\n };\n var ruText = {\n open: 'Читать далее',\n close: 'Свернуть'\n };\n var enText = {\n open: 'Read more',\n close: 'Close'\n };\n if(lang=='ru') {\n return ruText;\n } else if(lang=='en') {\n return enText;\n } else {\n return uaText;\n }\n }", "function openFunction() {\n\tlng = navigator.language;\n\tconsole.log(\"page language:\", lng);\n\tif (lng == \"pt-BR\") {\n\t\tswitchPt();\n\t}\n}", "function menuLangUp(event){\n\tvar target = event.target || event.srcElement;\n\t\n\tif(!event.which && event.button){ // Firefox, Chrome, etc...\n\t\tvar button = event.button;\n\t}else{ // MSIE\n\t\tvar button = event.which;\n\t}\t\n\t\n\tif(button == 1 && (target == app.BTN_LANG_MENU || util.hasParent(target, app.BTN_LANG_MENU))){\t\n\t\tif(util.getStyle(app.LANG_MENU, \"display\") == \"none\"){\n\t\t\tapp.LANG_MENU.style.display = \"block\";\n\t\t}else{\n\t\t\tapp.LANG_MENU.style.display = \"none\";\n\t\t}\n\t}else if(!util.hasParent(target, app.LANG_MENU)){\n\t\tif(util.getStyle(app.LANG_MENU, \"display\") == \"block\"){\n\t\t\tapp.LANG_MENU.style.display = \"none\";\n\t\t}\n\t}\n\t\n\t/** change the interface language. */\n\tif(button == 1 && util.hasParent(target, app.LANG_MENU) && target.localName == \"li\"){\n\t\ttarget.className = \"\";\n\t\tchangeLang(target.innerHTML.toLowerCase());\n\t\tapp.LANG_MENU_HEAD.innerHTML = target.innerHTML;\n\t}\n}", "function indexPopup(id, name, description)\n{\n var nameSpot = document.getElementById('questionName');\n var descriptionSpot = document.getElementById('questionDescription');\n var answerButton = document.getElementById('questionAnswer');\n\n // Display corresponding question name and description in popup\n nameSpot.innerHTML = name;\n descriptionSpot.innerHTML = description;\n answerButton.value= id;\n\n modal.style.display = \"block\";\n pagecontent.className += \" de-emphasized\";\n}", "async setAppLanguage() {\n this.props.actions.getLanguage().then((lang) => {\n if (lang !== undefined && typeof lang.value === 'string') {\n this.props.actions.setContentStrings(lang.value);\n this.props.actions.setLanguage(lang.value);\n } else {\n this.props.actions.setContentStrings(\"no\");\n this.props.actions.setLanguage(\"no\");\n }\n });\n }", "[consts.SET_B_SHOW_CONTENT_LANG](state, val) {\n state.bShowContentLang = val;\n }", "function popup2() {\nalert(\"Sukhdeep Singh is a young Bio-Informatician with Masters in Bio-Informatics from University of Leicester,UK. His main interests are developing web-interfaces and data handling for almost all kinds of experiments that are being conducted on daily basis all around the globe. Contact : vanbug@gmail.com\")\n}", "function popUp()\n{\n}", "onToggleLanguagesDropdown() {\n $('#select-languages').on('click', function () {\n $(this).siblings('#dropdown-languages').toggleClass('show')\n });\n }", "function icl_editor_popup(e) {\n\n // Toggle\n icl_editor_toggle(e);\n \n // Set popup\n icl_editor_resize_popup(e);\n \n // TODO Scroll window if popup title is out of screen\n // Not sure why other elements fail for\n // offset()\n // var t = e.parents('ul').one().offset();\n // alert(t.top);\n // if (e.parents('ul').one().is(':icl_offscreen')) {alert('off screen');\n // jQuery('html, body').animate({\n // scrollTop: title.offset().top\n // }, 2000);\n // }\n \n // Bind window click to auto-hide\n icl_editor_bind_auto_close();\n}", "function switchContent(e) {\n hideContent()\n toggleMenu()\n clearSelected()\n\n // Get selected language\n currentLang = this.id\n\n // Set flag image to currently selected\n lngBtn.classList.add(currentLang)\n\n // Set selected state on menu item\n this.classList.add('selected')\n\n // Set area to display\n const content = get(`#${currentLang}-content`)\n content && content.classList.add('show')\n\n // Remember language selection\n lastSelected = currentLang\n}", "function aboutModal() {\n var displayAbout = \"<img style=\\\"float: left; margin:11px 5px 0px 0px; padding:0;\\\" src=\\\"styles/images/brackets_icon.svg\\\" alt=\\\"logo\\\" width=\\\"30\\\" height=\\\"30\\\">\";\n displayAbout += \"<h3 style=\\\"margin-bottom:-5px;\\\">Font Select</h3></span>\\n<small>version: 1.0.0</small><br><br>\\n\";\n displayAbout += \"<center><span style=\\\"letter-spacing: 1px;\\\">A Simple Font Select for Brackets<br>\\n\";\n displayAbout += \"<span style=\\\"letter-spacing: 1px;\\\">You can Select a Custom font in the Fonts Menu</center><br>\\n\";\n displayAbout += \"<p>&#1023; Author: SeanDee Dela Torre</p> <p>&#1023; Github Profile: <a href=\\\"https://github.com/seanDeee/\\\" >seanDeee</a></p><p>&#1023; GitHub Repository: <a href=\\\"https://github.com/seanDeee/brackets-custom-extension\\\" >https://github.com/seanDeee/brackets-custom-font-extension</a></p>\";\n displayAbout += \"&#1023; Contact: sjdt17@gmail.com<br><hr>\";\n \n displayAbout += \"<br>\";\n \n displayAbout += \"More Updates Coming Soon...<br>\";\n // show modal dialog with \"About Extension\" information\n Dialogs.showModalDialog('a', \"About Extension\", displayAbout);\n }", "function multilanguageMessage(\r\n myMessageSpanish,\r\n myMessageEnglish,\r\n timeToShowSeconds\r\n ) {\r\n /*!!!!SET TO ENGLISH BY DEFAULT!!!!!!!*/\r\n var myuserlanguage = \"English\"; //localStorage[\"poorbuk.myuserlanguage\"];\r\n //alert(myuserlanguage);\r\n if (!myuserlanguage) {\r\n myuserlanguage = \"Spanish\";\r\n }\r\n\r\n if (myuserlanguage == \"\") {\r\n myuserlanguage = \"Spanish\";\r\n }\r\n\r\n if (myuserlanguage == \"Spanish\") {\r\n var myMessage = myMessageSpanish;\r\n }\r\n if (myuserlanguage == \"English\") {\r\n var myMessage = myMessageEnglish;\r\n }\r\n //alert(myMessage);\r\n var divAllMessages = \"divAllMessages\";\r\n var myTimeout = timeToShowSeconds * 1000;\r\n messagesWriteNewMessage(myMessage, divAllMessages, myTimeout);\r\n }", "function chooseAdvancedOptions() {\n /* Choose the labels based on the language */\n\n switch($F('language')) {\n case 'de':\n text_show = 'Optionen Anzeigen';\n text_hide = 'Optionen Ausblenden';\n break;\n case 'en':\n text_show = 'Show Options';\n text_hide = 'Hide Options';\n break;\n case 'es':\n text_show = 'Meustra Opciones';\n text_hide = 'Oculta Opciones';\n break;\n case 'fr':\n text_show = 'Affichez les Options';\n text_hide = 'Masquez les Options';\n break;\n case 'it':\n text_show = 'Mostra Opzioni';\n text_hide = 'Nascondi Opzioni';\n break;\n case 'nl':\n text_show = 'Toon Opties';\n text_hide = 'Verberg Opties';\n break;\n case 'sk':\n text_show = 'Ukáž možnosti';\n text_hide = 'Skri možnosti';\n case 'sv':\n text_show = 'Visa Alternativ';\n text_hide = 'Dölj Alternativ';\n break;\n default:\n text_show = 'Show Options';\n text_hide = 'Hide Options';\n break;\n }\n\n if ( $('advanced_options').hasClassName('selected') ) {\n $('advanced_options').removeClassName('selected');\n $('advanced_options').update(text_show);\n $$('#advanced_options_div > div').each(function(item) {\n item.hide();\n });\n } else {\n $('advanced_options').addClassName('selected');\n $('advanced_options').update(text_hide);\n plottype = $$('li.tab > a.selected')[0].identify();\n selector = '#advanced_options_div > div.' + plottype;\n $$(selector).each(function(item) {\n item.show();\n });\n }\n}", "function initLanguage() {\n if(getLanguage()) return;\n setItem('language', 'sv');\n}", "multiSelelect () {\r\n const O = this;\r\n O.optDiv.addClass('multiple');\r\n O.okbtn = $('<p tabindex=\"0\" class=\"btnOk\"></p>').click(() => {\r\n //if combined change event is set.\r\n O._okbtn();\r\n O.hideOpts();\r\n });\r\n [O.okbtn[0].innerText] = settings.locale;\r\n\r\n O.cancelBtn = $('<p tabindex=\"0\" class=\"btnCancel\"></p>').click(() => {\r\n O._cnbtn();\r\n O.hideOpts();\r\n });\r\n [, O.cancelBtn[0].innerText] = settings.locale;\r\n\r\n const btns = O.okbtn.add(O.cancelBtn);\r\n O.optDiv.append($('<div class=\"MultiControls\">').append(btns));\r\n\r\n // handling keyboard navigation on ok cancel buttons.\r\n btns.on('keydown.sumo', function (e) {\r\n const el = $(this);\r\n switch (e.which) {\r\n case 32: // space\r\n case 13: // enter\r\n el.trigger('click');\r\n break;\r\n\r\n case 9: //tab\r\n if (el.hasClass('btnOk')) return;\r\n break;\r\n case 27: // esc\r\n O._cnbtn();\r\n O.hideOpts();\r\n return;\r\n default:\r\n break;\r\n }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n });\r\n }", "function SetTitleHandler()\n{\n var buttons;\n var aList = [\"Latest\", \"Oldest\", \"Ascending\", \"Descending\"];\n var $btns = $(\"#buttons_box .button\");\n \n // Reset old buttons.\n $($btns).text(\"\");\n\n // Show buttons\n buttons = \"\";\n $.each(aList, function(i, value) {\n buttons += '<button type=\\\"button\\\" class=\\\"test\\\">' + value + '</button>';\n });\n $($btns).append(buttons); \n \n ShowPopupBox(\"#buttons_box\", \"Title\");\n SetState(\"page\", \"popup\"); \n}", "function buttonClick(e) {\n\n var editor = this,\n buttonDiv = e.target,\n buttonName = $.data(buttonDiv, BUTTON_NAME),\n button = buttons[buttonName],\n popupName = button.popupName,\n popup = popups[popupName];\n\n // Check if disabled\n if (editor.disabled || $(buttonDiv).attr(DISABLED) === DISABLED)\n return;\n\n // Fire the buttonClick event\n var data = {\n editor: editor,\n button: buttonDiv,\n buttonName: buttonName,\n popup: popup,\n popupName: popupName,\n command: button.command,\n useCSS: editor.options.useCSS\n };\n\n if (button.buttonClick && button.buttonClick(e, data) === false)\n return false;\n\n // Toggle source\n if (buttonName === \"source\") {\n \n // Show the iframe\n if (sourceMode(editor)) {\n delete editor.range;\n editor.$area.hide();\n editor.$frame.show();\n buttonDiv.title = button.title;\n }\n\n // Show the textarea\n else {\n editor.$frame.hide();\n editor.$area.show();\n\t\t\t\teditor.$main.find(\".cleditorSizing\").hide();\n buttonDiv.title = \"リッチテキストに切り替え\";//\"Show Rich Text\";\n }\n\n }\n\n // Check for rich text mode\n else if (!sourceMode(editor)) {\n\n // Handle popups\n if (popupName) {\n var $popup = $(popup),\n\t\t\t\t\tframeDocument=editor.$frame.contents(),\n\t\t\t\t\tframeBody=editor.$frame.contents().find(\"body\");\n\n // URL\n if (popupName === \"url\") {\n\n // Check for selection before showing the link url popup\n if (buttonName === \"link\" && selectedText(editor) === \"\") {\n showMessage(editor, \"A selection is required when inserting a link.\", buttonDiv);\n return false;\n }\n\n // Wire up the submit button click event handler\n $popup.children(\":button\")\n .off(CLICK)\n .on(CLICK, function () {\n\n // Insert the image or link if a url was entered\n var $text = $popup.find(\":text\"),\n url = $.trim($text.val());\n if (url !== \"\")\n execCommand(editor, data.command, url, null, data.button);\n\n // Reset the text, hide the popup and set focus\n $text.val(\"http://\");\n hidePopups();\n focus(editor);\n\n });\n\n }\n\n // Paste as Text\n else if (popupName === \"pastetext\") {\n\n // Wire up the submit button click event handler\n $popup.children(\":button\")\n .off(CLICK)\n .on(CLICK, function () {\n\n // Insert the unformatted text replacing new lines with break tags\n var $textarea = $popup.find(\"textarea\"),\n text = $textarea.val().replace(/\\n/g, \"<br />&#10;\");\n if (text !== \"\")\n execCommand(editor, data.command, text, null, data.button);\n\n // Reset the text, hide the popup and set focus\n $textarea.val(\"\");\n hidePopups();\n focus(editor);\n\n });\n\n }\n\n\t\t\t\t//insert textbox\n\t\t\t\telse if(buttonName === \"textbox\"){\n\n\t\t\t\t\t// Wire up the submit button click event handler\n $popup.children(\"div\")\n .off(CLICK)\n .on(CLICK, function (e) {\n\t\t\t\t\t\t// Build the html\n\t\t\t\t\t\tvar scrTop=$(frameBody).scrollTop(),\n\t\t\t\t\t\t\tvalue = $(e.target).css(\"background-color\"),\n\t\t\t\t\t\t\thtml = \"<textarea style='position:\"+editor.options.position+\";top:\"+scrTop\n\t\t\t\t\t\t\t\t\t+\"px;left:0px;width:100px;height:20px;background-color:\"\n\t\t\t\t\t\t\t\t\t+value+\";'></textarea>&#10;\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Insert the html\n\t\t\t\t\t\tif (html)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\texecCommand(editor,data.command,html,null,data.button);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thidePopups();\n focus(editor);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//insert table\n\t\t\t\telse if(buttonName === \"table\")\n\t\t\t\t{\t\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\n\t\t\t\t\t\t// Get the column and row count\n\t\t\t\t\t\tvar $text = $popup.find(\":text\"),\n\t\t\t\t\t\t\tcols = parseInt($text[0].value),\n\t\t\t\t\t\t\trows = parseInt($text[1].value);\n\n\t\t\t\t\t\t// Build the html\n\t\t\t\t\t\tvar html;\n\t\t\t\t\t\tif (cols > 0 && rows > 0) {\n\t\t\t\t\t\t\thtml=\"&#10;<table style='border-collapse:collapse;border:1px solid black;\"\n\t\t\t\t\t\t\t\t\t+\"background-color:white;position:\"+editor.options.position+\";top:0px;left:0px'>&#10;\";\n\t\t\t\t\t\t\tfor (y = 0; y < rows; y++) {\n\t\t\t\t\t\t\t\thtml += \"&#09;<tr>\";\n\t\t\t\t\t\t\t\tfor (x = 0; x < cols; x++)\n\t\t\t\t\t\t\t\t\thtml += \"<td style='border:1px solid black;min-width:30px;height:15px'></td>\";\n\t\t\t\t\t\t\t\thtml += \"</tr>&#10;\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += \"</table>&#10;<br />&#10;\";\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t// Insert the html\n\t\t\t\t\t\tif (html)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\texecCommand(editor,data.command,html,null,data.button);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Reset the text, hide the popup and set focus\n\t\t\t\t\t\t$text.val(\"4\");\n\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert rows and columns in table\n\t\t\t\telse if (buttonName === \"insertrowcol\")\n\t\t\t\t{\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\t// Get insert position\n\t\t\t\t\t\t\tvar $radi=$popup.find(\"input[name='insertFR']:checked\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get the column and row count\n\t\t\t\t\t\t\tvar $text = $popup.find(\":text\"),\n\t\t\t\t\t\t\t\tcols = parseInt($text[0].value),\n\t\t\t\t\t\t\t\trows = parseInt($text[1].value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Click event\n\t\t\t\t\t\t\tif($(focusedObj).closest(\"table\").length==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar html;\n\t\t\t\t\t\t\t\t//insert columns part\n\t\t\t\t\t\t\t\tif(cols>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thtml=$(\"<td style='\"+$(focusedObj).attr(\"style\")+\";min-width:2em'></td>\")\n\t\t\t\t\t\t\t\t\t\t.css({\"border-top\":objStyle.top,\"border-bottom\":objStyle.bottom,\n\t\t\t\t\t\t\t\t\t\t\t\t\"border-left\":objStyle.left,\"border-right\":objStyle.right});\n\t\t\t\t\t\t\t\t\t//Get current column index\n\t\t\t\t\t\t\t\t\tvar c=parseInt($(focusedObj).closest(\"tr\").children().index($(focusedObj)));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//loop each tr\n\t\t\t\t\t\t\t\t\tvar targetTable=$(focusedObj).closest(\"table\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(targetTable).find(\"tr\").each(function(idx,elem)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif($radi.val()===\"front\")\n\t\t\t\t\t\t\t\t\t\t{//front\n\t\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<cols;i++)\n\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\t\t$(elem).find(\"td:nth-child(\"+(1+c)+\")\").before(html[0].outerHTML);\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\telse\n\t\t\t\t\t\t\t\t\t\t{//rear\n\t\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<cols;i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$(elem).find(\"td:nth-child(\"+(1+c)+\")\").after(html[0].outeHTML);\n\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});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//insert rows part\n\t\t\t\t\t\t\t\tif(rows>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//Get current row\n\t\t\t\t\t\t\t\t\tvar thisTr=$(focusedObj).closest(\"tr\");\n\t\t\t\t\t\t\t\t\tvar r=parseInt($(thisTr).closest(\"table\").find(\"tr\").index());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//Get column number\n\t\t\t\t\t\t\t\t\tvar cs=$(thisTr).find(\"td\").length;\n\t\t\t\t\t\t\t\t\thtml=\"&#09;<tr style='\"+$(thisTr).attr(\"style\")+\"'>\";\n\t\t\t\t\t\t\t\t\t$(thisTr).find(\"td\").each(function(idx,elem)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\thtml+=$(\"<td style='\"+$(elem).attr(\"style\")+\";min-height:1em'></td>\")\n\t\t\t\t\t\t\t\t\t\t\t.css({\"border-top\":objStyle.top,\"border-bottom\":objStyle.bottom,\n\t\t\t\t\t\t\t\t\t\t\t\t\"border-left\":objStyle.left,\"border-right\":objStyle.right})[0].outerHTML;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\thtml+=\"</tr>&#10;\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($radi.val()===\"front\")\n\t\t\t\t\t\t\t\t\t{//front\n\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<rows;i++)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$(thisTr).before(html);\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\telse\n\t\t\t\t\t\t\t\t\t{//rear\n\t\t\t\t\t\t\t\t\t\t//insert columns\n\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<rows;i++)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$(thisTr).after(html);\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\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//off event -- cancel when click except table (include td)\n\t\t\t\t\t\t\teditor.$frame.contents().off(CLICK);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Reset the text\n\t\t\t\t\t\t\t$text.val(\"0\");\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//resize cell\n\t\t\t\telse if (buttonName === \"resizecell\")\n\t\t\t\t{\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\t// Get the column and row count\n\t\t\t\t\t\t\tvar $text = $popup.find(\":text\"),\n\t\t\t\t\t\t\t\twid = parseInt($text[0].value),\n\t\t\t\t\t\t\t\thei = parseInt($text[1].value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(focusedObj).is(\"td\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//change width size\n\t\t\t\t\t\t\t\tif(wid>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"min-width\",wid+\"px\");\n\t\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//change height size\n\t\t\t\t\t\t\t\tif(hei>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"height\",hei+\"px\");\n\t\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//off event -- cancel when click except table (include td)\n\t\t\t\t\t\t\teditor.$frame.contents().off(\"click\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Reset the text\n\t\t\t\t\t\t\t$text.val(\"0\");\t\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//border style\n\t\t\t\telse if (buttonName === \"borderstyle\")\n\t\t\t\t{\n\t\t\t\t\tvar borderColor,bdColor,bdImage,\n\t\t\t\t\t\tcurrentStyle=$(focusedObj).attr(\"style\"),\n\t\t\t\t\t\tcbs = $popup.find(\".appobj\");\n\t\t\t\t\t\t\n\t\t\t\t\t$popup.find(\".colorpicker\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e){\n\n\t\t\t\t\t\tvar rgbColor=$(e.target).css(\"background-color\")!=\"transparent\" ?\n\t\t\t\t\t\t\t\t\t\t$(e.target).css(\"background-color\") : \"0,0,0,0\";\n\t\t\t\t\t\tborderColor=$popup.find(\".bordersample\").css(\"border-color\");\n\t\t\t\t\t\tvar rgb=rgbColor.replace(\"rgb(\",\"\").replace(\"rgba(\",\"\").replace(\")\",\"\").split(\",\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$popup.find(\".rgbaColor.r\").val(parseInt(rgb[0]));\n\t\t\t\t\t\t$popup.find(\".rgbaColor.g\").val(parseInt(rgb[1]));\n\t\t\t\t\t\t$popup.find(\".rgbaColor.b\").val(parseInt(rgb[2]));\n\t\t\t\t\t\t$popup.find(\".rgbaColor.a\").val(rgb.length!=3 ? 0 : 1 );\n\t\t\t\t\t\tbdColor=\"rgba(\"+rgb[0]+\",\"+rgb[1]+\",\"+rgb[2]+\",\"+ (rgb.length!=3 ? 0 : 1)+\")\";\n\t\n\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bdColor);\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\tvar cb = $(popup).find(\"input[type=checkbox]\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//switch background color visibility by checkbox\n\t\t\t\t\t\tif($(cb[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(focusedObj).css(\"border-color\",bdColor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(focusedObj).css(\"border-color\",\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\n\t\t\t\t\t//drag and drop\n\t\t\t\t\tdndImage(\".sampleimage\",focusedObj,popup,buttonName);//sampleimage\n\t\t\t\t\t\n\t\t\t\t\t//on change RGBA number\n\t\t\t\t\t$popup.find(\".rgbaColor\")\n\t\t\t\t\t\t.on(\"change input paste\", function (e) {\n\t\t\t\t\t\t\tbdColor=\"rgba(\"+$popup.find(\".rgbaColor.r\").val()+\",\"+$popup.find(\".rgbaColor.g\").val()\n\t\t\t\t\t\t\t\t\t+\",\"+$popup.find(\".rgbaColor.b\").val()+\",\"+$popup.find(\".rgbaColor.a\").val()+\")\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bdColor);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-color\",bdColor);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t//on change Select tag\n\t\t\t\t\t$popup.find(\".border\")\n\t\t\t\t\t\t.on(\"change\",function(e){\n\t\t\t\t\t\t\t// Get the which positions are ON\n\t\t\t\t\t\t\tvar cb = $(popup).find(\"input[type=checkbox]\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//color\n\t\t\t\t\t\t\tfor(var i=0;i<4;i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-style\",$(popup).find(\".border.Style\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-width\",$(popup).find(\".border.Width\").val());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-style\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-width\",\"\");\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\t\n\t\t\t\t\t//on change Check Box \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change\",\"input[type=checkbox]\", function (e) {\n\t\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\t\tvar cb=$popup.find(\"input[type=checkbox]\");\n\n\t\t\t\t\t\t\t//remove all border (or initilize)\n\t\t\t\t\t\t\tif($(cb[4]).prop(\"checked\")==true && e.target==cb[4])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(cb).not(cb[4]).prop(\"checked\",false);\n\t\t\t\t\t\t\t\tif($(focusedObj).is(\"td\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border\",\"1px solid black\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border\",\"\");\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 if(e.target!=cb[4] && $(e.target).prop(\"checked\")==true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(cb[4]).prop(\"checked\",false);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//switch background color or image visibility by checkbox\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(var i=0;i<4;i++){\n\t\t\t\t\t\t\t\t//color\n\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-color\",bdColor);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-\"+$(cb[i]).val()+\"-color\",\"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//image\n\t\t\t\t\t\t\t\tif($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\"\");\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\t//on change check Box of image type \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change input\",\"input[type=radio],.imageOptions,.appobj\", function (e) {\n\t\t\t\t\t\t\tif($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//check selection with URL or Gradient\n\t\t\t\t\t\t\t\tif($popup.find(\"input[type=radio]:checked\").val()==\"url\" \n\t\t\t\t\t\t\t\t\t&& $popup.find(\".sampleimage\").css(\"background-image\").indexOf(\"url(\")!=-1\n\t\t\t\t\t\t\t\t\t&& $(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//URL\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".sampleimage\").css(\"background-image\"));\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-slice\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='slice']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-width\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='width']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-outset\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='outset']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-repeat\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='repeat']\").val());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//Gradient\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-source\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image\",\n\t\t\t\t\t\t\t\t\t\t($popup.find(\".imageOptions[name='repeat']\").val()==\"repeat\" ?\n\t\t\t\t\t\t\t\t\t\t\t\"repeating-linear-gradient(\" : \"linear-gradient(\") +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='angle']\").val() + \"deg,\" +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='colors']\").val() +\")\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-slice\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='slice']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-width\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='width']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-outset\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='outset']\").val());\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"border-image-repeat\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='repeat']\").val());\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\t\t\n\t\t\t\t\t// Wire up the apply button click event handler\n\t\t\t\t\t$popup.children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\t\t\t\t\t\t\tif($(e.target).prop(\"class\")==\"apply\")\n\t\t\t\t\t\t\t{//apply\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//stack current style\n\t\t\t\t\t\t\t\tcurrentStyle=$(focusedObj).attr(\"style\")\n\t\t\t\t\t\t\t\t//stack the border style of target object\n\t\t\t\t\t\t\t\tobjStyle.top=$(focusedObj).css(\"border-top\");\n\t\t\t\t\t\t\t\tobjStyle.bottom=$(focusedObj).css(\"border-bottom\");\n\t\t\t\t\t\t\t\tobjStyle.left=$(focusedObj).css(\"border-left\");\n\t\t\t\t\t\t\t\tobjStyle.right=$(focusedObj).css(\"border-right\");\n\n\t\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if($(e.target).prop(\"class\")==\"cancel\")\n\t\t\t\t\t\t\t{//cancel\n\t\t\t\t\t\t\t\t//roll back\n\t\t\t\t\t\t\t\t$(focusedObj).attr(\"style\",currentStyle);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{//close\n\t\t\t\t\t\t\t\t//off event\n\t\t\t\t\t\t\t\t$(frameDocument).off(CLICK);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//Changes background image and color\n\t\t\t\telse if (buttonName === \"background\")\n\t\t\t\t{\n\t\t\t\t\tvar imageObj,bgColor,\n\t\t\t\t\t\tcurrentBG=$(focusedObj).attr(\"style\"),\n\t\t\t\t\t\tcbs = $popup.find(\".appobj\");\t\n\t\t\t\t\t\n\t\t\t\t\t//Get clicked color code \n\t\t\t\t\t$popup.find(\".colorpicker\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\n\t\t\t\t\t\t\t//Get the background-color from color picker\n\t\t\t\t\t\t\tvar rgbColor=$(e.target).css(\"background-color\")!=\"transparent\" ?\n\t\t\t\t\t\t\t\t\t\t\t$(e.target).css(\"background-color\") : \"0,0,0,0\";\n\t\t\t\t\t\t\tbgColor=$popup.find(\".samplecolor\").css(\"background-color\");\n\t\t\t\t\t\t\tvar rgb=rgbColor.replace(\"rgb(\",\"\").replace(\"rgba(\",\"\").replace(\")\",\"\").split(\",\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.r\").val(parseInt(rgb[0]));\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.g\").val(parseInt(rgb[1]));\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.b\").val(parseInt(rgb[2]));\n\t\t\t\t\t\t\t$popup.find(\".rgbaColor.a\").val(rgb.length!=3 ? 0 : 1 );\n\t\t\t\t\t\t\tbgColor=\"rgba(\"+rgb[0]+\",\"+rgb[1]+\",\"+rgb[2]+\",\"+ (rgb.length!=3 ? 0 : 1)+\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bgColor);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\t\tvar cb = $popup.find(\"input[type=checkbox]\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//switch background color visibility by checkbox\n\t\t\t\t\t\t\tif($(cb[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-color\",bgColor);\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\t$(focusedObj).css(\"background-color\",\"\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t//drag and drop\n\t\t\t\t\tdndImage(\".sampleimage\",focusedObj,$popup,buttonName);\n\t\t\t\t\t\n\t\t\t\t\t//on change RGBA number\n\t\t\t\t\t$popup.find(\".rgbaColor\")\n\t\t\t\t\t\t.on(\"change\", function (e) {\n\t\t\t\t\t\t\t\tbgColor=\"rgba(\"+$popup.find(\".rgbaColor.r\").val()+\",\"+$popup.find(\".rgbaColor.g\").val()\n\t\t\t\t\t\t\t\t\t\t+\",\"+$popup.find(\".rgbaColor.b\").val()+\",\"+$popup.find(\".rgbaColor.a\").val()+\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$popup.find(\".samplecolor\").css(\"background-color\",bgColor);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//on change Check Box \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change\",\"input[type=checkbox]\", function (e) {\n\t\t\t\t\t\t\t\t// Get the which positions are change\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//switch background color or image visibility by checkbox\n\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-color\",bgColor);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-color\",\"\");\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($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\"url('\"+imageObj+\"')\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t//on change check Box of image type \n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change input\",\"input[type=radio],.imageOptions,.appobj\", function (e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar imageOptions=$popup.find(\".imageOptions[name='repeat']\");\t\n\t\t\t\t\t\t\t\t//check selection with URL or Gradient\n\t\t\t\t\t\t\t\tif($popup.find(\"input[type=radio]:checked\").val()==\"url\" \n\t\t\t\t\t\t\t\t\t&& $popup.find(\".sampleimage\").css(\"background-image\").indexOf(\"url(\")!=-1\n\t\t\t\t\t\t\t\t\t&& $(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//url\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".sampleimage\").css(\"background-image\"));\n\t\t\t\t\t\t\t\t\tif($(imageOptions).val()==\"cover\" || $(imageOptions).val()==\"contain\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-size\",\n\t\t\t\t\t\t\t\t\t\t\t$(imageOptions).val());\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\t$(focusedObj).css(\"background-repeat\",\n\t\t\t\t\t\t\t\t\t\t\t$(imageOptions).val());\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($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t{//gradient\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background-image\",\"\");\n\t\t\t\t\t\t\t\t\t$(focusedObj).css(\"background\",\n\t\t\t\t\t\t\t\t\t\t($popup.find(\".imageOptions[name='repeat']\").val()==\"repeat\" ?\n\t\t\t\t\t\t\t\t\t\t\t\"repeating-linear-gradient(\" : \"linear-gradient(\") +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='angle']\").val() + \"deg,\" +\n\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='colors']\").val() +\")\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t//Submit\n\t\t\t\t\t$popup.find(\"input[type='button']\") \n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\t\t\t\t\t\t\tbgColor=\"rgba(\"+$popup.find(\".rgbaColor.r\").val()+\",\"+$popup.find(\".rgbaColor.g\").val()+\",\"\n\t\t\t\t\t\t\t\t\t+$popup.find(\".rgbaColor.b\").val()+\",\"+$popup.find(\".rgbaColor.a\").val()+\")\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//forced fire when button was 'Apply to body'\n\t\t\t\t\t\t\tif($(e.target).prop(\"class\")==\".apply\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//Apply the image to cell\n\t\t\t\t\t\t\t\tdrawBackground(focusedObj);\n\t\t\t\t\t\t\t\tcurrentBG=$(focusedObj).attr(\"style\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if($(e.target).prop(\"class\")==\".cancel\")\n\t\t\t\t\t\t\t{//cancelation\n\t\t\t\t\t\t\t\t$(focusedObj).attr(\"style\",currentBG);\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\t//close\n\t\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//common draw procedure\n\t\t\t\t\t\t\tfunction drawBackground(target)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($(target).is(\"td\") || $(target).is(\"hr\") || $(target).is(\"body\")\n\t\t\t\t\t\t\t\t|| $(target).is(\"img\") || $(target).is(\"textarea\") || $(target).is(\"input\"))\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\tif($(cbs[0]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background\",\"\");\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-color\",bgColor);\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\tvar imageOptions=$popup.find(\".imageOptions[name='repeat']\");\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($popup.find(\"input[type=radio]:checked\").val()==\"url\" \n\t\t\t\t\t\t\t\t\t\t&& $popup.find(\".sampleimage\").css(\"background-image\").indexOf(\"url(\")!=-1\n\t\t\t\t\t\t\t\t\t\t&& $(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t\t{//url\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background\",\"\");\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-image\",\n\t\t\t\t\t\t\t\t\t\t\t$popup.find(\".sampleimage\").css(\"background-image\"));\n\t\t\t\t\t\t\t\t\t\tif($(imageOptions).val()==\"cover\" || $(imageOptions).val()==\"contain\")\n\t\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-size\",$(imageOptions).val());\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-repeat\",$(imageOptions).val());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if($(cbs[1]).prop(\"checked\")==true)\n\t\t\t\t\t\t\t\t\t{//gradient\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background-image\",\"\");\n\t\t\t\t\t\t\t\t\t\t$(target).css(\"background\",\n\t\t\t\t\t\t\t\t\t\t\t($popup.find(\".imageOptions[name='repeat']\").val()==\"repeat\" ?\n\t\t\t\t\t\t\t\t\t\t\t\t\"repeating-linear-gradient(\" : \"linear-gradient(\") +\n\t\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='angle']\").val() + \"deg,\" +\n\t\t\t\t\t\t\t\t\t\t\t$popup.find(\".imageOptions[name='colors']\").val() +\")\");\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//off event -- cancel when click except table (include td)\n\t\t\t\t\t\t\t\t$(frameDocument).off(\"click\");\n\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}\n\t\t\t\t\n\t\t\t\t//rotation\n\t\t\t\telse if (buttonName === \"rotation\")\n\t\t\t\t{\n\t\t\t\t\tvar target=\"\",defX,defY,defD,defS,$tempObj=$(focusedObj);\n\t\t\t\t\tif($(focusedObj).is(\"body\"))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(\"Please select object except body.\");\n\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t\tif($(focusedObj).is(\"td\") || $(focusedObj).is(\"th\"))\n\t\t\t\t\t\t\t$tempObj=$(focusedObj).closest(\"table\");\n\t\t\t\t\t\tif($tempObj.css(\"position\")==\"static\") $tempObj.css(\"position\",editor.options.position);\n\t\t\t\t\t\tvar tempPos= $tempObj.css(\"transform-origin\")!=undefined ? \n\t\t\t\t\t\t\t$tempObj.css(\"transform-origin\").split(\" \") : [0,0] ,\n\t\t\t\t\t\t\ttempD=$tempObj.css(\"transform\");\n\t\t\t\t\t\tdefX=parseInt(tempPos[0]);\n\t\t\t\t\t\tdefY=parseInt(tempPos[1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar tempH=$tempObj.outerHeight(),\n\t\t\t\t\t\t\ttempW=$tempObj.outerWidth();\n\t\t\t\t\t\t$popup.find(\".XPosition:nth-child(\"+(parseInt(defX/tempW*2)+1)+\")\").prop(\"selected\",true);\n\t\t\t\t\t\t$popup.find(\".YPosition:nth-child(\"+(parseInt(defY/tempH*2)+1)+\")\").prop(\"selected\",true);\n\t\t\t\t\t\tif(tempD==\"none\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdefD=0;\n\t\t\t\t\t\t\tdefS=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttempD=tempD.replace(\"matrix(\",\"\");\n\t\t\t\t\t\t\tvar aryD=tempD.split(\",\");\n\t\t\t\t\t\t\tdefD=Math.atan2(parseFloat(aryD[1]),parseFloat(aryD[0]))*180/Math.PI;\n\t\t\t\t\t\t\tdefS=Math.sqrt(Math.pow(parseFloat(aryD[0]),2)+Math.pow(parseFloat(aryD[1]),2));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$popup.find(\".deg\").val(defD);\n\t\t\t\t\t\n\t\t\t\t\t$popup\n\t\t\t\t\t\t.on(\"change input\",\".deg,.XPosition,.YPosition\",function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!$(focusedObj).is(\"html\") )\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tvar x=$popup.find(\".XPosition\").val(),\n\t\t\t\t\t\t\t\t\ty=$popup.find(\".YPosition\").val(),\n\t\t\t\t\t\t\t\t\tdeg=$popup.find(\".deg\").val();\n\t\t\t\t\t\t\t\t$tempObj.css({\"transform-origin\":x+\" \"+y,\n\t\t\t\t\t\t\t\t\t\"transform\":\"rotate(\"+deg+\"deg) scale(\"+defS+\")\"});\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\talert(\"Please select object.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t$popup.find(\"input[type='button']\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\tif($(e.target).attr(\"class\")!=\"apply\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tempObj.css({\"transform-origin\":defX+\" \"+defY,\n\t\t\t\t\t\t\t\t\t\"transform\":\"rotate(\"+defD+\"deg) scale(\"+defS+\")\"});\n\t\t\t\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//perspect\n\t\t\t\telse if (buttonName === \"perspect\")\n\t\t\t\t{\n\t\t\t\t\t$popup.find(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK,function(e) {\n\t\t\t\t\t\t\tvar perspect=$(e.target).attr(\"class\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tperspective(focusedObj,perspect);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t//perspective control\n\t\t\t\t\tfunction perspective(target,perspect)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar children=$(frameBody).children(),\n\t\t\t\t\t\t\tmaxid;\n\t\t\t\t\t\tzidx=0;\n\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($(item).css(\"z-index\")!=\"auto\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(zidx <= parseInt($(item).css(\"z-index\")))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tzidx=parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\tmaxid=idx;\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\t$(item).css(\"z-index\",$(children).index(item));\n\t\t\t\t\t\t\t\tif(zidx < parseInt($(children).index(item)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tzidx=parseInt($(children).index(item));\n\t\t\t\t\t\t\t\t\tmaxid=idx;\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\tif(perspect ==\"toFront\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar z=parseInt($(target).css(\"z-index\"));\n\t\t\t\t\t\t\tvar dz= (zidx - z) < 0 ? 0 : zidx -z ;\n\t\t\t\t\t\t\tvar pair=maxid;\t\n\t\t\t\t\t\t\t//check if same value as z was existed\n\t\t\t\t\t\t\tif(dz!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(idx != $(children).index(target))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar c = parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\t\tif(dz>c-z && c-z > 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdz=c-z;\n\t\t\t\t\t\t\t\t\t\t\tpair=idx;\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\t//convert\n\t\t\t\t\t\t\t\t$(target).css(\"z-index\",z+dz);\n\t\t\t\t\t\t\t\t$($(children).get(pair)).css(\"z-index\",z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(perspect == \"toBack\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar z=parseInt($(target).css(\"z-index\"));\n\t\t\t\t\t\t\tvar dz= z,\n\t\t\t\t\t\t\t\tpair=parseInt($(children).index(target));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//check if same value as z was existed\n\t\t\t\t\t\t\tif(dz>0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(idx != $(children).index(target))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar c = parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\t\tif(dz>=z-c && z-c >= 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdz=z-c;\n\t\t\t\t\t\t\t\t\t\t\tpair=idx;\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(z,c,idx);\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\t//convert\n\t\t\t\t\t\t\t\t$(target).css(\"z-index\",z - dz);\n\t\t\t\t\t\t\t\t$($(children).get(pair)).css(\"z-index\",z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(perspect == \"toMostFront\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tzidx++;\n\t\t\t\t\t\t\t$(target).css(\"z-index\",zidx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(perspect == \"toMostBack\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$(target).css(\"z-index\",0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(children).each(function(idx,item)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(idx != $(children).index(target))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar zz=parseInt($(item).css(\"z-index\"));\n\t\t\t\t\t\t\t\t\tzz++;\n\t\t\t\t\t\t\t\t\t$(item).css(\"z-index\",zz);\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\teditor.updateTextArea();//update iframe\n\t\t\t\t\t\teditor.$frame.contents().off(\"click\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//body style\n\t\t\t\telse if (buttonName === \"bodystyle\")\n\t\t\t\t{\n\t\t\t\t\t//insert style of body\n\t\t\t\t\t$popup.find(\"textarea\").val($(frameBody).attr(\"style\"));\n\t\t\t\t\t//Submit\n\t\t\t\t\t$popup.find(\"input[type='button']\") //children(\":button\")\n\t\t\t\t\t\t.off(CLICK)\n\t\t\t\t\t\t.on(CLICK, function (e) {\n\t\t\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\t\t\teditor.focus();\n\t\t\t\t\t\t\treturn false;\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t}\n\n // Show the popup if not already showing for this button\n if (buttonDiv !== $.data(popup, BUTTON)) {\n showPopup(editor, popup, buttonDiv);\n return false; // stop propagination to document click\n }\n\n // propaginate to document click\n return;\n\n }\n\t\t\t\n\t\t\t\n // Print\n else if (buttonName === \"print\")\n editor.$frame[0].contentWindow.print();\n\n // All other buttons\n else if (!execCommand(editor, data.command, data.value, data.useCSS, buttonDiv))\n return false;\n\n }\n\n // Focus the editor\n focus(editor);\n\n }", "function createEnglish(){\r\n\tdocument.form3.box2.value = \"Is \" + englishProfileID + \" interested in \" + englishActivity + \"(\" + englishAmbience + \r\n\t\"). It would be for \" + englishMinRSVP + \" to \" + englishMaxRSVP + \r\n\t\" people, \" + \"on \" + (englishStartDate == \"any day\" && englishEndDate == \"any day\" ? \"any day\" : (englishStartDate == englishEndDate ? englishStartDate : englishStartDate+ \" to \" +englishEndDate)) + \" between \" + \r\n\t(englishStartTime == \"any time\" && englishEndTime == \"any time\" ? \"any time\" : englishStartTime + \" to \" +englishEndTime) + \", at \" + englishLocation + \".\"\r\n\r\n}", "function createButton(text) {\n return $('<button data-value=\"' + text + '\" class=\"btn btn-secondary team-select\" onclick=\"showFlashMessage()\">')\n .text(text);\n}" ]
[ "0.72561747", "0.71684843", "0.69686013", "0.69333094", "0.6896625", "0.6682281", "0.6462629", "0.6349651", "0.6345955", "0.6344748", "0.6343344", "0.6324895", "0.62957805", "0.6281294", "0.6230471", "0.6219936", "0.6193364", "0.61436146", "0.61398196", "0.61309975", "0.612114", "0.61010635", "0.60898656", "0.60461694", "0.60435754", "0.60371035", "0.60261154", "0.60258627", "0.6018648", "0.6016371", "0.599441", "0.5991799", "0.5976621", "0.59519327", "0.5927226", "0.5922227", "0.59156156", "0.58815944", "0.58692306", "0.58582395", "0.58536446", "0.58182", "0.58018637", "0.57865715", "0.5784172", "0.57589275", "0.57503587", "0.5745505", "0.57333386", "0.573011", "0.5727448", "0.5709248", "0.5708612", "0.5702119", "0.5691313", "0.5686576", "0.5665949", "0.56543314", "0.5623614", "0.562318", "0.5621009", "0.5620636", "0.5615926", "0.55895346", "0.5589451", "0.5586772", "0.55866444", "0.55792105", "0.5577729", "0.5574906", "0.5574173", "0.5573788", "0.55721885", "0.5571505", "0.5567703", "0.55553454", "0.5553131", "0.554271", "0.5538566", "0.5538251", "0.5534388", "0.5522347", "0.55144906", "0.5511076", "0.5509544", "0.5500369", "0.5498688", "0.5497484", "0.5496087", "0.54840785", "0.5478336", "0.5473577", "0.5466035", "0.5465275", "0.546438", "0.5462093", "0.5457445", "0.5444832", "0.5444159", "0.54433984" ]
0.6639893
6
Create an scoped async function in the hook
async function setProductArguments() { const groupedData = await Object.values(groupBy(products, "categoryId")); let resp = []; for (let p = 0; p < groupedData.length; p++) { const selectedCategory = await getCategoryName( groupedData[p][0].categoryId ); if (selectedCategory) { const obj = { name: selectedCategory.name, value: groupedData[p].length, }; resp.push(obj); } } setResData(resp); setActiveIndex(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}", "function wrap (fn) {\n var res\n\n // create anonymous resource\n if (asyncHooks.AsyncResource) {\n res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')\n }\n\n // incompatible node.js\n if (!res || !res.runInAsyncScope) {\n return fn\n }\n\n // return bound function\n return res.runInAsyncScope.bind(res, fn, null)\n}", "async function MyAsyncFn () {}", "function Async(fun, hook) {\n\tthis.fun = fun;\n\tthis.hook = hook;\n}", "static async method(){}", "registerHooks() {\n S.addHook(this._hookPostFuncCreate.bind(this), {\n action: 'functionCreate',\n event: 'post'\n });\n\n return BbPromise.resolve();\n }", "function useAsync() {\n var async = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return new _fluentui_utilities__WEBPACK_IMPORTED_MODULE_2__.Async(); });\n // Function that returns a function in order to dispose the async instance on unmount\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { return function () { return async.dispose(); }; }, [async]);\n return async;\n}", "function useAsync() {\n var async = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return new _fluentui_utilities__WEBPACK_IMPORTED_MODULE_2__.Async(); });\n // Function that returns a function in order to dispose the async instance on unmount\n react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { return function () { return async.dispose(); }; }, [async]);\n return async;\n}", "async function asyncFn(){\n\n return 1;\n}", "async function myFunc() {\n // Function body here\n }", "async function named_async_resolve() {\n return 42;\n }", "async function f(){\n return something\n}", "async function myFunc() {\n return 'Hello';\n}", "async function foo() {\n return 1\n}", "async function myFn() {\n // wait\n}", "async init() {\n\n }", "function addHook (name, fn) {\n throwIfAlreadyStarted('Cannot call \"addHook\" when fastify instance is already started!')\n\n if (name === 'onSend' || name === 'preSerialization' || name === 'onError' || name === 'preParsing') {\n if (fn.constructor.name === 'AsyncFunction' && fn.length === 4) {\n throw new Error('Async function has too many arguments. Async hooks should not use the \\'done\\' argument.')\n }\n } else if (name === 'onReady') {\n if (fn.constructor.name === 'AsyncFunction' && fn.length !== 0) {\n throw new Error('Async function has too many arguments. Async hooks should not use the \\'done\\' argument.')\n }\n } else {\n if (fn.constructor.name === 'AsyncFunction' && fn.length === 3) {\n throw new Error('Async function has too many arguments. Async hooks should not use the \\'done\\' argument.')\n }\n }\n\n if (name === 'onClose') {\n this.onClose(fn)\n } else if (name === 'onReady') {\n this[kHooks].add(name, fn)\n } else if (name === 'onRoute') {\n this[kHooks].validate(name, fn)\n this[kHooks].add(name, fn)\n } else {\n this.after((err, done) => {\n _addHook.call(this, name, fn)\n done(err)\n })\n }\n return this\n\n function _addHook (name, fn) {\n this[kHooks].add(name, fn)\n this[kChildren].forEach(child => _addHook.call(child, name, fn))\n }\n }", "async function WrapperForAsyncFunc() {\n const result = await AsyncFunction();\n console.log(result);\n}", "constructor() {\n\t\treturn (async() => {\n\t\t\treturn this;\n\t\t})();\n\t}", "constructor() {\n\t\treturn (async() => {\n\t\t\treturn this;\n\t\t})();\n\t}", "constructor() {\n\t\treturn (async() => {\n\t\t\treturn this;\n\t\t})();\n\t}", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n __WEBPACK_IMPORTED_MODULE_0__promise_external__[\"c\" /* resolve */](true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n __WEBPACK_IMPORTED_MODULE_0__promise_external__[\"c\" /* resolve */](true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "async function myFn() {\n await console.log('testing');\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n __WEBPACK_IMPORTED_MODULE_0__promise_external__[\"b\" /* resolve */](true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n __WEBPACK_IMPORTED_MODULE_0__promise_external__[\"b\" /* resolve */](true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function wrapInPromiseAsync(asyncFunc){\r\n var promise = new Promise(async((resolve, reject) => {\r\n resolve(await(asyncFunc()));\r\n }));\r\n return promise;\r\n}", "registerHooks() {\n\n S.addHook(this._hookPre.bind(this), {\n action: 'functionRun',\n event: 'pre'\n });\n\n S.addHook(this._hookPost.bind(this), {\n action: 'functionRun',\n event: 'post'\n });\n\n return BbPromise.resolve();\n }", "async function test() {}", "async function asyncFunction(arg) {\r\n return arg;\r\n}", "registerAsyncServerFunc(name, func, override = false) {\n const asyncVariant = (...args) => {\n const fargs = args.slice(0, args.length - 1);\n const callback = args[args.length - 1];\n const promise = func(...fargs);\n promise.then((rv) => {\n callback(this.scalar(4 /* kReturn */, \"int32\"), rv);\n });\n };\n this.registerFunc(\"__async.\" + name, asyncVariant, override);\n }", "init (asyncId, type, triggersAsyncId, resource) {\n fs.writeSync(1, \"\\n\\t>>>>>> Hook init <<<<<<<<\"+asyncId+\"\\n\")\n }", "async function f() {\n return 1;\n }", "async function f() {\n return 1;\n }", "function asyncGate() {\n const pendingPromises = {};\n\n return async function execute(key, f) {\n if(pendingPromises[key]) {\n return await pendingPromises[key];\n }\n\n pendingPromises[key] = f();\n\n try {\n return await pendingPromises[key];\n } finally {\n delete pendingPromises[key];\n }\n }\n}", "async function wrapperForAsyncFunc() {\n const result1 = await AsyncFunction1();\n console.log(result1);\n const result2 = await AsyncFunction2();\n console.log(result2);\n}", "async function func() {\n return 1;\n}", "async function fetchAsync(func) { // eslint-disable-line no-unused-vars\r\n const response = await func();\r\n return response;\r\n}", "do(func) {\n return async && data instanceof Promise\n ? using(data.then(func), async)\n : using(func(data), async)\n }", "function async(f) {\n throw Error(\"Not implemented.\");\n Packages.net.appjet.ajstdlib.execution.runAsync(appjet.context, f);\n}", "function useAsync(asyncFn, onSuccess) {\n useEffect(() => {\n let isActive = true\n asyncFn().then((data) => {\n if (isActive) onSuccess(data)\n else console.log('aborted setState on unmounted component')\n })\n return () => {\n isActive = false\n }\n }, [asyncFn, onSuccess])\n}", "static using(config, handler) {\n return Promise.using(Client.disposer(config), handler);\n }", "async method(){}", "function promisifyLifeCycleFunction(originalFn, env) {return function (fn, timeout) {if (!fn) {return originalFn.call(env);}const hasDoneCallback = fn.length > 0;if (hasDoneCallback) {// Jasmine will handle it\n return originalFn.call(env, fn, timeout);\n }\n\n // We make *all* functions async and run `done` right away if they\n // didn't return a promise.\n const asyncFn = function (done) {\n const returnValue = fn.call({});\n\n if (isPromise(returnValue)) {\n returnValue.then(done, done.fail);\n } else {\n done();\n }\n };\n\n return originalFn.call(env, asyncFn, timeout);\n };\n}", "async function f() {\n return 1;\n}", "async init () {}", "async init() {}", "async init() {}", "function createThunk(actorOptions, fn) {\n const useActor = fn.length; \n\n // this function always return promise\n return function() {\n if(useActor) {\n actorOptions = actorOptions || {};\n const actor = new Actor(actorOptions).runner(mocha.runner);\n\n this instanceof Context && actor.context(this);\n\n const retVal = fn.apply(this, [actor].concat(arguments));\n\n return Promise.resolve(retVal).finally(() => actor.quit());\n }\n\n return Promise.resolve(fn.apply(this, arguments));\n }\n }", "function wrapper() {\n var num = self.counter++;\n var id = createId(prefix, num);\n\n var token = {\n name: name,\n async: !!fn.async,\n prefix: prefix,\n num: num,\n id: id,\n fn: fn,\n args: [].slice.call(arguments)\n };\n\n define(token, 'context', this);\n stash[id] = token;\n return id;\n }", "async function myAsyncFunction(arg) {\n return `Your argument is: ${arg}`\n}", "async function asyncFn() {\n return value;\n }", "async function asyncFn() {\n return value;\n }", "function async(f) {\n\t return function () {\n\t var argsToForward = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t argsToForward[_i] = arguments[_i];\n\t }\n\t promiseimpl.resolve(true).then(function () {\n\t f.apply(null, argsToForward);\n\t });\n\t };\n\t}", "function asyncHandler(fn) {\n return function(req, res, next) {\n return Promise.resolve(fn(req, res, next).catch(next));\n };\n}", "async function fetchAsyncSave(func, data) { // eslint-disable-line no-unused-vars\r\n const response = await func(data);\r\n return response;\r\n}", "function asyncTrigger() {\n var _checks = [];\n \n return {\n push: function(fn) {\n _checks.push(fn);\n },\n \n check: function() {\n for (var check = 0; check < _checks.length; ++check) {\n _checks[check]();\n }\n \n _checks.splice(0, _checks.length);\n }\n };\n }", "setAsyncContextIdPromise(contextId, promise) {\n const promiseId = getPromiseId(promise);\n\n // if (!promiseId) {\n\n // }\n\n const context = executionContextCollection.getById(contextId);\n if (context) {\n this.setAsyncContextPromise(context, promiseId);\n }\n\n // old version\n // TODO: remove the following part → this does not work if async function has no await!\n const lastAwaitData = this.lastAwaitByRealContext.get(contextId);\n\n // eslint-disable-next-line max-len\n // this.logger.warn(`[traceCallPromiseResult] trace=${traceCollection.makeTraceInfo(trace.traceId)}, lastContextId=${executionContextCollection.getLastRealContext(this._runtime.getLastPoppedContextId())?.contextId}`, calledContext?.contextId,\n // lastAwaitData);\n\n if (lastAwaitData) {\n lastAwaitData.asyncFunctionPromiseId = promiseId;\n\n // NOTE: the function has already returned -> the first `preAwait` was already executed (but not sent yet)\n // [edit-after-send]\n const lastUpdate = asyncEventUpdateCollection.getById(lastAwaitData.updateId);\n lastUpdate.promiseId = promiseId;\n }\n return lastAwaitData;\n }", "function withAsyncContext(getAwaitable) {\n const ctx = runtime_core_esm_bundler_getCurrentInstance();\n if (false) {}\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if (isPromise(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "function asyncHelper () {\n\tlet f, r\n\tconst prm = new Promise((_f, _r)=>{f = _f, r = _r})\n\tfunction done(...x){\n\t\treturn x.length === 0 ? f() : r(x[0])\n\t}\n\tdone.then = prm.then.bind(prm)\n\tdone.catch = prm.catch.bind(prm)\n\tdone.finally = prm.finally.bind(prm)\n\treturn done\n}", "function async(fn, onError) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n LocalPromise.resolve(true).then(function () {\n fn.apply(undefined, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function async(fn, onError) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n LocalPromise.resolve(true).then(function () {\n fn.apply(undefined, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n let awaitable = getAwaitable();\n setCurrentInstance(null);\n if (isPromise(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "function async(fn, onError) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n }", "async initialize() {\n\n }", "async initialize() {\n\n }", "async function bar(){\r\n\tconsole.log(\"bar\")\r\n}", "static LoadFromFileAsync() {}", "function makeFunctionAPI(genFn) {\n const fns = {\n sync: function(...args) {\n return evaluateSync(genFn.apply(this, args));\n },\n async: function(...args) {\n return new Promise((resolve, reject) => {\n evaluateAsync(genFn.apply(this, args), resolve, reject);\n });\n },\n errback: function(...args) {\n const cb = args.pop();\n if (typeof cb !== \"function\") {\n throw makeError(\n \"Asynchronous function called without callback\",\n GENSYNC_ERRBACK_NO_CALLBACK\n );\n }\n\n let gen;\n try {\n gen = genFn.apply(this, args);\n } catch (err) {\n cb(err);\n return;\n }\n\n evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n },\n };\n return fns;\n}", "function makeFunctionAPI(genFn) {\n const fns = {\n sync: function(...args) {\n return evaluateSync(genFn.apply(this, args));\n },\n async: function(...args) {\n return new Promise((resolve, reject) => {\n evaluateAsync(genFn.apply(this, args), resolve, reject);\n });\n },\n errback: function(...args) {\n const cb = args.pop();\n if (typeof cb !== \"function\") {\n throw makeError(\n \"Asynchronous function called without callback\",\n GENSYNC_ERRBACK_NO_CALLBACK\n );\n }\n\n let gen;\n try {\n gen = genFn.apply(this, args);\n } catch (err) {\n cb(err);\n return;\n }\n\n evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n },\n };\n return fns;\n}", "function makeFunctionAPI(genFn) {\n const fns = {\n sync: function(...args) {\n return evaluateSync(genFn.apply(this, args));\n },\n async: function(...args) {\n return new Promise((resolve, reject) => {\n evaluateAsync(genFn.apply(this, args), resolve, reject);\n });\n },\n errback: function(...args) {\n const cb = args.pop();\n if (typeof cb !== \"function\") {\n throw makeError(\n \"Asynchronous function called without callback\",\n GENSYNC_ERRBACK_NO_CALLBACK\n );\n }\n\n let gen;\n try {\n gen = genFn.apply(this, args);\n } catch (err) {\n cb(err);\n return;\n }\n\n evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n },\n };\n return fns;\n}", "function makeFunctionAPI(genFn) {\n const fns = {\n sync: function(...args) {\n return evaluateSync(genFn.apply(this, args));\n },\n async: function(...args) {\n return new Promise((resolve, reject) => {\n evaluateAsync(genFn.apply(this, args), resolve, reject);\n });\n },\n errback: function(...args) {\n const cb = args.pop();\n if (typeof cb !== \"function\") {\n throw makeError(\n \"Asynchronous function called without callback\",\n GENSYNC_ERRBACK_NO_CALLBACK\n );\n }\n\n let gen;\n try {\n gen = genFn.apply(this, args);\n } catch (err) {\n cb(err);\n return;\n }\n\n evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n },\n };\n return fns;\n}", "_hookPostFuncCreate(evt) {\n // TODO: only run with runtime node4.3\n if (evt.options.runtime != 'nodejs4.3') {\n console.log(evt.options.runtime);\n return;\n }\n let parsedPath = path.parse(evt.options.path);\n let funcName = parsedPath.base;\n\n return createTest(funcName);\n }", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (( true) && !ctx) {\n warn(`withAsyncContext called without active current instance. ` +\n `This is likely a bug.`);\n }\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "function withAsyncContext(getAwaitable) {\n const ctx = getCurrentInstance();\n if (( true) && !ctx) {\n warn(`withAsyncContext called without active current instance. ` +\n `This is likely a bug.`);\n }\n let awaitable = getAwaitable();\n unsetCurrentInstance();\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isPromise)(awaitable)) {\n awaitable = awaitable.catch(e => {\n setCurrentInstance(ctx);\n throw e;\n });\n }\n return [awaitable, () => setCurrentInstance(ctx)];\n}", "function async(fn, onError) {\n\t return function () {\n\t var args = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t _promise.PromiseImpl.resolve(true).then(function () {\n\t fn.apply(void 0, args);\n\t }).catch(function (error) {\n\t if (onError) {\n\t onError(error);\n\t }\n\t });\n\t };\n\t}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n promiseimpl.resolve(true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n promiseimpl.resolve(true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }", "async created() {\n\n\t}", "async created() {\n\n\t}", "AsyncCode()\n {\n\n }", "async init () {\r\n return;\r\n }", "function makeFunctionAPI(genFn) {\n\t const fns = {\n\t sync: function(...args) {\n\t return evaluateSync(genFn.apply(this, args));\n\t },\n\t async: function(...args) {\n\t return new Promise((resolve, reject) => {\n\t evaluateAsync(genFn.apply(this, args), resolve, reject);\n\t });\n\t },\n\t errback: function(...args) {\n\t const cb = args.pop();\n\t if (typeof cb !== \"function\") {\n\t throw makeError(\n\t \"Asynchronous function called without callback\",\n\t GENSYNC_ERRBACK_NO_CALLBACK\n\t );\n\t }\n\n\t let gen;\n\t try {\n\t gen = genFn.apply(this, args);\n\t } catch (err) {\n\t cb(err);\n\t return;\n\t }\n\n\t evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n\t },\n\t };\n\t return fns;\n\t}", "function ARandomAsyncFunction(toIncrease) {\n setTimeout(() => {\n toIncrease.value++\n /*\n (3)\n When we see this value it should be the value of result,\n which is defined on line 10, but moduified. This is to prove\n that line 27 did actually do something.\n */\n console.log(`INSIDE: ARandomAsyncFunction and result at this point is: ${result.value}`)\n }, 500)\n\n}", "function wrapTaskFunction(fn, ctx) {\n return fn.call(ctx, () => ({\n /* ??? in which situation does this */\n }));\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n resolve(true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function async(f) {\n return function () {\n var argsToForward = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argsToForward[_i] = arguments[_i];\n }\n resolve(true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "async init () {\r\n debug.log('called init');\r\n return;\r\n }", "function async(fn, onError) {\r\n return (...args) => {\r\n Promise.resolve(true)\r\n .then(() => {\r\n fn(...args);\r\n })\r\n .catch((error) => {\r\n if (onError) {\r\n onError(error);\r\n }\r\n });\r\n };\r\n}", "createRuntimeCatalogue() {\n\n let _this = this;\n let factory = {\n createHttpRequest: function() {\n return _this.createHttpRequest();\n }\n };\n\n return new RuntimeCatalogueLocal(factory);\n\n }", "function reusable_fun (mtd, url, asyn) {\n let myPromise = new Promise( (resolve,reject) => {\n let xhttp = new XMLHttpRequest();\n xhttp.open(mtd, url, asyn);\n xhttp.onreadystatechange = () => {\n if(xhttp.readyState == 4 && xhttp.status == 200){\n resolve(xhttp.responseText); \n } else if (xhttp.status > 399){\n reject(xhttp.status); \n }\n };\n xhttp.send();\n });\n return myPromise;\n}", "function web3AsynWrapper(web3Fun) {\n return function (arg) {\n return new Promise((resolve, reject) => {\n web3Fun(arg, (e, data) => e ? reject(e) : resolve(data))\n })\n }\n}", "async function myPromise (){\n return \"This is my promise\"\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 }", "_onTagClickFactory(tag) {\n const self = this;\n return onClick;\n /**\n * Callback invoked upon clicking a tag.\n *\n * @private\n * @param event - event object\n * @returns promise which resolves upon attempting to switch tags\n */\n async function onClick() {\n if (!self.props.branching) {\n showErrorMessage('Checkout tags is disabled', CHANGES_ERR_MSG);\n return;\n }\n self.props.logger.log({\n level: Level.RUNNING,\n message: 'Checking tag out...'\n });\n try {\n await self.props.model.checkoutTag(tag);\n }\n catch (err) {\n return onTagError(err, self.props.logger);\n }\n self.props.logger.log({\n level: Level.SUCCESS,\n message: 'Tag checkout.'\n });\n }\n }", "function async(f) {\n return function () {\n for (var _len = arguments.length, argsToForward = Array(_len), _key = 0; _key < _len; _key++) {\n argsToForward[_key] = arguments[_key];\n }\n\n promiseimpl.resolve(true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function async(f) {\n return function () {\n for (var _len = arguments.length, argsToForward = Array(_len), _key = 0; _key < _len; _key++) {\n argsToForward[_key] = arguments[_key];\n }\n\n promiseimpl.resolve(true).then(function () {\n f.apply(null, argsToForward);\n });\n };\n}", "function asyncInIE (f) {\n f();\n }", "async function makeUpYourOwnFunctionNameFnc(resolvAfterSec) {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve();\n }, resolvAfterSec * 1000);\n });\n }" ]
[ "0.66866744", "0.66866744", "0.6644987", "0.6118714", "0.6091471", "0.5942721", "0.5905155", "0.5905155", "0.5902095", "0.5853605", "0.5828594", "0.5798704", "0.5755112", "0.5700276", "0.5678251", "0.56761515", "0.5663224", "0.56525004", "0.5644326", "0.5644326", "0.5644326", "0.5639687", "0.56325686", "0.56325686", "0.56287545", "0.56173444", "0.56173444", "0.55322224", "0.5523746", "0.55197644", "0.5512456", "0.54744506", "0.5457705", "0.5441646", "0.5441646", "0.5408472", "0.54041487", "0.54006827", "0.5397852", "0.53857267", "0.53854567", "0.5380669", "0.5364113", "0.5350741", "0.53493065", "0.5331672", "0.5322487", "0.5320578", "0.5320578", "0.5313634", "0.53113353", "0.53000486", "0.52598923", "0.52598923", "0.5244055", "0.5240395", "0.5209075", "0.5189816", "0.5180717", "0.514568", "0.5130127", "0.5126221", "0.5126221", "0.5125564", "0.5116392", "0.51100606", "0.51100606", "0.510022", "0.5095485", "0.50914866", "0.50914866", "0.50914866", "0.50914866", "0.5082454", "0.50752056", "0.50752056", "0.50712025", "0.5070878", "0.5070878", "0.50686646", "0.50589514", "0.50589514", "0.5056879", "0.5054145", "0.50504917", "0.5044953", "0.5043938", "0.50428945", "0.50428945", "0.504066", "0.50349736", "0.50316507", "0.502626", "0.5025324", "0.5024484", "0.5022756", "0.5018611", "0.5014469", "0.5014469", "0.5010205", "0.5009152" ]
0.0
-1
remove the currently rendered filter from the popup
function removeFilter(evt) { if (!evt) return; const filter = getID(evt.target); if (!filter) return; stylingID = document.getElementById("styleID"); filterID = document.getElementById("filterID"); if (stylingID && filterID) { stylingID.remove(); filterID.remove(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFilter() {\n vm.filterApplied = null;\n activate();\n }", "function removeFilter(){\r\n\t$('.filter_btn').remove();\r\n\t$('.filter_btn_wrap').remove();\r\n\t$('#filter_tools').children().remove();\r\n}", "function closeFilterPopup() {\n properties.screen.closePopup(properties.filterPopupName);\n }", "clearFiltersAndShow() {\n this.clearFilters(true);\n this.show();\n }", "function clearFilterTag() {\n lastFilter = null;\n hideClearFilterBtn();\n // Show all articles\n SetNodesVisibility(\"article\", true);\n // Show all sections\n SetNodesVisibility(\"section\", true);\n}", "doDestroy() {\n const me = this;\n me.filterTip && me.filterTip.destroy();\n me.filterEditorPopup && me.filterEditorPopup.destroy();\n me.store.un({\n sort: me.onStoreFilter\n }, me);\n super.doDestroy();\n }", "function removeCompanyFilter() {\n currentCompany = \"\";\n document.getElementById('reset-company-filter').style.display = \"none\";\n filterAll();\n}", "function hideFilter() {\n svg.selectAll('.coursesoverview_split').remove();\n }", "function unapply() {\n status.applied = false;\n validationOptionElement.classList.remove(\"gallery-filter-button-selected\");\n }", "function cancelFilters() {\n $scope.filters = angular.copy($scope.appliedFilters);\n }", "closeFilterEditor() {\n const me = this;\n\n // Must defer the destroy because it may be closed by an event like a \"change\" event where\n // there may be plenty of code left to execute which must not execute on destroyed objects.\n me.filterEditorPopup && me.filterEditorPopup.setTimeout(me.filterEditorPopup.destroy);\n me.filterEditorPopup = null;\n }", "clearFilter() {\n if (!this.settings.filterable) {\n return;\n }\n\n this.clearFilterFields();\n\n this.applyFilter();\n this.element.trigger('filtered', { op: 'clear', conditions: [] });\n }", "function unfilter() {\n\td3.event.preventDefault();\n\n\t// remove all filters\n\tdocument.getElementById('datetime').value = '';\n\tdocument.getElementById('state-dropdown').selectedIndex = 0;\n\tdocument.getElementById('shape-dropdown').selectedIndex = 0;\n\n\t// show original table\n\tshowTable(tableData);\n}", "function clearFilters() {\n genderFilter();\n $('#day-filter-btn').html(\"Any Location\")\n $('#city-filter-btn').html(\"Any Day\")\n $('#childcare-filter-btn').html(\"Childcare\")\n }", "remove() {\n if (this.canRemove()) {\n this.scope_.$emit('filterbuilder.remove', this['selected']);\n }\n }", "removeAllFilters() {}", "function removeSameFilterAs(filterName) {\n var selectedFilter = $(FilterMarkup.SELECTEDFILTERS).children(\"span[name='\" + filterName + \"']\");\n if (selectedFilter.length !== 0)\n selectedFilter.remove();\n}", "function clearFilter(map) {\n console.log(\"Clearing\");\n map.eachLayer(function(layer) {\n if (layer.feature) {\n layer.getElement().style.display = 'inline';\n };\n });\n}", "removeSelf() {\n // triggered by clicking the exit button\n this.holder.remove()\n // take self out of the filter list on the AltHolder ob\n // this is a function set by the AltHolder on each row it creates\n this.removeFromList(this)\n }", "function clearFilters(ui) {\n ui.withFilters({});\n}", "closeFilterEditor() {\n const me = this; // Must defer the destroy because it may be closed by an event like a \"change\" event where\n // there may be plenty of code left to execute which must not execute on destroyed objects.\n\n me.filterEditorPopup && me.filterEditorPopup.setTimeout(me.filterEditorPopup.destroy);\n me.filterEditorPopup = null;\n }", "_clearFilterInput() {\r\n const that = this;\r\n\r\n that._filterInfo.query = '';\r\n delete that._filterInfo.inputFilters;\r\n that.$.filterInput.value = '';\r\n }", "function hideFilter() {\n $('.filter-close-btn').on('click', function(){\n $(this).removeClass('show-filter-close-btn');\n \n $('.filter-menu-wrapper').css('height', '40');\n localStorage.setItem(\"active-filter\", \"close\");\n });\n}", "disconnectedCallback() {\n document.removeEventListener(\n customEvents.FILTER_SUBSCRIPTIONS, this.filterView_);\n }", "function clearColumnFilter() {\n\n // Get the column filter object for this popup instance\n var filter = properties.activeColumn.enhancedTable.filter;\n\n // Nullify this individual columns filter data\n filter.position = null;\n filter.set = [];\n filter.concatType = null;\n\n // Re sort the filter columns, setting up for updating the header display\n properties.filterColumns = _.sortBy(properties.filterColumns, function (item) {\n return item.enhancedTable.filter.position == null ? 10000 : item.enhancedTable.filter.position;\n });\n\n // Recalculate the sortPosition property, for use in the header display\n _.each(properties.filterColumns, function (item, index) {\n if (item.enhancedTable.filter.position != null) {\n item.enhancedTable.filter.position = index;\n }\n });\n\n \t// Get the data if we are not in batch mode\n if (!properties.batchMode) reQuery();\n\n // Update the headers with the sort information (graphic, position)\n updateTableHeaders();\n\n }", "function clearFilter() {\n loadOsListAll();\n setFiltered(false);\n }", "onFiltersCleared() {\n }", "clearFilters() {\n this.filters.clear();\n this.filter();\n }", "doDestroy() {\n const me = this;\n\n me.filterTip && me.filterTip.destroy();\n\n me.store.un({ sort: me.onStoreFilter }, me);\n\n super.doDestroy();\n }", "function clearFilters() {\n let filtersList = document.getElementById('filtersList');\n // while there are entries in the list,\n while (filtersList.firstChild) {\n // remove the last one in the list\n filtersList.removeChild(filtersList.lastChild);\n }\n document.getElementById('filtersCount').innerHTML = `Applying ${filtersList.children.length} filters`;\n document.getElementById('featuresCount').innerHTML = '';\n }", "removeFilter() {\n this.setState({\n rarity: \"0\",\n type: \"0\",\n minPrice: 0,\n maxPrice: 0,\n stat1: 0,\n stat2: 0\n })\n this.props.removeFilter();\n this.props.toggleClose();\n }", "function pff_removeFilterItem(aFilter) {\n var index = pfv_filterActiveList.indexOf(aFilter);\n pfv_filterActiveList.splice(index, 1);\n}", "function removeGraph() {\n filtro = \"\";\n $(\"svg\").remove();\n}", "function clearGraphic(evt) {\n map.infoWindow.hide();\n map.graphics.clear();\n \n providerList.clearProviders();\n //$(\"#filterLink\").show();\n //$(\"#defaultfilter\").hide();\n }", "clearFilter(){\n\t\tthis.filtered = [];\n\t}", "function onClear(e) {\n resetFilter(e.target.parentNode.name)\n viewer.filter()\n refreshFilterPane()\n e.stopPropagation()\n }", "function clearFilters() {\n\n $('#filters-container').children('div').each(function(i) {\n if (i > 0) {\n $(this).remove();\n }\n \n });\n \n $('.dropdown_filter, .dropdown_operator, .textfield_value, .dropdown_relation').val('');\n $('.dropdown_filter').change();\n $('.dropdown_relation').last().hide();\n $('.span_add').last().show(); \n \n //Titulo\n $('#form_filtros h4').html(\"Nueva búsqueda avanzada:\");\n \n //Ocultar el botón guardar\n $('#filter-save2').parent('div').hide();\n \n //ocultar alert si está\n $(\".alert\").fadeOut('slow');\n \n}", "function clear(){\n for(let x in filter){\n filter[`${x}`] = false\n console.log(filter[`${x}`])\n document.getElementById(\"selected_filters_div\").innerHTML = \"\"\n }\n document.getElementById(\"count\").style.visibility = \"hidden\"\n document.getElementById(\"g\").innerHTML = \"\"\n document.getElementById(\"row4\").style.display = \"none\"\n }", "function cancel(nameClass) {\n\tconst main = document.querySelector('main');\n\tconst div = document.querySelector(nameClass);\n\tconst divFiltre = document.querySelector('.js-filter-blur');\n\n\tmain.removeChild(div);\n\tmain.removeChild(divFiltre);\n}", "function deleteFilter(del) {\n var toBeDeleted = del.innerText;\n for (i = 0; i < filtersArr.length; i++) {\n if (filtersArr[i] == toBeDeleted) {\n filtersArr.splice(i, 1);\n break;\n }\n }\n f--;\n resetfilters(del);\n if (filtersArr.length == 0) {\n document.getElementsByClassName(\"filter-applied\")[0].classList.add(\"invisible\");\n }\n}", "remove() {\n // remove the para, and filterdiv\n this.para.remove()\n this.filterDiv.remove()\n this.labelholder.remove()\n this.maxel.element.remove()\n this.minel.element.remove()\n }", "function clearFilter(){\n vm.search = '';\n }", "clearFilter() {\r\n this.refs.propertyGrid.onSelectAll(false, []);\r\n this.props.toggleButtonText(false);\r\n this.stateSet({ clearFilterKey: Math.random(), filterObj: { companyId: this.companyId }, selectedData: [] });\r\n }", "function removeAllFilters() {\n removeCountryFilter();\n removeTypeFilter();\n}", "function removePreview() {\n $(\"#streamPreview\").remove();\n }", "clear() {\n if (this.ready) {\n this.filters_active = false;\n this.load(this.mount);\n }\n }", "function hideClearFilterBtn() {\n SetNodesVisibility(\".clear-filter\", false);\n}", "function hideFilters() {\n\t\t$('.filters').hide();\n\t}", "handleFilterCancel() {\n const { activateModal, setTemporaryFilters } = this.props;\n return () => {\n if (hasLegacyInstance()) {\n setTemporaryFilters({});\n win.ProductCollectionFilter__Instance.toggleFilters();\n } else {\n activateModal({ shouldAppear: false });\n setTemporaryFilters(FILTER_DEFAULTS);\n }\n };\n }", "clear()\n {\n let {_filters} = this;\n\n if (_filters.size == 0)\n return;\n\n _filters.clear();\n\n this.emit(\"snippets.filtersCleared\");\n }", "handleFilterClear() {\n let newTableFilters = new Map(this.state.tableFilters);\n newTableFilters.delete(this.state.filterColumn);\n this.setState({ isTableFilterTextDialogOpen: false, tableFilters: newTableFilters, filterColumn: null });\n\n this.retrieveStudents(this.state.sortColumn, this.state.sortOrder, this.state.page, this.state.rowsPerPage, newTableFilters);\n }", "resetDropdown(){\r\n this.filterString = this.currentTextValue;\r\n this.unfilter();\r\n if ( this.isOpened ){\r\n this.isOpened = false;\r\n }\r\n }", "blur(){\n if(this._filterSub){\n this._filterSub.unsubscribe();\n }\n this._mapService.clearMarkers();\n this._mapService.closeInfo();\n }", "leave(){\r\n if ( this.isOpened && !this.getRef('list').isOver ){\r\n this.isOpened = false;\r\n }\r\n this.inputIsVisible = false;\r\n this.filterString = '';\r\n }", "function removeObject(objectId, filter) {\r\n if(objectId) {\r\n\tvar object = document.getElementById(objectId);\r\n //if(object) object.parentNode.removeChild(object);\r\n\tif(object) object.style.display = 'none';\r\n\twindow.dialog = null;\r\n\tif(objectId == PICKER.id) window.picker = null;\r\n }\r\n if(filter) {\r\n filter.DOM.parentNode.removeChild(filter.DOM);\r\n\tfilter = null;\r\n window.filter = null;\r\n }\r\n}", "function removeCountryFilter() {\n if (countryFilter.length !== 0) {\n const selectedCountry = countryFilter[0];\n countryFilter = countryFilter.filter(f => f !== selectedCountry);\n chordChart.highlightActiveCountry(selectedCountry);\n mapChart.highlightActiveCountry(selectedCountry);\n barChart.highlightActiveCountry(selectedCountry);\n }\n}", "async removeFilter(filterKey) {\n /* If filter applied */\n if (this._filtersObject.filtersApplied[filterKey]) {\n /* rebuild cards shown array */\n if (this._filtersObject.firstFilter === filterKey) {\n this._filtersObject.firstFilter = undefined;\n }\n await this._rebuildCardsShownArray(filterKey, false);\n }\n }", "function clearFilterInput(e) {\n inputFilter.value = '';\n headerState(e);\n}", "function removeFilter(spanId) {\n let elem = document.getElementById(spanId);\n $(elem).remove();\n}", "function clear_filter(filter){\n\n\t \tjQuery(filter).each(function(){\n\t\t\t\n\t\t\t\tjQuery(this).val('');\n\n\t\t});\t\n\n\t }", "function clearFilter(filter) {\n activeSheet.clearFilterAsync(filter);\n }", "function removePreview () {\n\tsvg.selectAll(\"polygon.preview\").remove();\n}", "function closeFilter() {\r\n var x = document.getElementById(\"filterControls\");\r\n if (x.style.display === \"none\") {\r\n x.style.display = \"block\";\r\n } else {\r\n x.style.display = \"none\";\r\n }\r\n}", "function WRS_clean_filter()\r\n{\r\n\t_START('WRS_clean_filter');\r\n\tvar getID\t\t=\t $('.wrsGrid').attr('id');\r\n\t\r\n\t\t$('.wrs_run_filter').removeAttr('locked').removeAttr('flag_load');\r\n\t\t\r\n\t\t$('.wrsGrid').removeClass('wrsGrid')\r\n\t\t$('#'+getID+'Main').addClass('hide');\r\n\t\t//$('.wrsGrid').removeAttr('wrsparam').removeAttr('wrskendoui');\r\n\t_END('WRS_clean_filter');\t\r\n}", "getActiveFilters(){\n\t\treturn false;\n\t}", "function clearFilterTags() {\n\t\t$('.location-filter-wrap').find(':checked').prop(\"checked\", false);\n\t\tclearBtnState();\n\t}", "_closeFilter() {\n this.setState({\n showFilterDialog: false\n })\n }", "function unfilter() {\n var drop_property = document.getElementById(\"toggle\");\n for (var i = 0; i < emoji_array.length; i++) {\n emoji_array[i].setVisible(true);\n }\n using_filter = false;\n // change the text color when toggle off\n \t drop_property.style.backgroundColor = \"#C0C0C0\";\n \t drop_property.style.color = \"black\";\n }", "function removePreview() {\n\t $(this).removeClass(\"gray\");\n\t $(\"#preview\").remove();\n }", "function closeFilterMenu() {\r\n $(\".filter-left-menu\").removeClass(\"opened\");\r\n}", "function clearFilters(filter_name, fromApply=false) {\n let vals = GM_listValues();\n for (let i=0; i < vals.length; i++) {\n if (vals[i].indexOf(filter_name) < 0) {continue;}\n let spanID = 'span-' + vals[i]; // id = vals[i]\n if (!fromApply) {removeFilter(spanID);}\n GM_deleteValue(vals[i]);\n }\n\n // Clear in-mem array\n filterArray = [];\n\n // This handles the ones in the UI but not yet in storage\n if (!fromApply) {\n let name = filter_name + '-filter-div';\n let elem = document.getElementById(name);\n let inputs = elem.getElementsByTagName('input');\n for (let i=0; i<inputs.length; i++) {\n let spanID = 'span-' + inputs[i].id;\n let rem = document.getElementById(spanID);\n if (validPointer(rem)) {$(rem).remove();}\n }\n }\n}", "function removeFilter(element) {\n\tif(element.style.removeAttribute){\n\t\telement.style.removeAttribute('filter');\n\t}\n}", "listenDeleteAllFiltersOptions(){\n\n \tvar self = this;\n\n \t$(this.containers.source_container).on('click', this.listeners.listen_click_delete_filters, function(){\n\n\t\t\t\t$(self.styles.filter_active).each(function(){\n\t\t\t\t\t$(this).fadeOut('slow');\n\t\t\t\t\t$(this).remove();\n\n\t\t\t\t\t//setTimeout(function(){ $(this).remove(); }, 2000);\n\n\t\t\t\t\t\tlet filter = $(this).data('filter');\n\n\t\t\t\t\t\tself.attributes.filters[filter]['active'] = false;\n\n\t\t\t\t\t\tself.attributes.filters[filter]['value'] = '';\n\n\t\t\t\t\t\tself.updateFilterList(filter);\n\n\t\t\t\t\t\tself.deleteParams(filter);\n\t\t\t\t\t\n\t\t\t\t});\n\t\t});\n }", "_removeCallback() {\n this._renderCallback()\n this._viewer.dcContainer.removeChild(this._delegate)\n this._state = DC.LayerState.REMOVED\n }", "function removeMarkers() {\n \n let filter = $(\"#filterTag\")[0].value;\n \n \n for (var i = 0; i < gmarkers.length; i++) {\n if (filter == \"All\" || tags[i] == filter) {\n gmarkers[i].setMap(map);\n show[i] = 1; \n } else {\n gmarkers[i].setMap(null);\n show[i] = 0;\n \n }\n }\n }", "function removeFilter(key) {\r\n delete(activeFilterList[key]);\r\n applyFilterList();\r\n }", "unfilterNoChangeLayers(){\n //get the no change status object\n let no_change_status = this.props.statuses.filter(status => status.key === 'no_change');\n //clear the filter depending on whether it is a global or country view\n let filter = (this.props.view === 'global') ? null : ['in', 'iso3', this.props.country.iso3];\n //iterate through the layers and set the filter\n no_change_status[0].layers.forEach(layer => this.map.setFilter(layer, filter));\n //\n }", "function removeAllMarker(){\n modifyCancel();\n selectClick.getFeatures().clear();\n selectLayer.getSource().clear();\n}", "function deactivate() {\n populationApp.toolbar.deactivate();\n clearMap();\n }", "remove() {\n\t\tthis.outerElement.style.display = \"none\";\n\t\tthis.removed = true;\n\t}", "function removeTypeFilter() {\n if (typeFilter.length !== 0) {\n const selectedTypeIndex = typeFilter[0];\n typeFilter = typeFilter.filter(f => f !== selectedTypeIndex);\n chordChart.highlightActiveType(selectedTypeIndex)\n }\n}", "function clearFilter() {\n let input = document.querySelector(\"#filterCompany\");\n input.value = \"\";\n textFilter();\n}", "dispose() {\n const addBtn = document.getElementById(this.buttonId);\n if (addBtn) {\n addBtn.parentElement.removeChild(addBtn);\n Object.keys(this.selectedParams, (searchItemId) =>\n this.removeParam(searchItemId)\n );\n }\n }", "clearFilters()\n {\n this._filterText = [];\n this._filterTextIndex.clear();\n }", "closePropertiesFilter() {\n this.setState({ showAddEditPropertiesFilter: false });\n }", "listenDeleteFilter(){\n\n\t\tvar self = this;\n\n\t\t$(this.containers.active_filters).on('click', this.listeners.listen_close_option, function(){\n\n\t\t\tvar filter = $(this).closest(self.styles.filter_active).data('filter');\n\n\t\t\t$(this).closest(self.styles.filter_active).remove();\n\n\t\t\tself.deleteActiveFilter(filter);\n\n\t\t\tself.updateFilterList(filter);\n\n\t\t\tself.showAllFilterOptions();\n\n\t\t});\n\t}", "reset() {\n this._kbnFilter = null;\n this.value = this.filterManager.getValueFromFilterBar();\n }", "remove() { this.tooltip.remove(); this.element.remove(); }", "addClearFiltersListener() {\n const this_ = this;\n $('#clear-filters').on('click', function (e) {\n $('.spinner-zone').show();\n this_.setForm('default');\n this_.setFormTransactions([]);\n IndexSearchObj.searchYelp();\n });\n }", "function onCategoriesSelectorClose()\n {\n // Clear the filter\n vm.categoriesSelectFilter = '';\n\n // Unbind the input event\n $document.find('md-select-header input[type=\"search\"]').unbind('keydown');\n }", "function toggleFilter () {\n\t\tvar filterProp = Object.keys(vm.tp.filter());\n\t\tif (!$scope.showFilter && filterProp.length > 0) {\n\t\t\tvm.tp.filter({});\n\t\t}\n\t}", "_mouseOut () {\n this.hide();\n this.html.remove.defer(this.html);\n }", "_clearRowFilters() {\r\n const that = this;\r\n\r\n if (!that._filterInfo.rowFilters) {\r\n return;\r\n }\r\n\r\n const filterRow = that.$.tableContainer.querySelector('.smart-table-filter-row'),\r\n selectionColumnCorrection = that.selection ? 1 : 0;\r\n\r\n for (let i = 0; i < that._columns.length; i++) {\r\n const container = filterRow.children[i + selectionColumnCorrection].firstElementChild;\r\n\r\n container.firstElementChild.value = '';\r\n container.children[2].classList.add('smart-hidden');\r\n }\r\n\r\n delete that._filterInfo.rowFilters;\r\n }", "clearText(){\n\n\t\t\tif(clearFilterText === this.props.listing_as){\n\t\t\t\tthis.setState({\n\t\t\t\t\tfilterText: '',\n\t\t\t\t});\n\t\t\t\tclearFilterText = false;\n\t\t\t}\n\t\t}", "resetDropdown(){\r\n this.currentText = this.currentTextValue;\r\n this.filterString = this.currentTextValue;\r\n this.unfilter();\r\n if ( this.isOpened ){\r\n this.isOpened = false;\r\n }\r\n }", "function onFeatureUnselect(feature) {\n clearMapPopup();\n selectedFeature=null;\n}", "function onDeleteFilter() {\n if (gDeleteButton.disabled) {\n return;\n }\n\n let items = gFilterListbox.selectedItems;\n if (!items.length) {\n return;\n }\n\n let checkValue = { value: false };\n if (\n Services.prefs.getBoolPref(\"mailnews.filters.confirm_delete\") &&\n Services.prompt.confirmEx(\n window,\n null,\n gFilterBundle.getString(\"deleteFilterConfirmation\"),\n Services.prompt.STD_YES_NO_BUTTONS,\n \"\",\n \"\",\n \"\",\n gFilterBundle.getString(\"dontWarnAboutDeleteCheckbox\"),\n checkValue\n )\n ) {\n return;\n }\n\n if (checkValue.value) {\n Services.prefs.setBoolPref(\"mailnews.filters.confirm_delete\", false);\n }\n\n // Save filter position before the first selected one.\n let newSelectionIndex = gFilterListbox.selectedIndex - 1;\n\n // Must reverse the loop, as the items list shrinks when we delete.\n for (let index = items.length - 1; index >= 0; --index) {\n let item = items[index];\n gCurrentFilterList.removeFilter(item._filter);\n item.remove();\n }\n updateCountBox();\n\n // Select filter above previously selected if one existed, otherwise the first one.\n if (newSelectionIndex == -1 && gFilterListbox.itemCount > 0) {\n newSelectionIndex = 0;\n }\n if (newSelectionIndex > -1) {\n gFilterListbox.selectedIndex = newSelectionIndex;\n updateViewPosition(-1);\n }\n}", "function cerrarFiltro() {\r\n $(\"#filtro\").fadeOut(\"fast\");\r\n filtroAbierto=false;\r\n}", "function closePreview(){\n $('#over').remove();\n}", "function clearFilters() {\n if (viz) {\n var worksheets = viz.getWorkbook().getActiveSheet().getWorksheets();\n worksheets.forEach(worksheet => {\n worksheet.getFiltersAsync().then(filters => {\n filters.forEach(filter => {\n worksheet.clearFilterAsync(filter.$caption);\n })\n })\n });\n }\n}" ]
[ "0.7871398", "0.7632811", "0.70768094", "0.70578927", "0.68705386", "0.68047756", "0.6758331", "0.67110443", "0.6638302", "0.660746", "0.6591502", "0.6588438", "0.65838635", "0.65730864", "0.65577894", "0.6549175", "0.65296936", "0.652412", "0.6520321", "0.65026456", "0.650258", "0.6498938", "0.6492211", "0.645214", "0.644363", "0.64315856", "0.6420772", "0.6414441", "0.6407892", "0.6395107", "0.63903886", "0.6388048", "0.63844174", "0.63833964", "0.63649935", "0.6364656", "0.63629854", "0.63372105", "0.63289875", "0.63151777", "0.62888294", "0.6259845", "0.62589365", "0.6247548", "0.6243318", "0.6233926", "0.6214836", "0.62034965", "0.61911863", "0.61820287", "0.6177966", "0.61776876", "0.61766535", "0.6175763", "0.6162453", "0.6155688", "0.6140734", "0.6138898", "0.6137801", "0.6134646", "0.6118705", "0.6110404", "0.610704", "0.61035585", "0.6100651", "0.6099411", "0.6094569", "0.6092384", "0.6091731", "0.6081979", "0.60754025", "0.60570663", "0.60494334", "0.6031237", "0.60221887", "0.60168374", "0.60148954", "0.60128987", "0.6009142", "0.6007876", "0.60077745", "0.59980553", "0.59927243", "0.5986501", "0.5967734", "0.59615195", "0.5958112", "0.59378743", "0.5931316", "0.5926297", "0.59197164", "0.5916512", "0.5916108", "0.58999884", "0.58906037", "0.58900976", "0.5874339", "0.58695745", "0.5868124", "0.5864767" ]
0.6601241
10
Monta a estrutura geral do piu
function montaLi(tweet) { var tweetLi = document.createElement("li"); var divFora = document.createElement("div"); divFora.classList.add("divisao"); divFora.appendChild(montaImagem(tweet.imagem, "")); divFora.appendChild( montaDiv( tweet.nome, tweet.username, tweet.mensagem, "nome-tweet", "user-tweet", "texto-tweet", "info" ) ); tweetLi.appendChild(divFora); tweetLi.appendChild(montaActions()); return tweetLi; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordinate geocentriche del pianeta riferite all'equinozio della data (njd).\n // calcola le principali perturbazioni planetarie.\n\n // new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n // 0 1 2 3 4 5 6 7 8 9\n\n var tempo_luce=t_luce(njd,np);\n \n njd=njd-tempo_luce; // correzione per il tempo luce.\n\n var el_orb=orb_plan(njd,np); // recupera gli elementi orbitali del pianeta.\n\n var periodo= el_orb[0]; // periodo.\n var L= el_orb[1]; // longitudine media all'epoca.\n var AM_media= el_orb[2]; // anomalia media. \n var long_peri= el_orb[3]; // longitudine del perielio.\n var eccent= el_orb[4]; // eccentricità dell'orbita.\n var semiasse= el_orb[5]; // semiasse maggiore.\n var inclinaz= el_orb[6]; // inclinazione.\n var long_nodo= el_orb[7]; // longitudine del nodo.\n var dimens= el_orb[8]; // dimensioni apparenti.\n var magn= el_orb[9]; // magnitudine.\n\n \n var correzioni_orb=pos_pianeticr(njd,np); // calcolo delle correzioni per il pianeta (np).\n \n// Array(Delta_LP , Delta_R , Delta_LL , Delta_AS , Delta_EC , Delta_MM , Delta_LAT_ELIO);\n// 0 1 2 3 4 5 6 \n// lperiodo, rvett long. assemagg ecc M lat\n\n// CORREZIONI \n\n L=L+correzioni_orb[0]; // longitudine media.\n AM_media= AM_media+correzioni_orb[5]; // anomalia media + correzioni..\n semiasse= semiasse+correzioni_orb[3]; // semiasse maggiore.\n eccent= eccent+correzioni_orb[4]; // eccentricità.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ***************************************************** inizio:\n\n var M=AM_media; // anomalia media \n \n M=gradi_360(M); // intervallo 0-360;\n\n var E=eq_keplero(M,eccent); // equazione di Keplero.E[0]=Anomalia eccentrica E[1]=Anomalia vera in radianti.\n \n var rv=semiasse*(1-eccent*Math.cos(E[0])); // calcolo del raggio vettore (distanza dal Sole).\n rv=rv+correzioni_orb[1]; // raggio vettore più correzione.\n\n\n var U=gradi_360(L+Rda(E[1])-M-long_nodo); // argomento della latitudine.\n\n var long_eccliticay=Math.cos(Rad(inclinaz))*Math.sin(Rad(U));\n var long_eccliticax=Math.cos(Rad(U));\n\n var long_ecclitica=quadrante(long_eccliticay,long_eccliticax)+long_nodo;\n var l=gradi_360(long_ecclitica);\n l=l+correzioni_orb[2]; // longitudine del pianeta + correzione.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ********************************************************* fine: \n\n var b=Rda(Math.asin(Math.sin(Rad(U))*Math.sin(Rad(inclinaz)))); // latitudine ecclittica in gradi (b)\n\n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** inizio:\n\n njd=njd+tempo_luce; \n\n var eff_sole=pos_sole(njd);\n var LS=eff_sole[2]; // longitudine geocentrica del Sole.\n var RS=eff_sole[4]; // raggio vettore.\n \n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** fine: \n\n // longitudine geocentrica.\n\n var Y=rv*Math.cos(Rad(b))*Math.sin(Rad(l-LS));\n var X=rv*Math.cos(Rad(b))*Math.cos(Rad(l-LS))+RS;\n\n var long_geo=gradi_360(quadrante(Y,X)+LS); // longitudine geocentrica.\n\n var dist_p=Y*Y+X*X+(rv*Math.sin(Rad(b)))*(rv*Math.sin(Rad(b))); \n dist_p=Math.sqrt(dist_p); // distanza del pianeta dalla Terra.\n\n var beta=(rv/dist_p)*Math.sin(Rad(b));\n var lat_geo=Rda(Math.asin(beta));\n lat_geo=lat_geo+correzioni_orb[6]; // latitudine + correzione.\n\n \n// fase del pianeta.\n\nvar fase=0.5*(1+Math.cos(Rad(long_geo-long_ecclitica)));\n fase=fase.toFixed(2);\n\n// parallasse del pianeta in gradi.\n\nvar pa=(8.794/dist_p)/3600;\n\nvar coo_pl=trasf_ecli_equa(njd,long_geo,lat_geo); // coordinate equatoriali. \n\n // diametro apparente in secondi d'arco.\n\nvar diam_app=dimens/dist_p; \n\n// magnitudine del pianeta.\n\nvar magnitudine=(5*(Math.log(rv*dist_p/(magn*Math.sqrt(fase))))/2.302580)-27.7;\n magnitudine=magnitudine.toFixed(1);\n\nif (magnitudine==Infinity) {magnitudine=\"nd\"; }\n\nvar elongaz=elong(coo_pl[0],coo_pl[1],eff_sole[0],eff_sole[1]); // elongazione in gradi dal Sole.\n \n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_p; // distanza pianeta-terra.\n var Dts= RS; // distanza terra-sole.\n var Dps= rv; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // angolo di fase in gradi.\n \nvar dati_pp= new Array(coo_pl[0],coo_pl[1],fase,magnitudine,dist_p,diam_app,elongaz,LS,RS,long_ecclitica,pa,rv,angolo_fase);\n// 0 1 2 3 4 5 6 7 8 9 10 11 12 \n\n\n\n// risultati: ARetta,Declinazione,fase,magnitudine,distanza pianeta,diametro apparente, elongazione, long. sole,raggio vettore Terra, longituddine elio. pianeta, parallase,dist sole-pianeta. \n\nreturn dati_pp;\n}", "function criarProduto(nome, modelo, preco) {\n return{\n nome,\n modelo,\n preco,\n desconto: 0.1 // aqui definimos um desconto padrão de 10%\n }\n}", "function PersonagemLimpaGeral() {\n gPersonagem.classes.length = 0;\n gPersonagem.pontos_vida.bonus.Limpa();\n gPersonagem.pontos_vida.temporarios = 0;\n gPersonagem.pontos_vida.ferimentos_nao_letais = 0;\n gPersonagem.armas.length = 1; // para manter desarmado.\n gPersonagem.armaduras.length = 0;\n gPersonagem.ca.bonus.Limpa();\n gPersonagem.iniciativa.Limpa();\n gPersonagem.outros_bonus_ataque.Limpa();\n gPersonagem.atributos.pontos.gastos.disponiveis = 0;\n gPersonagem.atributos.pontos.gastos.length = 0;\n for (var atributo in tabelas_atributos) {\n gPersonagem.atributos[atributo].bonus.Limpa();\n }\n for (var i = 0; i < gPersonagem.pericias.lista.length; ++i) {\n gPersonagem.pericias.lista[i].bonus.Limpa();\n }\n for (var chave_classe in gPersonagem.feiticos) {\n gPersonagem.feiticos[chave_classe].em_uso = false;\n gPersonagem.feiticos[chave_classe].nivel_maximo = 0;\n for (var i = 0; i <= 9; ++i) {\n gPersonagem.feiticos[chave_classe].conhecidos[i].length = 0;\n gPersonagem.feiticos[chave_classe].slots[i].feiticos.length = 0;\n gPersonagem.feiticos[chave_classe].slots[i].feitico_dominio = null;\n }\n }\n gPersonagem.estilos_luta.length = 0;\n for (var tipo_salvacao in gPersonagem.salvacoes) {\n if (tipo_salvacao in { fortitude: '', reflexo: '', vontade: '' }) {\n gPersonagem.salvacoes[tipo_salvacao].Limpa();\n } else {\n delete gPersonagem.salvacoes[tipo_salvacao];\n }\n }\n for (var tipo_item in tabelas_itens) {\n gPersonagem[tipo_item].length = 0;\n }\n gPersonagem.especiais = {};\n gPersonagem.imunidades.length = 0;\n gPersonagem.resistencia_magia.length = 0;\n PersonagemLimpaPericias();\n PersonagemLimpaTalentos();\n}", "function inicializacaoClasseProduto() {\r\n VETORDEPRODUTOSCLASSEPRODUTO = [];\r\n VETORDEINGREDIENTESCLASSEPRODUTO = [];\r\n VETORDECATEGORIASCLASSEPRODUTO = [];\r\n}", "function Iluminacao(pl, ka, ia, kd, od, ks, il, n) {\n this.pl = pl; //posições originais da fonte de luz em coordenadas de mundo\n this.pl_pvista_camera = pl; //adapta as posiçoes de entrada para o ponto de vista da camera\n this.ka = ka; // reflexão de luz ambiente (quanto maior, mais reflexível é)\n this.ia = ia; // intensidade da luz ambiente (quanto maior, mais iluminado kkk)\n this.kd = kd; // constante difusa, o quão espalhável é essa luz\n this.od = od; // vetor difuso, usado para simplesmente espalhar kkk\n this.ks = ks; // parte especular, como a luz vai ser refletida no objeto\n this.il = il; // cor da fonte de luz\n this.n = n; // constante de rugosidade, trata irregularidades, ruídos, enfim, frescura.\n}", "function criarPessoa() {\n return {\n nome: 'Th',\n sobrenome: 'Ol'\n }\n}", "function calcularNovaPonta(conceitoContainer, ligacaoContainer){\r\n \tvar coordenadas = new Coordenadas(new Array(),new Array());\r\n \tvar coordenadasFinais = new Coordenadas(new Object(),new Object());\r\n \tvar conceitoX = parseFloat(conceitoContainer.x);\r\n \tvar conceitoY = parseFloat(conceitoContainer.y);\r\n \tvar ligacaoX = parseFloat(ligacaoContainer.x);\r\n \tvar ligacaoY = parseFloat(ligacaoContainer.y);\r\n \t\r\n \tvar larguraConceito = gerenciadorLigacao.getLargura(conceitoContainer);\r\n \tvar alturaConceito = gerenciadorLigacao.getAltura(conceitoContainer);\r\n \tvar larguraLigacao = gerenciadorLigacao.getLargura(ligacaoContainer);\r\n \tvar alturaLigacao = gerenciadorLigacao.getAltura(ligacaoContainer);\r\n \t\r\n \t\r\n \tfor(var i=0;i<8;i++){\r\n \t\tcoordenadas.conceito[i] = new Object();\r\n \t\tcoordenadas.ligacao[i] = new Object();\r\n \t}\r\n \t\r\n \t//para o conceito\r\n \tcoordenadas.conceito[0].x = conceitoX;\r\n \tcoordenadas.conceito[0].y = conceitoY;\r\n \t\r\n \tcoordenadas.conceito[1].x = conceitoX + (larguraConceito/2);\r\n \tcoordenadas.conceito[1].y = conceitoY;\r\n \t\r\n \tcoordenadas.conceito[2].x = conceitoX + (larguraConceito);\r\n \tcoordenadas.conceito[2].y = conceitoY;\r\n \t\r\n \tcoordenadas.conceito[3].x = conceitoX + (larguraConceito);\r\n \tcoordenadas.conceito[3].y = conceitoY + (alturaConceito/2);\r\n \t\r\n \tcoordenadas.conceito[4].x = conceitoX + (larguraConceito);\r\n \tcoordenadas.conceito[4].y = conceitoY + (alturaConceito);\r\n \t\r\n \tcoordenadas.conceito[5].x = conceitoX + (larguraConceito/2);\r\n \tcoordenadas.conceito[5].y = conceitoY + (alturaConceito);\r\n \t\r\n \tcoordenadas.conceito[6].x = conceitoX;\r\n \tcoordenadas.conceito[6].y = conceitoY + (alturaConceito);\r\n \t\r\n \tcoordenadas.conceito[7].x = conceitoX;\r\n \tcoordenadas.conceito[7].y = conceitoY + (alturaConceito/2);\r\n \t\r\n \t//para a ligacao\r\n \tcoordenadas.ligacao[0].x = ligacaoX;\r\n \tcoordenadas.ligacao[0].y = ligacaoY;\r\n \t\r\n \tcoordenadas.ligacao[1].x = ligacaoX + (larguraLigacao/2);\r\n \tcoordenadas.ligacao[1].y = ligacaoY;\r\n \t\r\n \tcoordenadas.ligacao[2].x = ligacaoX + (larguraLigacao);\r\n \tcoordenadas.ligacao[2].y = ligacaoY;\r\n \t\r\n \tcoordenadas.ligacao[3].x = ligacaoX + (larguraLigacao);\r\n \tcoordenadas.ligacao[3].y = ligacaoY + (alturaLigacao/2);\r\n \t\r\n \tcoordenadas.ligacao[4].x = ligacaoX + (larguraLigacao);\r\n \tcoordenadas.ligacao[4].y = ligacaoY + (alturaLigacao);\r\n \t\r\n \tcoordenadas.ligacao[5].x = ligacaoX + (larguraLigacao/2);\r\n \tcoordenadas.ligacao[5].y = ligacaoY + (alturaLigacao);\r\n \t\r\n \tcoordenadas.ligacao[6].x = ligacaoX;\r\n \tcoordenadas.ligacao[6].y = ligacaoY + (alturaLigacao);\r\n \t\r\n \tcoordenadas.ligacao[7].x = ligacaoX;\r\n \tcoordenadas.ligacao[7].y = ligacaoY + (alturaLigacao/2);\r\n \t\r\n \t\r\n \tif(ligacaoY >= coordenadas.conceito[6].y){ //pontaLigacao[1] � pontaConceito[5]\r\n \t\t\r\n \t\tcoordenadasFinais.conceito.x = coordenadas.conceito[5].x;\r\n \t\tcoordenadasFinais.conceito.y = coordenadas.conceito[5].y;\r\n \t\tcoordenadasFinais.ligacao.x = coordenadas.ligacao[1].x;\r\n \t\tcoordenadasFinais.ligacao.y = coordenadas.ligacao[1].y;\r\n \t\treturn coordenadasFinais;\r\n \t}\r\n \tif(ligacaoY < coordenadas.conceito[6].y && coordenadas.ligacao[4].x <= conceitoX){ //pontaLigacao[3] � pontaConceito[7]\r\n \t\t\r\n \t\tcoordenadasFinais.conceito.x = coordenadas.conceito[7].x;\r\n \t\tcoordenadasFinais.conceito.y = coordenadas.conceito[7].y;\r\n \t\tcoordenadasFinais.ligacao.x = coordenadas.ligacao[3].x;\r\n \t\tcoordenadasFinais.ligacao.y = coordenadas.ligacao[3].y;\r\n \t\treturn coordenadasFinais;\r\n \t}\r\n \tif(coordenadas.ligacao[5].y <= conceitoY){ //pontaLigacao[5] � pontaConceito[1]\r\n \t\t\r\n \t\tcoordenadasFinais.conceito.x = coordenadas.conceito[1].x;\r\n \t\tcoordenadasFinais.conceito.y = coordenadas.conceito[1].y;\r\n \t\tcoordenadasFinais.ligacao.x = coordenadas.ligacao[5].x;\r\n \t\tcoordenadasFinais.ligacao.y = coordenadas.ligacao[5].y;\r\n \t\treturn coordenadasFinais;\r\n \t}\r\n \tif(coordenadas.ligacao[6].y > conceitoY && coordenadas.ligacao[4].x >= conceitoX){ //pontaLigacao[3] � pontaConceito[7]\r\n \t\t\r\n \t\tcoordenadasFinais.conceito.x = coordenadas.conceito[3].x;\r\n \t\tcoordenadasFinais.conceito.y = coordenadas.conceito[3].y;\r\n \t\tcoordenadasFinais.ligacao.x = coordenadas.ligacao[7].x;\r\n \t\tcoordenadasFinais.ligacao.y = coordenadas.ligacao[7].y;\r\n \t\treturn coordenadasFinais;\r\n \t}\t\r\n }", "constructor(){\n this.ju1 = new Jugador(1, 'X');\n this.ju2 = new Jugador(2, 'O');\n this.actual = this.ju1;\n this.tab = new Juego();\n this.ganador = 0;\n this.liGanad = [[0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]];\n }", "constructor(dato, sig) {\n this.dato = dato;\n this.sig = sig;\n this.peso = null; // solo se utiliza para cuando el nodo pertenece a la \n //lista de adyacencia del vertice\n this.color = null;\n this.nivel = null;\n this.padre = null;\n this.distancia = null;\n }", "function Propiedades() {\n this.texto = \"Palabra\";\n console.log(\"this.texto\", this.texto);\n this.numero = 5;\n console.log(\"numero\", this.numero);\n this.boleana = true;\n console.log(\"boleana\", this.boleana);\n this.arreglo = [\"texto1\", \"teto2\", 0, true];\n console.log(\"arreglo\", this.arreglo);\n this.cualquiera = { \"propiedad1\": \"valor1\",\n \"propiedad2\": \"valor2\",\n \"propiedad3\": \"valor3\" };\n console.log(\"cualquiera\", this.cualquiera);\n }", "function Produto(nome,preco){\n this.nome = nome;\n this.preco = preco;\n\n}", "efficacitePompes(){\n\n }", "function implant(pk){\n let Poke = new Pokemon(pk.name, pk.abilities, pk.sprites, pk.types);\n let move = \"\";\n let poketype = \"\";\n for(let x= 0; x< Poke._abilities.length; x++){\n move = move + \" \" + Poke._abilities[x].ability.name + \", \";\n }\n move = move.substring(0,move.length-2);\n for(let y of Poke._types){\n poketype = poketype + \" \" + y.type.name + \", \"; \n }\n poketype = poketype.substring(0,poketype.length-2);\n document.getElementById('pkInfo').innerHTML = '<br>' + 'Name: ' + Poke._name \n + '<br></br>' + 'Abilities: ' + move\n + '<br></br>' + 'Pokemon types: ' + poketype\n + '<br></br>' + \"<img src = ' \" + Poke._image.front_default + \"' /> \";\n\n console.log(Poke);\n console.log(pk);\n \n\n}", "function crear_puntaje_equipo(nombre_equipo) {\n return {nombre:nombre_equipo,\n puntos:0,\n goles_a_favor:0,\n goles_en_contra:0,\n dif_gol:0\n };\n}", "function Insignia(indio,numPix){\n //PROPIEDADES\n this.insigniaFuente = indio;\n this.numPixeles = numPix; //escala\n this.puntos = [];\n\n //METODOS\n\n //cargar insignia\n this.cargarInsignia = function(){\n this.insigniaFuente.loadPixels();\n loadPixels();\n\n var i = 0; //Contador de arreglo puntos\n\n for(var yDest = 0; yDest < int(this.insigniaFuente.height/this.numPixeles); yDest++){\n for(var xDest = 0; xDest < int(this.insigniaFuente.width/this.numPixeles); xDest++){\n //condensamos cada pixel\n var r = 0; //almacena valores tono rojo\n var g = 0; //almacena valores tono verde\n var b = 0; //almacena valores tono azul\n var alpha = 0; //almacena valores transparencia\n\n for(var x = 0; x < this.numPixeles; x++){\n for(var y = 0; y < this.numPixeles; y++){\n var index = 4*((x + xDest*this.numPixeles) + (y + yDest*this.numPixeles)*this.insigniaFuente.width); //posición del pixel en el arreglo de pixeles\n r += this.insigniaFuente.pixels[index + 0];\n g += this.insigniaFuente.pixels[index + 1];\n b += this.insigniaFuente.pixels[index + 2];\n alpha += this.insigniaFuente.pixels[index + 3];\n }\n }\n //instanciamos cada nuevo pixel\n var norma = this.numPixeles*this.numPixeles;\n this.puntos[i] = new Punto(this.numPixeles*(xDest+.5), this.numPixeles*(yDest+.5), 1.3*this.numPixeles, r/norma, g/norma, b/norma, alpha/norma);\n i++;\n }\n }\n }\n\n //actualizar/dibujar insignia\n this.actualizar = function(){\n for (var i = 0; i < this.puntos.length; i++) {\n this.puntos[i].actualizar();\n }\n }\n\n\n}", "function _CarregaFeiticos() {\n for (var chave_classe in tabelas_feiticos) {\n gPersonagem.feiticos[chave_classe] = {\n atributo_chave: tabelas_feiticos[chave_classe].atributo_chave,\n conhecidos: {},\n slots: {},\n };\n for (var i = 0; i <= 9; ++i) {\n gPersonagem.feiticos[chave_classe].conhecidos[i] = [];\n gPersonagem.feiticos[chave_classe].slots[i] = {\n atributo_chave: tabelas_feiticos[chave_classe].atributo_chave,\n base: 0,\n bonus_atributo: 0,\n feiticos: [],\n feitico_dominio: null,\n };\n }\n }\n\n // Tabela invertida de feiticos.\n for (var classe in tabelas_lista_feiticos) {\n for (var nivel in tabelas_lista_feiticos[classe]) {\n for (var chave_feitico in tabelas_lista_feiticos[classe][nivel]) {\n var feitico = tabelas_lista_feiticos[classe][nivel][chave_feitico];\n tabelas_lista_feiticos_invertida[StringNormalizada(feitico.nome)] = chave_feitico;\n tabelas_lista_feiticos_completa[chave_feitico] = feitico;\n }\n }\n }\n}", "function insertTypes(tipos) {\n for (var i = 0, n = tipos.length; i < n; i++) {\n\n var propriedades = [];\n\n // inserir propriedades com base no tipo de componente\n switch (tipos[i]['nome'].toLowerCase()) {\n case 'amp':\n propriedades.push({nome: 'atenuador', label: 'Atenuador', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'atenuador1', label: 'Atenuador 1', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'atenuador2', label: 'Atenuador 2', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'equalizador', label: 'Equalizador', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'ganho', label: 'Ganho', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'ganho1', label: 'Ganho 1', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'ganho2', label: 'Ganho 2', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'nivelSaida', label: 'Nível de saída', tipo: 'number', unidades: 'dB µV'});\n propriedades.push({\n nome: 'nivelSaidaRetorno',\n label: 'Nível de saída de retorno',\n tipo: 'number',\n unidades: 'dB µV'\n });\n propriedades.push({nome: 'preAcentuador', label: 'Pré-acentuador', tipo: 'number', unidades: 'dB'});\n break;\n case 'ati':\n case 'cc':\n propriedades.push({nome: 'amplificacao', label: 'Amplificação', tipo: 'number', unidades: 'dB'});\n propriedades.push({nome: 'nivelSinal', label: 'Nível de sinal', tipo: 'number', unidades: 'dB µV'});\n break;\n case 'derivador':\n propriedades.push({\n nome: 'atenuacaoDerivacao',\n label: 'Atenuação de derivação',\n tipo: 'number',\n unidades: 'dB'\n });\n propriedades.push({\n nome: 'atenuacaoInsercao',\n label: 'Atenuação de inserção',\n tipo: 'number',\n unidades: 'dB'\n });\n break;\n }\n\n tiposComponente.push({\n default: null,\n description: tipos[i]['descricao'],\n hidden: (vertical && tipos[i]['esconderVertical']) || (!vertical && tipos[i]['esconderHorizontal']),\n id: tipos[i]['id'],\n name: tipos[i]['nome'],\n properties: propriedades,\n svg: tipos[i]['svg']\n });\n }\n\n buildDraggables();\n}", "constructor(prix, type, proprietaire, nbALouer, nbAVendre, nbEtage){\n super(prix, type, proprietaire) //appeler le constructor de la class mere\n this.nbALouer = nbALouer\n this.nbAVendre = nbAVendre\n this.nbEtages = nbEtages\n }", "get informations() {\n return this.pseudo + ' (' + this.classe + ') a ' + this.sante + ' points de vie et est au niveau ' + this.niveau + '.'\n }", "function Producto(nombre, precio){ //Producto(\"parametros\")\n this.nombre = nombre; //Acceder a los parametros por medio del this\n this.precio = precio; \n}", "function Transporte() { \n this.id;\n this.tipo; \n this.tempo;\n this.capacidade_maxima;\n this.capacidade_atual;\n this.capacidade_confortavel;\n this.conforto;\n this.posicao_inicial;\n this.posicao_final; \n this.passageiros = new Array(); \n}", "function Orologio(){\n const ora = new Date();\n this.giorno = ora.getDate(); \n //il metodo getDate() ritorna il giorno del mese (da 1 a 31) esempoio 20.08.2021\n //il metodo getDay() ritorna il giorno della settimana, il formato americano parte da domenica, quindi domenica ha index 0\n this.mese = ora.getMonth();\n this.anno = ora.getFullYear();\n\n this.aggiornaMese = function(){\n //array contenente il nome dei mesi\n const mesi = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];\n return mesi[this.mese - 1]; //nel metodo getMonth() uscirà il numero del mese corrente, che corrisponderà poi al nome nel mio array di stringhe coi nomi\n }\n this.aggiornaOra = function(){\n return ora.getHours();\n }\n this.aggiornaMinuti = function(){\n return ora.getMinutes();\n }\n this.aggiornaSecondi = function(){\n return ora.getSeconds();\n }\n}", "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "constructor(size){\n\n // seteo el tamaño de la grilla\n this.size = size;\n\n //creo la grafica del juego\n this.grafica = new GraficaActiva(size,[2,4,8,16,32,64,128,256,512,1024,2048]);\n\n //crea la clase para guardar movimientos\n this.save = new Save(size,this.grafica);\n this.grilla = this.save.load();\n\n //crea clase puntaje (la setea el usuario)\n this.puntaje = null;\n }", "function createPrintStructureRendicontoGestionale() {\n\n\tvar printStructure = [];\n\n\tprintStructure.push({\"dialogText\":\"RENDICONTO GESTIONALE -- DETTAGLIO MOVIMENTI --\", \"titleText\":\"RENDICONTO GESTIONALE ANNO %1 DETTAGLIO MOVIMENTI\"});\n\n\tprintStructure.push({\"id\":\"dC\", \"isTitle\":true, \"newpage\":false});\n\tprintStructure.push({\"id\":\"dCA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CA1\"});\n\tprintStructure.push({\"id\":\"CA2\"});\n\tprintStructure.push({\"id\":\"CA3\"});\n\tprintStructure.push({\"id\":\"CA4\"});\n\tprintStructure.push({\"id\":\"CA5\"});\n\tprintStructure.push({\"id\":\"CA5b\"});\n\tprintStructure.push({\"id\":\"CA6\"});\n\tprintStructure.push({\"id\":\"CA7\"});\n\tprintStructure.push({\"id\":\"CA8\"});\n\tprintStructure.push({\"id\":\"CA9\"});\n\tprintStructure.push({\"id\":\"CA10\"});\n\tprintStructure.push({\"id\":\"CA\"});\n\tprintStructure.push({\"id\":\"dCB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CB1\"});\n\tprintStructure.push({\"id\":\"CB2\"});\n\tprintStructure.push({\"id\":\"CB3\"});\n\tprintStructure.push({\"id\":\"CB4\"});\n\tprintStructure.push({\"id\":\"CB5\"});\n\tprintStructure.push({\"id\":\"CB5b\"});\n\tprintStructure.push({\"id\":\"CB6\"});\n\tprintStructure.push({\"id\":\"CB7\"});\n\tprintStructure.push({\"id\":\"CB8\"});\n\tprintStructure.push({\"id\":\"CB\"});\n\tprintStructure.push({\"id\":\"dCC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CC1\"});\n\tprintStructure.push({\"id\":\"CC2\"});\n\tprintStructure.push({\"id\":\"CC3\"});\n\tprintStructure.push({\"id\":\"CC\"});\n\tprintStructure.push({\"id\":\"dCD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CD1\"});\n\tprintStructure.push({\"id\":\"CD2\"});\n\tprintStructure.push({\"id\":\"CD3\"});\n\tprintStructure.push({\"id\":\"CD4\"});\n\tprintStructure.push({\"id\":\"CD5\"});\n\tprintStructure.push({\"id\":\"CD6\"});\n\tprintStructure.push({\"id\":\"CD\"});\n\tprintStructure.push({\"id\":\"dCE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CE1\"});\n\tprintStructure.push({\"id\":\"CE2\"});\n\tprintStructure.push({\"id\":\"CE3\"});\n\tprintStructure.push({\"id\":\"CE4\"});\n\tprintStructure.push({\"id\":\"CE5\"});\n\tprintStructure.push({\"id\":\"CE5b\"});\n\tprintStructure.push({\"id\":\"CE6\"});\n\tprintStructure.push({\"id\":\"CE7\"});\n\tprintStructure.push({\"id\":\"CE8\"});\n\tprintStructure.push({\"id\":\"CE9\"});\n\tprintStructure.push({\"id\":\"CE\"});\n\tprintStructure.push({\"id\":\"C\"});\n\n\tprintStructure.push({\"id\":\"dR\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"dRA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RA1\"});\n\tprintStructure.push({\"id\":\"RA2\"});\n\tprintStructure.push({\"id\":\"RA3\"});\n\tprintStructure.push({\"id\":\"RA4\"});\n\tprintStructure.push({\"id\":\"RA5\"});\n\tprintStructure.push({\"id\":\"RA6\"});\n\tprintStructure.push({\"id\":\"RA7\"});\n\tprintStructure.push({\"id\":\"RA8\"});\n\tprintStructure.push({\"id\":\"RA9\"});\n\tprintStructure.push({\"id\":\"RA10\"});\n\tprintStructure.push({\"id\":\"RA11\"});\n\tprintStructure.push({\"id\":\"RA\"});\n\tprintStructure.push({\"id\":\"dRB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RB1\"});\n\tprintStructure.push({\"id\":\"RB2\"});\n\tprintStructure.push({\"id\":\"RB4\"});\n\tprintStructure.push({\"id\":\"RB5\"});\n\tprintStructure.push({\"id\":\"RB6\"});\n\tprintStructure.push({\"id\":\"RB7\"});\n\tprintStructure.push({\"id\":\"RB\"});\n\tprintStructure.push({\"id\":\"dRC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RC1\"});\n\tprintStructure.push({\"id\":\"RC2\"});\n\tprintStructure.push({\"id\":\"RC3\"});\n\tprintStructure.push({\"id\":\"RC\"});\n\tprintStructure.push({\"id\":\"dRD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RD1\"});\n\tprintStructure.push({\"id\":\"RD2\"});\n\tprintStructure.push({\"id\":\"RD3\"});\n\tprintStructure.push({\"id\":\"RD4\"});\n\tprintStructure.push({\"id\":\"RD5\"});\n\tprintStructure.push({\"id\":\"RD\"});\n\tprintStructure.push({\"id\":\"dRE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RE1\"});\n\tprintStructure.push({\"id\":\"RE2\"});\n\tprintStructure.push({\"id\":\"RE\"});\n\tprintStructure.push({\"id\":\"R\"});\n\n\tprintStructure.push({\"id\":\"dCG\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"CG1\"});\n\tprintStructure.push({\"id\":\"CG2\"});\n\tprintStructure.push({\"id\":\"CG\"});\n\tprintStructure.push({\"id\":\"dRG\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RG1\"});\n\tprintStructure.push({\"id\":\"RG2\"});\n\tprintStructure.push({\"id\":\"RG\"});\n\n\n\treturn printStructure;\n}", "function carregaOpcoesUnidadeSuporte(){\n\tcarregaTipoGerencia();\t\n\tcarregaTecnicos();\n\tcarregaUnidadesSolicitantes();\t\n\tcarregaEdicaoTipos();//no arquivo tipoSubtipo.js\n\tcarregaComboTipo();//no arquivo tipoSubtipo.js\n}", "function Terreno (largura, comprimento) {\n this.largura = largura\n this.comprimento = comprimento\n this.area = comprimento*largura\n}", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function heredaDe(prototipoHijo, prototipoPadre) { // Esta es una funcion que recibe funciones\n var fn = function () {} // Creamos una funcion vacia\n fn.prototype = prototipoPadre.prototype // Hacemos una copia del prototipo del Padre para guardarlo en el protitipo de nuestra funcion vacia\n prototipoHijo.prototype = new fn // De esa forma evitamos acceder directamente a la funcion y no la pizamos\n prototipoHijo.prototype.constructor = prototipoHijo //Asignamos la funcion constructora\n //Si no agregamos la ultima linea se estaria llamando al constructor de prototipo padre\n}", "constructor(name, type, evolutions){\n //This hace referencia al elemento que está por dentro.\n this.#name = name;\n this.#type = type;\n this.#evolutions = evolutions;\n }", "function heredaDe(prototipoHijo, prototipoPadre){\n var fn = function () {}\n fn.prototype = prototipoPadre.prototype\n prototipoHijo.prototype = new fn\n //asignamos la funcion constructora de la clase claseHija\n prototipoHijo.prototype.constructor = prototipoHijo\n}", "function inicializarArrayResultados() {\r\n for(var i=1;i<=totalPreguntas;i++) {\r\n resultadoEncuesta[\"p\"+i+\"-alt\"]=[0,0,0,0];\r\n }\r\n}", "function pengkodeanPopulasi(pos) {\n var urutan = new Array();\n //Pencocokan Posisi\n for (var i = 0; i < pos.length; i++) {\n urutan[i] = pengkodean1Partikel(pos[i]);\n }\n return urutan;\n}", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function PropulsionUnit() {\n\t}", "function extraerNodoU(){\r\n\tvar nuevo = new nodo();\r\n\tvar colaTemp = new cola();\r\n\twhile(this.raiz.sig!=null){\t\r\n\t\tvar temp = new nodo();\t\t\r\n\t\ttemp = this.extraerPrimero();\r\n\t\tcolaTemp.insertarPrimero(temp.proceso,temp.nombre, temp.tiempo, temp.quantum,temp.Tllegada,\r\n\t\t\ttemp.Tfinalizacion,temp.Turnarround,temp.prioridad,temp.rafagareal,temp.numEjecucion,temp.contenido); \t\t\r\n\t}\r\n\tnuevo = this.extraerPrimero();\t\t\r\n\twhile(!colaTemp.vacia()){\r\n\t\tvar temp = new nodo();\t\t\r\n\t\ttemp = colaTemp.extraerPrimero();\r\n\t\tthis.insertarPrimero(temp.proceso,temp.nombre, temp.tiempo, temp.quantum,temp.Tllegada,\r\n\t\t\ttemp.Tfinalizacion,temp.Turnarround,temp.prioridad,temp.rafagareal,temp.numEjecucion,temp.contenido); \t\r\n\t}\r\n\treturn nuevo;\r\n}", "function p_generar_factura_xml(){\n var estructuraFactura = {\n factura:{\n _id:\"comprobante\",\n _version:\"1.0.0\",\n infoTributaria:{\n ambiente:null,\n tipoEmision:null,\n razonSocial:null,\n nombreComercial:null,\n ruc:null,\n claveAcceso:null,\n codDoc:null,\n estab:null,\n ptoEmi:null,\n secuencial:null,\n dirMatriz:null,\n },\n infoFactura:{\n fechaEmision:null,\n dirEstablecimiento:null,\n contribuyenteEspecial:null,\n obligadoContabilidad:null,\n tipoIdentificacionComprador:null,\n guiaRemision:null,\n razonSocialComprador:null,\n identificacionComprador:null,\n direccionComprador:null,\n totalSinImpuestos:null,\n totalDescuento:null,\n totalConImpuestos:{\n totalImpuesto:[\n {\n codigo:2,\n codigoPorcentaje:2,\n //descuentoAdicional:null,\n baseImponible:null,\n valor:null,\n },\n {\n codigo:3,\n codigoPorcentaje:3072,\n baseImponible:null,\n valor:null,\n },\n {\n codigo:5,\n codigoPorcentaje:5001,\n baseImponible:null,\n valor:null,\n }\n ]\n },\n propina:null,\n importeTotal:null,\n moneda:null,\n },\n detalles:{\n detalle:[\n {\n codigoPrincipal:null, //opcional\n codigoAuxiliar:null, //obliatorio cuando corresponda\n descripcion:null,\n cantidad:null,\n precioUnitario:null,\n descuento:null,\n precioTotalSinImpuesto:null,\n detallesAdicionales:{\n detAdicional:[\n {\n _nombre:\"\",\n _valor:\"\"\n }\n //<detAdicional nombre=\"Marca Chevrolet\" valor=\"Chevrolet\"/>\n ]\n },\n \n impuestos:{\n impuesto:[\n {\n codigo:2,\n codigoPorcentaje:2,\n tarifa:12,\n baseImponible:null,\n valor:null\n },\n {\n codigo:3,\n codigoPorcentaje:3072,\n tarifa:5,\n baseImponible:null,\n valor:null\n },\n {\n codigo:5,\n codigoPorcentaje:5001,\n tarifa:0.02,\n baseImponible:null,\n valor:null\n }\n ]\n }\n }\n ]\n },\n infoAdicional:{\n campoAdicional:[\n {\n _nombre:\"Codigo Impuesto ISD\",\n __text:4580\n },\n {\n _nombre:\"Impuesto ISD\",\n __text:\"15.42x\"\n }\n //<campoAdicional nombre=\"Codigo Impuesto ISD\">4580</campoAdicional> //Obligatorio cuando corresponda\n //<campoAdicional nombre=\"Impuesto ISD\">15.42x</campoAdicional> //Obligatorio cuando corresponda\n ]\n }\n }\n };\n \n var tipoComprobante = 'factura';\n var estab = 1;\n var ptoEmi = 1;\n\n estructuraFactura[tipoComprobante].infoTributaria.ambiente = 1; //1 pruebas, 2 produccion\n estructuraFactura[tipoComprobante].infoTributaria.tipoEmision = 1; //1 emision normal\n estructuraFactura[tipoComprobante].infoTributaria.razonSocial = 'JYBARO SOFTWARE HOUSE CIA LTDA';\n estructuraFactura[tipoComprobante].infoTributaria.nombreComercial = 'JYBARO SOFTWARE HOUSE CIA LTDA';\n estructuraFactura[tipoComprobante].infoTributaria.ruc = '1792521254001';\n estructuraFactura[tipoComprobante].infoTributaria.claveAcceso = ''; //se lo llena más abajo\n estructuraFactura[tipoComprobante].infoTributaria.codDoc = pad(codDoc[tipoComprobante], 2); //tipo de comprobante\n estructuraFactura[tipoComprobante].infoTributaria.estab = pad(estab, 3);\n estructuraFactura[tipoComprobante].infoTributaria.ptoEmi = pad(ptoEmi, 3);\n estructuraFactura[tipoComprobante].infoTributaria.secuencial = pad(p_obtener_secuencial(codDoc[tipoComprobante]), 9);\n estructuraFactura[tipoComprobante].infoTributaria.dirMatriz = 'Carapungo Av. Luis Vacarri B9 S29 y Carihuairazo';\n \n \n estructuraFactura[tipoComprobante].infoFactura.fechaEmision = moment().format('DD/MM/YYYY');\n estructuraFactura[tipoComprobante].infoFactura.dirEstablecimiento = 'Carapungo B9-S29';\n estructuraFactura[tipoComprobante].infoFactura.contribuyenteEspecial = '5368';\n estructuraFactura[tipoComprobante].infoFactura.obligadoContabilidad = 'SI';\n estructuraFactura[tipoComprobante].infoFactura.tipoIdentificacionComprador = pad(4, 2);\n estructuraFactura[tipoComprobante].infoFactura.guiaRemision = '001-001-000000001';\n estructuraFactura[tipoComprobante].infoFactura.razonSocialComprador = 'PRUEBAS SERVICIO DE RENTAS INTERNAS';\n estructuraFactura[tipoComprobante].infoFactura.identificacionComprador = '1713328506001';\n estructuraFactura[tipoComprobante].infoFactura.direccionComprador = 'salinas y santiago';\n estructuraFactura[tipoComprobante].infoFactura.totalSinImpuestos = '2995000.00';\n estructuraFactura[tipoComprobante].infoFactura.totalDescuento = '5000.00';\n \n\n estructuraFactura[tipoComprobante].infoFactura.totalConImpuestos.totalImpuesto[0].baseImponible = '309750.00';\n estructuraFactura[tipoComprobante].infoFactura.totalConImpuestos.totalImpuesto[0].valor = '37170.00';\n\n estructuraFactura[tipoComprobante].infoFactura.totalConImpuestos.totalImpuesto[1].baseImponible = '295000.00';\n estructuraFactura[tipoComprobante].infoFactura.totalConImpuestos.totalImpuesto[1].valor = '14750.00';\n \n estructuraFactura[tipoComprobante].infoFactura.totalConImpuestos.totalImpuesto[2].baseImponible = '12000.00';\n estructuraFactura[tipoComprobante].infoFactura.totalConImpuestos.totalImpuesto[2].valor = '240.00';\n \n estructuraFactura[tipoComprobante].infoFactura.propina = '0.00';\n estructuraFactura[tipoComprobante].infoFactura.importeTotal = '3371160.00';\n estructuraFactura[tipoComprobante].infoFactura.moneda = 'DOLAR'; \n \n estructuraFactura[tipoComprobante].infoTributaria.claveAcceso = p_obtener_codigo_autorizacion_desde_comprobante(estructuraFactura);\n \n \n estructuraFactura[tipoComprobante].detalles.detalle[0].codigoPrincipal = '125BJC-01';\n estructuraFactura[tipoComprobante].detalles.detalle[0].codigoAuxiliar = '1234D56789-A';\n estructuraFactura[tipoComprobante].detalles.detalle[0].descripcion = 'CAMIONETA 4X4 DIESEL 3.7';\n estructuraFactura[tipoComprobante].detalles.detalle[0].cantidad = '10.00';\n estructuraFactura[tipoComprobante].detalles.detalle[0].precioUnitario = '300000.00';\n estructuraFactura[tipoComprobante].detalles.detalle[0].descuento = '5000.00';\n estructuraFactura[tipoComprobante].detalles.detalle[0].precioTotalSinImpuesto = '295000.00';\n \n estructuraFactura[tipoComprobante].detalles.detalle[0].detallesAdicionales.detAdicional[0]._nombre = 'Marca Chevrolet';\n estructuraFactura[tipoComprobante].detalles.detalle[0].detallesAdicionales.detAdicional[0]._valor = 'Chevrolet';\n \n \n estructuraFactura[tipoComprobante].detalles.detalle[0].impuestos.impuesto[0].baseImponible = '309750.00';\n estructuraFactura[tipoComprobante].detalles.detalle[0].impuestos.impuesto[0].valor = '361170.00';\n \n estructuraFactura[tipoComprobante].detalles.detalle[0].impuestos.impuesto[1].baseImponible = '295000.00';\n estructuraFactura[tipoComprobante].detalles.detalle[0].impuestos.impuesto[1].valor = '14750.00';\n \n\n estructuraFactura[tipoComprobante].detalles.detalle[0].impuestos.impuesto[2].baseImponible = '12000.00';\n estructuraFactura[tipoComprobante].detalles.detalle[0].impuestos.impuesto[2].valor = '240.00';\n \n \n var x2js = new X2JS({useDoubleQuotes:true});\n \n var xmlAsStr = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n';\n xmlAsStr += x2js.json2xml_str(estructuraFactura);\n \n return xmlAsStr;\n}", "function grafo_pi(grafo,grafo_posiciones,coord)\n{\nvar id_nodo=nodo_distancia_menor(coord,grafo_posiciones);//guardamos el id del nodo mas cercando al pi\nvar tam=grafo.length;\nvar subtam;//variable usada para copiar las listas de adyacencia\nvar grafo_aux= new Array():\n\n\tfor(var i=0;i<tam;i++)\n\t{\n\tgrafo_aux[i]=new Array();\n\tgrafo_aux[i][0]=grafo[i][0]://guardamos el id actual\n\tsubtam=grafo[i][1].length;//guardamos la cantidad de adyacentes\n\tgrafo_aux[i][1]=new Array();\n\t\tfor(var j=0;i<subtam;j++)//copiamos todos los adyacentes al nodo actual\n\t\t{\n\t\tgrafo_aux[i][1][j]=new Array();\n\t\tcopiar_arreglo(grafo_aux[i][1][j],grafo[i][1][j]);//copiamos el j-esimo adyacente al i-esimo adyacente del grafo\n\t\t}\n\t\tif(id_nodo==grafo_aux[i][0])//si este es el nodo adyacente mas cercando a la posicion \n\t\t\t{\n\t\t\tgrafo_aux[i][1][grafo_aux[i][1].length][0]=-2;//ID del punto ingresado por el usuario, es generico\n\t\t\tgrafo_aux[i][1][grafo_aux[i][1].length][1]=0;//Peso para ir del nodo al punto ingresado por el usuario, no es relevante\n\t\t\t}\n\t}\n\treturn grafo_aux;\n}", "constructor(Brand, Ram, Storage, Prossesor) { \n this.PC_Brand = Brand;\n this.PC_Ram = Ram;\n this.PC_Storage = Storage;\n this.PC_Prossesor = Prossesor;\n }", "function generarCola(usuario,permiso) {\n\tconsole.log(\"generamos cola\");\n\tlet tabla = {\n\t\t\"datos\":[\n\t\t\t{\n\t\t\t\t\"Estado\":\"Genera permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdtes. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Ausencia finalizada\",\n\t\t\t\t\"Contador\":0\n\t\t\t}\n\t\t]\n\t};\n\tswitch (permiso) {\n\t\tcase \"Profesor\":\n\t\t\tpideDatos(\"peticion\",\"?usuario=\"+usuario,(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tbreak;\n\t\tcase \"Directivo\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\tif (dato[\"estado_proceso\"]===1 || dato[\"estado_proceso\"]===3){\n\t\t\t\t\t\t\tif (dato.usuario===usuario){\n\t\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\n\n\t\t\tbreak;\n\t\tcase \"Admin\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\t\t\tbreak;\n\t}\n}", "function _ConvertePericias() {\n for (var i = 0; i < gEntradas.pericias.length; ++i) {\n var pericia_personagem = gPersonagem.pericias.lista[gEntradas.pericias[i].chave];\n pericia_personagem.pontos = gEntradas.pericias[i].pontos;\n pericia_personagem.complemento = 'complemento' in gEntradas.pericias[i] ? gEntradas.pericias[i].complemento : '';\n }\n}", "function enviataxaaula(percent_aula, id_aula, id_projeto) {\n var envio = {}\n envio.id_contato = get_data('geral').id\n envio.id_aula = id_aula\n envio.percentual = percent_aula\n envio.email = get_data('geral').email \n envio.id_projeto = id_projeto \n\n set_tempo_ondemand(envio, (stst) => {\n //console.log('inserido - ' + id_aula + ' - ' + percent_aula + ' - ' + envio.id_contato)\n })\n}", "constructor(especificaciones) {\n\t this.puerto = especificaciones.puerto;\n\t this.ip = especificaciones.ip;\n\t this.inventario = especificaciones.inventario;\n\t this.idAlmacen = especificaciones.idAlmacen;\n\t }", "calculerPourUnelement(element,bacterie,col){\n\t\tlet glucose = element.glucose;//\n\t\tlet color = ['#000000','#800000','#008000','#cc99ff','#ccff99','#ffe699','#ff6384','#36a2eb','#cc65fe','#ffce56'];\n\t\tlet bacterieTab = new Array(this.nombreHeurs);\n\t\tbacterieTab[0] = this.bacteriesBase;\n\t\tfor(let i = 1 ; i < this.nombreHeurs ; i++){\n\t\t\tconsole.log(\"Etape : \"+i+\" glucose : \"+glucose+\"\\n\");\n\t\t\tif(glucose > 0){\n\t\t\t\tlet ajoutTemp = bacterieTab[i-1] * element.facteurMultiplication * bacterie.division * this.facteurTemperature(element,bacterie) * this.facteurPh(element,bacterie);\n\t\t\t\tbacterieTab[i] = ajoutTemp;\n\t\t\t\tif(glucose - GlucoseParDivision*ajoutTemp >= 0){\n\t\t\t\t\tglucose = glucose - GlucoseParDivision*ajoutTemp ;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tglucose = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbacterieTab[i] = bacterieTab[i-1]\n\t\t\t}\n\t\t\tif(i >= cycleBacterien ){\n\t\t\t\tif(bacterieTab[i] - bacterieTab[i-cycleBacterien] >= 0){\n\t\t\t\tbacterieTab[i] = bacterieTab[i] - bacterieTab[i-cycleBacterien];//mort de bacteries\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbacterieTab[i] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn {data : bacterieTab , label : element.nom ,borderColor : color[col],fill : false ,borderWidth : 1 };\n\t}", "function Compra(productos, importe, metodoDePago,cantCuotas){\n this.productos = productos;\n this.importe = importe;\n this.metodoDePago = metodoDePago;\n this.cantCuotas = cantCuotas;\n financiar = function(){\n if (this.metodoDePago = 'C' && this.cantCuotas > 1){\n importe = importe/cantCuotas\n }\n }\n recibo = function(){\n \n\n return `Productos ${Array.from(productos.nombre)}\\n Importe final = ${importe} en ${cantCuotas}` \n }\n}", "static get properties(){\n return{\n porcentaje: {type:Number,}\n \n\n };\n \n}", "function dibujar_tier(){\n\n var aux=0;\n var padre=$(\"#ordenamientos\"); // CONTENEDOR DE TODOS LOS TIER Y TABLAS\n for(var i=0;i<tier_obj.length;i++){ // tier_obj = OBJETO CONTENEDOR DE TODOS LOS TIER DE LA NAVE\n if(i==0) { // PRIMER CASO\n aux=tier_obj[0].id_bodega;\n aux=tier_obj[i].id_bodega;\n var titulo1= $(\"<h4 id='bodega' > BODEGA \"+tier_obj[i].num_bodega+\"</h4>\");\n padre.append(titulo1);\n }\n if(aux!=tier_obj[i].id_bodega){\n aux=tier_obj[i].id_bodega;\n var titulo1= $(\"<h4 id='bodega' > BODEGA \"+tier_obj[i].num_bodega+\"</h4>\");\n padre.append(titulo1);\n }\n\n // DIV CONTENEDOR DEL TITULO, TABLA DE DATOS Y TIER\n var tier_div= $(\"<div class='orden_tier_div'></div>\");\n padre.append( tier_div );\n\n // DIV CON EL TITULO Y LA TABLA VACIA\n var titulo2= $(\"<div id='div\"+tier_obj[i].id_tier+\"'><h4 id='tier'> M/N. \"+tier_obj[i].nombre+\" ARROW . . . . .HOLD Nº \"+tier_obj[i].num_bodega+\" </h4><table class='table table-bordered dat'></table></div>\");\n tier_div.append( titulo2 );\n\n // DIV CON EL TIER Y SUS DIMENSIONES\n var dibujo_tier=$(\"<div class='dibujo1_tier'></div>\");\n\n //DIV DEL RECTANGULO QUE SIMuLA UN TIER\n\n // LARGO AL LADO DERECHO DEL TIER\n var largo_tier=$(\"<div class='largo_tier'><p>\"+tier_obj[i].largo+\" mts</p></div>\");\n dibujo_tier.append( largo_tier );\n\n // EL ID DEL DIV, SERA EL ID DEL TIER EN LA BASE DE DATOS\n var cuadrado_tier=$(\"<div class='dibujo_tier' id=\"+tier_obj[i].id_tier+\"></div>\");\n dibujo_tier.append( cuadrado_tier );\n\n // ANCHO DEBAJO DEL TIER\n var ancho_tier=$(\"<div class='ancho_tier'><p>\"+tier_obj[i].ancho+\" mts</p></div>\");\n dibujo_tier.append( ancho_tier );\n\n tier_div.append( dibujo_tier );\n }\n\n datos_tier(); // ASIGNAR DATOS A LA TABLE DE CADA TIER\n}", "function _CarregaPericias() {\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var achou = false;\n for (var i = 0; i < pericia.classes.length; ++i) {\n // Aplica as pericias de mago a magos especialistas tambem.\n if (pericia.classes[i] == 'mago') {\n achou = true;\n break;\n }\n }\n if (!achou) {\n continue;\n }\n for (var chave_classe in tabelas_classes) {\n var mago_especialista = chave_classe.search('mago_') != -1;\n if (mago_especialista) {\n pericia.classes.push(chave_classe);\n }\n }\n }\n var span_pericias = Dom('span-lista-pericias');\n // Ordenacao.\n var divs_ordenados = [];\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var habilidade = pericia.habilidade;\n var prefixo_id = 'pericia-' + chave_pericia;\n var div = CriaDiv(prefixo_id);\n var texto_span = Traduz(pericia.nome) + ' (' + Traduz(tabelas_atributos[pericia.habilidade]).toLowerCase() + '): ';\n if (tabelas_pericias[chave_pericia].sem_treinamento) {\n texto_span += 'ϛτ';\n }\n div.appendChild(\n CriaSpan(texto_span, null, 'pericias-nome'));\n\n var input_complemento =\n CriaInputTexto('', prefixo_id + '-complemento', 'input-pericias-complemento',\n {\n chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n AtualizaGeral();\n evento.stopPropagation();\n }\n });\n input_complemento.placeholder = Traduz('complemento');\n div.appendChild(input_complemento);\n\n var input_pontos =\n CriaInputNumerico('0', prefixo_id + '-pontos', 'input-pericias-pontos',\n { chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n ClickPericia(this.chave_pericia);\n evento.stopPropagation(); } });\n input_pontos.min = 0;\n input_pontos.maxlength = input_pontos.size = 2;\n div.appendChild(input_pontos);\n\n div.appendChild(CriaSpan(' ' + Traduz('pontos') + '; '));\n div.appendChild(CriaSpan('0', prefixo_id + '-graduacoes'));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total-bonus'));\n div.appendChild(CriaSpan(' = '));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total'));\n\n // Adiciona as gEntradas\n gEntradas.pericias.push({ chave: chave_pericia, pontos: 0 });\n // Adiciona ao personagem.\n gPersonagem.pericias.lista[chave_pericia] = {\n graduacoes: 0, bonus: new Bonus(),\n };\n // Adiciona aos divs.\n divs_ordenados.push({ traducao: texto_span, div_a_inserir: div});\n }\n divs_ordenados.sort(function(lhs, rhs) {\n return lhs.traducao.localeCompare(rhs.traducao);\n });\n divs_ordenados.forEach(function(trad_div) {\n if (span_pericias != null) {\n span_pericias.appendChild(trad_div.div_a_inserir);\n }\n });\n}", "pedalConfigFromUI(faustUI) {\n let elements = this.faustParser.pedalConfigFromUI(faustUI);\n let width = Math.max(...elements.map(elm => elm.width)) + 20;\n width = width < 130 ? 130 : width;\n let height = 10;\n\n elements.forEach(elem => {\n // MICHEL BUFFA DIRTY FIX: as labels may contain\n // spaces and / and are used as HTML ids, let's filter\n // these chars ansd replace them by underscores...\n elem.label = elem.label.replace(/ /g, \"_\");\n elem.label = elem.label.replace(\"/\", \"_\");\n\n elem.x = width / 2 - elem.width / 2;\n elem.y = height;\n height += elem.height + 30;\n });\n\n let detail = {\n width: width,\n height: height,\n elements: elements\n };\n\n return detail;\n }", "function crear_partido_llave(nombre_llave) {\n return {nombre_llave:nombre_llave,\n equipo_1:'',\n goles_eq_1:'',\n equipo_2:'',\n goles_eq_2:''\n };\n}", "function paz(){\n\tDepartamento = new Array('<p>La Paz</p>');\n\tHistoria = new Array('<p class=\"text-justify\">La Paz es un departamento de El Salvador ubicado en la zona oriental del país. Limita al Norte con la república de Honduras; al Sur y al Oeste con el departamento de San Miguel, y al Sur y al Este con el departamento de La Unión. Su cabecera departamental es San Francisco. Morazán comprende un territorio de 1 447 km² y cuenta con una población de 181 285 habitantes.</p>');\n\t/*Declaracion de Variable Interna para recorrer el arreglo de Municipios,\n\tde la Misma manera para recorrer los elementos de otros arreglos*/\n\tvar Municipioss, Municipioss2, rios, lagos, volcanes, centertour, personaje;\n\tMunicipioss = \"\";\n\tMunicipios = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> La Union</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yucuaiquin</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Intipuca</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> El Carmen</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Bolivar</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Santa Rosa de Lima</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Anamoros</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Concepcion de Oriente</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Lislique </ol>');\n\tfor(i = 0; i < Municipios.length; i++){\n\t\tMunicipioss += Municipios[i];\n\t}\n\tMuniciipios2 = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> San Alejo</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Conchagua</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> San Jose</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yayantique</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Meanguera del Golfo</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Pasaquina</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Nueva Esparta</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Poloros</ol>');\n\tfor(m = 0; m< Municiipios2.length; m++){\n\t\tMunicipioss2 += Municiipios2[m];\n\t}\n\tRios = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> PLaya El Jaguey</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Playa Blanca</ol>');\n\trios = \"\";\n\tfor(j = 0; j < Rios.length; j++){\n\t\trios += Rios[j];\n\t}\n\tVolcanes = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Volcan Conchagua</ol>');\n\tPersonajes = new Array('<ol><span class=\"glyphicon glyphicon-ok\"></span> Antonio Grau Mora</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Maria Cegarra Salcedo</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Asensio Saez</ol>');\n\tpersonaje = \"\";\n\tfor(k = 0; k < Personajes.length; k++){\n\t\tpersonaje += Personajes[k];\n\t}\n\tCentroTour = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Parque de la Familia</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Bosque Conchagua</ol>');\n\tcentertour = \"\";\n\tfor(c = 0; c < CentroTour.length; c++){\n\t\tcentertour += CentroTour[c];\n\t}\n\n\tdocument.getElementById(\"Departament\").innerHTML = Departamento[0];\n\tdocument.getElementById(\"History\").innerHTML = Historia[0];\n\tdocument.getElementById(\"Municipio\").innerHTML = Municipioss;\n\tdocument.getElementById(\"Municipio2\").innerHTML = Municipioss2;\n\tdocument.getElementById(\"centro\").innerHTML = centertour;\n\tdocument.getElementById(\"Persons\").innerHTML = personaje;\n\tdocument.getElementById(\"river\").innerHTML = rios;\n\tdocument.getElementById(\"volca\").innerHTML = Volcanes[0];\n}", "function puntosCultura(){\r\n\t\tvar a = find(\"//div[@id='lmid2']//b\", XPList);\r\n\t\tif (a.snapshotLength != 5) return;\r\n\r\n\t\t// Produccion de puntos de cultura de todas las aldeas\r\n\t\tvar pc_prod_total = parseInt(a.snapshotItem(2).innerHTML);\r\n\t\t// Cantidad de puntos de cultura actuales\r\n\t\tvar pc_actual = parseInt(a.snapshotItem(3).innerHTML);\r\n\t\t// Puntos de cultura necesarios para fundar la siguiente aldea\r\n\t\tvar pc_aldea_prox = parseInt(a.snapshotItem(4).innerHTML);\r\n\r\n\t\t// 下一个的村庄数\r\n\t\tvar aldeas_actuales = (check3X() )? pc2aldeas3X(pc_aldea_prox) : pc2aldeas(pc_aldea_prox) ;\r\n\t\t// 目前村庄数\r\n\t\tvar aldeas_posibles = (check3X() )? pc2aldeas3X(pc_actual) : pc2aldeas(pc_actual) ;\r\n\r\n\t\tvar texto = '<table class=\"tbg\" align=\"center\" cellspacing=\"1\" cellpadding=\"2\"><tr class=\"rbg\"><td>' + T('ALDEA') + '</td><td>' + T('PC') + \"</td></tr>\";\r\n\t\tvar j = pc_f = 0;\r\n\t\tfor (var i = 0; i < 3; i++){\r\n\t\t\tvar idx = i + j;\r\n\r\n\t\t\ttexto += '<tr><td>' + (aldeas_actuales + idx + 1) + '</td><td>';\r\n\r\n\t\t\t// 下一级需要的文明\r\n\t\t\tvar pc_necesarios = (check3X() )? aldeas2pc3X(aldeas_actuales + idx) : aldeas2pc(aldeas_actuales + idx) ;\r\n\r\n\t\t\t// Si hay PC de sobra\r\n\t\t\tif (pc_necesarios < pc_actual) {\r\n\t\t\t\ttexto += T('FUNDAR');\r\n\t\t\t\tpc_f = 1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t// Tiempo en segundos hasta conseguir los puntos de cultura necesarios\r\n\t\t\t\tvar tiempo = ((pc_necesarios - pc_actual) / pc_prod_total) * 86400;\r\n\r\n\t\t\t\tvar fecha = new Date();\r\n\t\t\t\tfecha.setTime(fecha.getTime() + (tiempo * 1000));\r\n\t\t\t\tvar texto_tiempo = calcularTextoTiempo(fecha);\r\n\r\n\t\t\t\ttexto += T('FALTA') + ' <b>' + (pc_necesarios - pc_actual) + '</b> ' + T('PC') +'<br/>';\r\n\t\t\t\ttexto += T('LISTO') + \" \" + texto_tiempo;\r\n\t\t\t}\r\n\t\t\ttexto += '</td></tr>';\r\n\r\n\t\t\tif (pc_f && pc_necesarios >= pc_actual) {\r\n\t\t\t\tj = idx + 1;\r\n\t\t\t\tpc_f = i = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\ttexto += '</table>';\r\n\r\n\t\ta.snapshotItem(4).parentNode.innerHTML += \"<p>\" + texto + \"</p>\";\r\n\t}", "function gerProObj()\n{\n\tvar pro=_tg(\"td\",\"type=profile\");\n\t//alert(pro.length);\n\t//bug(\"the total number of the profile container\",pro.length);\n\treturn pro;\n}", "function ConfigPessoa(obj){\n\tobj.mutacao = new Array();\n\tobj.qualidade=null;\n\tobj.aptidao=null;\n\tobj.soma=null;\n\tobj.stexto=null;\n\tobj.nivel=Nivel;\n\treturn obj;\n}", "function crea_cerchio_spesso(raggio,spessore){\n var dominio3D = DOMAIN([[0,1],[0,1]])([30,40]);\n\n var c1 = punti_controllo_cerchio(raggio)\n var c2 = proporzione(c1,(10-spessore)*10)\n\n var nodi = calcola_nodi(c1,2)\n\n var nn1 = NUBS(S0)(2)(nodi)(c1);\n var nn2 = NUBS(S0)(2)(nodi)(c2);\n\n var bezier = BEZIER(S1)([nn1,nn2]);\n var unione = R([1,2])(PI/2)(MAP(bezier)(dominio3D));\n\n return unione;\n }", "function volar(golondrina, distancia) {\n \n return{\n energia: golondrina.energia - (2*distancia), \n nombre:golondrina.nombre}\n}", "getBuscaProfundidade(verticeEscolhido) {\n\t\tif(this.trep == 1) {\n\t\t\tlet lista = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = [];\n\t\t\tlet buscaProf = [];\n\t\t\tlet arrayVertices = [];\n\t\t\tlet tempo = 0;\n\n\t\t //Criação de uma lista de array contendo todos os vertices diferentes do\n\t\t //vertice escolhido pelo usuário\n\t\t for(let i = 0; i < quantVertice; i++) {\n\t\t \tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t }\n\t\t /*Estrutura auxiliar de array bidimensional contendo na primeira posição da\n\t\t segunda dimensão um objeto tendo cor, tempo da primeira passagem,\n\t\t tempo da segunda passagem e antecessor. Na segunda posição da mesma dimensão a grafo*/\n\t\t for(let i = 0; i < quantVertice; i++){\n\t\t \tbuscaProf[i] = {\n\t\t \t\tcor: \"branco\",\n\t\t \t\ttempoInicial: \"indef\",\n\t\t \t\ttempoFinal: \"indef\",\n\t\t \t\tantecessor: \"indef\",\n\t\t \t\tadj: lista[i]\n\t\t \t}\n\t\t }\n while(arrayVertices.length > 0){\n\n\t\t \tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\n\t\t \t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t \t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t \t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t \t\tbacktracking.push(verticeEscolhido);\n\n\t\t \t\tvar verticeSecundario\n\n\t\t \t\twhile(backtracking.length > 0){\n\n\t\t \t\t\tif(buscaProf[verticeEscolhido].adj.length > 0){\n\n\t\t \t\t\t\tverticeSecundario = buscaProf[verticeEscolhido].adj.shift().vertice;\n\n\t\t \t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\t\t \t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t \t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t \t\t\t\t}\n\n\n\t\t \t\t\t}\n\t\t \t\t\telse{\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t \t\t\t\tverticeEscolhido = backtracking.pop()\n\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t}\n\t\t \tverticeEscolhido = arrayVertices.shift();\n\t\t }\n\n\t\t buscaProf[principal].antecessor = null\n\n\t\t return buscaProf;\n\t\t}\n\t\telse {\n\t\t\tlet matriz = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = []\n\t\t\tlet buscaProf = []\n\t\t\tlet arrayVertices = []\n\t\t\tlet tempo = 0\n\n\t\t\tfor(let i = 0; i < quantVertice; i++) {\n\t\t\t\tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t\t}\n\n\t\t\tfor(let j = 0; j < quantVertice; j++){\n\t\t\t\tvar obj = {\n\t\t\t\t\tcor: \"branco\",\n\t\t\t\t\ttempoInicial: \"indef\",\n\t\t\t\t\ttempoFinal: \"indef\",\n\t\t\t\t\tantecessor: \"indef\"\n\t\t\t\t}\n\t\t\t\tbuscaProf[j] = obj\n\t\t\t}\n //contador de vertices, recebe a quantidade de vértices - 1, para ir até o penúltimo na busca\n\t\t\tlet contVert = quantVertice - 1\n\n\t\t\twhile(contVert > 0){\n\t\t\t\tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t\t\t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t\t\t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\n\t\t\t\t\tvar verticeSecundario\n\n\n\t\t\t\t\twhile(backtracking.length > 0){\n\n\t\t\t\t\t\tfor(verticeSecundario = 0; verticeSecundario < quantVertice; verticeSecundario++){\n\t\t\t\t\t\t\tif(matriz[verticeEscolhido][verticeSecundario] != \"inf\"){\n\t\t\t\t\t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\n\t\t\t\t\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t\t\t\t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t\t\t\t\t\t\t\tbreak\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\n\t\t\t\t\t\tif(verticeSecundario == quantVertice){\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t\t\t\t\t\tverticeEscolhido = backtracking.pop()\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tverticeEscolhido = arrayVertices.shift();\n\t\t\t\tcontVert--\n\t\t\t}\n\n\t\t\tbuscaProf[principal].antecessor = null\n\t\t\treturn buscaProf\n\t\t}\n }", "function IndicadorGradoAcademico () {}", "function Piso(nome, sx, sy, dx, dy, dWidth, dHeight) {\n\t//valores fixos\n\tthis.pisoInfectado = false;\n this.nome = nome;\t\n\tthis.sWidth = 8;\n\tthis.sHeight = 8;\t\n\t//valores variaveis\n\tthis.sx = sx;\n\tthis.sy = sy;\n\tthis.dx = dx;\n\tthis.dy = dy;\n\tthis.dWidth = dWidth;\n\tthis.dHeight = dHeight;\t\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 Pessoa(nome, sobrenome){\n\n // atributos privados\n const ID = 123123;\n const metodos = function(){\n \n }\n\n\n //atributos ou metodos publicos\n this.Pessoa = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function(){\n console.log(\"Oi sou o Metodo\");\n }\n }", "constructor(ojos, boca, extremidades, duenio) {\n super(ojos, boca, extremidades);\n this.duenio = duenio;\n this.estaDomesticado = true;\n }", "function tarea(nombre,urgencia){\n this.nombre = nombre;\n this.urgencia=urgencia;\n}", "function Oi(a,b,c,d){this.type=a;this.name=b;this.h=c;this.s=d;this.Pa=[];this.align=-1;this.oa=!0}", "function Manusia(nama,umur){\n let manusia = {}; //* inisiasi objek biar nanti diisi\n manusia.nama = nama; //* menambahkan properti objek manusia dengan simbol (.) dan assign (=) dari parameter\n manusia.umur = umur;\n manusia.energi = 0; //* menambahkan properti objek manusia bukan dari parameter\n\n manusia.makan = function(porsi){ //* membuat method makan untuk manusia\n this.energi += porsi \n return this.nama + \" telah makan sebanyak \" + porsi\n }\n\n return manusia //* mereturn objek yang sudah diisi\n}", "constructor(){\n this.hasSavedValues = false\n this.publicoAlvoSim= 0,\n this.publicoAlvoNao= 0,\n this.publicoAlvoALVA= 0,\n this.XER= 0,\n this.COP= 0,\n this.listaPrefixos= [],\n this.operacaoNaoVinculada= 0,\n this.operacaoVinculada= 0,\n this.operacaoVinculadaEmOutroNPJ= 0,\n this.acordoRegPortalSim= 0,\n this.acordoRegPortalNao= 0,\n //this.acordoRegPortalDuplicados= 0,\n this.totaisEstoque = 0,\n this.totaisFluxo = 0,\n this.estoqueNumber= 0,\n this.fluxoNumber= 0,\n this.duplicadoSimNao = 0,\n this.analisadoSimNao = 0\n }", "function generarPoblacionInicial(){\n\tarrayAux = new Array(GENES);\n\tfor(i=0;i<POBLACION;i++) {\n\n\t\t//aux con los numeros del 0 al 22\n\t\tfor(j=0;j<GENES;j++) {\n\t\t\tarrayAux[j] = j;\n\t\t}\n\n\t\t//rellenar cromosomas con el aux en orden aleatorio\n\t\tfor(j=0;j<GENES;j++) {\n\t\t\tcromosoma[i][j] = parseInt((arrayAux.splice(Math.floor(Math.random() * arrayAux.length), 1)).join(\"\"));\n\t\t}\n\t}\n}", "function escogerValorMasGrande(elemetos){\n\n}", "function clasificacion_equipos() {\n\n //deshabilitar boton 8vos\n document.getElementById(\"btn-octavos\").disabled = true;\n\n //Se carga el archivo\n json = JSON.parse(localStorage['json']);\n\n //fechas\n var fechas = [\"fecha1\",\"fecha2\",\"fecha3\"];\n\n //tabla, datos cada equipo en el torneo\n dict_puntajes_grupoA = {} ; //por definicion, como no se declaro es GLOBAL.\n dict_puntajes_grupoB = {} ;\n dict_puntajes_grupoC = {} ;\n dict_puntajes_grupoD = {} ;\n dict_puntajes_grupoE = {} ;\n dict_puntajes_grupoF = {} ;\n dict_puntajes_grupoG = {} ;\n dict_puntajes_grupoH = {} ;\n\n //Por cada equipo en el grupo se crea un objeto\n $.each(json[\"grupoA\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoA[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoB\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoB[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoC\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoC[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoD\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoD[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoE\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoE[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoF\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoF[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoG\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoG[f.nombre] = equipo;\n\n });\n\n $.each(json[\"grupoH\"][\"equipos\"], function(i, f) {\n\n var equipo = crear_puntaje_equipo(f.nombre);\n dict_puntajes_grupoH[f.nombre] = equipo;\n\n });\n\n calcular_puntos(json, \"grupoA\", fechas, [\"_#partido_1_ga\",\"_#partido_2_ga\",\"_#partido_3_ga\"], dict_puntajes_grupoA);\n calcular_puntos(json, \"grupoB\", fechas, [\"_#partido_1_gb\",\"_#partido_2_gb\",\"_#partido_3_gb\"], dict_puntajes_grupoB);\n calcular_puntos(json, \"grupoC\", fechas, [\"_#partido_1_gc\",\"_#partido_2_gc\",\"_#partido_3_gc\"], dict_puntajes_grupoC);\n calcular_puntos(json, \"grupoD\", fechas, [\"_#partido_1_gd\",\"_#partido_2_gd\",\"_#partido_3_gd\"], dict_puntajes_grupoD);\n calcular_puntos(json, \"grupoE\", fechas, [\"_#partido_1_ge\",\"_#partido_2_ge\",\"_#partido_3_ge\"], dict_puntajes_grupoE);\n calcular_puntos(json, \"grupoF\", fechas, [\"_#partido_1_gf\",\"_#partido_2_gf\",\"_#partido_3_gf\"], dict_puntajes_grupoF);\n calcular_puntos(json, \"grupoG\", fechas, [\"_#partido_1_gg\",\"_#partido_2_gg\",\"_#partido_3_gg\"], dict_puntajes_grupoG);\n calcular_puntos(json, \"grupoH\", fechas, [\"_#partido_1_gh\",\"_#partido_2_gh\",\"_#partido_3_gh\"], dict_puntajes_grupoH);\n\n console.log(dict_puntajes_grupoA);\n console.log(dict_puntajes_grupoB);\n console.log(dict_puntajes_grupoC);\n console.log(dict_puntajes_grupoD);\n console.log(dict_puntajes_grupoE);\n console.log(dict_puntajes_grupoF);\n console.log(dict_puntajes_grupoG);\n console.log(dict_puntajes_grupoH);\n\n //generar_octavos();\n generar_fase(\"octavos\",octavos);\n\n}", "function ucitajPodatkeImpl(periodicna, vanredna){\r\n //ucitavanje podataka\r\n glavniNizP=periodicna;\r\n glavniNizV=vanredna;\r\n }", "function _AtualizaPericias() {\n var span_total = Dom('pericias-total-pontos');\n span_total.textContent = gPersonagem.pericias.total_pontos;\n var span_gastos = Dom('pericias-pontos-gastos');\n span_gastos.textContent = gPersonagem.pericias.pontos_gastos;\n\n for (var chave in gPersonagem.pericias.lista) {\n var dom_pericia = Dom('pericia-' + chave);\n var pericia_personagem = gPersonagem.pericias.lista[chave];\n if (pericia_personagem.de_classe) {\n dom_pericia.className = 'pericia-de-classe';\n } else {\n dom_pericia.className = '';\n }\n var input_complemento = Dom('pericia-' + chave + '-complemento');\n input_complemento.value = pericia_personagem.complemento;\n var input_pontos = Dom('pericia-' + chave + '-pontos');\n input_pontos.value = pericia_personagem.pontos;\n\n var dom_graduacoes = Dom('pericia-' + chave + '-graduacoes');\n dom_graduacoes.textContent = pericia_personagem.graduacoes;\n var dom_total_bonus = Dom('pericia-' + chave + '-total-bonus');\n dom_total_bonus.textContent = StringSinalizada(pericia_personagem.bonus.Total(), false);\n Titulo(pericia_personagem.bonus.Exporta(), dom_total_bonus);\n var dom_total = Dom('pericia-' + chave + '-total');\n dom_total.textContent = StringSinalizada(pericia_personagem.total);\n }\n}", "function PropulsionUnit() {\n }", "function PropulsionUnit() {\n }", "constructor(nombre, apellido, altura) {\r\n this.nombre = nombre;\r\n this.apellido = apellido;\r\n this.altura = altura;\r\n }", "function RdatosLogistica(Material, Partidas, Destinos, Tiempo) {\n return { Material,Partidas, Destinos, Tiempo };\n}", "function Oggetto(_id, _anno, _trachea, _prostata, _fegato, _stomaco, _pancreas, _cervello) {\n\n // DATI E COSTRUTTORE\n this.id = Number(_id); // < Number() converte in numero intero la stringa\n this.anno = _anno;\n this.trachea = Number(_trachea);\n this.prostata = Number(_prostata);\n this.fegato = Number(_fegato);\n this.stomaco = Number(_stomaco);\n this.pancreas = Number(_pancreas);\n this.cervello = Number(_cervello);\n\n\n\n this.mostra = function() {\n // disegna, cerchio o quadrato dipende dalla forma, colore dai dati passati\n fill(this.id, this.trachea, this.prostata, this.fegato);\n\n push();\n translate(grid - 0 + this.id * grid, height / 5) + this.dy\n\n //// TESTO DATI\n fill(255);\n \n textAlign(LEFT, CENTER);\n text(this.trachea + \" \" + \"Trachea\", -65, 80);\n fill(255);\n text(this.prostata + \" \" + \"Prostata\", -65, 180);\n fill(255);\n text(this.fegato + \" \" + \"Fegato\", -65, 280);\n fill(255);\n textAlign(LEFT, CENTER);\n text(this.stomaco + \" \" + \"Stomaco\", -65, 380);\n fill(255);\n text(this.pancreas + \" \" + \"Pancreas\", -65, 480);\n fill(255);\n text(this.cervello + \" \" + \"Cervello\", -65, 580);\n\n//////////\n\n rotate(PI / 2);\n\n\n /////////////////////////////////////////////////////////////DATI \n //ELLISSE BASE\n fill(\"#ffd700\");\n noStroke(0);\n ellipse(30, 35, this.trachea*this.trachea/6, this.trachea*this.trachea/6);\n\n //ELLISSE BASE\n fill(\"#FF6347\");\n noStroke(0);\n ellipse(150, 35, this.prostata*this.prostata/6, this.prostata*this.prostata/6);\n\n //ELLISSE BASE\n fill(\"#3CB371\");\n noStroke(0);\n ellipse(250, 35, this.fegato*this.fegato/6, this.fegato*this.fegato/6);\n\n\n\n //ELLISSE BASE\n fill(\"#00CED1\");\n noStroke(0);\n ellipse(350, 35, this.stomaco*this.stomaco/6, this.stomaco*this.stomaco/6);\n\n //ELLISSE BASE\n fill(\"#FFF8DC\");\n noStroke(0);\n ellipse(450, 35, this.pancreas*this.pancreas/6, this.pancreas*this.pancreas/6);\n\n //ELLISSE BASE\n fill(\"#FF00FF\");\n noStroke(0);\n ellipse(550, 35, this.cervello*this.cervello/6, this.cervello*this.cervello/6);\n\n\n ///////////////////////////////////////////////////\n\n\n\n //ANNO\n rotate(PI / 2);\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 70 + (this.id * grid), height / 8);\n textSize(30);\n textStyle(BOLD);\n text(this.anno, 0, 0);\n pop();\n\n\n\n\n ///////Trachea\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 210, 180);\n textSize(16);\n textStyle(BOLD);\n fill(\"#ffd700\");\n text(\"Trachea\", 30, 30);\n pop();\n\n\n ///////Prostata\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 210, 290);\n textSize(16);\n textStyle(BOLD);\n fill(\"#FF6347\");\n text(\"Prostata\", 30, 30);\n pop();\n\n\n ///////fegato\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 210, 390);\n textSize(16);\n textStyle(BOLD);\n fill(\"#3CB371\");\n text(\"Fegato\", 30, 30);\n pop();\n\n ///////stomaco\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 210, 490);\n textSize(16);\n textStyle(BOLD);\n fill(\"#00CED1\");\n text(\"Stomaco\", 30, 30);\n pop();\n\n ///////Pacreas\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 210, 590);\n textSize(16);\n textStyle(BOLD);\n fill(\"#FFF8DC\");\n text(\"Pancreas\", 30, 30);\n pop();\n\n ///////Cervello\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 210, 690);\n textSize(16);\n textStyle(BOLD);\n fill(\"#FF00FF\");\n text(\"Cervello\", 30, 30);\n pop();\n\n\n }\n}", "function inicializarPrototipos() {\n\n\tString.prototype.toPriceEntero = function () {\n\n\t\t// Este metodo convierte el string a un numero de la forma 123.321,50\n\t\tvar v;\n\t\tif (/^\\d+(,\\d+)$/.test(this))\n\t\t\tv = this.replace(/,/, '.');\n\t\telse if (/^\\d+((,\\d{3})*(\\.\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/,/g, \"\");\n\t\telse if (/^\\d+((.\\d{3})*(,\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/\\./g, \"\").replace(/,/, \".\");\n\t\tvar x = parseFloat(v).toFixed(2).toString().split(\".\"),\n\t\tx1 = x[0],\n\t\tx2 = ((x.length == 2) ? \",\" + x[1] : \".00\"),\n\t\texp = /^([0-9]+)(\\d{3})/;\n\t\twhile (exp.test(x1))\n\t\t\tx1 = x1.replace(exp, \"$1\" + \".\" + \"$2\");\n\t\treturn x1 + x2;\n\t}\n\n\tString.prototype.toPriceSinComa = function () {\n\n\t\t// Este metodo convierte el string a un numero de la forma 123.321\n\t\tvar v;\n\t\tif (/^\\d+(,\\d+)$/.test(this))\n\t\t\tv = this.replace(/,/, '.');\n\t\telse if (/^\\d+((,\\d{3})*(\\.\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/,/g, \"\");\n\t\telse if (/^\\d+((.\\d{3})*(,\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/\\./g, \"\").replace(/,/, \".\");\n\t\t//var x = parseFloat(v).toFixed(2).toString().split(\".\"),\n\t\tvar x = parseFloat(v).toFixed(0).toString(),\n\t\t\t//x1 = x[0],\n\t\t\tx1 = x,\n\t\t\texp = /^([0-9]+)(\\d{3})/;\n\t\twhile (exp.test(x1))\n\t\t\tx1 = x1.replace(exp, \"$1\" + \".\" + \"$2\");\n\t\treturn x1;\n\t}\n\t\n\tString.prototype.validarMail = function(){\n\t//Regresa TRUE si el mail esta bien formado, FALSE en caso contrario\t\n\t\tvar emailReg = /^([\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4})?$/;\n\t\tif( !emailReg.test(this) )\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}\n\n\tString.prototype.validarPassword = function(){\n\t//Regresa TRUE si la contrasenia es segura, FALSE en caso contrario\n\n\t\tvar passRegExp = /(?=^.{8,}$)((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$/;\n\t\tif (passRegExp.test(this))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tString.prototype.validarFecha = function( ){\n\t\t//Validar el formato de la fecha, y que sea una fecha valida\n\t\t\n\t\tfunction daysInFebruary (year){\n\t\t\treturn (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );\n\t\t}\n\t\t\n\t\tvar formato = this.split('/');\n\n\t\tvar dia = parseInt(formato[0]);\t\n\t\tvar mes = parseInt(formato[1]);\n\t\tvar anio = parseInt(formato[2]);\n\t\t\n\t\tvar diasEnMes = [31,daysInFebruary(anio),31,30,31,30,31,31,30,31,30,31];\n\t\t\n\t\tmes--;\n\t\t\n\t\tif (1900 < anio && anio < 2100){\n\t\t\tif (0 <= mes && mes <= 11){\n\t\t\t\tif (0 < dia && dia <= diasEnMes[mes]){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tString.prototype.isNumeric = function( ){\n\n\t\tif (this == undefined)\n\t\t\treturn false\n\n\t\tvar validChars = '0123456789.';\n\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tif(validChars.indexOf(this.charAt(i)) == -1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tString.prototype.isDuracion = function( ){\n\n\t\tif (this == undefined)\n\t\t\treturn false\n\n\t\tvar validChars = '0123456789:';\n\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tif(validChars.indexOf(this.charAt(i)) == -1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tString.prototype.esSimboloMatematico = function( ){\n\n\t\tif (this == undefined)\n\t\t\treturn false\n\n\t\tvar validChars = '()+-*/';\n\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar caracter = this.charAt(i);\n\t\t\tif(validChars.indexOf(caracter) != -1)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t\n\tString.prototype.reemplazarComas = function( ) {\n\t\tvar resultado = this;\n\t\tif (resultado != \"\") {\n\t\t\twhile (resultado.search(',') != -1) {\n\t\t\t\tresultado = resultado.replace(\",\",\".\");\n\t\t\t}\n\t\t}\n\t\treturn resultado;\n\t}\n\t\n\tString.prototype.quitarTildesYOtros = function() { \n\t\n\t\tvar from = \"ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÇç\",\n\t\t\tto = \"AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuucc\",\n\t\t\tmapping = {};\n\t \n\t\tfor(var i = 0, j = from.length; i < j; i++ )\n\t\t\tmapping[ from.charAt( i ) ] = to.charAt( i );\n\t\t\n\t\tvar str = this;\n\t\tvar ret = [];\n\t\tfor( var i = 0, j = str.length; i < j; i++ ) {\n\t\t\tvar c = str.charAt( i );\n\t\t\tif( mapping.hasOwnProperty( str.charAt( i ) ) )\n\t\t\t\tret.push( mapping[ c ] );\n\t\t\telse\n\t\t\t\tret.push( c );\n\t\t}\n\t\treturn ret.join( '' );\n\t} \n\n\tArray.prototype.moverElemento = function(index, nuevoIndex){\n\n\t\t// Este metodo mueve el elemento que esta en la posicion index\n\t\t// a la posicion nuevoIndex, y conserva la posicion de los demas elementos\n\n\t\t// Por ejemplo:\n\t\t// myarray = {0,1,2,3,4,5}\n\t\t// myarray.moverElemento(5, 0); Mueve el elemento de la posicion 5 a la 0\n\t\t// conservando la posicion de los demas elementos\n\t\t// myarray = {5,0,1,2,3,4}\n\n\t\tvar copiaElem = this.splice(index,1);\n\t\tthis.splice(nuevoIndex,0,copiaElem[0]);\n\n\t\treturn true;\n\t};\n\t\n\tArray.prototype.obtenerPosicionPorID = function(id) {\n\t//Devuelve la posicion del elemento con id = id si existe\n\t//en caso contrario retorna -1\n\t\tfor (var i = 0; i < this.length; i++) {\n\t\t\tif (this[i].id == id)\n\t\t\t\treturn i;\n\t\t};\n\t\treturn -1;\n\t};\n\n\tArray.prototype.clear = function() {\n\t\n\t\twhile (this.length > 0) {\n\t\t\tthis.pop();\n\t\t}\n\t};\n\t\n\tArray.prototype.contains = function(otro) {\n\t\tfor(var i =0; i< this.length; i++){\n\t\t\tif(this[i] == otro){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n}", "function _GeraPontosDeVida(modo, submodo) {\n if (modo != 'personagem' && modo != 'elite' && modo != 'comum') {\n Mensagem(Traduz('Modo') + ' ' + modo + ' ' + Traduz('invalido') + '. ' + Traduz('Deve ser elite, comum ou personagem.'));\n return;\n }\n // Para cada classe, rolar o dado.\n var total_pontos_vida = 0;\n // Primeiro eh diferente na elite e personagem.\n var primeiro = (modo == 'comum') ? false : true;\n for (var i = 0; i < gPersonagem.classes.length; ++i) {\n var info_classe = gPersonagem.classes[i];\n for (var j = 0; j < info_classe.nivel; ++j) {\n var pontos_vida_nivel = 0;\n var template_personagem = PersonagemTemplate();\n var dados_vida = template_personagem != null && 'dados_vida' in template_personagem ?\n template_personagem.dados_vida :\n tabelas_classes[info_classe.classe].dados_vida;\n if (primeiro) {\n if (modo == 'elite') {\n pontos_vida_nivel = dados_vida;\n } else if (modo == 'personagem') {\n // O modificador de constituicao eh subtraido aqui pq sera adicionado\n // no calculo de pontos de vida, nos bonus.\n pontos_vida_nivel = dados_vida +\n gPersonagem.atributos['constituicao'].valor -\n gPersonagem.atributos['constituicao'].modificador;\n } else {\n pontos_vida_nivel = submodo == 'tabelado' ? dados_vida / 2 : Rola(1, dados_vida);\n }\n primeiro = false;\n } else {\n pontos_vida_nivel = submodo == 'tabelado' ? dados_vida / 2 : Rola(1, dados_vida);\n\n }\n // Nunca pode ganhar menos de 1 ponto por nivel.\n if (pontos_vida_nivel < 1) {\n pontos_vida_nivel = 1;\n }\n total_pontos_vida += pontos_vida_nivel;\n }\n }\n gPersonagem.pontos_vida.total_dados = Math.floor(total_pontos_vida);\n}", "function comer(golondrina, alpiste) { \n return {\n nombre: golondrina.nombre,\n energia: golondrina.energia + 10 * alpiste\n }\n}", "function InSSconst(){\r\n\r\n this.init = function(){\r\n\r\n };\r\n\r\n this.constSplitSeparator = ','; /* separator listy zamienianej na tablice */\r\n this.constListSeparator = '^'; /* separator listy nie zamienianej na tablice */\r\n\r\n this.constImgSrc = 'buttons/';\r\n this.constImgFolder = 'folder.png';\r\n this.constImgBack = 'back.png';\r\n this.constImgSpacer = 'spacer.gif';\r\n this.constImgPricePerRoom = 'rooms_price_per_room.png';\r\n this.constImgPricePerPerson = 'rooms_price_per_person.png';\r\n\r\n this.constAlertInitError = 'Error: initiate class error, please sent this to administrator'; /* jezeli nie ma komunikatu, wtedy bez alertu */\r\n \r\n //jezyki\r\n this.constLangDE = 'pl';\r\n this.constLangENG = 'eng';\r\n this.constLangES = 'es';\r\n this.constLangPL = 'pl';\r\n this.constLangRU = 'ru';\r\n\r\n //obiekty klas\r\n this.constClassObjInSScache = 'cache';\r\n this.constClassObjInSSconst = 'c';\r\n this.constClassObjInSSdesign = 'design';\r\n this.constClassObjInSSexcept = 'except';\r\n this.constClassObjInSSgallery = 'gallery';\r\n this.constClassObjInSSgalleryIndex = 'galleryIndex';\r\n this.constClassObjInSSgalleryPreview = 'galleryPreview';\r\n this.constClassObjInSSlang = 'lang';\r\n this.constClassObjInSSpager = 'pager';\r\n this.constClassObjInSSpopup = 'popup';\r\n this.constClassObjInSSshortCuts = 'sc';\r\n this.constClassObjInSSstructHTML = 'struct';\r\n this.constClassObjInSSutiles = 'utiles';\r\n this.constClassObjInSSzoom = 'zoom';\r\n\r\n //nazwy klas\r\n this.constClassInSScache = 'InSScache';\r\n this.constClassInSSconst = 'InSSconst';\r\n this.constClassInSSdesign = 'InSSdesign';\r\n this.constClassInSSexcept = 'InSSexcept';\r\n this.constClassInSSgallery = 'InSSgallery';\r\n this.constClassInSSgalleryIndex = 'InSSgalleryIndex';\r\n this.constClassInSSgalleryPreview = 'InSSgalleryPreview';\r\n this.constClassInSSlang = 'InSSlang';\r\n this.constClassInSSpager = 'InSSpager';\r\n this.constClassInSSpopup = 'InSSpopup';\r\n this.constClassInSSshortCuts = 'InSSshortCuts';\r\n this.constClassInSSstructHTML = 'InSSstructHTML';\r\n this.constClassInSSutiles = 'InSSutiles';\r\n this.constClassInSSzoom = 'InSSzoom';\r\n this.constClassInSSinit = 'InSSinit';\r\n\r\n //właściwości HTML/DOM\r\n this.constHTMLpropertyAlt = 'alt';\r\n this.constHTMLpropertyTitle = 'title';\r\n this.constHTMLpropertyInnerHTML = 'innerHTML';\r\n this.constHTMLpropertyStyle = 'style';\r\n this.constHTMLpropertyClass = 'class';\r\n this.constHTMLpropertySrc = 'src';\r\n this.constHTMLpropertyName = 'name';\r\n this.constHTMLpropertyId = 'id';\r\n \r\n //kody bledow\r\n this.constErrIdNotExists = '00001';\r\n this.constErrIdExists = '00002';\r\n\r\n this.constErrJSONobjNotExists = '00021';\r\n this.constErrJSONinvalidObj = '00022';\r\n\r\n this.constErrNameNo = '00031';\r\n\r\n this.constErrClassNoExists = '00041';\r\n this.constErrObjectNoExists = '00042';\r\n this.constErrClassDisabled = '00043';\r\n this.constErrObjectTypeOf = '00044';\r\n this.constErrObjectInstanceOf = '00045';\r\n this.constErrObjectInitCreate = '00046';\r\n this.constErrObjectCreateNew = '00047';\r\n this.constErrObjectGetExists = '00048';\r\n \r\n //lokalizacje bledow\r\n this.constErrLocNoInSScache = '01';\r\n this.constErrLocNoInSSconst = '02';\r\n this.constErrLocNoInSSdesign = '03';\r\n this.constErrLocNoInSSdesignName = '01';\r\n this.constErrLocNoInSSdesignNameValid = '01';\r\n this.constErrLocNoInSSdesignIcons = '02';\r\n this.constErrLocNoInSSdesignIconsValid = '01';\r\n this.constErrLocNoInSSdesignDesign = '03';\r\n this.constErrLocNoInSSdesignDesignValid = '01';\r\n this.constErrLocNoInSSdesignSchema = '04';\r\n this.constErrLocNoInSSdesignSchemaValid = '01';\r\n this.constErrLocNoInSSdesignJSON = '05';\r\n this.constErrLocNoInSSdesignJSONvalid = '01';\r\n this.constErrLocNoInSSdesignParent = '06';\r\n this.constErrLocNoInSSdesignParentValid = '01';\r\n this.constErrLocNoInSSdesignId = '07';\r\n this.constErrLocNoInSSdesignIdValid = '01';\r\n this.constErrLocNoInSSdesignIcon = '08';\r\n this.constErrLocNoInSSdesignIconValid = '01';\r\n this.constErrLocNoInSSexcept = '04';\r\n this.constErrLocNoInSSgallery = '05';\r\n this.constErrLocNoInSSgalleryIndex = '06';\r\n this.constErrLocNoInSSgalleryPreview = '07';\r\n this.constErrLocNoInSSlang = '08';\r\n this.constErrLocNoInSSpager = '09';\r\n this.constErrLocNoInSSpopup = '10';\r\n this.constErrLocNoInSSshortCuts = '11';\r\n this.constErrLocNoInSSstructHTML = '12';\r\n this.constErrLocNoInSSutiles = '13';\r\n this.constErrLocNoInSSzoom = '14';\r\n this.constErrLocNoInSSinit = '15';\r\n this.constErrLocNoInSSinitInit = '01';\r\n this.constErrLocNoInSSinitInitInSSconst = '01';\r\n this.constErrLocNoInSSinitInitInSSexcept = '02';\r\n this.constErrLocNoInSSinitInitParams = '03';\r\n this.constErrLocNoInSSinitCheckObject = '02';\r\n this.constErrLocNoInSSinitCheckObjectCexists = '01';\r\n this.constErrLocNoInSSinitCheckObjectOexists = '02';\r\n this.constErrLocNoInSSinitCheckObjectCdisabled = '03';\r\n this.constErrLocNoInSSinitCheckObjectOtypeof = '04';\r\n this.constErrLocNoInSSinitCheckObjectOinstanceof = '05';\r\n this.constErrLocNoInSSinitInitModules = '03';\r\n this.constErrLocNoInSSinitInitModulesCreateObject = '01';\r\n this.constErrLocNoInSSinitGetObject = '04';\r\n this.constErrLocNoInSSinitGetObjectCreateNew = '01';\r\n this.constErrLocNoInSSinitGetObjectGetExists = '02';\r\n\r\n\r\n //lokalizacje bledow\r\n this.constErrLocInSScache = this.constClassInSScache;\r\n this.constErrLocInSSconst = this.constClassInSSconst;\r\n this.constErrLocInSSdesign = this.constClassInSSdesign;\r\n this.constErrLocInSSexcept = this.constClassInSSexcept;\r\n this.constErrLocInSSgallery = this.constClassInSSgallery;\r\n this.constErrLocInSSgalleryIndex = this.constClassInSSgalleryIndex;\r\n this.constErrLocInSSgalleryPreview = this.constClassInSSgalleryPreview;\r\n this.constErrLocInSSlang = this.constClassInSSlang;\r\n this.constErrLocInSSpager = this.constClassInSSpager;\r\n this.constErrLocInSSpopup = this.constClassInSSpopup;\r\n this.constErrLocInSSshortCuts = this.constClassInSSshortCuts;\r\n this.constErrLocInSSstructHTML = this.constClassInSSstructHTML;\r\n this.constErrLocInSSutiles = this.constClassInSSutiles;\r\n this.constErrLocInSSzoom = this.constClassInSSzoom;\r\n this.constErrLocInSSinit = this.constClassInSSinit;\r\n\r\n //stale\r\n this.constNullDate = -1;\r\n this.constNullNumber = -1;\r\n \r\n this.constIdPrefix = 'calgrid_'; //dzien kalendarza\r\n this.constIdDayPrefix = 'calgrid_day_'; //numer dnia kalendarza\r\n this.constIdImgPrefix = 'calgrid_img_'; //obrazek dnia kalendarza\r\n this.constIdHeaderFirstDay = 'booCalHeadSpecDate'; //naglowek kalendarza: data od\r\n this.constIdHeaderDaysChoose = 'booCalHeadSpecDays'; //naglowek kalendarza: ilosc dni\r\n this.constIdHeaderDaysAvailable = 'booCalHeadSpecDaysEnable'; //naglowek kalendarza: ilosc dostepnych dni\r\n this.constIdHeaderYear = 'g01_calendar_month_year_y'; //naglowek kalendarza: rok\r\n this.constIdHeaderMonth = 'g01_calendar_month_year_m'; //naglowek kalendarza: miesiac\r\n\r\n this.constIdRoomPrefix = 'booking_rooms_cell_'; //pokoj na liscie pokoi\r\n this.constIdRoomSufixImages = '_img';\r\n this.constIdRoomSufixImagesGallery = '_img_gallery';\r\n this.constIdRoomSufixImagesEquipment = '_img_equipment';\r\n this.constIdRoomSufixImagesInformation = '_img_information';\r\n this.constIdRoomSufixImagesPrice = '_img_price';\r\n this.constIdRoomSufixImagesSchedule = '_img_schedule';\r\n this.constIdRoomSufixImagesOk = '_img_ok';\r\n this.constIdRoomSufixImagesCancel = '_img_cancel';\r\n this.constIdRoomSufixInfo = '_info';\r\n this.constIdRoomSufixInfoPrice = '_info_price';\r\n this.constIdRoomSufixInfoSpacer1 = '_info_spacer1';\r\n this.constIdRoomSufixInfoCurrency = '_info_currency';\r\n this.constIdRoomSufixInfoSpacer2 = '_info_spacer2';\r\n this.constIdRoomSufixInfoPricePromotion = '_info_price_promotion';\r\n this.constIdRoomSufixInfoSpacer3 = '_info_spacer3';\r\n this.constIdRoomSufixInfoCurrencyPromotion = '_info_currency_promotion';\r\n this.constIdRoomSufixInfoSpacer4 = '_info_spacer4';\r\n this.constIdRoomSufixInfoImgPerRoom = '_info_img_per_room';\r\n this.constIdRoomSufixInfoMore = '_info_more';\r\n this.constIdRoomSufixInfoMoreImgPersons = '_info_more_img_persons';\r\n this.constIdRoomSufixInfoMoreSpacer5 = '_info_more_spacer5';\r\n this.constIdRoomSufixInfoMorePersons = '_info_more_persons';\r\n this.constIdRoomSufixState = '_state';\r\n \r\n this.constClassRoomInfoPrice = 'booking_rooms_info_price';\r\n this.constClassRoomInfoPricePromotion = 'booking_rooms_info_price_promotion';\r\n this.constClassRoomInfoPriceOld = 'booking_rooms_info_price_old';\r\n this.constClassRoomInfoCurrency = 'booking_rooms_info_currency';\r\n this.constClassRoomInfoCurrencyPromotion = 'booking_rooms_info_currency_promotion';\r\n this.constClassRoomInfoCurrencyOld = 'booking_rooms_info_currency_old';\r\n this.constClassRoomInfoImgEnable = 'booking_rooms_enable';\r\n this.constClassRoomInfoImgChoosen = 'booking_rooms_choosen';\r\n\r\n this.constHeaderFirstDayEmpty = '-';\r\n this.constHeaderDaysChooseEmpty = '-';\r\n this.constHeaderDaysAvailableEmpty = '-';\r\n\r\n this.constFreeWeekLines = 1; //liczba tygodni widocznych z poprzedniego miesiaca\r\n this.constDays = 49;//56; //dni w kalendarzu (krotnosc 7 dni w tygodniu)\r\n this.constRooms = 6; //pokoi na liscie miniaturek pokoi - z uwzglednieniem stronicowania\r\n this.constValidMinYear = 0; //minimalny rok\r\n this.constValidMaxYear = 1; //maksymalny rok\r\n \r\n this.constCalendarDayStateFree = 0; //wolny\r\n this.constCalendarDayStateOccupied = 1; //zajety\r\n\r\n this.constRoomTypePricePerPerson = 0; //cena za osobę\r\n this.constRoomTypePricePerRoom = 1; //cena za pokój/obiekt\r\n\r\n this.constDayStateModeReset = 0; //reset widoku kalendarza\r\n this.constDayStateModeFree = 1; //wolny\r\n this.constDayStateModeFreePale = 2; //wolny szary\r\n this.constDayStateModeSelected = 3; //wybrany\r\n this.constDayStateModeSelectedPale = 4; //wybrany szary\r\n this.constDayStateModeOccupied = 5; //zajety\r\n this.constDayStateModeOccupiedPale = 6; //zajety szary\r\n \r\n this.constTermStateNotSelected = 0; //nie wybrany\r\n this.constTermStateInProgress = 1; //w trakcie wybierania\r\n this.constTermStateSelected = 2; //wybrany\r\n \r\n this.constRoomStateEnable = 0; //dostepny\r\n this.constRoomStateChoosen = 1; //wybrany\r\n this.constRoomStateOccupied = 2; //zajęty\r\n this.constRoomStateDiffNumOfPeople = 3; //z inną liczbą osób\r\n this.constRoomStateNoChooseComfort = 4; //bez wymaganego wyposażenia\r\n\r\n this.constTermSelectedOperSelectToDelete = 0; //oznacz wybrany termin do usuniecia\r\n this.constTermSelectedOperUnselectFromDelete = 1; //odznacz usuniecie wybranego terminu (przywroc podswietlenie wybranego terminu)\r\n\r\n this.constArrayAdd = 0;\r\n this.constArrayRemove = 1;\r\n this.constArrayClear = 2;\r\n\r\n this.init();\r\n }", "function nuovoMembro(){\n// la funzione prende i valori e ci crea un oggetto\nconst nuovoMembro =\n{\nimmagine : document.getElementById(\"image\").value,\nnome : document.getElementById(\"name\").value,\nruolo : document.getElementById(\"role\").value\n};\n\n//Pushiamo l'oggetto nell'array membri\nmembri.push(nuovoMembro)\n\n//inception di funzione printatrice\nprintatrice(nuovoMembro)\n}", "function Oujabe(){\n this.sex = \"\";\n //this holds the phenotype characteristics that affect the colors\n this.phenotype = \"\";\n //this holds the phenotype characteristics that do not affect the colors\n this.pattern = \"\";\n this.letality = false;\n this.albino = false;\n this.genes = {};\n //these variables will be used to display the proper images to reflect the pattern genes present\n this.red = true;\n this.mask = false;\n this.violet = false;\n this.colorSet;\n this.spot = true;\n this.bodySpots = [];\n this.headSpots = [];\n //parameters for displaying - only set in display\n this.width;\n this.height;\n}", "initializeUserVolumeDefinitions() {\r\n \r\n var southbound_detvol = new BoundedDetailedVolume(\"southbound\" , 0, 0, 0);\r\n var westbound_detvol = new BoundedDetailedVolume(\"westbound\" , 0, 0, 0);\r\n var northbound_detvol = new BoundedDetailedVolume(\"northbound\" , 0, 0, 0);\r\n var eastbound_detvol = new BoundedDetailedVolume(\"eastbound\" , 0, 0, 0);\r\n var southbound_detperc = new DetailedPercentage(\"southbound\" , 0, 0, 0);\r\n var westbound_detperc = new DetailedPercentage(\"westbound\" , 0, 0, 0);\r\n var northbound_detperc = new DetailedPercentage(\"northbound\" , 0, 0, 0);\r\n var eastbound_detperc = new DetailedPercentage(\"eastbound\" , 0, 0, 0);\r\n \r\n // This is the one raw volume table for the entire Project\r\n this._user_volume_definitions = new UserVolumeDefinitions(\r\n southbound_detvol \r\n ,westbound_detvol \r\n ,northbound_detvol \r\n ,eastbound_detvol \r\n ,southbound_detperc \r\n ,westbound_detperc \r\n ,northbound_detperc \r\n ,eastbound_detperc \t\t\r\n ,false\r\n );\r\n \r\n // This is the one Passenger Car Equivalent table - based on values in this._user_volume_definitions - for the entire Project\r\n this._master_PCE_table = new PCETable(\r\n this._user_volume_definitions.getDirectionByIndex(0).getPassengerCarEquivalentWithDetailedPercentObject(\"southbound\", this._user_volume_definitions._user_defined_southbound_truck_perc),\r\n this._user_volume_definitions.getDirectionByIndex(1).getPassengerCarEquivalentWithDetailedPercentObject(\"westbound\", this._user_volume_definitions._user_defined_westbound_truck_perc),\r\n this._user_volume_definitions.getDirectionByIndex(2).getPassengerCarEquivalentWithDetailedPercentObject(\"northbound\", this._user_volume_definitions._user_defined_northbound_truck_perc),\r\n this._user_volume_definitions.getDirectionByIndex(3).getPassengerCarEquivalentWithDetailedPercentObject(\"eastbound\", this._user_volume_definitions._user_defined_eastbound_truck_perc)\r\n );\r\n }", "function puntosCultura(){\n\t\tvar a = find(\"//td[@class='s3']//b\", XPList);\n\t\tif (a.snapshotLength != 5) return;\n\n\t\t// Produccion de puntos de cultura de todas las aldeas\n\t\tvar pc_prod_total = parseInt(a.snapshotItem(2).innerHTML);\n\t\t// Cantidad de puntos de cultura actuales\n\t\tvar pc_actual = parseInt(a.snapshotItem(3).innerHTML);\n\t\t// Puntos de cultura necesarios para fundar la siguiente aldea\n\t\tvar pc_aldea_prox = parseInt(a.snapshotItem(4).innerHTML);\n\n\t\t// Numero de aldeas actuales\n\t\tvar aldeas_actuales = pc2aldeas(pc_aldea_prox);\n\t\t// Numero de aldeas que se pueden tener con los PC actuales\n\t\tvar aldeas_posibles = pc2aldeas(pc_actual);\n\n\t\tvar texto = '<table class=\"tbg\" align=\"center\" cellspacing=\"1\" cellpadding=\"2\"><tr class=\"rbg\"><td>' + T('ALDEA') + '</td><td>' + T('PC') + \"</td></tr>\";\n\t\tfor (var i = 0; i < 3; i++){\n\t\t\ttexto += '<tr><td>' + (aldeas_actuales + i + 1) + '</td><td>';\n\n\t\t\t// PC necesarios para conseguir la siguiente aldea\n\t\t\tvar pc_necesarios = aldeas2pc(aldeas_actuales + i);\n\n\t\t\t// Si hay PC de sobra\n\t\t\tif (pc_necesarios < pc_actual) texto += T('FUNDAR');\n\t\t\telse{\n\t\t\t\t// Tiempo en segundos hasta conseguir los puntos de cultura necesarios\n\t\t\t\tvar tiempo = ((pc_necesarios - pc_actual) / pc_prod_total) * 86400;\n\t\n\t\t\t\tvar fecha = new Date();\n\t\t\t\tfecha.setTime(fecha.getTime() + (tiempo * 1000));\n\t\t\t\tvar texto_tiempo = calcularTextoTiempo(fecha);\n\n\t\t\t\ttexto += T('FALTA') + ' <b>' + (pc_necesarios - pc_actual) + '</b> ' + T('PC') +'<br/>';\n\t\t\t\ttexto += T('LISTO') + \" \" + texto_tiempo;\n\t\t\t}\n\t\t\ttexto += '</td></tr>';\n\t\t}\n\t\ttexto += '</table>';\n\n\t\ta.snapshotItem(4).parentNode.innerHTML += \"<p>\" + texto + \"</p>\";\n\t}", "function inicializarPesos(pesos, setEntrenamiento) {\n divmatriz.innerHTML += \"<div style='text-align: center'><b>Matriz</b><br></div>\";\n for (var i = 0; i < setEntrenamiento[0].entrada.length; i++) {// numero de elementos para entrada\n pesos[i] = Math.random() * (1 - (-1) + 1) + (-1);\n divmatriz.innerHTML += \" \" + pesos[i] + \" &nbsp;&nbsp; \";\n }\n divmatriz.innerHTML += \"<br>\";\n divmatriz.innerHTML += \"<div style='text-align: center'><b>Umbral</b><br></div>\";\n pesos.push( Math.random() * (1 - (-1) + 1) + (-1) ); //umbral\n divmatriz.innerHTML += \" \" + pesos[2] + \"&nbsp;&nbsp; \";\n }", "function serVivo(especie) {\n //this.especie = especie;\n this.especie = especie;\n }", "function insertarNodoU(proceso,nombre, tiempo, quantum,tll, tf, tr, pr,rar, ne,contenido){\r\n\tvar nuevo = new nodo();\r\n\tvar colaTemp = new cola();\r\n\tnuevo.proceso = proceso;\r\n\tnuevo.nombre=nombre;\r\n\tnuevo.tiempo = tiempo;\r\n\tnuevo.quantum = quantum;\r\n\tnuevo.Tllegada=tll;\r\n\tnuevo.Tfinalizacion=tf;\r\n\tnuevo.Turnarround=tr;\r\n\tnuevo.numEjecucion=ne;\r\n\t\r\n\t\r\n\tnuevo.prioridad=pr;\r\n\tnuevo.rafagareal=rar;\r\n\tnuevo.contenido=contenido;\r\n\tnuevo.sig = null;\r\n\t\r\n\tif(this.vacia()){\r\n\t\tthis.raiz = nuevo;\r\n this.fondo = nuevo;\r\n\t}else{\r\n\t\twhile(!this.vacia()){\t\r\n\t\t\tvar temp = new nodo();\t\t\r\n\t\t\ttemp = this.extraerPrimero();\r\n\t\t\tcolaTemp.insertarPrimero(temp.proceso,temp.nombre, temp.tiempo, temp.quantum,temp.Tllegada,\r\n\t\t\t\ttemp.Tfinalizacion,temp.Turnarround,temp.prioridad,temp.rafagareal,temp.numEjecucion,temp.contenido); \t\t\r\n\t\t}\r\n\t\tthis.insertarPrimero(proceso,nombre, tiempo, quantum,tll, tf, tr, pr,rar,ne,contenido);\t\t\r\n\t\twhile(!colaTemp.vacia()){\r\n\t\t\tvar temp = new nodo();\t\t\r\n\t\t\ttemp = colaTemp.extraerPrimero();\r\n\t\t\tthis.insertarPrimero(temp.proceso,temp.nombre, temp.tiempo, temp.quantum,temp.Tllegada,\r\n\t\t\t\ttemp.Tfinalizacion,temp.Turnarround,temp.prioridad,temp.rafagareal,temp.numEjecucion,temp.contenido); \t\r\n\t\t}\r\n\t}\r\n}", "function effemeridi_pianeti(np,TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,STEP,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011\n // funzione per il calcolo delle effemeridi del Sole.\n // Parametri utilizzati\n // np= numero identificativo del pianeta 0=Mercurio,1=Venere.....7=Nettuno\n // il valore np=2 (Terra) non deve essere utilizzato come parametro.\n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // STEP=salto \n // LAN=\"EN\" versione in inglese.\n \n \n var njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi T.U.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n\n //njd=njd+t_luce(njd,np); // correzione tempo luce.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\nvar numero_iterazioni=ITERAZIONI;\n\nvar fusoloc=-fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar sorge=0;\nvar trans=0;\nvar tramn=0;\nvar azimuts=0;\nvar azimutt=0;\n\nvar effe_pianeta=0;\nvar ar_pianeta=0;\nvar de_pianeta=0;\nvar classetab=\"colore_tabellaef1\";\nvar istanti=0;\nvar magnitudine=0;\nvar fase=0;\nvar diametro=0;\nvar distanza=0;\nvar elongazione=0;\nvar costl=\"*\"; // nome della costellazione.\nvar parallasse=0;\nvar p_ap=0; // coordinate apparenti del pianeta.\n\nif (STEP==0) {STEP=1;}\n \n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>A. So.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Tr.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Fase.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Cost.</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set:</td>\");\n document.write(\" <td class='colore_tabella'>R.A.:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Ph.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Const.</td>\");\n\n }\n\n\n document.write(\" </tr>\");\n\n // ST_ASTRO_DATA Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n // 0 1 2 3 4\n\n njd=njd-STEP;\n\n for (b=0; b<numero_iterazioni; b=b+STEP){\n njd=njd+STEP;\n effe_pianeta=pos_pianeti(njd,np); \n\n // calcola le coordinate apparenti nutazione e aberrazione.\n\n p_ap=pos_app(njd,effe_pianeta[0],effe_pianeta[1]);\n ar_pianeta= sc_ore(p_ap[0]); // ascensione retta in hh:mm:ss.\n de_pianeta=sc_angolo(p_ap[1],0); // declinazione. \n \n fase=effe_pianeta[2];\n magnitudine=effe_pianeta[3];\n distanza=effe_pianeta[4].toFixed(3);\n diametro=effe_pianeta[5].toFixed(1);\n elongazione=effe_pianeta[6].toFixed(1);\n costl=costell(effe_pianeta[0]); // costellazione.\n\n istanti=ST_ASTRO_DATA(njd,effe_pianeta[0],effe_pianeta[1],LON,LAT,ALT,0);\n\nif (TEMPO_RIF==\"TL\"){\n sorge=ore_24(istanti[2]+fusoloc);\n trans=ore_24(istanti[3]+fusoloc);\n tramn=ore_24(istanti[4]+fusoloc); }\n\nelse {\n sorge=ore_24(istanti[2]);\n trans=ore_24(istanti[3]);\n tramn=ore_24(istanti[4]); } \n\n sorge=sc_ore_hm(sorge); // istanti in hh:mm\n trans=sc_ore_hm(trans);\n tramn=sc_ore_hm(tramn);\n\n // formatta la data da inserire.\n\n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[4];} // versione in inglese.\n\n azimuts=istanti[0].toFixed(1);\n azimutt=istanti[1].toFixed(1);\n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+sorge+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+trans+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+tramn+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimuts+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimutt+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+fase+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+distanza+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+diametro+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+elongazione+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+magnitudine+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n}", "function dibujar_lingas_tier(){\n for(var i=0;i<Linga.length;i++){\n var padre=$(\"#\"+Linga[i].id_tier); // SELECCIONO EL TIER PADRE\n var left=padre.position().left;\n var top=padre.position().top;\n\n // ASIGNAR CLASE RESPECTO A SU GIRO\n if(Linga[i].giro==\"0\"){\n var linga_tier=$(\"<div><p class='cant_unit_sin_giro'>\"+Linga[i].cantidad+\"</p></div>\");\n }else{\n var linga_tier=$(\"<div><p class='cant_unit_con_giro'>\"+Linga[i].cantidad+\"</p></div>\");\n }\n\n // ASIGNAR MARCA SEGUN EMPRE\n\n if(Linga[i].marca==1){\n\n if(Linga[i].company == \"ARAUCO\"){\n var marca=$(\"<img src='../imagenes/marcas/ARAUCO/\"+Linga[i].marca_arauco+\".png' width='18px'>\");\n }\n if(Linga[i].company == \"CMPC\"){\n var marca=$(\"<img src='../imagenes/marcas/CMPC/\"+Linga[i].marca_cmpc+\".png' width='18px'>\");\n }\n }\n // ESTILOS DE LA IMAGEN DE LA MARCA\n $(marca).css({\n \"position\":\"absolute\",\n \"top\":4,\n \"left\":4\n });\n\n // ESTILOS DE A LINGA\n $(linga_tier).css({\n \"position\":\"absolute\", // YA QUE SU POSITION ES ABSOLUTE\n \"top\":(parseFloat(Linga[i].posx)+parseFloat(top))+\"px\", //SE ASIGNA POSICION RESPECTO\n \"left\":(parseFloat(Linga[i].posy)+parseFloat(left))+\"px\", // AL DOCUMENT\n \"width\":Linga[i].ancho,\n \"height\":Linga[i].alto,\n \"text-align\":\"center\",\n \"outline\": \"1px solid\" // BORDE HACIA DENTRO\n });\n linga_tier.append(marca);\n padre.append(linga_tier);\n marca=\"\";\n }\n}", "function loadPano(panoObjects){\n console.log('loadPano', panoObjects)\n const filePath = panoObjects.panoPath \n let newPanoId = gPanos.length\n console.log(panoObjects.data)\n const panos = Object.values(panoObjects.data)\n console.log('panos', panos, typeof panos, panos.length)\n const panoBaseId = gPanos.length-1\n let panoIdNum \n Object.values(panos).forEach(pano => { \n // debugger\n panoIdNum = panoBaseId + Number(pano.id)\n console.log('pano', pano)\n // Populate New Pano with loaded values\n //panoIdNum = Number(pano.id) + panoBaseId - 1\n let curPano = gPanos[ panoIdNum -1 ]\n if (panoIdNum %2 == 0){\n curPano.elements.main.setAttribute('class', 'pano_a')\n } else {\n curPano.elements.main.setAttribute('class', 'pano_b');\n }\n \n curPano.elements.message.innerHTML = filePath\n curPano.elements.title.innerHTML = \"<b>Pano \"+pano.id+\"</b>\"\n // curPano.elements.addButton.value = \"Save\"\n curPano.elements.addButton.setAttribute(\"hidden\", true)\n curPano.elements.deleteButton.style.display = \"block\"\n curPano.elements.viewName.setAttribute('value', pano.name)\n curPano.elements.inputFile.setAttribute('value', pano.file)\n curPano.elements.posx.setAttribute('value', pano.x) \n curPano.elements.posy.setAttribute('value', pano.y) \n curPano.elements.posz.setAttribute('value', pano.z)\n // curPano.elements.inputFile.setAttribute('onchange', 'input_file-'+newPanoId)\n // Create new Pano \n // pano object {elements, values}\n let newPano = {\n elements: { \n main: curPano.elements.main, \n title: curPano.elements.title, \n message: curPano.elements.message, \n addButton: curPano.elements.addButton,\n deleteButton: curPano.elements.deleteButton,\n inputFile: curPano.elements.inputFile,\n viewName: curPano.elements.viewName,\n viewNameEnabled: curPano.elements.viewNameEnabled, \n camPosEnabled: curPano.elements.camPosEnabled, \n posx: curPano.elements.posx,\n posy: curPano.elements.posy,\n posz: curPano.elements.posz\n },\n values:{}\n }\n\n // gPanos.push(newPano);\n \n // Create New Pano panel\n createPano(gPanos.length)\n })\n\n // Enable Make Panos button\n const makePanoBtn = document.querySelector('#submit_button')\n makePanoBtn.disabled = false\n makePanoBtn.setAttribute('class', 'submit_button')\n console.log(makePanoBtn)\n }", "function createPrintStructureRendicontoCassa() {\n\n\tvar printStructure = [];\n\n\tprintStructure.push({\"dialogText\":\"RENDICONTO PER CASSA -- DETTAGLIO MOVIMENTI --\", \"titleText\":\"RENDICONTO PER CASSA ANNO %1 CON DETTAGLIO MOVIMENTI\"});\n\n\tprintStructure.push({\"id\":\"dC\", \"isTitle\":true, \"newpage\":false});\n\tprintStructure.push({\"id\":\"dCA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CA1\"});\n\tprintStructure.push({\"id\":\"CA2\"});\n\tprintStructure.push({\"id\":\"CA3\"});\n\tprintStructure.push({\"id\":\"CA4\"});\n\tprintStructure.push({\"id\":\"CA7\"});\n\tprintStructure.push({\"id\":\"CA\"});\n\tprintStructure.push({\"id\":\"dCB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CB1\"});\n\tprintStructure.push({\"id\":\"CB2\"});\n\tprintStructure.push({\"id\":\"CB3\"});\n\tprintStructure.push({\"id\":\"CB4\"});\n\tprintStructure.push({\"id\":\"CB7\"});\n\tprintStructure.push({\"id\":\"CB\"});\n\tprintStructure.push({\"id\":\"dCC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CC1\"});\n\tprintStructure.push({\"id\":\"CC2\"});\n\tprintStructure.push({\"id\":\"CC3\"});\n\tprintStructure.push({\"id\":\"CC\"});\n\tprintStructure.push({\"id\":\"dCD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CD1\"});\n\tprintStructure.push({\"id\":\"CD2\"});\n\tprintStructure.push({\"id\":\"CD3\"});\n\tprintStructure.push({\"id\":\"CD4\"});\n\tprintStructure.push({\"id\":\"CD6\"});\n\tprintStructure.push({\"id\":\"CD\"});\n\tprintStructure.push({\"id\":\"dCE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"CE1\"});\n\tprintStructure.push({\"id\":\"CE2\"});\n\tprintStructure.push({\"id\":\"CE3\"});\n\tprintStructure.push({\"id\":\"CE4\"});\n\tprintStructure.push({\"id\":\"CE7\"});\n\tprintStructure.push({\"id\":\"CE\"});\n\tprintStructure.push({\"id\":\"C\"});\n\n\tprintStructure.push({\"id\":\"dR\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"dRA\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RA1\"});\n\tprintStructure.push({\"id\":\"RA2\"});\n\tprintStructure.push({\"id\":\"RA3\"});\n\tprintStructure.push({\"id\":\"RA4\"});\n\tprintStructure.push({\"id\":\"RA5\"});\n\tprintStructure.push({\"id\":\"RA6\"});\n\tprintStructure.push({\"id\":\"RA7\"});\n\tprintStructure.push({\"id\":\"RA8\"});\n\tprintStructure.push({\"id\":\"RA9\"});\n\tprintStructure.push({\"id\":\"RA10\"});\n\tprintStructure.push({\"id\":\"RA\"});\n\tprintStructure.push({\"id\":\"dRB\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RB1\"});\n\tprintStructure.push({\"id\":\"RB2\"});\n\tprintStructure.push({\"id\":\"RB4\"});\n\tprintStructure.push({\"id\":\"RB5\"});\n\tprintStructure.push({\"id\":\"RB6\"});\n\tprintStructure.push({\"id\":\"RB\"});\n\tprintStructure.push({\"id\":\"dRC\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RC1\"});\n\tprintStructure.push({\"id\":\"RC2\"});\n\tprintStructure.push({\"id\":\"RC3\"});\n\tprintStructure.push({\"id\":\"RC\"});\n\tprintStructure.push({\"id\":\"dRD\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RD1\"});\n\tprintStructure.push({\"id\":\"RD2\"});\n\tprintStructure.push({\"id\":\"RD3\"});\n\tprintStructure.push({\"id\":\"RD4\"});\n\tprintStructure.push({\"id\":\"RD5\"});\n\tprintStructure.push({\"id\":\"RD\"});\n\tprintStructure.push({\"id\":\"dRE\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RE1\"});\n\tprintStructure.push({\"id\":\"RE2\"});\n\tprintStructure.push({\"id\":\"RE\"});\n\tprintStructure.push({\"id\":\"R\"});\n\t//printStructure.push({\"id\":\"IM\"});\n\n\tprintStructure.push({\"id\":\"dCF\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"CF1\"});\n\tprintStructure.push({\"id\":\"CF2\"});\n\tprintStructure.push({\"id\":\"CF3\"});\n\tprintStructure.push({\"id\":\"CF4\"});\n\tprintStructure.push({\"id\":\"CF\"});\n\tprintStructure.push({\"id\":\"dRF\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RF1\"});\n\tprintStructure.push({\"id\":\"RF2\"});\n\tprintStructure.push({\"id\":\"RF3\"});\n\tprintStructure.push({\"id\":\"RF4\"});\n\tprintStructure.push({\"id\":\"RF\"});\n\t//printStructure.push({\"id\":\"IMRC\"});\n\n\tprintStructure.push({\"id\":\"dACIV\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"ACIV\"});\n\tprintStructure.push({\"id\":\"ACIV3\"});\n\tprintStructure.push({\"id\":\"ACIV1\"});\n\n\tprintStructure.push({\"id\":\"dCG\", \"isTitle\":true, \"newpage\":true});\n\tprintStructure.push({\"id\":\"RC1\"});\n\tprintStructure.push({\"id\":\"RC2\"});\n\tprintStructure.push({\"id\":\"RC\"});\n\tprintStructure.push({\"id\":\"dRG\", \"isTitle\":true});\n\tprintStructure.push({\"id\":\"RG1\"});\n\tprintStructure.push({\"id\":\"RG2\"});\n\tprintStructure.push({\"id\":\"RG\"});\n\n\n\n\treturn printStructure;\n}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "function Patrocinador(){\n\tvar nome; \n\tvar title; \n\tvar imagem; \n\tvar url; \n\t\n\tthis.getNome = function() {\n\t\treturn this.nome;\n\t}; \n\tthis.setNome = function(nome_){\n\t\tthis.nome = nome_;\n\t};\n\tthis.getTitle = function() {\n\t\treturn this.title;\n\t}; \n\tthis.setTitle = function(title_){\n\t\tthis.nome = title_;\n\t};\t\t\n\tthis.getImagem = function() {\n\t\treturn this.imagem;\n\t}; \n\tthis.setImagem = function(imagem_){\n\t\tthis.imagem = imagem_;\n\t};\n\t\tthis.getUrl = function() {\n\t\treturn this.url;\n\t}; \n\tthis.setUrl = function(url_){\n\t\tthis.url = url_;\n\t};\n}", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "function heredaDe(prototipoHijo, prototipoPadre) {\n var fn = function() {};\n fn.prototype = prototipoPadre.prototype;\n prototipoHijo.prototype = new fn;\n prototipoHijo.prototype.constructor = prototipoHijo;\n}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function generarGrilla(){\n $elemento = $('<div>');\n $grillaPx.append($elemento);\n}", "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "function getBaseCalculo() {\n var pfaEng = config_isEng && isEng ? Number($('#pct-pfa-eng').html()) : 0;\n var pfaDes = config_isDes && isDes ? Number($('#pct-pfa-des').html()) : 0;\n var pfaImp = config_isImp && isImp ? Number($('#pct-pfa-imp').html()) : 0;\n var pfaTes = config_isTes && isTes ? Number($('#pct-pfa-tes').html()) : 0;\n var pfaHom = config_isHom && isHom ? Number($('#pct-pfa-hom').html()) : 0;\n var pfaImpl = config_isImpl && isImpl ? Number($('#pct-pfa-impl').html()) : 0;\n var V = Number((pfaEng + pfaDes + pfaImp + pfaTes + pfaHom + pfaImpl) * config_aumentoEsforco).toFixed(4);\n return V;\n}", "function undici () {}" ]
[ "0.5996954", "0.5983424", "0.5963005", "0.59619313", "0.59143555", "0.5840939", "0.5797499", "0.57750404", "0.5748499", "0.5688318", "0.5685359", "0.56467867", "0.5646608", "0.5645454", "0.56396013", "0.5600409", "0.559782", "0.5584805", "0.55598027", "0.5551936", "0.554921", "0.55416745", "0.5540503", "0.5529208", "0.5522912", "0.55220515", "0.55198836", "0.55132824", "0.550952", "0.55061483", "0.5505165", "0.54937154", "0.54934007", "0.54755473", "0.54711324", "0.54654276", "0.5464447", "0.54627883", "0.5454028", "0.545294", "0.54506034", "0.5440313", "0.543571", "0.5434606", "0.5431339", "0.54310495", "0.54294425", "0.54268116", "0.5425791", "0.5425619", "0.5421241", "0.54185706", "0.541345", "0.54092216", "0.5404014", "0.54037654", "0.54017454", "0.53936094", "0.5391853", "0.5391481", "0.53851825", "0.53809017", "0.5375478", "0.53727376", "0.5372189", "0.536657", "0.5366469", "0.5364697", "0.53640383", "0.5363659", "0.5359235", "0.5354184", "0.5354184", "0.5351817", "0.53447163", "0.53314793", "0.5331235", "0.5328756", "0.53258735", "0.5321897", "0.53131557", "0.5312388", "0.5311971", "0.53098625", "0.53054893", "0.5301842", "0.5300368", "0.52992964", "0.52971923", "0.5296541", "0.52878225", "0.52874833", "0.52864486", "0.528628", "0.52856266", "0.5285547", "0.5280552", "0.5278077", "0.5276602", "0.52760655", "0.5273089" ]
0.0
-1
Monta a div do nome, user e piu
function montaDiv( nome, user, texto, classeNome, classeUser, classeTexto, classeDiv ) { var div = document.createElement("div"); div.classList.add(classeDiv); div.appendChild(montaStrong(nome, classeNome)); div.appendChild(montaSpan(user, classeUser)); div.appendChild(montaTexto(texto, classeTexto)); return div; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrarInfoSesion($usuario){\n\n $('aside').css('display','flex');\n\n $user=new Usuario($usuario.idUsuario, $usuario.nombreUsuario, $usuario.email, $usuario.password, $usuario.codResp);\n\n $('aside div:nth-child(2)').text('user: '+$user.getIdUsuario()+'-'+$user.getNombreUsuario());\n $('aside div:nth-child(3)').text($user.getEmail());\n\n\n}", "function oiPesquisa()\n{\n\t$('#nomeDrPesquisa').html('Prezado (a) <strong>Dr(a). '+nomeUser+'</strong>,');\n\t// '+nomeUser+'\n}", "get lblUsuarioLogado() { return $('div#app-root div.userinfo') }", "function mainDom(user) {\n\t\treturn `\n\t\t\t<div id=\"all\">\n\t\t\t\t<a href=\"#${user.login}\">\n\t\t\t\t\t<img class=\"ava\" src=\"${user.avatar_url}\"></img>\n\t\t\t\t\t<img class=\"gitlogo\" src=\"assets/images/git.png\"/>\n\t\t\t\t\t<h2>${user.login}</h2>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t`;\n\t}", "function user_name(){\n\t\tvar name = document.createElement(\"div\");\n\t\tname.textContent = \"NAME\";\n\t\tname.setAttribute(\"class\", \"user_name\");\n\t\tdiv.appendChild(name);\n\t}", "function cargarNombreEnPantalla() {\n if (loggedIn) {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + usuarioLogeado.nombre;\n }\n}", "function Showuser(user1,para)\n {\n //para.style.float=\"left\";\n para.innerHTML= para.innerHTML+ \"<div style='float: left;margin: 10px'>Username: \"+user1.username+\" <br> Userpassword: \"+user1.userpassword+\"<br>Email: \"+user1.email+ \" <br>Card No: \"+ user1.cardno+ \"<br>Available Amount: \"+user1.amount+ \"<br> </div>\";\n }", "function div_login_user() {\n \n $('#contenido').children('div').remove();\n $('#contenido').append('<div id=\"margen\"></div>');\n \n $('#contenido').append('<div class=\"div_unaColumna\" id=\"div_login\">');\n $('#div_login').append('<h3> Login Usuario </h3>');\n\n $('#div_login').append('<label> Email: </label>');\n $('#div_login').append('<input type=\"text\" id=\"login_email\"> <br>');\n\n $('#div_login').append('<label> Num Afiliación: </label>');\n $('#div_login').append('<input type=\"text\" id=\"login_num_afiliacion\"> <br>');\n\n $('#div_login').append('<button onclick=\"login_user();\"> Acceder </button>');\n}", "function usluga(cena, id, majstor, naslov, opis, preporuka, vremeOdgovora, slika) {\n return '<div class=\"row uslugaKomponenta\">\\n' +\n ' <div class=\"offset-1 col-10 polje\">\\n' +\n ' <table class=\"uslugaTabela\" id=\"' + id + '\">\\n' +\n ' <tr>\\n' +\n ' <td id=\"userimg\"><img src=\"' + slika + '\"></td>\\n' +\n ' <td width=\"60%\">\\n' +\n ' <h1>\\n' +\n ' ' + naslov + '\\n' +\n ' </h1>\\n' +\n ' <hr/>\\n' +\n ' <p>\\n' +\n ' ' + opis + '\\n' +\n ' </p>\\n' +\n ' </td>\\n' +\n ' <td class=\"statistika\" width=\"25%\">\\n' +\n ' <h3>\\n' +\n ' Majstora preporučuje: <b class=\"preporuke\"> ' + preporuka + '</b> <br>\\n' +\n ' Prosečno vreme odgovora: <b class=\"vremeOdgovora\">' + vremeOdgovora + '</b> <br>\\n' +\n ' Cena usluge: <b class=\"cenaUsluge\"> ' + cena + '</b>\\n' +\n ' </h3>\\n' +\n ' </td>\\n' +\n ' </tr>\\n' +\n ' <tr>\\n' +\n ' <td colspan=\"3\" width=\"100%\">\\n' +\n ' <div class=\"detaljnijeMajstor\" id=\"' + majstor + '\">\\n' +\n ' <form action=\"../prikazMajstora\" method=\"POST\">\\n' +\n ' <input type=\"hidden\" id=\"idUsluge\" name=\"id\" value=\"' + majstor + '\">\\n' +\n ' <button type=\"SUBMIT\" id=\"\" onClick=\"\" formTarget=\"_blank\" value=\"...\">\\n' +\n ' Prikaži profil majstora\\n' +\n ' </button>\\n' +\n ' </form>\\n' +\n ' </div>\\n' +\n ' <div class=\"odbij\">\\n' +\n ' <button>\\n' +\n ' <label for=\"cb\">Odaberi</label>\\n' +\n ' <input type=\"checkbox\" class=\"uslugaCB\" id=\"cb' + id + '\">\\n' +\n ' </button>\\n' +\n ' </div>\\n' +\n ' </td>\\n' +\n ' </tr>\\n' +\n ' </table>\\n' +\n ' </div>\\n' +\n '</div>\\n'\n}", "function mostrarBienvenidaUsuario() {\n $(\"#pHome\").html(`Hola, ${usuarioLogueado.nombre}!`);\n}", "function renderizarUsuarios(personas) {\n console.log(personas);\n\n var html = '';\n\n // Html que se mostrara en el frontend\n html += '<li>';\n html += '<a href=\"javascript:void(0)\" class=\"active\"> Chat de <span>' + params.get('sala') + '</span></a>';\n html += '</li>';\n\n for (let i = 0; i < personas.length; i++) {\n\n html += '<li>';\n html += '<a data-id=\"' + personas[i].id + '\" href=\"javascript:void(0)\"><img src=\"assets/images/users/1.jpg\" alt=\"user-img\" class=\"img-circle\"> <span>' + personas[i].nombre + '<small class=\"text-success\">online</small></span></a>';\n html += '</li>';\n\n }\n\n // Inserta todo el contenido de la variable html, en el divUsuarios del front\n divUsuarios.html(html);\n\n}", "function renderizarUsuarios(personas) {\n console.log(personas);\n var html = '';\n html += '<li>';\n html += ' <a href=\"javascript:void(0)\" class=\"active\"> Chat de <span> ' + sala + '</span></a>';\n html += '</li>';\n for (let i = 0; i < personas.length; i++) {\n const per = personas[i];\n html += '<li>';\n html += ' <a data-id=\"' + per.id + '\" href=\"javascript:void(0)\"><img src=\"assets/images/users/' + (i + 1) + '.jpg\" alt=\"user-img\" class=\"img-circle\"> <span>' + per.nombre + ' <small class=\"text-success\">online</small></span></a>';\n html += '</li>';\n }\n divUsuario.html(html);\n}", "function definirNomeJogador(nome) {\n document.getElementById('jogador-nome').innerHTML = nome;\n}", "function renderUserDiv() {\n return (\n <p>Check out this cool site, {currentUser.first_name}!</p>\n )\n }", "function detalii_user() {\n\n var uid = getQueryVariable('UID')\n\n // pentru detaliile utilizatorului curent\n if (uid == false) {\n $.post('server/getuser.php', function(data) {\n var json_data = JSON.parse(data)\n if (json_data.status == 1) {\n var type_user = [\"Utilizator\", \"Angajat\"]\n const contin = `\n <div class=\"centered card card-success card-outline\" >\n <div class=\"card-body box-profile\">\n <div class=\"text-center\">\n <img class=\"profile-user-img img-fluid img-circle\" src=\"../../dist/img/user.png\" alt=\"User profile picture\">\n </div>\n \n <h3 class=\"profile-username text-center\">${json_data.first_name} ${json_data.last_name}</h3>\n \n <p class=\"text-muted text-center\">${type_user[json_data.user_type]}</p>\n \n <ul class=\"list-group list-group-unbordered mb-3\">\n <li class=\"list-group-item\">\n <b>Email</b> <a class=\"float-right\">${json_data.user_email}</a>\n </li>\n `\n\n if (json_data.user_type == 0) {\n caseta = contin + `<li class=\"list-group-item\">\n <b>Număr de animale adăugate</b> <a class=\"float-right\">${json_data.nr_owned_pets}</a>\n </li>\n </ul>\n <a href=\"animalele_mele.php\" class=\"btn btn-success btn-block\"><b>Animalele mele</b></a>\n </div>\n <!-- /.card-body -->\n </div>`\n } else\n if (json_data.user_type == 1) {\n caseta = contin + `</ul>\n </div>\n <!-- /.card-body -->\n </div>`\n }\n\n if (document.getElementById('continut_pag') != null) {\n document.getElementById('continut_pag').innerHTML += caseta;\n } else {\n console.log('Nu s-a gasit detalii_user.php')\n }\n }\n })\n } else\n // pentru angajatul care vrea sa vada contul unui utilizator\n {\n $.post('server/getuser.php', { WantedUID: uid },\n\n function(data) {\n var json_data = JSON.parse(data)\n if (json_data.status == 1) {\n var type_user = [\"Utilizator\", \"Angajat\"]\n const contin = `\n <div class=\"centered card card-success card-outline\" >\n <div class=\"card-body box-profile\">\n <div class=\"text-center\">\n <img class=\"profile-user-img img-fluid img-circle\" src=\"../../dist/img/user.png\" alt=\"User profile picture\">\n </div>\n \n <h3 class=\"profile-username text-center\">${json_data.first_name} ${json_data.last_name}</h3>\n \n <p class=\"text-muted text-center\">${type_user[json_data.user_type]}</p>\n \n <ul class=\"list-group list-group-unbordered mb-3\">\n <li class=\"list-group-item\">\n <b>Email</b> <a class=\"float-right\">${json_data.user_email}</a>\n </li>\n `\n\n if (json_data.user_type == 0) {\n caseta = contin + `<li class=\"list-group-item\">\n <b>Număr de animale adăugate</b> <a class=\"float-right\">${json_data.nr_owned_pets}</a>\n </li>\n </ul>\n </div>\n <!-- /.card-body -->\n </div>`\n } else\n if (json_data.user_type == 1) {\n caseta = contin + `</ul>\n </div>\n <!-- /.card-body -->\n </div>`\n }\n\n if (document.getElementById('continut_pag') != null) {\n document.getElementById('continut_pag').innerHTML += caseta;\n } else {\n console.log('Nu s-a gasit detalii_user.php')\n }\n }\n })\n\n }\n}", "function cargarNombreEnPantalla() \n{\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenid@ \" + nombreUsuario;\n}", "async function buscaUser() {\n const userGit = document.getElementById(\"userGit\").value;\n requisicao.url += userGit;\n requisicao.resposta = await fetch(requisicao.url);\n requisicao.resultado = await requisicao.resposta.json();\n\n limpaPesquisa();\n document.getElementById(\"gitUser\").innerHTML = requisicao.resultado.login;\n }", "function saludar()\n {\n // Recojo el valor introducido por el usuario\n let user = oDom.eInputName.value\n // Saco en el html, en la etiqueta output introduzco el valor que teniamos en console antes\n oDom.eOutSaludo.innerHTML = `Hola ${user}` // Podria poner un parrafo = `<p>Hola ${user}</p>`\n console.log(user)\n //console.log(`Hola ${user}`)\n }", "function carregaUser(){\n var userStr = localStorage.getItem(\"user\");\n if (!userStr){ // se nao tiver isso no localStorage, redireciona para o index (login)\n window.location = \"index.html\";\n }\n else{\n\n // se o usuario existe armazenado, eu pego, converto-o para JSON\n var user = JSON.parse(userStr);\n // e comeco a preencher as diferentes secoes da minha pagina\n // secao do perfil\n var strNome = fragmentoNome.replace(\"{{NOME}}\",user.nome);\n var strRacf = fragmentoRacf.replace(\"{{RACF}}\",user.racf);\n var strEmail = fragmentoEmail.replace(\"{{EMAIL}}\",user.email);\n var strSetor = fragmentoSetor.replace(\"{{SETOR}}\",user.setor);\n\n document.getElementById(\"nome\").innerHTML = strNome;\n document.getElementById(\"racf\").innerHTML = strRacf;\n document.getElementById(\"email\").innerHTML = strEmail;\n document.getElementById(\"setor\").innerHTML = strSetor;\n // secao da foto\n document.getElementById(\"fotoUser\").innerHTML = \n fragmentoFoto.replace(\"{{LINKFOTO}}\",user.linkFoto);\n\n // secao dos pedidos\n var strPedidos=\"\";\n for (i=0; i<user.pedidos.length; i++){\n let pedidoatual = fragmentoPedido;\n strPedidos += pedidoatual.replace(\"{{DATAPEDIDO}}\",user.pedidos[i].dataPedido)\n .replace(\"{{NUMPEDIDO}}\",user.pedidos[i].numPedido) \n .replace(\"{{OBSERVACOES}}\",user.pedidos[i].observacoes);\n }\n document.getElementById(\"pedidos\").innerHTML = strPedidos;\n }\n\n \n}", "function asignarNombre(nombreUsuario){\n\tvar nombreU = nombreUsuario;\n\tvar elemento = document.getElementById(\"Hi_user\");\n\telemento.innerHTML = nombreU;\n}", "function addUNameToDom(name) {\r\n\tconst paraElement = document.createElement('p')\r\n\tparaElement.innerHTML = '<strong>From user: </strong>' + name\r\n\treturn paraElement\r\n}", "function add_user_ui(u) {\n //a = `<div id=\"${name_to_id(u.first_name)}\" onClick=\"update_person(this)\" class=\"person\"><div class=\"person-name\">${u.first_name}</div><div class=\"person-date\">${u.last}</div></div>`\n a = `<div id=\"${name_to_id(u.first_name + u.last_name)}\" onClick=\"update_person(this)\" class=\"person\"><div class=\"person-name\">${u.first_name}</div><div class=person-lastname>${u.last_name}</div></div>`\n $(\"#contact_list\").append(a);\n}", "function newUser() { // Ajout d'un nouvel utilisateur\n\n // Cible le container des profils\n const userProfileContainer = document.querySelector(\".user-profile-container\");\n\n let myName = prompt(\"Prénom de l'utilisateur\");\n\n if (myName.length !== 0) { // On vérifie que le prompt ne soit pas vide\n\n usersNumber+=1; // Incrémente le nombre d'utilisateurs\n\n // 1 - Créer un nouveau user-profile\n const userProfile = document.createElement(\"div\");\n // Lui assigner la classe userProfileContainer\n userProfile.classList.add(\"user-profile\");\n // Lui assigner un ID\n userProfile.id = `user-profile-${usersNumber}`; \n // L'ajouter au DOM \n userProfileContainer.insertBefore(userProfile, document.querySelector(\"#add-user\"));\n\n // 2 - Créer un nouveau user portrait\n const userPortrait = document.createElement(\"div\");\n // Lui assigner la classe portrait\n userPortrait.classList.add(\"user-portrait\");\n // Lui assigner un ID\n userPortrait.id = `user-portrait-${usersNumber}`;\n // L'ajouter au DOM\n document.getElementById(`user-profile-${usersNumber}`).appendChild(userPortrait);\n\n // 3 - Créer un nouveau user-portrait__image\n const userPortraitImage = document.createElement(\"img\");\n // Lui assigner la classe userImage\n userPortraitImage.classList.add(\"user-portrait__image\");\n // Lui assigner un ID\n userPortraitImage.id = `user-portrait-image-${usersNumber}`;\n // Ajouter une image automatiquement\n userPortraitImage.src = \"assets/img/new_user_added.png\";\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userPortraitImage);\n\n // 4 - Créer un nouveau user-name\n const userName = document.createElement(\"h2\");\n // Lui assigner la classe profileName\n userName.classList.add(\"user-name\");\n // Utiliser un innerHTML pour afficher le nom\n userName.innerHTML = myName;\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userName);\n }\n}", "function showData(user) {\n \n let userImage = document.createElement('img');\n userImage.src = user.avatar;\n userImage.alt = 'User Avatar';\n\n sectionInfo.appendChild(userImage);\n\n let userIntro = document.createElement('h5');\n userIntro.innerText = `Hi! My name is ${user.first_name} ${user.last_name}.`\n\n sectionInfo.appendChild(userIntro);\n\n let userContact = document.createElement('h6');\n userContact.innerText = `You can reach me at ${user.email}`;\n\n sectionInfo.appendChild(userContact);\n\n}", "function CuadroMensaje(dato){\n\tvar instancia = $(\"<div class='contenidoMensaje'>\");\n\tvar usuario = $(\"<div class='usuario'>\");\n\tvar imagen = $(\"<img>\");\n\tvar mensaje = $(\"<div class='mensaje'>\");\n\tvar nombreUsuario = $(\"<h4 class='nombreUsuario'>\");\n\tvar cuerpoMensaje = $(\"<div>\");\n\tfunction init(){\n\t\tinstancia.append(usuario);\n\t\tinstancia.append(mensaje);\n\t\tusuario.append(imagen);\n\t\tmensaje.append(nombreUsuario);\n\t\tmensaje.append(cuerpoMensaje);\n\t\tvar linkFoto = dato.user.profile_image_url;\n\t\timagen.attr({\"src\":linkFoto});\n\t\tnombreUsuario.html(dato.user.name);\n\t\tcuerpoMensaje.html(dato.text);\n\t\tsetTimeout(function(){\n\t\t\tinstancia.addClass(\"leer\");\n\t\t},100);\n\t\tsetTimeout(function(){\n\t\t\tinstancia.addClass(\"leido\");\n\t\t},5000);\n\t}\n\tinit();\n\treturn instancia;\n}", "function DodajPorukeIzListe(usr,msg,prim) {\n\n let chatDiv = '#chat-' + prim;\n let chatDiv2 = '#chat-' + usr;\n $(chatDiv).find(\"#divMessage\").append(usr + ': ' + msg + '<br>');\n $(chatDiv2).find(\"#divMessage\").append(usr + ': ' + msg + '<br>');\n}", "function AgregarAlDom() {\n contenedor.innerHTML = `<h3> Ultimo alumno ingresado:</h3>\n <p><strong> Nombre: </strong> ${nombreI}</p>\n <p><strong> Email: </strong> ${emailI}</p>\n <p><strong> PassWord: </strong> ${passwordI}</p>\n <hr>`;\n}", "async function showUserData() {\n // fetch user data from the server\n //let fetched = await fetch('/json/users');\n //let users = await fetched.json();\n\n let fetched = await fetch('/json/minuss');\n // convert from json to a data structure\n let minuss = await fetched.json();\n\n //console.log(\"users\", users);\n console.log(\"minuss\", minuss);\n\n // test (vi ka testa nu)\n //console.log(users);\n\n let html = `\n <table style=\"width:100%\">\n <tr>\n <td><b>Förnamn</b></td>\n <td><b>Efternamn</b></td>\n <td><b>Personnummer</b></td>\n <td><b>Kontonummer</b></td>\n <td><b>Balance</b></td> \n </tr>\n `;\n for (let minus of minuss) {\n html += `\n <tr>\n <td>${minus.first_name}</td>\n <td>${minus.last_name}</td>\n <td>${minus.pnr}</td>\n <td>${minus.number}</td>\n <td>${minus.balance}</td>\n </tr>\n `;\n }\n\n html += '</table>';\n\n // visa console med detta:\n //console.log(html);\n\n // add the html inside the div tag\n // with the class users\n\n // grab the div with the class users\n let userDiv = document.querySelector('.minuss');\n // replace the content inside the div\n userDiv.innerHTML = html;\n\n}", "function cargarNombreEnPantalla() {\n\tdocument.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function colocar_dulce(fila,modo=\"aleatorio\",nombre_imagen=0){\r\nvar html_para_agregar=\"\";\r\n if(modo === \"aleatorio\"){\r\n nombre_imagen = numero_entero_al_azar(1,4);\r\n }\r\n html_para_agregar = '<div class=\"candycru fila'+fila+'\"><img src=\"image/'+nombre_imagen+'.png\" alt=\"\"></div>'\r\n return html_para_agregar\r\n}", "function pintarNombre(nombre, apellido) {\n $(\"#nombreUser\").empty();\n $(\"#nombreUser\").append('<h3>' + nombre + ' ' + apellido + '</h3>')\n}", "function cargarNombreEnPantalla() {\r\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\r\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function cargarNombreEnPantalla() {\n document.getElementById(\"nombre\").innerHTML = \"Bienvenido/a \" + nombreUsuario;\n}", "function setName(username) {\n const usernamediv = document.querySelector('#name');\n usernamediv.innerHTML = `<i class=\"fa fa-user-circle\"></i>${username}`;\n}", "function addUserToDom( user ) {\n var user = new User( user );\n var html = user.getUserHtmlString();\n $('#users-window').append(html);\n }", "function displayNameUser(responseAsJson, div, authToken, apiUrl, content){\n\tconst username = document.createElement(\"h1\");\n\tusername.style.textAlign = \"center\"; //display username\n\tusername.textContent = \"@\" + responseAsJson.username;\n\tusername.className = \"listAll\"; //make username linkable to public profile\n\tusername.onclick = function(){let userPage = createUserPage(div,\n\t\t\t\t\t\t\t\t\t\t responseAsJson.username, authToken, apiUrl);\n\t\t\t\t\t\t\t\t\t\t openEdit(div, userPage)};\n\tcontent.appendChild(username);\n\tconst n = document.createElement(\"h2\"); //display name\n\tn.style.textAlign = \"center\";\n\tn.style.color = \"var(--reddit-blue)\";\n\tn.textContent = responseAsJson.name;\n\tcontent.appendChild(n);\n\treturn content;\n}", "function userAc(user){\n// Elementos de informacion de la card del usuario\n const userNickName = document.getElementById(\"titulo\")\n const userImage = document.getElementById(\"imagen\")\n const userName = document.getElementById(\"nombre\")\n const userLink = document.getElementById(\"enlace\")\n const userRepo = document.getElementById(\"repo\")\n \n const api = \"https://api.github.com\"\n fetch(api + \"/users/\"+user)\n .then(response => response.json())\n .then(json => {\n userNickName.innerHTML =json.login\n userImage.src = json.avatar_url\n userName.innerHTML = json.name\n userRepo.innerHTML = json.public_repos\n userLink.href = json.html_url\n \n }) \n}", "function masquer_div(id) {\n document.getElementById(id).style.display = 'none';\n var comment = document.getElementById(\"commentaire\").value;\n document.getElementById(\"ico\").title = comment;\n\n}", "function showUser(peoplesObject) {\r\n let peopleMessage = document.querySelector('.people-say-slider-comment');\r\n let peopleDetails = document.querySelector('.user-details');\r\n\r\n // create new element \r\n const peopleComment = document.createElement('p');\r\n const peopleName = document.createElement('p');\r\n const peoplePosition = document.createElement('p');\r\n const peopleImageBlock = document.createElement('div');\r\n const peoplePhoto = document.createElement('img');\r\n\r\n // to add class \r\n $(peopleComment).addClass('people-slider-message');\r\n $(peopleName).addClass('user-name');\r\n $(peoplePosition).addClass('user-position');\r\n $(peopleImageBlock).addClass('user-photo');\r\n $(peoplePhoto).addClass('user-photo-img');\r\n\r\n // to write value from object\r\n $(peopleComment).text(peoplesObject.text);\r\n $(peopleName).text(peoplesObject.user_name);\r\n $(peoplePosition).text(peoplesObject.user_work);\r\n peoplePhoto.setAttribute('src', `./img/people/${peoplesObject.user_image}`);\r\n\r\n // to hide all elements\r\n $(peopleComment).hide();\r\n $(peopleName).hide();\r\n $(peoplePosition).hide();\r\n $(peopleImageBlock).hide();\r\n\r\n // to add current element inside new created block\r\n $(peopleMessage).append(peopleComment);\r\n $(peopleDetails).append(peopleName);\r\n $(peopleDetails).append(peoplePosition);\r\n $(peopleImageBlock).append(peoplePhoto);\r\n $(peopleDetails).append(peopleImageBlock);\r\n\r\n// to show with duration\r\n $(peopleComment).fadeIn(1100);\r\n $(peopleName).fadeIn(800);\r\n $(peoplePosition).fadeIn(800);\r\n $(peopleImageBlock).fadeIn(1100);\r\n}", "function displayUser(users) {\n\tPromise.all(users.map(function(user) {\n\t\tconst userDisplay = document.createElement('div');\n\t\tuserDisplay.className= \"user\"\n\t\tuserDisplay.innerHTML = user.login;\n\t\tdocument.body.appendChild(userDisplay);\n\t}))\n}", "displayBio(data){\n \n this.ui.userBioContainer.innerHTML=`\n <div class=\"bio text-center\">\n <img src=\"${data.authorImage}\" alt=\"Image Placeholder\" class=\"img-fluid mb-5\" style=\"height:150px;width:150px;border-radius:50%;\">\n <div class=\"bio-body\">\n <h2>${data.authorName}</h2>\n <p class=\"mb-4\">${data.authorBio}</p>\n \n <p class=\"social\">\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-facebook\"></span></a>\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-twitter\"></span></a>\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-instagram\"></span></a>\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-youtube-play\"></span></a>\n </p>\n </div>\n </div>\n `\n }", "function forEncabezado(modulo, empleado){\n\tvar txt ='<div id=\"cont_norte\"><div id=\"imagenLogo\" class=\"col-xs-3 col-xs-offset-1 \">';\n\ttxt +='<img src=\"img/logo1.png\" alt=\"logo\" id=\"imgLoginChef\"></div>';\n\ttxt +='<div class=\"col-xs-6\"><div id=\"logoModulo\" class=\"col-xs-12 col-md-6\"><h1>'+ modulo +'</h1></div>';\n\ttxt +='<div id=\"logoNombre\" class=\"col-xs-12 col-md-6\"><h1>'+ empleado +'</h1></div></div>';\n\ttxt +='<div id=\"cerrarSesion\" class=\"col-xs-2 \"><button class=\"btn\" id=\"btnCerrar\"><span class=\"glyphicon glyphicon-off\"></span></button></div></div>';\n\treturn txt;\n}", "function renderizaOk() {\n const nomeOk = criaP();\n const userOk = criaP();\n const senhaOk = criaP();\n const titulo = document.createElement('h3');\n render();\n\n // Renderizando as Informações do Usuário\n function render() {\n nomeOk.innerHTML = `<b>Nome</b> : ${inputNome.value.trim()}`;\n userOk.innerHTML = `<b>Username</b> : ${inputUser.value}`;\n senhaOk.innerHTML = `<b>Senha</b> : ${inputSenha.value}`;\n titulo.innerText = 'Usuário criado com sucesso!';\n\n divRenderiza.appendChild(titulo);\n divRenderiza.appendChild(nomeOk);\n divRenderiza.appendChild(userOk);\n divRenderiza.appendChild(senhaOk);\n }\n }", "function renderUserInfo(user) {\n userBox.innerHTML += `\n <h3>Hi ${user.data.attributes.username}!</h3>\n <h5>Your Badges</h5>\n <div class=\"badgeContainer\"></div>\n <form data-id=${user.data.id} class=\"userUpdateForm\">\n Change Username:<br>\n <input type=\"text\" name=\"username\" value=\"\">\n <br>\n Change Email:<br>\n <input type=\"text\" name=\"email\" value=\"\">\n <br>\n <button data-id=${user.data.id} class=\"updateButton\"> Update </button>\n <br>\n </form>\n <button data-id=${user.data.id} class=\"deleteButton\"> Delete Me </button>\n ` \n let userUpdateForm = document.querySelector(\".userUpdateForm\") \n \n}", "function showUser(res, username) {\n let image = res.data;\n for (let pf of image) {\n if (pf.username === username) {\n let userPf = document.createElement('img');\n let text = document.createElement('h2');\n userPf.src = pf.profile;\n text.textContent = pf.username;\n text.style.marginLeft = 10 + \"px\";\n userPf.style.width = 70 + \"px\";\n userPf.style.height = 70 + \"px\";\n userPf.style.borderRadius = 40 + \"px\";\n images.appendChild(userPf);\n images.appendChild(text);\n }\n }\n}", "function setUserData() {\r\n userDto = UserRequest.getCurrentUser();\r\n // set value for Mã giới thiệu\r\n document.getElementsByClassName('btn btn-primary')[0].innerText =\r\n ' Mã giới thiệu: ' + userDto.username;\r\n document.getElementById('numOfCoin').innerHTML = userDto.accountBalance + ' xu';\r\n document.getElementById('numOfTime').innerHTML = userDto.numOfDefaultTime + ' phút';\r\n document.getElementById('numOfCoinGiftBox').innerHTML = userDto.numOfCoinGiftBox + ' hộp';\r\n document.getElementById('numOfTimeGiftBox').innerHTML = userDto.numOfTimeGiftBox + ' hộp';\r\n document.getElementById('numOfTravelledTime').innerHTML = userDto.numOfTravelledTime + ' phút';\r\n document.getElementById('numOfStar').innerHTML = userDto.numOfStar + ' sao';\r\n fadeout();\r\n}", "function generarFichaPersona(){\n\tterapeuta = $(\".nonmbre-terapeuta\").text()\n\tfichaPersona = '\t<div class=\"busqueda-box-center\">'\n\tfichaPersona += '\t<div class=\"ficha-persona\">'\n\tfichaPersona += '\t\t<div class=\"ver-contenido-ficha\">'\n\tfichaPersona += '\t\t<p class=\"nombre-ficha\">Plan Información Total</p>'\n\tfichaPersona += '\t\t\t<h3>Tipo de suscripción.</h3><br />'\n\tfichaPersona += '\t\t\t\t<form accept-charset=\"UTF-8\" action=\"/terapeutas/upgrade_plan/'+terapeuta+'\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input name=\"authenticity_token\" type=\"hidden\" value=\"pkKb3pECaOh8coEUJSLk3lYZ/w1/PIPKV3K7RPiyrgg=\" /></div>'\n\tfichaPersona += '\t\t\t\t<div class=\"form-block one-line radio-button\">'\n\tfichaPersona += '\t\t\t\t\t<div class=\"label\"><input checked=\"checked\" id=\"plan_ciclo_Anual\" name=\"plan_ciclo\" type=\"radio\" value=\"Anual\" /></div>'\n\tfichaPersona += '\t\t\t\t\t<div class=\"columna30\">'\n\tfichaPersona += '\t\t\t \t \t\tSuscripción completa <strong>anual</strong>. <br/>$ 5.300 por mes. Total $ 63.600 '\n\tfichaPersona += '\t\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t\t<div class=\"form-block one-line radio-button\">'\n\tfichaPersona += '\t\t\t\t\t<div class=\"label\"><input id=\"plan_ciclo_Semestral\" name=\"plan_ciclo\" type=\"radio\" value=\"Semestral\" /></div>'\n\tfichaPersona += '\t\t\t\t\t<div class=\"columna30\">'\n\tfichaPersona += '\t\t\t \t \t\tSuscripción <strong>semestral</strong>. <br/> $ 7.480 por mes. Total $ 44.800'\n\tfichaPersona += '\t\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t\t<div class=\"form-block one-line radio-button\">'\n\tfichaPersona += '\t\t\t\t\t<div class=\"label\"><input id=\"plan_ciclo_Trimestral\" name=\"plan_ciclo\" type=\"radio\" value=\"Trimestral\" /></div>'\n\tfichaPersona += '\t\t\t\t\t<div class=\"columna30\">'\n\tfichaPersona += '\t\t\t \t \t\tSuscripción <strong>trimestral</strong>. <br/>$ 8.900 por mes. Total $ 26.700'\n\tfichaPersona += '\t\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t\t<div align=\"right\">'\n\tfichaPersona += '\t\t\t\t<input class=\"boton-morado derecha\" name=\"commit\" type=\"submit\" value=\"Contratar\" />'\n\tfichaPersona += '\t\t\t\t</div>'\n\tfichaPersona += '\t\t\t</form>\t\t\t'\n\tfichaPersona += '\t\t\t</div><!-- ficha-columna -->'\n\tfichaPersona += '\t\t\t</div><!--contenido ficha-->'\n\tfichaPersona += '\t\t</div><!--ficha persona-->'\n\tfichaPersona += '\t</div><!--box center-->'\n\treturn fichaPersona;\n}", "async function getname() {\n let modified_url2 = url_info + handle_name;\n\n const jsondata2 = await fetch(modified_url2);\n const jsdata2 = await jsondata2.json();\n let name = jsdata2.result[0].firstName || \"user\";\n\n let user = document.querySelector(\".user\");\n let user_avatar = document.querySelector(\".user_avatar\");\n let str = jsdata2.result[0].titlePhoto;\n let p = \"http://\";\n str = str.substr(2);\n let arr = [p, str];\n let stt = arr.join(\"\");\n user_avatar.innerHTML = `<img src=\"${stt}\" class=\"avatar\"></img>`;\n user.innerHTML = name;\n }", "function mostrarJornadaUsuario(partidos){\n\n\n\tfor (index = 0; index < partidos.length; index++) {\n\n\t\tvar row = $(\"<tr></tr>\").attr(\"scope\", \"row\");\n\t\trow.append($(\"<td></td>\").text(partidos[index].fecha));\n\t\trow.append($(\"<td></td>\").text(partidos[index].horario));\n\t\trow.append($(\"<td></td>\").text(partidos[index].equipo_local));\n\n\t\tvar resultado = partidos[index].resultado;\n\n\t\tif (resultado === \"vs\")\n\t\t\trow.append($(\"<td></td\").append($(\"<span></span>\").attr(\"class\", \"badge badge-pill badge-danger\").text(\"vs\")));\n\t\telse{\n\t\t\tvar RL = resultado.substring(0, 1);\n\t\t\tvar RV = resultado.substring(1, 2);\n\t\t\trow.append($(\"<td></td\").append($(\"<span></span>\").attr(\"class\", \"badge badge-pill badge-danger\").text(RL + \" - \" + RV)));\n\t\t}\n\n\t\trow.append($(\"<td></td>\").text(partidos[index].equipo_visitante));\n\t\trow.append($(\"<td></td>\").attr(\"class\", \"tabla-estadio\").text(partidos[index].estadio));\n\t\t$(\"#tabla_fixture\").append(row);\n\t}\n\n}", "function myFunction (){\n var user = document.getElementById(\"name\").value;\n var p = document.getElementById(\"welcomeMsje\");\n p.innerHTML = user + \" cuando tú respuesta esté correcta, se verá en color verde, y cuando sea incorrecta se verá en color naranjo\";\n}", "function printUsers(qty){\n // Function which handle the edit forms url\n \n \n while ( \n document\n .getElementById('section')\n .firstChild) {\n document\n .getElementById('section').\n removeChild(\n document\n .getElementById('section')\n .firstChild);\n }\n for(i=1 ; i < qty ; i++){\n console.log(users[i])\n \n if(users[i].status!='Deleted'){\n document.getElementById('section').style.display = 'grid'\n \n auxUsers = `<div id=\"user-${i}\" class=\"card\"\">\n <header class=\"card-header\">\n <div class=\"media-content d-flex align-center\">\n <div class=\"info\">\n <p class=\"title is-4\">${users[i].name}</p>\n <p class=\"subtitle is-6\">${users[i].email}</p>\n <span class=\"tag is-warning mx-5\">${users[i].partnerShip}</span>\n </div>\n </div>\n <span class=\"mt-3 mx-2\">#${i}</span>\n \n </header>\n <div class=\"card-content\">\n <div class=\"content\">\n \n ${users[i].situation}\n </div>\n </div>\n </div>` + auxUsers }else if(i+1 == users.length && auxUsers == ''){\n\n document.getElementById('section').style.display = 'flex'\n document.getElementById('section').style.justifyContent = 'center'\n\n auxUsers = `<div class=\"notification is-warning is-light\">\n Nenhum cliente cadastrado!\n </div>`\n }\n \n }\n \n \n }", "function chargerDonnees(){\n document.getElementById(\"pseudo\").innerHTML = /*window.mon_identifiant + \" --> \" + */ \"Chat privé avec \"+escapeHtml(window.destinataire);\n document.getElementById(\"messageChat\").innerHTML = window.historique;\n}", "function mostrarDatos(Persona) {\n //debugger;\n let div = document.createElement(\"div\");\n let parr = document.createElement(\"p\");\n let nombres = document.createTextNode(Persona.nombres+\" \");\n let apellidos = document.createTextNode(Persona.apellidos+\" \");\n let edad = document.createTextNode(Persona.edad+\" \");\n\n console.log(apellidos);\n parr.append(nombres);\n parr.append(apellidos);\n parr.append(edad);\n div.appendChild(parr);\n document.body.appendChild(div);\n}", "function mostrarResultado() {\n $infoBox.classList.remove(\"ativadoinfo\");\n $boxquiz.classList.remove(\"ativadoquiz\");\n $resultado.classList.add(\"ativadoResultado\");\n const pontosText = $resultado.querySelector(\".pontos-quiz\");\n if (userPontos >= 5) {\n let pontos_tag = '<span>Párabens, você GABARITOU, acertou <p>' + userPontos + '</p> de <p>' + perguntas.length + '</p>!</span>'\n pontosText.innerHTML = pontos_tag;\n }\n else if (userPontos >= 3) {\n let pontos_tag = '<span>Você mandou bem, acertou <p>' + userPontos + '</p> de <p>' + perguntas.length + '</p>!</span>'\n pontosText.innerHTML = pontos_tag;\n }\n else if (userPontos > 1) {\n let pontos_tag = '<span>Eu sei que você pode ser melhor, você só acertou <p>' + userPontos + '</p> de <p>' + perguntas.length + '</p>.</span>'\n pontosText.innerHTML = pontos_tag;\n }\n else {\n let pontos_tag = '<span>Que pena, você só acertou <p>' + userPontos + '</p> de <p>' + perguntas.length + '</p>.</span>'\n pontosText.innerHTML = pontos_tag;\n }\n}", "function sinDatos(){\r\n\t\r\n\tvar textoHTML=\"<h1 style='text-align:center'>Actualmente no hay usuarios registrados</h1>\";\r\n\t\r\n\tdocument.getElementById(\"usuarioContent\").innerHTML=textoHTML;\r\n\t\r\n}", "function setUser() {\n user = new User($(\"#idh\").html(),$(\"#nameh\").html());\n}", "function showTopFivePlayers(topFivePlayers, topFivePlayersDiv) {\n while (topFivePlayersDiv.children.length > 0) {\n topFivePlayersDiv.removeChild(topFivePlayersDiv.firstChild);\n }\n topFivePlayers.forEach(user => {\n\n const paragraph1 = document.createElement('p');\n paragraph1.setAttribute('class', `${user.username}`);\n const paragraph2 = document.createElement('p');\n paragraph2.setAttribute('class', `${user.username}`);\n const paragraph3 = document.createElement('p');\n paragraph3.setAttribute('class', `${user.username}`);\n\n paragraph2.style.color = '#e40046';\n paragraph2.style.fontWeight = 'bold';\n paragraph3.style.color = '#e40046';\n paragraph3.style.fontWeight = 'bold';\n\n const username = document.createTextNode(user.username);\n const title = document.createTextNode(user.title);\n const score = document.createTextNode(user.score);\n\n paragraph1.appendChild(username);\n paragraph2.appendChild(title);\n paragraph3.appendChild(score);\n\n const userContainer = document.createElement('div');\n userContainer.appendChild(paragraph1);\n userContainer.appendChild(paragraph2);\n userContainer.appendChild(paragraph3);\n topFivePlayersDiv.appendChild(userContainer);\n });\n return;\n}", "function renderDetail(el, user){\n el.append(\n '<div class=\"row align-item-center justify-content-center\">' +\n '<div class=\"col-md-6\">' +\n '<div class=\"card\"><img class=\"card-img\" src=\"' + user.picture + '\" alt=\"Card image\"></div>' +\n '<div class=\"row col-md-12\">' +\n '<h1>' + user.first_name + ' ' + user.last_name + '</h1><br>' +\n '</div>' +\n '</div>' +\n '</div>'\n\n );\n }", "formularioUno(contPar,formPar,filPar){/* avisoCuatro.css*/\n\t\tlet txt,fil;\n\t\t//contenedor\n\t\tconst contenedor = document.createElement('div');\n\t\tcontenedor.setAttribute('class',contPar[1]);\n\t\tcontenedor.setAttribute('id',contPar[2]);\n\t\t//titulo\n\t\tconst titulo = document.createElement('p');\n\t\ttxt = document.createTextNode(contPar[0]);\n\t\ttitulo.appendChild(txt);\n\t\tcontenedor.appendChild(titulo);\n\t\t// form\n\t\tconst formul = document.createElement('form');\n\t\tformul.setAttribute('class',formPar[0]);\n\t\tformul.setAttribute('id',formPar[1]);\n\t\t//filas\n\t\tfilPar.forEach((item,index) =>{\n\t\t\tfil = document.createElement('div');\n\t\t\tfil.setAttribute('class',formPar[2]);\n\t\t\tfil.setAttribute('id',`${formPar[2]}-${index}`);\n\t\t\titem.forEach(it => {fil.appendChild(it);});\n\t\t\tformul.appendChild(fil);\n\t\t});\n\t\tcontenedor.appendChild(formul);\n\t\treturn contenedor;\n\t}", "function divForAllPeople2(parentElement, data) {\n\t \n\t \tif (data[0].member == 'false')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tif (data[0].end_date != '')\n\t\t{\n\t\t\tvar d1 = new Date();\n\t\t\tvar d2 = new Date(data[0].end_date);\n\t\t\tif (d2.getTime() < d1.getTime()) return;\n\t\t}\n\t \n\t// ------------------------------------------- CDD (LLGRD-07/09/21)\n\tif (data[0].perm == 'false')\n\t{\n\t\tconst childElement = document.createElement('div');\n\t\tconst appendChildElement = parentElement.appendChild(childElement);\n\t\tappendChildElement.setAttribute(\"class\",\"people col-lg-2 col-md-6 mb-lg-0 mb-5\");\n\t\tavatarDivElement = document.createElement('div');\n\t\tconst appendAvatarDivElement = appendChildElement.appendChild(avatarDivElement);\n\t\tappendAvatarDivElement.setAttribute(\"class\",\"avatar mx-auto img-member\");\n\t\timgElement = document.createElement('img');\n\t\timgElement.setAttribute(\"class\",\"rounded-circle z-depth-1\");\n\t\timgElement.setAttribute(\"src\",data[0].photo);\n\t\timgElement.setAttribute(\"alt\",\"\");\n\t\tappendImgElement = appendAvatarDivElement.appendChild(imgElement);\n\n\t\taElement = document.createElement('a');\n\t\taElement.setAttribute(\"href\", data[0].webpage);\n\t\tnameElement = document.createElement('h5');\n\t\tnameElement.innerHTML = data[0].firstname +\" \"+ data[0].lastname;\n\t\tnameElement.setAttribute(\"class\",\"font-weight-bold mt-4 mb-3\");\n\t\taElement.append(nameElement);\n\t\tappendChildElement.appendChild(aElement);\n\t\tstatusElement = document.createElement('p');\n\t\tstatusElement.innerHTML = data[0].status;\n\t\tstatusElement.setAttribute(\"class\",\"text blue-text text-status lang-en\");\n\t\tappendChildElement.appendChild(statusElement);\n\t\tstatutElement = document.createElement('p');\n\t\tstatutElement.innerHTML = data[0].statut;\n\t\tstatutElement.setAttribute(\"class\",\"text blue-text text-status lang-fr\");\n\t\tappendChildElement.appendChild(statutElement);\n\t\t//appendChildElement.innerHTML = data[0].status;\n\t}\n }", "function author(e) {\n fetch(\"https://jsonplaceholder.typicode.com/users/\")\n .then((res) => res.json())\n .then((data) => {\n let usercontainer = \"<h2>Author</h2>\";\n data.forEach(function (users) {\n usercontainer += `<div class=\"user\">\n <div>${users.name}</div>\n <br/>\n <div>${users.email}</div>\n <br/>\n <div>Phone: ${users.phone}</div>\n <br/>\n </div>`;\n });\n document.getElementById(\"user\").innerHTML = usercontainer;\n });\n}", "function renderOwner(name, data, parameters={}, options={}) {\n\n var html = `<span>${data.name}</span>`;\n\n switch (data.label) {\n case 'user':\n html += `<span class='float-right fas fa-user'></span>`;\n break;\n case 'group':\n html += `<span class='float-right fas fa-users'></span>`;\n break;\n default:\n break;\n }\n\n return html;\n}", "function createInfo(){\n\tvar nickName = $(\"#header_nickName\").html()||'';\n\tvar strDom = '<div id=\"userInfoDialog2\" class=\"popContent popRegister\" style=\"display:none;\">'+\n\t\t\t'<div class=\"content\"><fieldset><form id=\"editThirdUserForm\" method=\"post\" action=\"\" onsubmit=\"return false;\">'+\n\t\t\t'<div><em class=\"title\">昵称</em><em><input id=\"nickName\" name=\"nickName\" value=\"'+\n\t\t\tnickName+'\" class=\"input g170\" type=\"text\" /></em></div><div><em class=\"title\">邮箱</em>'+\n\t\t\t'<em><input id=\"email\" name=\"email\" class=\"input g170\" type=\"text\" />*</em></div><div>'+\n\t\t\t'<em class=\"title\"></em><em ><a id=\"thirdLoginSubmit\" href=\"#\" class=\"btnOS\" >确定</a></em>'+\n\t\t\t'<em ><a id=\"thirdLoginCancel\" href=\"#\" class=\"btnBS\" >取消</a></em></div></form></fieldset></div></div>';\n\treturn strDom;\n}", "function myFunction (){\n var user = document.getElementById(\"name\").value;\n var p = document.getElementById(\"welcomeMsje\");\n p.innerHTML = \"Bienvenida \" + user;\n}", "function imprimirHTML(usuarios) {\n let html = '';\n // For que recorre a todos los usuarios de nuestro arreglo\n usuarios.forEach(usuario => {\n html += `\n <li>\n Nombre: ${usuario.name.first} ${usuario.name.last}\n País: ${usuario.nat}\n Imagen:\n <img src=\"${usuario.picture.medium}\">\n </li>\n `;\n });\n\n // Esta estrucctura siempre es igual\n const contenedorApp = document.querySelector('#app');\n contenedorApp.innerHTML = html;\n}", "function displayName(user) {\n const html = `<br><br>\n <h1>${user.first_name} ${user.last_name}</h1>\n `;\n const display = document.getElementById('display-name')\n display.innerHTML = html\n return html\n}", "function usuarioSistema(perfil) {\n if (perfil.value == \"Administrador\") {\n document.getElementById(\"div-usuario\").style.display = \"block\";\n document.getElementById(\"div-senha\").style.display = \"block\";\n } else {\n document.getElementById(\"div-usuario\").style.display = \"none\";\n document.getElementById(\"div-senha\").style.display = \"none\";\n }\n}", "function inserisciRichiesta(boxRichieste,id,username){\r\n var nuovaRichiesta = $(\".offerta-da-accettare-ospite:first\").clone();\r\n nuovaRichiesta.children(\"label\").text(username);\r\n $(nuovaRichiesta).appendTo(boxRichieste);\r\n}", "function trocarNome() {\r\n\tvar nome = document.getElementById('nome');\r\n\tvar usuario = document.getElementById('usuario').value;\r\n\tnome.innerHTML = usuario;\r\n}", "function buscaUsuario(usuario) {\n let $requisicaoApi = new XMLHttpRequest();\n\n $requisicaoApi.open('GET', `https://api.github.com/users/${usuario}`, true);\n\n $requisicaoApi.send(null);\n \n $requisicaoApi.onload = function() {\n if ($requisicaoApi.status !== 200) {\n alert('Usuário não encontrado');\n $entradaDeTexto.focus();\n return;\n\n } else if ($requisicaoApi.status === 200) { \n processaDados();\n } \n }\n\n \n /* PROCESSAR DADOS */\n function processaDados() { \n let $usuarioRequisitado = JSON.parse($requisicaoApi.response);\n\n const { name, bio, avatar_url, html_url } = $usuarioRequisitado;\n\n /* ADICIONA USUARIO NO REPOSITORIO */\n $usuarioInArray.push({ dadosDoUsuario: { name, bio, avatar_url, html_url } });\n \n adicionarUsuario(); \n }\n \n \n /* ADICIONAR USUARIO */\n function adicionarUsuario() {\n let $divResponse = $('div#response'); \n \n $usuarioInArray.forEach(function(item) {\n\n /* ABREVIAR BIOGRAFIA */\n let testeBio;\n\n if (item.dadosDoUsuario.bio === null) {\n testeBio = 'Sem biografia';\n\n }else if (item.dadosDoUsuario.bio.length != null) { \n item.dadosDoUsuario.bio.length <= 33 ? \n testeBio = item.dadosDoUsuario.bio : \n testeBio = item.dadosDoUsuario.bio.substring(0, 33) + '...';\n }\n\n /* CRIA ELEMENTOS */\n let $avatar = $('<img src=' + \"'\" + `${item.dadosDoUsuario.avatar_url}` + \"'\" + \" \" + 'id=avatar>');\n let $nome = $(`<strong id=\"name\">${item.dadosDoUsuario.name}</strong>`);\n let $biografia = $(`<p id=\"bio\">${testeBio} </p>`);\n let $acessar = $('<a id=\"url\" href=' + \"'\" + `${item.dadosDoUsuario.html_url}` + \"'\" + ' target=\"_blank\"> Acessar</a>');\n\n let $divResponseData = $('<div id=\"response-data\"></div>');\n\n let $elementosCarregados = $( $divResponseData.prepend(\n $avatar,\n $nome,\n $biografia,\n $acessar\n ));\n \n $divResponse.prepend($elementosCarregados).slideDown(200);\n \n });\n\n deletaDados();\n }\n \n }", "function userInformationHTML(user) { //the 'user' parameter here references the user object being returned from the github API. this contains information methods like user's name login name etc.\n//could console.log(user) to see all the different things in user object from github data API that you could display.\n return `<h2>${user.name}\n <span class=\"small-name\">\n (@<a href=\"${user.html_url}\" target= \"_blank\">${user.login}</a>)\n </span>\n </h2>\n <div class=\"gh-content\">\n <div class=\"gh-avatar\">\n <a href=\"${user.html_url} target= \"_blank\" \n <img src=\"${user.avatar_url}\" width=\"80\" height=\"80\" alt=\"${user.login}\"/>\n </a>\n </div>\n <p>Followers: ${user.followers} - Following ${user.following} <br> Repos: ${user.public_repos}</p>\n </div>`;\n}", "function PlayerInfo(){\n var infos = ['NOM : ', 'PV : ', 'MP : ', 'OR : '];\n var infos_nbr = [classe_perso.nom, classe_perso.pv, classe_perso.mp, classe_perso.or];\n for (i = 0; i< infos.length; i++){\n $(\"#div_infos\").append(`<p class=\"p-div-infos\"> ${infos[i]} ${infos_nbr[i]} </p>`);\n }\n}", "function mostrarPlantearEje(){ // Cuando toque el boton \"plantear ejercicios\" voy a ver la seccion (plantear tarea a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"block\"; // muestro plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "function populatePage(uid) {\n let userProfile = `<div class='picture'>\n <img class='profilePic' src=\"${uid.imageURL}\" alt=\"${uid.name}\">\n </div>\n <div class=\"userDetail\">\n <div class=\"nameEmail\">\n <h2>${uid.name}</h2>\n </div>\n <div class=\"info\">\n <p>Email: <a href=\"mailto:${uid.email}\">${uid.email}</a></p>\n <p class=\"siteUrl\">Website: <a href=\"${uid.url}\">${uid.name}</a></p>\n <p class=\"about\">About Me: ${uid.about}</p>\n </div>\n </div>`\n\n profileInfo.innerHTML = userProfile\n }", "function pegaNomeUsuario(numeroUsuario) {\n let nomeUsuario = rs.question(`Digite o nome do usuário ${numeroUsuario}: \\n`)\n return nomeUsuario\n}", "function alumnoIngreso(){ \r\n document.querySelector(\"#bodyHome\").style.display = \"block\"; //Muestro interfaz bienvenida\r\n document.querySelector(\"#h1TitBienvenida\").innerHTML = `Bienvenido/a ${usuarioLoggeado}`;//Bienvenida usuario\r\n document.querySelector(\"#navAlumno\").style.display = \"block\"; //Muestro interfaz alumno\r\n document.querySelector(\"#auxUsuario\").style.display = \"block\"; //Muestro div auxiliar de usuarios\r\n document.querySelector(\"#auxLanding\").style.display = \"none\"; //Oculto botones de registrar e ingresar\r\n document.querySelector(\"#pagPrincipal\").style.display = \"none\"; //Oculto boton pagina principal\r\n document.querySelector(\"#registro\").style.display = \"none\"; //Oculto el formulario\r\n document.querySelector(\"#ingreso\").style.display = \"none\"; //Oculto formulario de ingreso\r\n}", "function populateUserInfo(me)\r\n{\r\n\tlet ja = DomParser.parseFromString(template_userdetails, \"text/html\").body.childNodes[0];\r\n\t\r\n $(ja).find(\"h2\").text(me.fullname.split(\" \")[0]);\r\n \r\n $(\"body\").append(ja);\r\n \r\n}", "function userInfo() {\n let userInput1 = document.getElementById(\"input-Prenom\").value;\n let userInput2 = document.getElementById(\"input-Nom\").value;\n let userInput3 = document.getElementById(\"input-email\").value;\n userQuery(userInput1, userInput2, userInput3);\n}", "function showUser(){\n\t$(\".profile-user-nickname\").html(userData.prezdivka);\n\t$(\".profile-user-name\").html(\"<p>\"+userData.jmeno+\" \"+userData.prijmeni+\"</p>\");\n\t$(\".profile-user-age-status\").html(userData.vek+checkStatus(userData.stav));\n\t$(\".profile-user-status\").html(userData.stav);\n\tif(userStatus){\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>Bounty: \"+userData.vypsana_odmena+\" gold</p>\");\n\t}\n\telse{\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>\" + 0 + \" gold</p>\");\n\t}\n}", "mostrarPublicaciones(publiaciones){\n let salida = \"\";\n publiaciones.forEach((publicacion) => {\n salida += `\n <div class=\"card mb-3\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">${publicacion.titulo}</h4>\n <p class=\"card-text\">${publicacion.cuerpo}</p>\n <a href=\"#\" class=\"editar card-link\" data-id=\"${publicacion.id}\">\n <i class=\"fa fa-pencil\"></i>\n </a>\n <a href=\"#\" class=\"borrar card-link\" data-id=\"${publicacion.id}\">\n <i class=\"fa fa-remove\"></i> \n </a>\n </div>\n </div>`\n })\n this.publicacionesUI.innerHTML = salida;\n }", "function limpiar(){ \r\n limpiarMensajesError();\r\n let inputsText = document.querySelectorAll(\".interfazUsuario\"); //Limpio inputs de texto\r\n for (let i = 0; i < inputsText.length; i++) {\r\n inputsText[i].value = \"\";\r\n }\r\n let psODivs = document.querySelectorAll(\".mensajeUsuario\"); //Limpio \"p\"s o divsde mensajes a usuario\r\n for (let i = 0; i < psODivs.length; i++) {\r\n psODivs[i].innerHTML = \"\";\r\n }\r\n}", "function msgDiv(msg) {\n const div = document.createElement('div');\n div.classList.add(\"message\", msg.author == data.user.id ? \"own\" : \"external\");\n const author = document.createElement('span');\n author.innerHTML = data.users[msg.author].user;\n author.className = \"author\";\n author.style.color = data.users[msg.author].color;\n div.appendChild(author);\n if (data.users[msg.author].name) {\n div.innerHTML += `<span class=\"name\">~${data.users[msg.author].name}</span>`;\n }\n div.innerHTML += `<div class=\"content\">${msg.content}</div>\n <span class=\"date\" title=\"${msg.date}\">${formatDatetime(msg.date)}</span>`;\n return div;\n}", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "async function getUserData(){\n\ntry{\n\t\tconst data = await fetch(\"https://api.github.com/users/yagovaluchedevs\")\n\t\tconst response = await data.json();\n\tconsole.log(response);\n\n\tconst image = document.createElement(\"img\");\n\t\timage.src = response.avatar_url;\n\t\timage.style.width = \"250px\";\n\t\timage.style.borderRadius = \"100%\";\n\n\t\tcontainerRoot.appendChild(image);\n\n\tconst bioGit = document.createElement(\"p\");\n\t\tbioGit.innerText = response.bio;\n\t\tbioGit.style.fontSize = \"20px\";\n\t\tcontainerRoot.appendChild(bioGit);\n\n\tconst locationUser = document.createElement(\"h2\");\n\t\tlocationUser.innerText = response.location;\n\t\tcontainerRoot.appendChild(locationUser);\n\n\tconst followersUser = document.createElement(\"h3\");\n\t\tfollowersUser.innerText = `Followers: ${response.followers}`;\n\t\tcontainerRoot.appendChild(followersUser);\n\n\tconst followingUser = document.createElement(\"h3\");\n\t\tfollowingUser.innerText = `Following: ${response.following}`;\n\t\tcontainerRoot.appendChild(followingUser);\n\n\n\tconst link = document.createElement(\"a\");\n\t\tlink.innerText = \"link\";\n\n\t\tlink.setAttribute(\"href\",`${response.html_url}`);\n\t\tlink.setAttribute(\"target\",\"_blank\");\n\t\t\n\n\t\tcontainerRoot.appendChild(link);\n\n\t}catch(error){\n\t\tconsole.log(`Meu erro: ${error}`);\n\t}\n\n\n\n\n}", "function buildTypingUserHtml(userId, userLogin) {\n var typingUserHtml =\n '<div id=\"' + userId + '_typing\" class=\"list-group-item typing\">' +\n '<time class=\"pull-right\">writing now</time>' +\n '<h4 class=\"list-group-item-heading\">' + userLogin + '</h4>' +\n '<p class=\"list-group-item-text\"> . . . </p>' +\n '</div>';\n\n return typingUserHtml;\n}", "function printUsername() {\n let usernameDOM = document.getElementById('label-username');\n usernameDOM.innerHTML = user.username;\n}", "function usuarioSeleccionado(idUsuario){\n\n var Usuario = usuarios[idUsuario].nombre;\n document.getElementById('bienvedida').innerHTML=\n `<h1 style=\"font-weight: 900;color: #5c3286;\">¡Hola ${Usuario}</h1>\n <h3 style=\"color: #5c3286;\">¿Qué Necesitas?</h3>`; \n\n document.getElementById('dropdown01').innerHTML= Usuario; \n\n document.getElementById('nombreOrdenes').innerHTML= \n `<h3 style=\"font-weight: 600;color: white;\">${Usuario}, Estas son tus ordenes</h3>`; \n\n\n for(let i=0;i<usuarios[idUsuario].ordenes.length;i++)\n {\n document.getElementById('usuarios').innerHTML = '';\n document.getElementById('ordenes').innerHTML +=\n `<div class=\"col-12\" style=\"background-color: rgba(0,0,0,.075);\">\n <p>${usuarios[idUsuario].ordenes[i].nombreProducto}</p>\n <p>${usuarios[idUsuario].ordenes[i].descripcion}</p>\n <p>${usuarios[idUsuario].ordenes[i].precio}</p>\n </div>`; \n }\n \n}", "function zoomDom(user) {\n\t\treturn ` \n\t\t\t<div>\n\t\t\t\t<img src=\"${user.avatar_url}\"></img>\n\t\t\t\t<article>\n\t\t\t\t\t<h1>${user.login}</h1>\n\t\t\t\t\t<span>Name:</span>\n\t\t\t\t\t<p>${user.name}</p>\n\t\t\t\t\t<span>Biography:</span>\n\t\t\t\t\t<p>${user.bio}</p>\n\t\t\t\t\t<span>Works for:</span>\n\t\t\t\t\t<p>${user.company}</p>\n\t\t\t\t\t<span>Github link:</span>\n\t\t\t\t\t<a href=\"${user.html_url}\">${user.html_url}</a>\n\t\t\t\t\t<span>Public repo's:</span>\n\t\t\t\t\t<p>${user.public_repos}</p>\n\t\t\t\t\t<a class=\"back\" href=\"#main\">Back</a>\n\t\t\t\t</article>\n\t\t\t</div>\n\t\t`;\n\t}" ]
[ "0.7179511", "0.67268205", "0.66005903", "0.6458098", "0.6452249", "0.64122194", "0.64092064", "0.6324449", "0.62956285", "0.6224395", "0.616215", "0.6153065", "0.6146758", "0.6118394", "0.6118181", "0.6108614", "0.61072195", "0.6080923", "0.60761243", "0.6074647", "0.6070331", "0.6066554", "0.60659057", "0.6034161", "0.6027014", "0.6026719", "0.60163003", "0.6013663", "0.60033363", "0.59998125", "0.5983249", "0.59816813", "0.598136", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.598025", "0.59753907", "0.59725827", "0.5951363", "0.5923089", "0.59228283", "0.5920561", "0.5918639", "0.59183115", "0.5907686", "0.5898592", "0.5897746", "0.5886275", "0.5884186", "0.5876319", "0.58625", "0.5856383", "0.5838439", "0.58281446", "0.5819622", "0.58029485", "0.5790317", "0.5787839", "0.5783912", "0.5780591", "0.5766458", "0.5759817", "0.57544005", "0.57525164", "0.5751941", "0.5740276", "0.57268786", "0.57244414", "0.57093024", "0.5703278", "0.57028043", "0.57024837", "0.57023513", "0.570128", "0.5690179", "0.5689808", "0.5686089", "0.5685915", "0.56846124", "0.5681254", "0.56809163", "0.567961", "0.56741935", "0.5673167", "0.56701064", "0.56679255", "0.5667585", "0.5655211", "0.5650476", "0.5647612", "0.56447715" ]
0.7417256
0
Monta o texto do piu
function montaTexto(dado, classe) { var p = document.createElement("p"); p.textContent = dado; p.classList.add(classe); return p; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textoQuatro() {\n var texto = document.getElementById(\"texto_explicacao\");\n texto.innerHTML = '<b> In&eacute;rcia: </b> é a propriedade que os objetos têm de opor resitência à acelara&ccedil;&atilde;o.<br>\\n\\\n <b> Massa: </b> é uma medida da in&eacute;rcia, e mede a quantidade de mat&eacute;ria do objeto. \\n\\\n A massa &eacute; uma grandeza escalar, e sua unidade no Sistema Internacional &eacute; o quilograma(kg).<br>\\n\\\n <b>For&ccedil;a:</b> é o que causa a mudan&ccedil;a de velocidade ou deforma&ccedil;&atilde;o em um objeto.';\n}", "mostrar() {\n return `${this.nombre} tiene una urgencia de ${this.prioridad}`;\n }", "getBiografia(){\n return super.getBiografia()+` Puesto: ${this.puesto}, Salario: ${this.sueldo}`;\n\n }", "function mostrarPista(espacio){\n\tvar pista = document.getElementById('pista');\n\tvar texto = '';\n\n\tfor (var i = 0; i < espacio.length; i++) {\n\t\tif (espacio[i] !== undefined){\n\t\t\ttexto += espacio[i] + ' ';\n\t\t} else {\n\t\t\ttexto += '_ ';\n\t\t}\n\t}\n\n\tpista.innerText = texto;\n}", "function clube_Pinheiros_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Clube Pinheiros 2018 (1/3)\";\n break;\n\n case 2:\n caption = \"Clube Pinheiros 2018 (2/3)\";\n break; \n \n case 3:\n caption = \"Clube Pinheiros 2018 (3/3)\";\n break; \n \n }\n\n return(caption);\n}", "function palestra_de_literatura_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Palestra de literatura (1/2)\";\n break;\n\n case 2:\n caption = \"Palestra de literatura (2/2)\";\n break; \n \n }\n\n return(caption);\n}", "function print_don() {\n // quando il metodo mi deve ritornare qualcosa per prima cosa inizializzo la variabile e in fondo\n // metto il \"return nomevariabile;\"\n let text = \"\";\n\n //let miosaldo = 0;\n\n //let maxver = 0;\n\n\n for (i = 0; i < ar_numeri.length; i++) {\n // In questo modo tutte le linee vengono generate con uno span con un id univoco, quindi possono essere gestiti anche singolarmenti\n text += \"<span id'don\" + i + \"'>\" + ar_numeri[i]+\"</span><br/>\";\n\n }\n\n\n return text;\n}", "formatearProducto(){\n return `El producto ${this.nombre} vale ${this.precio}`;\n }", "function pecati(what) {\n let result = `this text is coming from \"pecati\" function: ${what}`\n return result\n}", "function presentarNota(){darRespuestaHtml(\"<b>Nota: \"+nota+\"</b> punto/s sobre 10\");}", "afficherDescription() {\n return (\n this.nom\n + ' est '\n + this.couleur\n + ' pèse '\n + this.poids\n + ' grammes et mesure '\n + this.taille\n + ' centimètres.'\n );\n }", "function gapNoteText() { \n return gapPlanData.gapNote();\n}", "toString() {\n let info = \"<p>El nombre del Infante es \" + this.nombre + \"<br>\";\n info += \"El edad del Infante es \" + this.edad + \" años<br>\"\n info += \"La altura del Infante es \" + this.altura + \" cm<br></p>\";\n return (info);\n }", "mostrar() {\n return \"Propiedad N° \" + this.id +\n \"\\nTipo: \" + this.tipo +\n \"\\nActividad: \" + this.actividad +\n \"\\nCalle: \" + this.calle + \" \" + this.numero +\n \"\\nDescripción: \" + this.descripcion +\n \"\\nValor: \" + this.precio\n }", "function petrobras_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Petrobras: Bazar solidário 2012 (1/2)\";\n break;\n\n case 2:\n caption = \"Petrobras: Bazar solidário 2012 (2/2)\";\n break; \n \n }\n\n return(caption);\n}", "function trabalho_caption(N_trabalho)\n{\n var caption = '';\n\n switch (N_trabalho) {\n \n case 1:\n caption = \"Capas para almofadas (1/10)\";\n break;\n\n case 2:\n caption = \"Capas para livros e agendas (2/10)\";\n break;\n\n case 3:\n caption = \"Panos de prato (3/10)\";\n break;\n\n case 4:\n caption = \"Bolsas (4/10)\";\n break;\n\n case 5:\n caption = \"Reciclagem de disco de Vinil (5/10)\";\n break; \n\n case 6:\n caption = \"Bijuterias e Pedraria (6/10)\";\n break;\n\t\t\n\t\tcase 7:\n caption = \"Trabalhos Manuais (7/10)\";\n break; \n\n\t\tcase 8:\n caption = \"Pulseira de imã (8/10)\";\n break; \n\t\t\n\t\tcase 9:\n caption = \"Brincos artesanais (9/10)\";\n break; \n\n\t\tcase 10:\n caption = \"Colcha em Patchwork, retalhos em tecido (10/10)\";\n break; \t\t\n } \n\n return(caption);\n}", "toString() {\n let info = \"<p>El nombre de la Centuria es \" + this.nombreCenturia + \"<br>\";\n info += \"El nombre de la Legion es \" + this.nombreLegion + \"<br>\"\n info += \"La centuria esta destinada en \" + this.provincia + \"<br></p>\";\n return (info);\n }", "function printMetinisPajamuDydis () {\n console.log(\"Metines pajamos\", atlyginimas * 12);\n\n}", "function getPuntaje(puntaje) {\n let puntajeHtml = \"\";\n for(let i = 0; i < PUNTAJE_MAXIMO; i++) {\n puntajeHtml += (i >= puntaje) ? `<i class=\"far fa-square\"></i>` : `<i class=\"fas fa-square\"></i>`\n }\n return puntajeHtml;\n}", "toString() {\n let info = \"<p>El nombre del Centurion es \" + this.nombre + \"<br>\";\n info += \"El edad del Centurion es \" + this.edad + \" años<br>\"\n info += \"La altura del Centurion es \" + this.altura + \" cm<br>\";\n info += \"El centurion lleva al cargo \" + this.tiempoEnCargo + \" años<br></p>\";\n return (info);\n }", "function holamundo(texto){\n var hola_mundo=\"Texto dentro de una funcion\";\n console.log(texto);\n // metodo toString permite convertir un numero en un string \n console.log(numero.toString());\n console.log(hola_mundo);\n}", "createTextPoint(object) {\n return object.add.text(16, 16, 'Pontuação: 0', { fontFamily: 'MV Boli', fontSize: '25px', fill: '#fff' });\n }", "function estacio_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Estácio: Exposição de Artesanato 2017 (1/3)\";\n break;\n\n case 2:\n caption = \"Estácio: Exposição de Artesanato 2017 (2/3)\";\n break; \n \n case 3:\n caption = \"Estácio: Exposição de Artesanato 2017 (3/3)\";\n break; \n \n }\n\n return(caption);\n}", "toString () {\r\n var str = this.text\r\n if(this.author)\r\n str += `\\n\\t*Proposée par ${this.author}*`\r\n return str\r\n }", "function imprimetexto(texto) {\n console.log(texto)\n}", "function oiPesquisa()\n{\n\t$('#nomeDrPesquisa').html('Prezado (a) <strong>Dr(a). '+nomeUser+'</strong>,');\n\t// '+nomeUser+'\n}", "function piùdue() {\n ordine = ordine + 1;\n tempo = tempo + 2;\n var style1 = { font: \"bold 32px Arial\", fill: \"#fff\", boundsAlignH: \"center\", boundsAlignV: \"middle\" };\n più2 = game.add.text(952/2+120, 550+16, \"+2!\", style1);\n più2.setShadow(3, 3, 'rgba(0,0,0,0.5)', 2);\n //più2.setTextBounds(100, 239, 952, 652);\n game.add.tween(più2.scale).to( { x: 2.2, y: 2.2 }, 500, Phaser.Easing.Linear.None, true);\n più2.anchor.setTo(0.5, 0.5);\n setTimeout(più2Sparisce, 300);\n}", "function shopping_penha_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Shopping penha: 14/fev/2012 (1/3)\";\n break;\n\n case 2:\n caption = \"Shopping penha: 14/fev/2012 (2/3)\";\n break; \n \n case 3:\n caption = \"Shopping penha: 14/fev/2012 (3/3)\";\n break; \n \n }\n\n return(caption);\n}", "function floatParaText(valor) {\n var text = (valor < 1 ? \"0\" : \"\") + Math.floor(valor * 100);\n text = \"R$ \" + text;\n return text.substr(0, text.length - 2) + \",\" + text.substr(-2);\n}", "getBio() {\n return `${this.firstName} ${this.lastName} is a(n) ${this.position}.`\n }", "function getPelnas() {\n var pajamos = 12500;\n var islaidos = 7500;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + (pajamos-islaidos) + \"<br>\";\n return pajamos-islaidos;\n}", "function toText(inst){\n var shownText = inst[\"value\"][\"shortName\"] + \" - \" + inst[\"value\"][\"fullName\"] + \n \"\\nTotal Launches: \"+inst[\"value\"][\"Total\"] + \n \"\\nSuccess: \"+inst[\"value\"][\"Success\"] + \n \"\\nFailure: \"+inst[\"value\"][\"Failure\"]+\n \"\\nUnknown: \"+inst[\"value\"][\"Unknown\"]+\n \"\\nPad Explosion: \"+inst[\"value\"][\"Pad Explosion\"]\n return shownText\n}", "function writeColosseum(){\n tipeText(COLOSSEUM_TEXT, \"written-text\");\n}", "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "function bazar_bem_possivel_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Bazar do bem possível (1/3)\";\n break;\n\n case 2:\n caption = \"Bazar do bem possível (2/3)\";\n break; \n \n case 3:\n caption = \"Bazar do bem possível (3/3)\";\n break; \n \n }\n\n return(caption);\n}", "get informations() {\n return this.pseudo + ' (' + this.classe + ') a ' + this.sante + ' points de vie et est au niveau ' + this.niveau + '.'\n }", "function menu(){\n let text = \"\";\n text += \"1- Afficher le tableau1 \\n\";\n text += \"2- Afficher le tableau2 \\n\";\n text += \"3- Afficher le Produit de la Moyenne des Deux tableaux \\n\";\n text += \"9- Quitter \\n\";\n\n console.log(text)\n}", "as_string() {\n return this.porraID + \" → \" + this.quien + \": \" + this.resultado();\n }", "function setText() {\n if (temperature < 10) return <p style={{ color: \"blue\" }}>It's cold ❄️</p>;\n else if (temperature > 30)\n return <p style={{ color: \"red\" }}> It's warm ☀️</p>;\n else return <p style={{ color: \"black\" }}>It's nice 🌼</p>;\n }", "printText () {\n\n push();\n\n translate ( this.xCoord, this.yCoord );\n\n fill ( 250, 250, 250 );\n noStroke();\n\n triangle( 0, - this.size / 3, this.size / 5, -this.size / 2, - this.size / 5, -this.size / 2 );\n ellipse ( 0, - 2 * (this.size / 3), this.size - 20, this.size / 2 );\n\n textAlign( CENTER );\n textStyle ( BOLD );\n textSize ( this.size / 12 );\n fill ( 70, 70, 70 );\n\n text ( this.name, 0, - 15 * ( this.size / 20 ) );\n textSize ( this.size / 16 );\n text ( \"Pre\", -this.size / 5, - 13 * (this.size / 20 ) );\n text ( \"Post\", this.size / 5, - 13 * (this.size / 20 ) );\n\n textSize ( this.size / 12 );\n text ( this.preCovidPercentage + \"%\", - this.size / 5, - 11 * ( this.size / 20 ));\n text ( this.postCovidPercentage + \"%\", this.size / 5, - 11 * ( this.size / 20 ));\n\n pop();\n }", "function addP(text, p) {\n return text + \"\\n(\" + (100 * p).toFixed(0) + \" in 100)\";\n}", "function printMetinisPajamuDydis() {\n var metinesPajamos = atlyginimas * 12;\n console.log(\"per metus uzdirbu:\", metinesPajamos);\n\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n console.log(oculta)\r\n hueco.innerHTML = oculta.join(\"\"); //me escribe en el html la cadena la cual contiene las lineas azules depende de la palabra\r\n}", "decrire() \n {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "function inicio(){\n let paragraph1 = document.getElementById(\"paragraph1\").textContent;\n speechTitle(\"¿Quiénes Somos?\",paragraph1)\n }", "function getSaludo(nomRebutParametre) {\n return `Hola ${nomRebutParametre}, com estas ?`\n}", "function infoText(name, limit_value, beforeSum, afterSum) {\n\t\tlet message = '<div class=\"col-md-3 col-sm-6 col-12\" style=\"float: left; text-align: left;\">'+name+'</div><div class=\"col-md-3 col-sm-6 col-12\" style=\"float: left; text-align: left;\">Limit: '+limit_value+'</div><div class=\"col-md-3 col-sm-6 col-12\" style=\"float: left; text-align: left;\"> Miesiąc: '+beforeSum+'</div><div class=\"col-md-3 col-sm-6 col-12\" style=\"float: left; text-align: left;\"> Łącznie: '+afterSum+'</div>';\n\t\treturn message;\n\t}", "function descipher() {\n let texto = document.getElementById('texto').value;\n let descifrado = '';\n // el for recorrera las letras del texto a descifrar//\n for (let j = 0; j < texto.length; j++) {\n let ubicacionDescifrado = (texto.charCodeAt(j) + 65 - 33) % 26 + 65;\n let palabraDescifrada = String.fromCharCode(ubicacionDescifrado);\n // acumular las letras descifradas//\n descifrado += palabraDescifrada;\n }\n let newParagraph = document.createElement('p');\n let paragraphText = document.createTextNode(descifrado);\n newParagraph.appendChild(paragraphText);\n document.body.appendChild(newParagraph);\n}", "function Titulo(pares, dom) {\n var titulo = '';\n for (var i = 0; i < pares.length; ++i) {\n var parcial = pares[i];\n for (var chave in parcial) {\n titulo += chave + ': ' + StringSinalizada(parcial[chave]) + '\\n';\n }\n }\n if (titulo.length > 0) {\n titulo = titulo.slice(0, -1);\n }\n dom.title = titulo;\n}", "function repeticao (texto){\n let texto = \"Essa sentença se repetirá 10 vezes\";\n return (texto*10)\n}", "function drawPuntaje() {\n ctx.font = \"27px Monoton-Regular\";\n ctx.fillStyle = \"white\";\n ctx.fillText(\"Puntaje:\" + puntaje, 8, 25)\n}", "get text() {}", "get text() {}", "function RellenaTexto(aux, TotalDigitos, TipoCaracter) {\r\n\tvar Numero = aux.toString();\r\n\tvar mon_len = parseInt(TotalDigitos) - Numero.length;\r\n\t\r\n\tif (mon_len<0) { \r\n\t\tmon_len = mon_len * -1;\r\n\t}\r\n\t// Solo para el tipo caracter\r\n\tif (TipoCaracter == 'C') {\r\n\t\tmon_len = parseInt(mon_len) + 1;\r\n\t}\r\n\t\r\n\tif (Numero == null || Numero == '') {\r\n\t\tNumero = '';\r\n\t} \r\n\r\n\tvar pd = '';\r\n\tif (TipoCaracter == 'N') {\r\n\t\tpd = repitechar(TotalDigitos,'0');\r\n\t} else {\r\n\t\tpd = repitechar(TotalDigitos,' ');\r\n\t}\r\n\tif (TipoCaracter == 'N') {\r\n\t\t// Numero = pd.substring(0, mon_len) + Numero;\r\n\t\tTotalDigitos = parseFloat(TotalDigitos) * -1;\r\n\t\tNumero = (pd + Numero).slice(TotalDigitos);\r\n\t\treturn Numero;\r\n\t} else {\r\n\t\tNumero = Numero + pd;\r\n\t\treturn Numero.substring(0, parseInt(TotalDigitos));\r\n\t}\r\n}", "function createText (pai,texto) { \r\n\tvar t = document.createTextNode(texto); \r\n\tpai.appendChild(t); \r\n }", "toString(){\r\n //Se aplica poliformismo (multiples formas en tiempo de ejecucion)\r\n //el metodo que se ejecuta depende si es una referencia de tipo padre \r\n //o de tipo hijo\r\n return this.nombreCompleto();\r\n }", "asText() {\nreturn this._makeText(`${this.amount}`);\n}", "function saludar3(nombre) {\r\n return `hola ${nombre}`;\r\n}", "function p (text){\n let divAffichage = document.querySelector(\"#affichage\");\n let ajoutTexte = document.createTextNode(text);\n\n divAffichage.append(ajoutTexte);\n}", "function nombre_mes(mes) {\r\n let m_l = meses[mes].length;\r\n let linea = ' '.repeat(11 - Math.floor(m_l / 2)) + meses[mes];\r\n linea = linea + ' '.repeat(22 - linea.length) + '|';\r\n return linea;\r\n}", "function outputvusazi(){\r\n function output(degvplus,degvminus) {\r\n var text = document.getElementById('vusazi');\r\n text.value = '';\r\n for(var i = 0; i < degvplus.length;i++){\r\n if(degvplus[i] + degvminus[i] == 0){\r\n text.value += \"Ізольована вершина \" + (i+1)\r\n text.value += \"\\n\"\r\n }else if(degvplus[i] + degvminus[i] == 1){\r\n text.value += \"Висяча вершина \" + (i+1)\r\n text.value += \"\\n\"\r\n }\r\n }\r\n }\r\n output(degvplus,degvminus)\r\n}", "toString(){\n //Se aplica poliformismo (multiples formas en tiempo de ejecucion)\n //el metodo que se ejecuta depende si es una referencia de tipo padre \n //o de tipo hijo\n return this.nombreCompleto();\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 descriptionCreature(Creature) {\n if (Creature.gender == \"женщина\") {t0 = \"ась\"; t1 = \"Она\"; t2=\"я\"; t3=\"ла\" } else {t0 = \"ся\"; t1=\"Он\"; t2=\"й\";; t3=\"л\" }\n count0 = allCreatures.length>1 ? `И стало их ${allCreatures.length} на планете.` : ``;\n let txt = `Родил${t0} ${Creature.subType}-${Creature.gender} ${Creature.name} в год ${Creature.generation}-й. `;\n txt += `${t1} - ${Creature.id+1}-${t2} из всех. ${count0} ${t1} говори${t3}: ${Creature.mood}`;\n Log(txt,\"Born\");\n /* let txt = `A ${Creature.subType}-${Creature.gender} ${Creature.name} was born in generation ${Creature.generation}. `;\n txt1 = Creature.gender == \"female\" ? \"She\" : \"Hi\";\n txt += `${txt1} was № ${Creature.id} of all. Now their ${allCreatures.length}. ${txt1} said: ${Creature.mood}`; */\n}", "function convertirJugada(jugadaJSCodigo){\nlet jugada = \"\";\n\n if(jugadaJSCodigo === 1 )\n jugada = \"PIEDRA\";\n else if(jugadaJSCodigo === 2)\n jugada = \"PAPEL\";\n else if (jugadaJSCodigo === 3)\n jugada = \"TIJERA\";\n\n return jugada;\n}", "function SaludarConProfesion(nombre=\"Persona\", profesion=\"Estudiante\"){\nreturn `Hola soy ${nombre} mi profesion es ${profesion}`\n}", "function saludo4(mensaje){\n return `Hola buen dia 3 ${mensaje}`;\n }", "function printData(data) {\ndocument.write(`Ima ${data.fuelCap}litri kapacitet, Konsumira${data.fuelCons} litri po kilometar,\n vie sakate da patuvate ${data.distance} kilometri, a so toa ke potroshite ${data.spending()} litri<br/>`);\n }", "function changeText(projet){\n switch (projet) {\n case \"fimmi\":\n return fimmi;\n break;\n case \"pasvupasnous\":\n return pasvupasnous;\n break;\n case \"mihivai\":\n return mihivai;\n break;\n case \"yodanja\":\n return yodanja;\n break;\n case \"texposou\":\n return texposou;\n break;\n default:\n }\n}", "function deloitte_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Deloitte: bazar de natal 2012 (1/4)\";\n break;\n\n case 2:\n caption = \"Deloitte: bazar de natal 2012 (2/4)\";\n break; \n \n case 3:\n caption = \"Deloitte: ipacday / 2012 (3/4)\";\n break; \n \n case 4:\n caption = \"Deloitte ipacday / 2012 (4/4)\";\n break; \n \n }\n\n return(caption);\n}", "function atualizaPlacar(){\n var divPlacar = document.getElementById('placar')\n var html = \"Jogador \" + pontosJogador + \"/\" + pontosMaquina + \" Máquina\" \n divPlacar.innerHTML = html\n }", "function mostrarPregunta1(texto) {\r\n document.getElementById(\"p01\").innerHTML = texto;\r\n}", "getBio() {\n return `${this.firstName} ${this.lastName} is a ${this.position}`\n }", "function afficherNbMultiplicateur() {\n $multiplicateur.innerHTML = \"Multiplicateur x\" + nbMultiplicateur + \" (prix du prochain verre de lait : \" + prix() + \")\";\n}", "function escoltaPregunta ()\r\n{\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML+=\"<br>\"+this.paraules[index].paraula.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n this.capa.innerHTML = \"\"\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.putSound (this.paraules[index].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual+this.putCursor ('black');\r\n }\r\n}", "function texto(n) {\n\tcadena = n.value;\n\tband = false;\n\tpuntoycoma = false;\n\tmax = false;\n\tif (cadena.length <= 250) {\n\t\tfor (i = 0; i < cadena.length; i++) {\n\t\t\tletra = cadena.substring(i, i + 1);\n\t\t\tif ((letra === \"'\") || (letra === '\"') || (letra === '`') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�') || (letra === '�')) {\n\t\t\t\tcadena2 = cadena;\n\t\t\t\tcadena = cadena2.replace(letra, \"\");\n\t\t\t\tband = true;\n\t\t\t}\n\t\t\tif (letra === \";\") {\n\t\t\t\tcadena2 = cadena;\n\t\t\t\tcadena = cadena2.replace(letra, \". \");\n\t\t\t\tpuntoycoma = true;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tmax = true;\n\t}\n\tif (max === false) {\n\t\tif (band === true) {\n\t\t\tswal(\"\", \"No se permiten ingresar comillas simples o dobles, ni letras con tildes u otro caracter desconocido...\", \"info\");\n\t\t\tn.value = cadena;\n\t\t}\n\t\tif (puntoycoma === true) {\n\t\t\tn.value = cadena;\n\t\t}\n\t} else {\n\t\tswal(\"\", \"El m\\u00E1ximo de caracteres en este campo son 250...\", \"info\");\n\t\tcadena = cadena.substring(0, 250);\n\t\tn.value = cadena;\n\t}\n\treturn;\n}", "function projecttypeWriter() {\n if (pps < projecttxt.length) {\n document.getElementById(\"projectP\").innerHTML += projecttxt.charAt(pps);\n pps++;\n // if (projecttxt.charAt(pps-1)=='.' ){\n // projectP.innerHTML += (`<br>`);\n // }\n setTimeout(projecttypeWriter, projectspeed);\n }\n}", "decrire(){\n\t\treturn `Nom : ${this.nom}, prénom : ${this.prenom}`;\n\t}", "function getImonesPelnas( ) {\n let ats = imonesPajamos - imonesIslaidos - tomoAtlyginimas - antanoAtlyginimas - poviloAtlyginimas;\n return ats;\n}", "function senac_caption(N_evento)\n{\n var caption = '';\n\n switch (N_evento) {\n \n case 1:\n caption = \"Senac: Oficina de feltro 2012 (1/7)\";\n break;\n\n case 2:\n caption = \"Senac: Oficina de feltro 2012 (2/7)\";\n break; \n \n case 3:\n caption = \"Senac: Oficina de feltro 2012 (3/7)\";\n break; \n \n case 4:\n caption = \"Senac: Dia da responsabilidade social 2012 (4/7)\";\n break; \n \n case 5:\n caption = \"Senac: Dia da responsabilidade social 2012 (5/7)\";\n break; \n \n case 6:\n caption = \"Senac: Semana do meio ambiente/2012 (6/7)\";\n break; \n \n case 7:\n caption = \"Senac: Semana do meio ambiente/2012 (7/7)\";\n break; \n \n }\n\n return(caption);\n}", "function renderPorSucursal() {\n var ventasPorSucursal = [];\n for (i = 0; i < local.sucursales.length; i++) {\n ventasPorSucursal.push('Total de ' + local.sucursales[0] + ': ' + ventasSucursal(local.sucursales[0]));\n ventasPorSucursal.push(' Total de ' + local.sucursales[1] + ': ' + ventasSucursal(local.sucursales[1]));\n //intenté mil veces con ventasPorSucursal.push('Total de ' + local.sucursales[i] + ': ' + ventasSucursal(local.sucursales[i])) pero no funciona\n } return 'Ventas por sucursal: ' + ventasPorSucursal;\n}", "function MostrarPPM(ppm)\n{\n optPpm.innerHTML = ppm.toString() + \" ppm\";\n}", "function DisplayTaunt() {\n\t\tif (props.powerPro.boss === 0) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t\"Well! Come in intruder\" says the cyborg without looking at you,\n\t\t\t\t\t\t\"Give me a second to finish... Ah done!\"\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t\"Let me take a look at you... I see... You're here to stop my master\n\t\t\t\t\t\tand kill me. Oh where are my manners I am Dr. Crackle and while it\n\t\t\t\t\t\twould be interesting to learn your name we should get started. Good\n\t\t\t\t\t\tluck! Mwah. Mwah Ha Ha HA HA!\n\t\t\t\t\t</p>\n\t\t\t\t</>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<p>\n\t\t\t\t\t\"Oh look it's {props.name.name}. What? Surprised I know your name? I\n\t\t\t\t\thacked your brain while you were unconscious before I threw you out\n\t\t\t\t\twith the other scrap. Looks like Polina is not doing her job. Seems\n\t\t\t\t\tthat I need to give her another chance at it! Ha Ha HA HA!\"\"\n\t\t\t\t</p>\n\t\t\t);\n\t\t}\n\t}", "function aumentarTamanhoTexto() {\n document.documentElement.classList.contains('textoMaior')\n ? (aumentarTexto.textContent = 'A+')\n : (aumentarTexto.textContent = 'A-');\n\n document.documentElement.classList.toggle('textoMaior');\n }", "getBio() {\n let bio = `Info: ${this.firstName} is ${this.age}.`\n this.likes.forEach((like) => {\n // shorthand for bio = bio + smtg\n bio += ` ${this.firstName} likes ${like}.`\n })\n return bio\n }", "function negrita(val) {\n return '<b>' + val + '</b>';\n }", "function dibujarArbol (altura) {\n console.log(altura)\n let Arbol = \"\";\n Arbol += \"<p>\";\n for(let i=0; i<altura; i++) {\n for(let j=0; j<=i; j++) {\n Arbol +=\"*\";\n }\n Arbol += \"</p>\";\n }\n\n\n document.getElementById('Arbol').innerHTML = Arbol;\n}", "function decrire(personnage) {\n var description = personnage.nom + \" a \" + personnage.sante + \" points de vie et \" + personnage.force + \" en force\";\n return description;\n}", "getBio() {\n let likesString = this.likes.join(\", \");\n return `Meow meow mmeeeowww mrroww! (${this.fullName} loves ${likesString}!)`\n }", "getBio() {\n let bio = `${this.firstName} is ${this.age}.`;\n this.likes.forEach((like) => {\n bio += ` ${this.firstName} likes ${like}.`;\n });\n return bio;\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 convertText(pcount) {\r\n var str = \"\\n\\n\\n\\n\\n\" + pcount;\r\n //console.log(\"str === \" + str);\r\n return str;\r\n}", "function texte2(){\n document.querySelector(\".textM\").classList.add(\"textM3\")\n document.querySelector(\".textM\").innerText= `fonctionne en bluethoot ! ou part cable !\n peut se rechargé sur un socle transportable`;\n}", "function TakePapel(t: int)\n{\n\tvar papel : String;\n\tswitch(t)\n\t{\n\t case 2: \t//caso analista\n\t\t papel = \"Analyst\";\n\t break;\n\t \n\t case 3:\t//caso arquiteto\n\t\t\tpapel = \"Architect\";\n\t break;\n\t \n\t case 4:\t//caso gerente\n\t\t\tpapel = \"Manager\";\n\t break;\n\t \n\t case 5:\t//caso marketing\n\t\t\tpapel = \"Marketing\";\n\t break;\n\t \n\t case 6:\t//caso programador\n\t\t\tpapel = \"Programmer\";\n\t break;\n\t \n\t case 7:\t//caso tester\n\t\t\tpapel = \"Tester\";\n\t break;\n\t \n\t case 8:\t//caso nenhum papel\n\t\t\tpapel = \"None\";\n\t break;\n\t \n\t case 9:\t//caso treinamento\n\t\t\tpapel = \"Training\";\n\t break;\n\n\t default:\n\t\t\tpapel = \"None\";\n\t\tbreak;\n\t}\n\treturn papel;\n}", "function saludoConProfesion(nombre,profesion=\"Analisis de sitemas\") {\n return `Hola soy ${nombre} mi profesión es ${profesion}`;\n}", "function printNews() {\n\t$('#pNoticias').text('NUEVAS RECETAS');\t\t\n}", "static get TEXT() {\r\n return 1;\r\n }" ]
[ "0.68220186", "0.6614765", "0.6460293", "0.6430093", "0.64289373", "0.6428764", "0.64143085", "0.632255", "0.6265601", "0.6235353", "0.62350494", "0.6229727", "0.622969", "0.6226398", "0.6213148", "0.6202602", "0.6201476", "0.6168902", "0.61377084", "0.61201173", "0.61043173", "0.61001784", "0.60929084", "0.60918003", "0.6086763", "0.6081522", "0.6078332", "0.606823", "0.6068025", "0.6055232", "0.6053686", "0.60528976", "0.6052061", "0.60364246", "0.6031264", "0.6026989", "0.6016085", "0.60136455", "0.60093284", "0.600845", "0.6001774", "0.60015494", "0.5990773", "0.59897476", "0.5989233", "0.5989233", "0.5989233", "0.59832543", "0.5975147", "0.5973708", "0.59664136", "0.59648025", "0.5960412", "0.5954279", "0.5950178", "0.5950178", "0.5938917", "0.59375733", "0.59363306", "0.5935447", "0.59346026", "0.59340566", "0.59233916", "0.5921989", "0.5910448", "0.5905739", "0.5899221", "0.5882527", "0.5881816", "0.58698857", "0.58696306", "0.58601946", "0.5857991", "0.5853621", "0.5851767", "0.58482885", "0.58477116", "0.5844385", "0.5842163", "0.58382237", "0.5837153", "0.5832914", "0.58159983", "0.5809269", "0.58087045", "0.5804164", "0.5802873", "0.57996243", "0.57967764", "0.57940483", "0.5784359", "0.5781878", "0.5780039", "0.57794005", "0.5777596", "0.5777146", "0.57718766", "0.5771139", "0.5766952", "0.57650864" ]
0.59547174
53
Monta o nome do user do piu
function montaStrong(dado, classe) { var strong = document.createElement("strong"); strong.textContent = dado; strong.classList.add(classe); return strong; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "name(userId) {\n if (userId) {\n // find user from user id\n let user = Meteor.users.findOne(userId, {fields: {'username': 1}});\n // return username\n return user ? `@${user.username}`: '';\n }\n }", "function pegaNomeUsuario(numeroUsuario) {\n let nomeUsuario = rs.question(`Digite o nome do usuário ${numeroUsuario}: \\n`)\n return nomeUsuario\n}", "function name() {\n console.info(this.username);\n}", "get username() { // get uinique username. In your api use ${utils.username}\n return new Date().getTime().toString();\n }", "function getUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function nomeUser(nome){\n\n nome = prompt(\"Qual è il tuo nome?\")\n \n return nome\n}", "function getUserName() {\n userName = prompt('Identify yourself user.');\n}", "function usuarioNombre() {\n let currentData = JSON.parse(sessionStorage.getItem('currentUser'));\n if (currentData.rol == \"administrador\")\n return \"Administrador\";\n else if (currentData.rol == \"estudiante\")\n return currentData.Nombre1 + ' ' + currentData.apellido1;\n else if (currentData.rol == \"cliente\")\n return currentData.primer_nombre + ' ' + currentData.primer_apellido;\n else\n return currentData.nombre1 + ' ' + currentData.apellido1;\n}", "function req_read_user_name(env) {\n var data = http.req_body(env).user;\n set_user_name(\n env,\n data.user_name_title,\n data.user_name_first,\n data.user_name_initial,\n data.user_name_last\n )\n}", "get userName(){\n\t\treturn this._user.user_name;\n\t}", "function getUserName() {\n return getAuth().currentUser.displayName;\n}", "function printUsername() {\n let usernameDOM = document.getElementById('label-username');\n usernameDOM.innerHTML = user.username;\n}", "getUserName() {\n let loggedInUser = this.loginUserNameLabel.getText();\n console.log(`User is logged in as ${loggedInUser}`);\n return loggedInUser;\n }", "function getUserByName(username) {\n}", "function getUserName() {\n\treturn firebase.auth().currentUser.displayName;\n}", "function getName() {\n const username = inquirer.prompt({\n type: \"input\",\n message: \"Enter your Github profile name?\",\n name: \"username\"\n })\n return username\n}", "function getFullUserName(nick, user, host) {\n return nick + \"!\" + user + \"@\" + host;\n }", "function req_read_new_user_name(env) {\n var data = http.req_body(env).user;\n set_new_user_name(\n env,\n data.user_name_title,\n data.user_name_first,\n data.user_name_initial,\n data.user_name_last\n )\n}", "get username_field() {return browser.element('#user_name')}", "function getUserName(id){\r\n\tvar i;\r\n\tvar name;\r\n\tfor (i = 0; i < users.length; i++) { \r\n \tif(users[i].userID){\r\n \t\tname = users[i].nickName;\r\n \t}\r\n\t}\r\n\treturn name;\r\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;// TODO 5: Return the user's display name.\n}", "function set_user_name(env, title, first, initial, last) {\n env.auth.user.name = [title, first, initial, last];\n}", "get userName() {\n return this._data.user_login;\n }", "get userName() {\n return this._data.user_login;\n }", "function getUserName() {\r\n return firebase.auth().currentUser.displayName;\r\n}", "function get_user_name() {\n switch (event_type) {\n case \"user\":\n var nameurl = \"https://api.line.me/v2/bot/profile/\" + user_id;\n break;\n case \"group\":\n var groupid = msg.events[0].source.groupId;\n var nameurl = \"https://api.line.me/v2/bot/group/\" + groupid + \"/member/\" + user_id;\n break;\n }\n\n try {\n // call LINE User Info API, get user name\n var response = UrlFetchApp.fetch(nameurl, {\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer \" + CHANNEL_ACCESS_TOKEN,\n \"Content-Type\": \"application/json\"\n },\n });\n var namedata = JSON.parse(response);\n var reserve_name = namedata.displayName;\n }\n catch {\n reserve_name = \"not avaliable\";\n }\n return String(reserve_name)\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function createUserNameForSession() {\n const sessionNumber = Math.floor(Math.random() * (100000) + 1);\n return `User${sessionNumber}`;\n}", "function createUserNameForSession() {\n const sessionNumber = Math.floor(Math.random() * (100000) + 1);\n return `User${sessionNumber}`;\n}", "function user_name(){\n\t\tvar name = document.createElement(\"div\");\n\t\tname.textContent = \"NAME\";\n\t\tname.setAttribute(\"class\", \"user_name\");\n\t\tdiv.appendChild(name);\n\t}", "function getUserName() {\n console.log(firebase.auth().currentUser.displayName);\n return firebase.auth().currentUser.displayName;\n}", "function playerName(){\n if(loggedIn()){\n return firebase.auth().currentUser.email.split(\"@\")[0].substring(0,20).capitalize();\n }\n return \"\";\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\r\n return firebase.auth().currentUser.displayName;\r\n}", "getDisplayName() {\r\n var name = this.auth.currentUser.displayName;\r\n var nameArr = name.split(\" \");\r\n return nameArr[0];\r\n }", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "name(){\n if(this.loggedIn()){\n return localStorage.getItem('user');\n }\n }", "function getUserName() {\n return _userInformation.UserName;\n }", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "function getName(message) {\n const traits = getFieldValueFromMessage(message, \"traits\");\n let uName;\n if (traits) {\n uName =\n traits.name ||\n (traits.firstName\n ? traits.lastName\n ? `${traits.firstName}${traits.lastName}`\n : traits.firstName\n : undefined) ||\n traits.username ||\n (message.properties ? message.properties.email : undefined) ||\n traits.email ||\n (message.userId ? `User ${message.userId}` : undefined) ||\n `Anonymous user ${message.anonymousId}`;\n } else {\n uName =\n (message.properties ? message.properties.email : undefined) ||\n (message.userId ? `User ${message.userId}` : undefined) ||\n `Anonymous user ${message.anonymousId}`;\n }\n\n logger.debug(\"final name::: \", uName);\n return uName;\n}", "function getUserName() {\n return firebase.auth().currentUser.displayName;\n }", "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user.name = [title, first, initial, last];\n}", "function getUsername() {\n return $rootScope.currentUsername || \"\";\n }", "function printName(user){\n console.log(`this user name is ${user.name}`);\n}", "function getCurrentUserName() {\n return page.evaluate((selector) => {\n let el = document.querySelector(selector);\n\n return el ? el.innerText : '';\n }, selector.user_name);\n }", "getParticipantName(participant) {\n const selfInfo = this.contactManager.getLocalUser();\n let userName = this.contactManager.getDisplayName(participant.regId);\n if (participant.regId === selfInfo.regId) {\n userName = `${userName} (You)`;\n }\n return userName || participant.regId;\n }", "get userName() {\n this._logger.debug(\"userName[get]\");\n return this._userName;\n }", "getUserName() {\n return this.userData.name;\n }", "function getUserName() {\r\n if(isUserSignedIn()){\r\n return auth.currentUser.displayName;\r\n }\r\n}", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "function Info(user) {\n return `${user.name} tem ${user.age} anos.`;\n}", "function getOtherUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function multiplayerName(username)\n{\n\tlet multiplayerName = Engine.ConfigDB_GetValue(\"user\", \"playername.multiplayer\") || Engine.GetSystemUsername();\n\treturn !username ? multiplayerName : multiplayerName != username ? multiplayerName + \" (\" + username + \")\" : username;\n}", "function createUserName ( email ){\n const user = email;\n const iend = user.indexOf(\"@\");\n const userName = user.substring(0 , iend);\n console.log( userName ); \n return userName;\n }", "function safeUsername() {\n return os.userInfo().username.replace(/[^\\w+=,.@-]/g, '@');\n}", "function sayUserName(user) {\n const { name } = user;\n console.log(\"THE USER's NAME IS \" + name);\n}", "function getUserName(){\n\t\tuserName = $cookies.get('userName');\n\t\treturn userName;\n\t}", "function getName() {\n getUseInput(function(name) {\n userName = name;\n deleteAllLines();\n displayString(\"Hello \" + userName, 'main');\n });\n }", "function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}", "function findCurrentUser() {\n return \"stefan\"\n }", "function showLoginName(){\r\n\r\n\tif(typeof login_name != 'undefined')\r\n\t\t$(\"#loginName\").text(_user+': '+login_name);\r\n\telse\r\n\t\t$(\"#loginName\").text(_user+': '+'admin');\r\n\r\n}", "function CreateUserName(divID) {\n var name = Sanitize($(`${divID}`).val());\n name = name.toLowerCase();\n\n if (name.match(/^(https?:\\/\\/)?[a-z0-9]+\\./ig) || name.match(/^@/ig)) {\n name = name.match(/@[a-z0-9-]{3,16}[^\\/]/ig)[0].substring(1);\n }\n\n return name;\n }", "function getDisplayTextOfUser() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return _userInformation.UserName;\n }", "async default() {\n const { stdout } = await execa.command('git config user.name', {\n reject: false,\n })\n if (stdout !== '') {\n return stdout\n }\n\n return username()\n }", "get name(): string {\n return this._displayName || this._userId;\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "function changeNickname() {\n userLog.name = command[1]; // je change le nickname de l'utilisateur\n }", "function returnUser(userName) {\n return \"Welcome to Kodiri \" + userName;\n return `Welcome to Kodiri ${userName}`;\n}", "function _init_user_name(){\n try{\n var db = Titanium.Database.open(self.get_db_name());\n db.execute('CREATE TABLE IF NOT EXISTS my_login_info('+\n 'id INTEGER,'+\n 'name TEXT,'+\n 'value TEXT)');\n var rows = db.execute('SELECT * FROM my_login_info where id=1');\n if((rows.getRowCount() > 0) && (rows.isValidRow())){\n _user_name = rows.fieldByName('value');\n }\n rows.close();\n db.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_user_name');\n return;\n } \n }", "async function getOSUserName() {\n await ipcRenderer.send(GET_OS_USER);\n await ipcRenderer.on(GET_OS_USER_REPLY, (event, OSusername) => {\n defaultConnectionSettings.user = OSusername;\n });\n }", "username (value) {\n // min length 1\n if (!value || value.length < 1) {\n return 'You must provide a username.';\n }\n // max length 40\n else if (value.length > 40) {\n return 'Username can only be 40 characters long.';\n }\n return null;\n }", "get username() {\n return this.getStringAttribute('username');\n }", "function getOwnerName(id) {\n// var db = ScriptDb.getMyDb();\n var db = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n \n var user = db.load(id);\n \n if (user != null) {\n return user.name;\n }\n \n return null;\n}", "get userName() {\n this._logService.debug(\"gsDiggUserDTO.userName[get]\");\n return this._userName;\n }", "getCurrentUsername() {\r\n return this.auth.currentUser && this.auth.currentUser.displayName;\r\n }", "username(){\n return Meteor.user().username;\n }", "getUsername() {\r\n return this.username;\r\n }", "function getUsername (){\n let username = document.querySelector(\"#username\").value;\n return JSON.stringify(username);\n }" ]
[ "0.7605024", "0.7210848", "0.70792484", "0.7067545", "0.69976646", "0.6966553", "0.6960228", "0.6954211", "0.6904805", "0.6902397", "0.6872926", "0.6861118", "0.6853361", "0.685144", "0.6846163", "0.6819838", "0.6814597", "0.6812936", "0.67986166", "0.6765348", "0.6749551", "0.67449903", "0.67189664", "0.67189664", "0.67151606", "0.6709688", "0.67062634", "0.67062634", "0.67062634", "0.67062634", "0.67026174", "0.67026174", "0.66992563", "0.66984755", "0.66950554", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.6687701", "0.66783345", "0.66780216", "0.66731143", "0.66731143", "0.66731143", "0.6664548", "0.66642064", "0.66593057", "0.66593057", "0.6639141", "0.66366726", "0.6635425", "0.663378", "0.663087", "0.6628589", "0.6619393", "0.66125035", "0.66058034", "0.653452", "0.653239", "0.653239", "0.6527715", "0.6518862", "0.6510547", "0.6501551", "0.648805", "0.6483063", "0.6482541", "0.64771706", "0.64736336", "0.64692074", "0.6455243", "0.64550537", "0.64543754", "0.6454047", "0.64513505", "0.64326453", "0.64326453", "0.64326453", "0.64326453", "0.6428369", "0.6428369", "0.6428369", "0.6428369", "0.64261377", "0.6424404", "0.6412914", "0.64103055", "0.640122", "0.6390587", "0.6389854", "0.6363449", "0.6351861", "0.6343332", "0.6340484", "0.63358045" ]
0.0
-1
Monta o user do piu
function montaSpan(dado, classe) { var span = document.createElement("span"); span.textContent = dado; span.classList.add(classe); return span; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user()\n {\n\n }", "function getUser () {return user;}", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "get user() { return this.args.user }", "function setUser(u) {\n user = u\n}", "function userStudent() {\n //Chiedo i dati\n let userName = prompt(\"Inserisci il nome\");\n let userSurname = prompt(\"Inserisci il cognome\");\n let userEta = parseInt(prompt(\"Inserisci l'età\"));\n //Creo oggetto per l'utente\n userInfo = {};\n userInfo.nome = userName;\n userInfo.cognome = userSurname;\n userInfo.eta = userEta;\n}", "function mParticleUser(mpid, isLoggedIn) {\n return {\n /**\n * Get user identities for current user\n * @method getUserIdentities\n * @return {Object} an object with userIdentities as its key\n */\n getUserIdentities: function() {\n var currentUserIdentities = {};\n\n var identities = Persistence.getUserIdentities(mpid);\n\n for (var identityType in identities) {\n if (identities.hasOwnProperty(identityType)) {\n currentUserIdentities[Types.IdentityType.getIdentityName(Helpers.parseNumber(identityType))] = identities[identityType];\n }\n }\n\n return {\n userIdentities: currentUserIdentities\n };\n },\n /**\n * Get the MPID of the current user\n * @method getMPID\n * @return {String} the current user MPID as a string\n */\n getMPID: function() {\n return mpid;\n },\n /**\n * Sets a user tag\n * @method setUserTag\n * @param {String} tagName\n */\n setUserTag: function(tagName) {\n if (!Validators.isValidKeyValue(tagName)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n this.setUserAttribute(tagName, null);\n },\n /**\n * Removes a user tag\n * @method removeUserTag\n * @param {String} tagName\n */\n removeUserTag: function(tagName) {\n if (!Validators.isValidKeyValue(tagName)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n this.removeUserAttribute(tagName);\n },\n /**\n * Sets a user attribute\n * @method setUserAttribute\n * @param {String} key\n * @param {String} value\n */\n setUserAttribute: function(key, value) {\n var cookies,\n userAttributes;\n\n mParticle.sessionManager.resetSessionTimer();\n\n if (Helpers.canLog()) {\n if (!Validators.isValidAttributeValue(value)) {\n Helpers.logDebug(Messages.ErrorMessages.BadAttribute);\n return;\n }\n\n if (!Validators.isValidKeyValue(key)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.SetUserAttribute, JSON.stringify({ key: key, value: value }));\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n var existingProp = Helpers.findKeyInObject(userAttributes, key);\n\n if (existingProp) {\n delete userAttributes[existingProp];\n }\n\n userAttributes[key] = value;\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = userAttributes;\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n Forwarders.callSetUserAttributeOnForwarders(key, value);\n }\n }\n },\n /**\n * Set multiple user attributes\n * @method setUserAttributes\n * @param {Object} user attribute object with keys of the attribute type, and value of the attribute value\n */\n setUserAttributes: function(userAttributes) {\n mParticle.sessionManager.resetSessionTimer();\n if (Helpers.isObject(userAttributes)) {\n if (Helpers.canLog()) {\n for (var key in userAttributes) {\n if (userAttributes.hasOwnProperty(key)) {\n this.setUserAttribute(key, userAttributes[key]);\n }\n }\n }\n } else {\n Helpers.debug('Must pass an object into setUserAttributes. You passed a ' + typeof userAttributes);\n }\n },\n /**\n * Removes a specific user attribute\n * @method removeUserAttribute\n * @param {String} key\n */\n removeUserAttribute: function(key) {\n var cookies, userAttributes;\n mParticle.sessionManager.resetSessionTimer();\n\n if (!Validators.isValidKeyValue(key)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.RemoveUserAttribute, JSON.stringify({ key: key, value: null }));\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n var existingProp = Helpers.findKeyInObject(userAttributes, key);\n\n if (existingProp) {\n key = existingProp;\n }\n\n delete userAttributes[key];\n\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = userAttributes;\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n Forwarders.applyToForwarders('removeUserAttribute', key);\n }\n },\n /**\n * Sets a list of user attributes\n * @method setUserAttributeList\n * @param {String} key\n * @param {Array} value an array of values\n */\n setUserAttributeList: function(key, value) {\n var cookies, userAttributes;\n\n mParticle.sessionManager.resetSessionTimer();\n\n if (!Validators.isValidKeyValue(key)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n if (!Array.isArray(value)) {\n Helpers.logDebug('The value you passed in to setUserAttributeList must be an array. You passed in a ' + typeof value);\n return;\n }\n\n var arrayCopy = value.slice();\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.SetUserAttributeList, JSON.stringify({ key: key, value: arrayCopy }));\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n var existingProp = Helpers.findKeyInObject(userAttributes, key);\n\n if (existingProp) {\n delete userAttributes[existingProp];\n }\n\n userAttributes[key] = arrayCopy;\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = userAttributes;\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n Forwarders.callSetUserAttributeOnForwarders(key, arrayCopy);\n }\n },\n /**\n * Removes all user attributes\n * @method removeAllUserAttributes\n */\n removeAllUserAttributes: function() {\n var cookies, userAttributes;\n\n mParticle.sessionManager.resetSessionTimer();\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.RemoveAllUserAttributes);\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n if (userAttributes) {\n for (var prop in userAttributes) {\n if (userAttributes.hasOwnProperty(prop)) {\n Forwarders.applyToForwarders('removeUserAttribute', prop);\n }\n }\n }\n\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = {};\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n }\n },\n /**\n * Returns all user attribute keys that have values that are arrays\n * @method getUserAttributesLists\n * @return {Object} an object of only keys with array values. Example: { attr1: [1, 2, 3], attr2: ['a', 'b', 'c'] }\n */\n getUserAttributesLists: function() {\n var userAttributes,\n userAttributesLists = {};\n\n userAttributes = this.getAllUserAttributes();\n for (var key in userAttributes) {\n if (userAttributes.hasOwnProperty(key) && Array.isArray(userAttributes[key])) {\n userAttributesLists[key] = userAttributes[key].slice();\n }\n }\n\n return userAttributesLists;\n },\n /**\n * Returns all user attributes\n * @method getAllUserAttributes\n * @return {Object} an object of all user attributes. Example: { attr1: 'value1', attr2: ['a', 'b', 'c'] }\n */\n getAllUserAttributes: function() {\n var userAttributesCopy = {};\n var userAttributes = Persistence.getAllUserAttributes(mpid);\n\n if (userAttributes) {\n for (var prop in userAttributes) {\n if (userAttributes.hasOwnProperty(prop)) {\n if (Array.isArray(userAttributes[prop])) {\n userAttributesCopy[prop] = userAttributes[prop].slice();\n }\n else {\n userAttributesCopy[prop] = userAttributes[prop];\n }\n }\n }\n }\n\n return userAttributesCopy;\n },\n /**\n * Returns the cart object for the current user\n * @method getCart\n * @return a cart object\n */\n getCart: function() {\n return mParticleUserCart(mpid);\n },\n\n /**\n * Returns the Consent State stored locally for this user.\n * @method getConsentState\n * @return a ConsentState object\n */\n getConsentState: function() {\n return Persistence.getConsentState(mpid);\n },\n /**\n * Sets the Consent State stored locally for this user.\n * @method setConsentState\n * @param {Object} consent state\n */\n setConsentState: function(state) {\n Persistence.setConsentState(mpid, state);\n if (MP.mpid === this.getMPID()) {\n Forwarders.initForwarders(this.getUserIdentities().userIdentities);\n }\n },\n isLoggedIn: function() {\n return isLoggedIn;\n }\n };\n}", "function getUser(id) {\n return \"Akhil\";\n}", "addUser(user) {\n // normale Logik aufrufen\n super.addUser(user);\n // User-spezifische Spielvariable initialisieren\n this.SchiffePos[user.id] = {\n sindBooteGesetzt: false,\n Boote : \"\",\n Getroffen : \"\"\n };\n\n // Es kann 'richtig' losgehen, sobald 2 Leute im Raum sind\n\tif (this.currentGameState === WAITING_TO_START && this.users.length == 2) {\n\t\tthis.startGame();\n }\n\n}", "function findCurrentUser() {\n return \"stefan\"\n }", "function User(myName) {\n this.myName = myName;\n this.PI = 3.14;\n //this.myName = myName;\n }", "get user() { return this.user_; }", "function user(){\r\n uProfile(req, res);\r\n }", "function ejercicio04(user){\n console.log(user);\n adulto = 0;\n if (user.edad>18)\n {\n adulto = 1;\n }\n else\n {\n return \"El usuario \" + user.nombre + \" no es mayor de edad\";\n }\n\n if (adulto == 1)\n {\n return \"El usuario \" + user.nombre + \" es mayor de edad. Por lo tanto, le he creado un usuario con el correo \" + user.correo;\n }\n \n}", "function getUserById(userid) {\n}", "function getUsuarioActivo(nombre){\n return{\n uid: 'ABC123',\n username: nombre\n\n }\n}", "async function buscaUser() {\n const userGit = document.getElementById(\"userGit\").value;\n requisicao.url += userGit;\n requisicao.resposta = await fetch(requisicao.url);\n requisicao.resultado = await requisicao.resposta.json();\n\n limpaPesquisa();\n document.getElementById(\"gitUser\").innerHTML = requisicao.resultado.login;\n }", "function getUser(){\n return user;\n }", "function User(nombre, edad) {\n this.nombre = nombre\n this.edad = edad\n this.mascotas = [] //como pongo mascotas sería un array y pondría dentro de un array un push no voy a guardar el nombre\n //el objeto, guardo la mascota\n /*this.saludar = function(aQuien = 'amigo') //pongo this y ya Elena y Ernesto podrían saludar\n {\n console.log(`Hola ${aQuien}, soy ${this.nombre}`)*/\n\n}", "function getToxicNumber(user, message){\n\n con.query(\"SELECT * FROM user WHERE lower(name) = '\"+(user).toLowerCase()+\"'\", function (err, result) {\n if (err) throw err;\n if (result == null || result.length == 0)\n {\n console.log(\"null in getToxicNumber\");\n userInfo = null;\n }\n else\n userInfo = result;\n\n if(userInfo == null)\n message.channel.send(0);\n else\n message.channel.send(userInfo[0][\"toxic\"]);\n });\n}", "function User(naam, telefoon, mail, wachtwoord, straatNr, postcode) { // geeft de waarden van lijn 40 mee(als parameters) en maakt een user aan met deze propertie values\n this.naam = naam.value;\n this.telefoon = telefoon.value;\n this.mail = mail.value;\n this.wachtwoord = wachtwoord.value;\n this.straatNr = straatNr.value;\n this.postcode = postcode.value;\n}", "function Info(user) {\n return `${user.name} tem ${user.age} anos.`;\n}", "function ejercicio05(user){\n console.log(user);\n mismo = \"\";\n if (user.nombre===\"Yunior\")\n { \n return \"La persona introducida es Yunior\"; \n }\n if (user.correo.indexOf(\"yunior\") > -1 || user.edad == 24)\n {\n if (user.correo.indexOf(\"yunior\") > -1 )\n {\n mismo = \"el mismo correo\";\n }\n else\n {\n mismo = \"la misma edad\";\n }\n return \"La persona introducida pudiera ser Yunior. Ya que tiene \" + mismo; \n }\n else\n {\n return \"La persona introducida no es Yunior\";\n }\n}", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "getNextUser() {\r\n return this.users[1];\r\n }", "function getUserID() {\n userID = Math.floor(Math.random()*1000000000)\n }", "function main() {\r\n // user.userLogin(\"sporkina@hotmail.com\", \"sporks\");\r\n}", "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "function nomeUser(nome){\n\n nome = prompt(\"Qual è il tuo nome?\")\n \n return nome\n}", "function persona(usr,contra,ip,puert) {\n this.usuario=usr;\n this.contraseña=contra;\n this.IP =ip;\n this.puerto=puert;\n}", "async bringUser(req,res){\n //función controladora con la lógica que muestra los usuarios\n }", "function showFormarttedInfo(user) {\n console.log('user Info', \"\\n id: \" + user.id + \"\\n user: \" + user.username + \"\\n firsname: \" + user.firsName + \"\\n \");\n}", "get username() { // get uinique username. In your api use ${utils.username}\n return new Date().getTime().toString();\n }", "function appendUser(user) {\n var username = user.username;\n /*\n * A new feature to Pepper, which is a permission value,\n * may be 1-5 afaik.\n *\n * 1: normal (or 0)\n * 2: bouncer\n * 3: manager\n * 4/5: (co-)host\n */\n var permission = user.permission;\n\n /*\n * If they're an admin, set them as a fake permission,\n * makes it easier.\n */\n if (user.admin) {\n permission = 99;\n }\n\n /*\n * For special users, we put a picture of their rank\n * (the star) before their name, and colour it based\n * on their vote.\n */\n var imagePrefix;\n switch (permission) {\n case 0:\n imagePrefix = 'normal';\n break;\n // Normal user\n case 1:\n // Featured DJ\n imagePrefix = 'featured';\n break;\n case 2:\n // Bouncer\n imagePrefix = 'bouncer';\n break;\n case 3:\n // Manager\n imagePrefix = 'manager';\n break;\n case 4:\n case 5:\n // Co-host\n imagePrefix = 'host';\n break;\n case 99:\n // Admin\n imagePrefix = 'admin';\n break;\n }\n\n /*\n * If they're the current DJ, override their rank\n * and show a different colour, a shade of blue,\n * to denote that they're playing right now (since\n * they can't vote their own song.)\n */\n if (API.getDJs()[0].username == username) {\n if (imagePrefix === 'normal') {\n drawUserlistItem('void', '#42A5DC', username);\n } else {\n drawUserlistItem(imagePrefix + '_current.png', '#42A5DC', username);\n }\n } else if (imagePrefix === 'normal') {\n /*\n * If they're a normal user, they have no special icon.\n */\n drawUserlistItem('void', colorByVote(user.vote), username);\n } else {\n /*\n * Otherwise, they're ranked and they aren't playing,\n * so draw the image next to them.\n */\n drawUserlistItem(imagePrefix + imagePrefixByVote(user.vote), colorByVote(user.vote), username);\n }\n}", "function setUser(username){\n return {\n type: 'SET_USER',\n username\n }\n}", "function getUserByName(username) {\n}", "function newUser(){\r\r\n}", "function updateUserStuff(user) {\n console.log(\"doing stuff for\", user.get('username'));\n}", "function getUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function User(nome, numero, email, password, escola, curso, ip) {\n this.nome = nome;\n this.numero = numero;\n this.email = email;\n this.password = password;\n this.escola = escola;\n this.curso = curso;\n this.ip = ip;\n}", "function current() {\n return user;\n }", "function userget(){\n document.getElementById('current-user').innerHTML = current_user;\n }", "function printUser(user){\n console.log(\"Nombre: \"+ user.name + \"\\nEdad: \"+ user.age + \"\\nEmail: \"+ user.email + \"\\n\");\n}", "function giveUserPoint(ID){\n\n}", "function user(){\n\n var person = usuario.name+\" - (\"+usuario.username+\")\";\n socket.emit(\"nickname\", person);\n\n return false;\n }", "get userId(){\n\t\treturn this._user.user_id;\n\t}", "function upgradeUser(user){\n if(user.point <= 10 ){\n return;\n }\n // lona upgrade logic...\n}", "function procesa() {\n\n var params = getSearchParameters();\n var id = params.id;\n myUser = {\n \"id\": id\n\n };\n llenaCasos();\n\n}", "function fetchUser() {\n const userId = document.getElementById('user-id').value\n client.user.fetch(userId)\n}", "function showUser(){\n\t$(\".profile-user-nickname\").html(userData.prezdivka);\n\t$(\".profile-user-name\").html(\"<p>\"+userData.jmeno+\" \"+userData.prijmeni+\"</p>\");\n\t$(\".profile-user-age-status\").html(userData.vek+checkStatus(userData.stav));\n\t$(\".profile-user-status\").html(userData.stav);\n\tif(userStatus){\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>Bounty: \"+userData.vypsana_odmena+\" gold</p>\");\n\t}\n\telse{\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>\" + 0 + \" gold</p>\");\n\t}\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 getUserData() {\n return {\n \"id\": Math.floor(Math.random() * 100 + 1),\n \"username\": generateName(),\n \"balance\":2500\n }\n}", "function showInfo(user) {\n console.log(`User Info ${user.id} ${user.username} ${user.firstname}`);\n // return 'hola';\n}", "function getCurrentUser() {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList[0];\n}", "function getOtherUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function user(name, pass, admin) {\n return {\n name: name,\n pass: pass,\n uid : ++nextUID,\n admin : admin\n };\n}", "function getUserName() {\n userName = prompt('Identify yourself user.');\n}", "userReceived(p) {\n let player = newUser(p);\n players.push(player);\n requestPlayers();\n }", "function usuario(){\n\tvar nombreDelUsuario = document.getElementById(\"user\");\n\tasignarNombre(nombreDelUsuario);\n}", "findBotUser() {\n this.getUsers()\n .then(users => {\n const botUsers = users.members.filter(isBot);\n this.user = botUsers.find(user => isUserBot(user, this.name));\n let welcomeText;\n if (!this.user) {\n welcomeText = `:negative_squared_cross_mark: Cannot find bot user : ${this\n .name}!\\n_I cannot respond to messages until this is resolved_`;\n } else {\n welcomeText = `:tada: ${this.user\n .real_name} is reporting for duty!`;\n }\n\n const welcomeMessage = smb()\n .text(welcomeText)\n .json();\n this.respondInChannel('general', welcomeMessage);\n })\n .catch(error => {\n console.log(error);\n });\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 }", "function anonymizeUser(user){\n\tgetUsername(updateUserCredits);\n}", "function getCurrentUser() {\n let userId = $('#cu').data(\"cu\");\n user = new User({id: userId});\n return user;\n}", "function addUser() {\n }", "function getIdUsuario (){\n\treturn Math.round(Math.random() * 50) + 1;\n}", "get user() {\n return this.fapp.get('user');\n }", "user() {\n return Member.findOne({_id: Meteor.userId()});\n\t}", "function printUsername() {\n let usernameDOM = document.getElementById('label-username');\n usernameDOM.innerHTML = user.username;\n}", "function welcomeIntent (app) {\n\n //Inizializzo db\n var db = admin.database();\n var userId = app.getUser().userId;\n var userData;\n\n //Faccio query Alias Cointracking basandomi su userId\n var ref = db.ref(\"users\");\nref.orderByChild(\"userId\").equalTo(userId).on(\"child_added\", function(snapshot) {\n console.log(snapshot.key);\n userData = snapshot.val();\n console.log(userData.username);\n console.log(userData.userId);\n});\n\n //Check se username già presente in memoria\n if(userData != null){\n checkBalance(app,userData.username, true);\n }\n else{\n app.ask('It seems you have not yet set the' + \n ' username for your portfolio. What is your username on Cointracking?',\n ['Tell me your username.', 'What is your alias on Cointracking?', 'We can stop here. See you soon.']);\n }\n }", "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "function userPlayer () {\n playerOne = totalPokemon[0];\n}", "function usuario(variable){\n alert(prompt(\"cual es su nombre?\") + \" \" + \"si decea cambia de usuario solo desinstale su app y vuelva a registrarla, por el momento no tenemos la opcion de \\\"volver a registrarse\\\"\");\n }", "function pegaNomeUsuario(numeroUsuario) {\n let nomeUsuario = rs.question(`Digite o nome do usuário ${numeroUsuario}: \\n`)\n return nomeUsuario\n}", "function userInfo() {\n let userInput1 = document.getElementById(\"input-Prenom\").value;\n let userInput2 = document.getElementById(\"input-Nom\").value;\n let userInput3 = document.getElementById(\"input-email\").value;\n userQuery(userInput1, userInput2, userInput3);\n}", "updateUser(h, p){\n\t\tlet oldInfo = this.props.user;\n\t\tlet updatedInfo = { happiness: oldInfo.happiness + h,\n\t\t pollution: oldInfo.pollution + p};\n\t\tlet userUrl = `/api${this.props.match.url}`;\n\t\tthis.props.actions.updateUser(userUrl, updatedInfo);\n\t}", "function randomUser([num = 6, id = \"random\"] = []) {\n return `Generated ${num} - ${id} users`;\n}", "function showLoggedInUser(user) {\n login_status.text(\"Logged in as: \" + user.profile.name);\n login_button.text(\"Logout\");\n }", "function who(tok,fn){\n\tisValid(tok,function(resultado){\n\t\tif(resultado){\n\t\t\tvar param={token:tok};\n\t\t\t//Find the token in the database\n\t\t\tToken.find(param).exec(function(err, tokens){\n\t\t\t\tif(err){\n\t\t\t\t\tfn(\"\");\n\t\t\t\t}\n\t\t if(tokens.length==1){\n\t\t \t//Consult who is the creator\n\t\t \tvar answer = {\temail:tokens[0].email,\n \t\t\t\ttoken:tokens[0].token};\n\t\t \t\tfn(answer);\n\t\t\t }\n\t\t });\n\t\t}else{\n\t\t\tfn(\"\");\n\t\t}\n\t});\n}", "function setUser() {\n user = new User($(\"#idh\").html(),$(\"#nameh\").html());\n}", "async user(obj, field, context, info) {\n const user = context.getUser()\n const usersService = context.get(\"users\");\n return await usersService.findOne(field.username, user);\n }", "function addRoomUser(info) {\n\tvar dude = new PalaceUser(info);\n\tif (theRoom.lastUserLogOnID == dude.id && ticks()-theRoom.lastUserLogOnTime < 900) { // if under 15 seconds\n\t\ttheRoom.lastUserLogOnID = 0;\n\t\ttheRoom.lastUserLogOnTime = 0;\n\t\tif (!getGeneralPref('disableSounds')) systemAudio.signon.play();\n\t}\n\tif (theUserID == dude.id) {\n\t\ttheUser = dude;\n\t\tfullyLoggedOn();\n\t}\n\n\ttheRoom.users.push(dude);\n\tloadProps(dude.props);\n\tdude.animator();\n\tdude.grow(10);\n\tPalaceUser.setUserCount();\n}", "function createUser(cedula,apellido,email, nombre, telefono, pass){\n const password = pass;\n var userId=\"\";\n \n auth.createUserWithEmailAndPassword(email, password)\n .then(function (event) {\n user = auth.currentUser;\n userId = user.uid;\n console.log(\"UserID: \"+userId);\n insertar(cedula,apellido,email, nombre, telefono, userId);\n })\n .catch(function(error) {\n alert(error.message);\n console.log(error.message);\n });\n}", "function upgradeUser(user){\r\n if (user.plint>10){\r\n // long upgrade logic...\r\n }\r\n}", "function userRegistered(user) {\n console.log(\"user has been registered\");\n}", "execute(message, args) {\n const taggedUser = message.mentions.users.first();\n message.channel.send(`Jo ${taggedUser.username}, iemand probeert je de ober uit te trappen`);\n }", "function grabUserID(id, name) {\n\t\tsetUserID(id);\n\t\tsetDisplayUserName(name);\n\t}", "function getUser() {\n return user;\n }", "addUserInfo(user) {\n return db(\"users_sleep\")\n .insert(user, \"id\")\n .then(([id]) =>\n db(\"users_sleep\")\n .where({ uid: user.uid })\n .then((uI) => uI.find((elem) => elem.id === id))\n );\n }", "function User() {\n if (!userRank)\n var userRank = -8;\n\n if (!progress)\n var progress = 0;\n\n var levels = [-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8]; // Массив существующих уровней уровней\n if (!incLevel)\n var incLevel = 0;\n\n\n this.incProgress = function(taskRank) {\n console.log('Уровень задачи', taskRank);\n var n = 0;\n if (taskRank == userRank) { // Уровни задачи и юзера одинаковые\n progress += 3;\n }\n\n if (levels.indexOf(taskRank) - levels.indexOf(userRank) == -1) { // Уровень задачи меньше уровня юзера на один уровень\n progress += 1;\n }\n\n if (taskRank > userRank) { // Уровень задачи выше уровня юзера\n progress += (10 * Math.pow((levels.indexOf(taskRank) - levels.indexOf(userRank)) , 2));\n }\n\n if (progress >= 100) { // Расчет количества уровней, на сколько нужно прибавить userRank\n n = progress;\n progress = n%100; // Возвращаем прогресс в диапазон от 0 до 99\n n = (n - n%100) + '';\n var arr = n.split('');\n while (n % 10 == 0) {\n n = n/10; // В конце цикла n будет равен количеству скачков на новый уровень\n }\n console.log('Повышение на ', n, ' уровней');\n\n }\n incLevel = n;\n userRank = levels[levels.indexOf(userRank) + incLevel] || 8;\n if (userRank == 8)\n progress = 0;\n\n };\n\n\n\n this.rank = function() {\n return 'User rank = ' + userRank;\n };\n\n this.progress = function() {\n return 'Progress = ' + progress;\n };\n}", "updateUser(h, p){\n\t\tlet oldInfo = this.props.user;\n\t\tlet updatedInfo = { happiness: oldInfo.happiness + h,\n\t\t pollution: oldInfo.pollution + p};\n\t\tlet userUrl = `/api${this.props.match.url}`;\n\n\t\tthis.props.actions.updateUser(userUrl, updatedInfo);\n\t}", "function kudo(user) {\n console.log('Kudos: ' + user)\n if (!state.kudos[user]) {\n state.kudos[user] = 1\n } else {\n state.kudos[user]++\n }\n}", "async getCurrentUser() {\n // Lo que hacemos es detectar los cambios en tiempo real\n return new Promise((resolve, reject) => {\n const unsubscribe = Service.auth.onAuthStateChanged(\n // Si tenemos usuario, resolvemos la promesa y lo retornamos\n (user) => {\n unsubscribe();\n resolve(user);\n },\n // Rechazamos\n () => {\n reject();\n },\n );\n });\n }", "async getUserInfo(ctx) {\r\n const { name } = ctx.state.user;\r\n ctx.body = { name };\r\n }", "static userToMentor(req, res) {\n const userId = parseInt(req.params.id, 10);\n const userIndex = Users.findIndex((usr) => usr.id === userId);\n if (userIndex >= 0) {\n Users[userIndex].isMentor = true;\n return res.status(200).json({\n status: 200,\n message: 'User account changed to mentor',\n data: Users[userIndex],\n });\n }\n return res.status(404).json({\n status: 404,\n error: 'user not found',\n });\n }", "function sessoUser(genere){\n\n genere = prompt(\"Sei uomo o donna?\")\n\n if(genere != \"uomo\" && genere != \"donna\"){\n\n alert(\"Non fare lo scemo!\");\n\n }\n\n return genere\n}", "function getUserInfo(){\n let humanName = userForm.userName.value;\n let humanSymbol = userForm.symbol.value;\n let aiSymbol;\n\n event.preventDefault();\n (humanSymbol == \"O\") ? aiSymbol = \"X\" : aiSymbol = \"O\"\n\n human.name = humanName;\n human.symbol = humanSymbol;\n ai.name = \"AI\";\n ai.symbol = aiSymbol;\n\n $modal.css('display','none')\n displayPlayers();\n return mode = userForm.difficulty.value;\n}", "function usuarioNombre() {\n let currentData = JSON.parse(sessionStorage.getItem('currentUser'));\n if (currentData.rol == \"administrador\")\n return \"Administrador\";\n else if (currentData.rol == \"estudiante\")\n return currentData.Nombre1 + ' ' + currentData.apellido1;\n else if (currentData.rol == \"cliente\")\n return currentData.primer_nombre + ' ' + currentData.primer_apellido;\n else\n return currentData.nombre1 + ' ' + currentData.apellido1;\n}", "static getCurrentUserID() {\n const myInfo = (document.querySelector('.mmUserStats .avatar a'));\n if (myInfo) {\n const userID = this.endOfHref(myInfo);\n console.log(`[M+] Logged in userID is ${userID}`);\n return userID;\n }\n console.log('No logged in user found.');\n return '';\n }", "greetUser() {\n Channel.botMessage(`\\nHello, ${this.user}!\\n\\n`)\n }", "function iniciarJugadores(pUser) {\r\n\t\tuserId = parseInt(pUser);\r\n\t\tif(pUser == 1){\r\n\t\t\tMASTER = true;\r\n\t\t\tconnected = true;\r\n\t\t\tmessageGeneral = \"Waiting Opponents. MASTER. Online: \" + (numUsuarios) + \"/\" +maxSess;\r\n\t\t\t\r\n\t\t\tlocalPlayer = new LocalPlayer(1);\r\n\t\t\t\r\n\t\t\tfunction anim() {\r\n\t\t\t\tloop();\r\n\t\t\t\trequestAnimFrame(anim);\r\n\t\t\t}\r\n\t\t\tanim();\r\n\t\t} else {\r\n\t\t\tMASTER = false;\r\n\t\t\tconnected = true;\t\t\t\r\n\t\t\t\r\n\t\t\tlocalPlayer = new LocalPlayer(pUser);\t\r\n\t\t\tvar count = userId;\r\n\t\t\twhile(count>1){\r\n\t\t\t\tcount -= 1;\r\n\t\t\t\tplayers[count] = new Enemy(count);\t\t\t\t\r\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tfunction anim() {\r\n\t\t\t\tloop();\r\n\t\t\t\trequestAnimFrame(anim);\r\n\t\t\t}\r\n\t\t\tanim();\r\n\t\t\t\r\n\t\t\tif (pUser == maxSess) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//The last\r\n\t\t\t\tpriorWriteAction(MEN_TYPE_BEGIN + SEP + userId + SEP + MEN_ULTIMO);\t\t\t//START GAME ALL JOINED\r\n\t\t\t} else {\r\n\t\t\t\tpriorWriteAction(MEN_TYPE_BEGIN + SEP + userId + SEP + MEN_CONECTADO);\t\t//I log and I say to others\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tnumUsuarios = parseInt(pUser);\r\n\t\t\tmessageGeneral = \"Waiting Opponents. Online: \" + (numUsuarios) + \"/\" +maxSess;\t\t\t\r\n\t\t}\r\n\t}", "isVipUser () {\n\t\tif (!this.currentUser) return false;\n const type = Number(this.currentUser.userType);\n return type > 1 && type < 5;\n\t}" ]
[ "0.68286467", "0.6566979", "0.6558826", "0.649154", "0.64560634", "0.6446387", "0.6350743", "0.63045454", "0.6288292", "0.62872773", "0.62822187", "0.6247767", "0.6237478", "0.62328947", "0.6195679", "0.6127468", "0.6125908", "0.61204803", "0.6070937", "0.6061811", "0.6055615", "0.6042452", "0.6034717", "0.60266846", "0.60092396", "0.5989846", "0.59617484", "0.5955342", "0.5950911", "0.5944738", "0.5944505", "0.5939913", "0.5935063", "0.5931343", "0.59294736", "0.5926764", "0.5925361", "0.59219825", "0.5919724", "0.59184635", "0.5892752", "0.58924276", "0.58794785", "0.5867981", "0.5856902", "0.58498734", "0.58365285", "0.5821495", "0.5820016", "0.5816936", "0.5816401", "0.58063334", "0.5800741", "0.57994026", "0.5786383", "0.5786094", "0.57663", "0.5759579", "0.5753966", "0.57539177", "0.5750819", "0.5750527", "0.57409585", "0.57408965", "0.5740223", "0.57354486", "0.5735378", "0.5732922", "0.57320493", "0.57316726", "0.5729864", "0.57297224", "0.5728992", "0.57280856", "0.5709446", "0.57079685", "0.5706657", "0.57033867", "0.5703312", "0.5700666", "0.56989855", "0.5695863", "0.56957954", "0.5693406", "0.56928927", "0.5688139", "0.5685334", "0.5684252", "0.5681486", "0.5679528", "0.56783485", "0.5678193", "0.5678163", "0.5677599", "0.56768495", "0.5676266", "0.5675306", "0.5666616", "0.5665738", "0.56641513", "0.5654577" ]
0.0
-1
Auto initialization of one or more instances of lazyload, depending on the options passed in (plain object or an array)
function autoInitialize(classObj, options) { if (!options) { return; } if (!options.length) { // Plain object createInstance(classObj, options); } else { // Array of objects for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) { createInstance(classObj, optionsItem); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyLoad() {\n var args = [];\n for (var i = 0, n = arguments.length; i < n; i++) {\n args[i] = arguments[i];\n }\n return {\n load: ['$ocLazyLoad', function ($ocLazyLoad) {\n return $ocLazyLoad.load(args);\n }]\n }\n }", "function autoInitialize(classObj, options) {\n\tif (!options) {\n\t\treturn;\n\t}\n\tif (!options.length) {\n\t\t// Plain object\n\t\tcreateInstance(classObj, options);\n\t} else {\n\t\t// Array of objects\n\t\tfor (let i = 0, optionsItem; (optionsItem = options[i]); i += 1) {\n\t\t\tcreateInstance(classObj, optionsItem);\n\t\t}\n\t}\n}", "function autoInitialize(classObj, options) {\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!options.length) {\n\t\t\t// Plain object\n\t\t\tcreateInstance(classObj, options);\n\t\t} else {\n\t\t\t// Array of objects\n\t\t\tfor (var i = 0, optionsItem; (optionsItem = options[i]); i += 1) {\n\t\t\t\tcreateInstance(classObj, optionsItem);\n\t\t\t}\n\t\t}\n\t}", "function lazyLoad() {\n\t$(\"*[data-jsclass]\").each( function () {\n\t\tif($(this).data('iowajsinstance') && $(this).data('iowajsinstance').lazy) {\n\t\t\t$(this).data('iowajsinstance').lazy();\n\t\t}\n\t});\n\t\n\tajaxLayer();\n}", "_load() {\n\n // if already loaded, do nothing\n if (this._loaded) {\n return;\n }\n\n // attempt to load\n this._lazyload();\n\n }", "function defineLazyLoadedRepos() {\n repoNames.forEach(function(name) {\n Object.defineProperty(service, name, {\n configurable: true,\n get: function() {\n // The 1st time the repo is request via this property,\n // we ask the repositories for it (which will inject it).\n var repo = getRepo(name);\n // Rewrite this property to always return this repo;\n // no longer redefinable\n Object.defineProperty(service, name, {\n value: repo,\n configurable: false,\n enumerable: true\n });\n return repo;\n }\n });\n });\n }", "function defineLazyLoadedRepos() {\n repoNames.forEach(function (name) {\n Object.defineProperty(service, name, {\n configurable: true, //will redefine this property once\n get: function () {\n // The 1st time repo is request via property,\n // We ask this repositories for it (which will inject it).\n var repo = repositories.getRepo(name);\n //Rewrite this property to always return this repo;\n // no longer redifinable.\n Object.defineProperty(service, name, {\n value: repo,\n configurable: false,\n enumerable: true\n });\n return repo;\n }\n });\n });\n }", "initialize () {\n return Promise.all([\n lib.Utils.buildShopFixtures(this.app)\n .then(fixtures => {\n this.shopFixtures = fixtures\n return lib.Utils.loadShopFixtures(this.app)\n }),\n lib.Utils.buildCountryFixtures(this.app)\n .then(fixtures => {\n this.countryFixtures = fixtures\n return lib.Utils.loadCountryFixtures(this.app)\n })\n ])\n }", "$onInit() {\n\n \tPromise.all([\n \t\tthis.loadLocations(),\n \t\tthis.loadCategories(), \n \t\tthis.loadCollections()\n \t]).then(() => this.loadFeatures(this.filter))\n }", "function initLazyElements() {\n $window.lazyLoadXT();\n }", "function initLazyElements() {\n $window.lazyLoadXT();\n }", "function initLazyElements() {\n $window.lazyLoadXT();\n }", "function populateInstanceComputableOptions(options){$.each(instanceComputableOptions,function(name,func){if(options[name]==null){options[name]=func(options);}});}", "function lazyLoad(){\n\tvar $images = $('.lazy_load');\n\n\t$images.each(function(){\n\t\tvar $img = $(this),\n\t\t\tsrc = $img.attr('data-img');\n\t\t$img.attr('src',src);\n\t});\n}", "constructor(options) {\n \n /**\n * Take options as a class object\n * @type {Object}\n */\n this.options = options;\n \n /**\n * Counts loaded images\n * @type {Number}\n */\n this.loadedCounter = 0;\n\n /**\n * Data attribute in the img element containg the image url to be loaded\n * @type {String}\n */\n this.attribute = (options && options.attribute) || \"dataset\"\n\n /**\n * Show stats of this instance after the script has finished loading the images from the this.imageSelector\n * @type {Boolean}\n */\n this.showStats = (options && options.showStats) || false;\n\n /**\n * Class name to be added to the loaded images\n * @type {String}\n */\n this.loadedClass = (options && options.loadedClass) || \"lazy--loaded\";\n\n /**\n * Nodelist with images\n * @type {Array of objects}\n */\n this.imageSelector = (options && options.images) || document.querySelectorAll('img[' + this.attribute + ']');\n \n /**\n * Counts images to be lazyload\n * @type {Number}\n */\n this.imageCounter = this.imageSelector.length;\n \n /**\n * Additional buffer scroll value to trigger earlier image loading\n * @type {Number}\n */\n this.offset = options && options.offset || window.innerHeight * 0.5;\n\n /**\n * Loads the image with Xms delay after the user stopped scrolling\n * @type {Number}\n */\n this.loadDelay = options && options.loadDelay || 100;\n\n /**\n * Timeout containg the self.loadDelay value and the lazyload script\n * @type {Mixed}\n */\n this.timeout = null;\n\n /**\n * Init the script at first loading. This will load all images visible on the current screen.\n */\n this.lazyImageLoader();\n\n /**\n * Load the script\n */\n this.bindLoader();\n }", "init(){\n for(var entityName in this._models){\n var Model = this._models[entityName];\n new Model();\n }\n }", "_initLoaders () {\n this.options = this.ControllerHelper.request.getArrayLoader({\n loaderFunction: () => this.LogsOptionsService.getOptions(this.serviceName)\n });\n this.currentOptions = this.ControllerHelper.request.getArrayLoader({\n loaderFunction: () => this.LogsOptionsService.getSubscribedOptionsMapGrouped(this.serviceName)\n });\n this.selectedOffer = this.ControllerHelper.request.getHashLoader({\n loaderFunction: () => this.LogsOptionsService.getOffer(this.serviceName)\n });\n\n this.service = this.ControllerHelper.request.getHashLoader({\n loaderFunction: () => this.LogsDetailService.getServiceDetails(this.serviceName)\n .then(service => {\n if (service.state !== this.LogsConstants.SERVICE_STATE_ENABLED) {\n this.goToHomePage();\n } else {\n this.options.load();\n this.currentOptions.load();\n this.selectedOffer.load();\n }\n return service;\n })\n });\n this.service.load();\n }", "lazy(middlewareFactory) {\n return this.use(async (ctx, next) => {\n const middleware = await middlewareFactory(ctx);\n const arr = toArray(middleware);\n await flatten(new Composer(...arr))(ctx, next);\n });\n }", "initializeInstance(options) {}", "function init() {\n return {\n loaders: [ new LocalLoader() ],\n fetch: function(dep_name, targetConfig) {\n var output;\n this.loaders.forEach(function(l) {\n if (!output && l.match(dep_name)) {\n output = l.load(dep_name, targetConfig);\n }\n });\n return output;\n }\n };\n}", "function populateInstanceComputableOptions(options) {\n $.each(instanceComputableOptions, function (name, func) {\n if (options[name] == null) {\n options[name] = func(options);\n }\n });\n}", "function populateInstanceComputableOptions(options) {\n $.each(instanceComputableOptions, function (name, func) {\n if (options[name] == null) {\n options[name] = func(options);\n }\n });\n}", "function populateInstanceComputableOptions(options) {\n $.each(instanceComputableOptions, function (name, func) {\n if (options[name] == null) {\n options[name] = func(options);\n }\n });\n}", "function populateInstanceComputableOptions(options) {\n $.each(instanceComputableOptions, function (name, func) {\n if (options[name] == null) {\n options[name] = func(options);\n }\n });\n}", "function loadAllPrepared(container,alreadyinload) {\n\n\t\t\tcontainer.find('img, .defaultimg').each(function(i) {\n\t\t\t\tvar img = jQuery(this);\n\n\t\t\t\tif (img.data('lazyload')!=img.attr('src') && alreadyinload<3 && img.data('lazyload')!=undefined && img.data('lazyload')!='undefined') {\n\n\t\t\t\t\tif (img.data('lazyload') !=undefined && img.data('lazyload') !='undefined') {\n\t\t\t\t\t\timg.attr('src',img.data('lazyload'));\n\n\t\t\t\t\t\tvar limg = new Image();\n\n\t\t\t\t\t\tlimg.onload = function(i) {\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) setDefImg(img,limg);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlimg.error = function() {\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlimg.src=img.attr('src');\n\t\t\t\t\t\tif (limg.complete) {\n\t\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) setDefImg(img,limg);\n\t\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tif ((img.data('lazyload') === undefined || img.data('lazyload') === 'undefined') && img.data('lazydone')!=1) {\n\t\t\t\t\t\tvar limg = new Image();\n\t\t\t\t\t\tlimg.onload = function() {\n\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) setDefImg(img,limg);\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlimg.error = function() {\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (img.attr('src')!=undefined && img.attr('src')!='undefined') \t{\n\t\t\t\t\t\t\tlimg.src = img.attr('src');\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tlimg.src = img.data('src');\n\n\t\t\t\t\t\tif (limg.complete) {\n\t\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) {\n\t\t\t\t\t\t\t\t\tsetDefImg(img,limg);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\timg.data('lazydone',1);\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}", "function loadAllPrepared(container,alreadyinload) {\n\n\t\t\tcontainer.find('img, .defaultimg').each(function(i) {\n\t\t\t\tvar img = jQuery(this);\n\n\t\t\t\tif (img.data('lazyload')!=img.attr('src') && alreadyinload<3 && img.data('lazyload')!=undefined && img.data('lazyload')!='undefined') {\n\n\t\t\t\t\tif (img.data('lazyload') !=undefined && img.data('lazyload') !='undefined') {\n\t\t\t\t\t\timg.attr('src',img.data('lazyload'));\n\n\t\t\t\t\t\tvar limg = new Image();\n\n\t\t\t\t\t\tlimg.onload = function(i) {\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) setDefImg(img,limg);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlimg.error = function() {\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlimg.src=img.attr('src');\n\t\t\t\t\t\tif (limg.complete) {\n\t\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) setDefImg(img,limg);\n\t\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tif ((img.data('lazyload') === undefined || img.data('lazyload') === 'undefined') && img.data('lazydone')!=1) {\n\t\t\t\t\t\tvar limg = new Image();\n\t\t\t\t\t\tlimg.onload = function() {\n\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) setDefImg(img,limg);\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlimg.error = function() {\n\t\t\t\t\t\t\timg.data('lazydone',1);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (img.attr('src')!=undefined && img.attr('src')!='undefined') \t{\n\t\t\t\t\t\t\tlimg.src = img.attr('src');\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tlimg.src = img.data('src');\n\n\t\t\t\t\t\tif (limg.complete) {\n\t\t\t\t\t\t\t\tif (img.hasClass(\"defaultimg\")) {\n\t\t\t\t\t\t\t\t\tsetDefImg(img,limg);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\timg.data('lazydone',1);\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}", "initializeDefaultArtworkCollection(options) {\n if (!(__guard__(this.get('artworkCollections'), x => x.length) > 0)) {\n this.set({artworkCollections: [new ArtworkCollection({userId: this.get('id')})]});\n }\n if (!this.defaultArtworkCollection.fetched) { return this.defaultArtworkCollection().fetch(options); }\n }", "function fullInit(options)\n\t{\n\t\t//assuming the given data is a map of <variant, annotation data> pairs\n\t\t_annotationDataCache = options.data;\n\t}", "function populateInstanceComputableOptions(options) {\n\t$.each(instanceComputableOptions, function(name, func) {\n\t\tif (options[name] == null) {\n\t\t\toptions[name] = func(options);\n\t\t}\n\t});\n}", "function populateInstanceComputableOptions(options) {\n\t$.each(instanceComputableOptions, function(name, func) {\n\t\tif (options[name] == null) {\n\t\t\toptions[name] = func(options);\n\t\t}\n\t});\n}", "function populateInstanceComputableOptions(options) {\n\t$.each(instanceComputableOptions, function(name, func) {\n\t\tif (options[name] == null) {\n\t\t\toptions[name] = func(options);\n\t\t}\n\t});\n}", "function populateInstanceComputableOptions(options) {\n\t$.each(instanceComputableOptions, function(name, func) {\n\t\tif (options[name] == null) {\n\t\t\toptions[name] = func(options);\n\t\t}\n\t});\n}", "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 }", "function lazyLoadOthers(){\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\n\n //quitting when it doesn't apply\n if (!options.lazyLoading || !hasAutoHeightSections){\n return;\n }\n\n //making sure to lazy load auto-height sections that are in the viewport\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function(section){\n if(isSectionInViewport(section)){\n lazyLoad(section);\n }\n });\n }", "function lazyLoadOthers(){\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\n\n //quitting when it doesn't apply\n if (!options.lazyLoading || !hasAutoHeightSections){\n return;\n }\n\n //making sure to lazy load auto-height sections that are in the viewport\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function(section){\n if(isSectionInViewport(section)){\n lazyLoad(section);\n }\n });\n }", "function lazyLoadOthers(){\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\n\n //quitting when it doesn't apply\n if (!options.lazyLoading || !hasAutoHeightSections){\n return;\n }\n\n //making sure to lazy load auto-height sections that are in the viewport\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function(section){\n if(isSectionInViewport(section)){\n lazyLoad(section);\n }\n });\n }", "function lazyLoadOthers() {\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0]; //quitting when it doesn't apply\n\n if (!options.lazyLoading || !hasAutoHeightSections) {\n return;\n } //making sure to lazy load auto-height sections that are in the viewport\n\n\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function (section) {\n if (isSectionInViewport(section)) {\n lazyLoad(section);\n }\n });\n }", "function initDataProxies(options)\n\t{\n\t\t// init proxies\n\t\tvar dataProxies = {};\n\n\t\t// workaround: alphabetically sorting to ensure that mutationProxy is\n\t\t// initialized before pdpProxy, since pdbProxy depends on the mutationProxy instance\n\t\t_.each(_.keys(options).sort(), function(proxy) {\n\t\t\tvar proxyOpts = options[proxy];\n\t\t\tvar instance = null;\n\n\t\t\t// TODO see if it is possible to remove pdb proxy's dependency on mutation proxy\n\n\t\t\t// special initialization required for mutation proxy\n\t\t\t// and pdb proxy, so a custom function is provided\n\t\t\t// as an additional parameter to the initDataProxy function\n\t\t\tif (proxy == \"pdbProxy\")\n\t\t\t{\n\t\t\t\tinstance = initDataProxy(proxyOpts, function(proxyOpts) {\n\t\t\t\t\tvar mutationProxy = dataProxies[\"mutationProxy\"];\n\n\t\t\t\t\tif (mutationProxy != null &&\n\t\t\t\t\t mutationProxy.hasData())\n\t\t\t\t\t{\n\t\t\t\t\t\tproxyOpts.options.mutationUtil = mutationProxy.getMutationUtil();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// do not initialize pdbProxy at all\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// regular init for all other proxies...\n\t\t\t\tinstance = initDataProxy(proxyOpts);\n\t\t\t}\n\n\t\t\tdataProxies[proxy] = instance;\n\t\t});\n\n\t\treturn dataProxies;\n\t}", "function lazy(p = (function() {}, class {}, function() {}, class { method1() { } })) { }", "function lazyLoadOthers(){\r\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\r\n\r\n //quitting when it doesn't apply\r\n if (!options.lazyLoading || !hasAutoHeightSections){\r\n return;\r\n }\r\n\r\n //making sure to lazy load auto-height sections that are in the viewport\r\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function(section){\r\n if(isSectionInViewport(section)){\r\n lazyLoad(section);\r\n }\r\n });\r\n }", "function fullInit(options)\n\t{\n\t\tvar data = options.data;\n\n\t\t_cacheByKeyword = data.byKeyword;\n\t\t_cacheByProteinChange = data.byProteinChange;\n\t\t_cacheByGeneSymbol = data.byGeneSymbol;\n\t\t_cacheByProteinPosition = data.byProteinPosition;\n\t}", "applyRuntimeInitializers() {\n const { mapValues } = this.lodash\n const matches = this.runtimeInitializers\n\n Helper.attachAll(this, this.helperOptions)\n\n mapValues(matches, (fn, id) => {\n try {\n this.use(fn.bind(this), INITIALIZING)\n } catch (error) {\n this.error(`Error while applying initializer ${id}`, { error })\n }\n })\n\n Helper.attachAll(this, this.helperOptions)\n\n return this\n }", "function loadSequence() {\r\n var _args = arguments;\r\n return {\r\n deps: ['$ocLazyLoad', '$q',\r\n\t\t\tfunction ($ocLL, $q) {\r\n\t\t\t var promise = $q.when(1);\r\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\r\n\t\t\t promise = promiseThen(_args[i]);\r\n\t\t\t }\r\n\t\t\t return promise;\r\n\r\n\t\t\t function promiseThen(_arg) {\r\n\t\t\t if (typeof _arg == 'function')\r\n\t\t\t return promise.then(_arg);\r\n\t\t\t else\r\n\t\t\t return promise.then(function () {\r\n\t\t\t var nowLoad = requiredData(_arg);\r\n\t\t\t if (!nowLoad)\r\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\r\n\t\t\t return $ocLL.load(nowLoad);\r\n\t\t\t });\r\n\t\t\t }\r\n\r\n\t\t\t function requiredData(name) {\r\n\t\t\t if (jsRequires.modules)\r\n\t\t\t for (var m in jsRequires.modules)\r\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\r\n\t\t\t return jsRequires.modules[m];\r\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\r\n\t\t\t }\r\n\t\t\t}]\r\n };\r\n }", "function fLazyLoad(arrsfDirectives, scope) {\n arrsfDirectives.forEach(function(sfDirective){\n oLazyLoad[sfDirective]();\n });\n scope.bLazyLoadingDone = true;\n }", "function _init() {\n var self = this\n ;\n\n if (!!self['_data']) {\n self.bindTo(_loadData)(self['_data']);\n }\n }", "function initialiseCarousels() {\n const CAROUSELS = document.querySelectorAll(SEL_CAROUSEL);\n\n CAROUSELS.forEach(element => {\n const CAROUSEL_TYPE = JSON.parse(element.dataset.carouselConfig).mode;\n\n if (CAROUSEL_TYPE === \"slider\") {\n let slider = new Slider(element);\n } else if (CAROUSEL_TYPE === \"fader\") {\n let fader = new Fader(element);\n } \n });\n}", "constructor () {\n this.hdrCubeLoader = new HDRCubeTextureLoader();\n this.gltfLoader = new GLTFLoader();\n this.fbxLoader = new FBXLoader();\n this.jsonLoader = new JSONLoader();\n this.textureLoader = new TextureLoader();\n this.fontLoader = new FontLoader();\n this.isLoaded = false;\n }", "_dispatchOnInit(){\n for (const instance of this._instances.values()) {\n instance.onInit&&instance.onInit()\n }\n }", "lateLoad() {\n for (let instance of this.instanceSet) {\n this.addSceneData(instance, instance.scene);\n }\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t return promise;\n\n\t\t\t function promiseThen(_arg) {\n\t\t\t if (typeof _arg == 'function')\n\t\t\t return promise.then(_arg);\n\t\t\t else\n\t\t\t return promise.then(function () {\n\t\t\t var nowLoad = requiredData(_arg);\n\t\t\t if (!nowLoad)\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\n\t\t\t return $ocLL.load(nowLoad);\n\t\t\t });\n\t\t\t }\n\n\t\t\t function requiredData(name) {\n\t\t\t if (jsRequires.modules)\n\t\t\t for (var m in jsRequires.modules)\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n\t\t\t return jsRequires.modules[m];\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\n\t\t\t }\n\t\t\t}]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t return promise;\n\n\t\t\t function promiseThen(_arg) {\n\t\t\t if (typeof _arg == 'function')\n\t\t\t return promise.then(_arg);\n\t\t\t else\n\t\t\t return promise.then(function () {\n\t\t\t var nowLoad = requiredData(_arg);\n\t\t\t if (!nowLoad)\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\n\t\t\t return $ocLL.load(nowLoad);\n\t\t\t });\n\t\t\t }\n\n\t\t\t function requiredData(name) {\n\t\t\t if (jsRequires.modules)\n\t\t\t for (var m in jsRequires.modules)\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n\t\t\t return jsRequires.modules[m];\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\n\t\t\t }\n\t\t\t}]\n };\n }", "enableLoad(args) {\n if (args.autoload && typeof args.autoload === 'number') {\n this.count[args.channels] = args.autoload;\n\n args.channels.forEach((channel) => {\n this.count[channel] = args.autoload;\n });\n }\n }", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n\r\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\r\n ['src', 'srcset'].forEach(function(type){\r\n var attribute = element.getAttribute('data-' + type);\r\n if(attribute != null && attribute){\r\n setSrc(element, type);\r\n }\r\n });\r\n\r\n if(matches(element, 'source')){\r\n var typeToPlay = closest(element, 'video') != null ? 'video' : 'audio';\r\n closest(element, typeToPlay).load();\r\n }\r\n });\r\n }", "function lazyload(callback, name) {\n let me = this\n name.map((item) => {\n this._views[item] = () => {\n return new Promise((resolve, reject) => {\n if (this._views[item].lazy) {\n callback((module) => {\n if (module.models.multiple) {\n registerMultiple.call(me, module, resolve, item)\n } else {\n loadModule.call(me, module, resolve, item)\n }\n this._store.replaceReducer(getReducer.call(this))\n })\n } else {\n resolve(this._views[item])\n }\n })\n }\n this._views[item].lazy = true\n })\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg === 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "lazyLoad() {\n if(!this.state.loading && this.state.next) {\n const offset = this.state.offset + this.state.limit;\n this.getAlbums(offset);\n }\n }", "function loadLazyThingFallback() {\n _lazyThings.forEach( ( _lazyThing ) => {\n _lazyThing.classList.remove( 'is-lazy-thing' );\n } );\n}", "function init() {\n\t\tloadPosts();\n\t\tloadPages();\n\t\tloadCategories();\n\t\tloadTags();\n\t}", "function lazyLoad(destiny) {\n if (!options.lazyLoading) {\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n var element;\n\n panel.find('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]').each(function() {\n element = $(this);\n\n $.each(['src', 'srcset'], function(index, type) {\n var attribute = element.attr('data-' + type);\n if (typeof attribute !== 'undefined' && attribute) {\n setSrc(element, type);\n }\n });\n\n if (element.is('source')) {\n var typeToPlay = element.closest('video').length ? 'video' : 'audio';\n element.closest(typeToPlay).get(0).load();\n }\n });\n }", "function loadAssociations(object /*, paths... */) {\n var paths = Array.prototype.slice.call(arguments, 1);\n for (var i = 0; i < paths.length; i++) {\n var components = paths[i].split(\".\");\n for (var j = 0; j < components.length; j++) {\n Ember.run(function () {\n var path = components.slice(0, j+1).join(\".\");\n object.get(path);\n });\n }\n }\n}", "function init() {\n vm.loaded = 0;\n\n if (type == 'followers') loadFollowers();\n else if (type == 'following') loadFollowing();\n }", "_initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n var element;\r\n\r\n panel.find('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]').each(function(){\r\n element = $(this);\r\n\r\n $.each(['src', 'srcset'], function(index, type){\r\n var attribute = element.attr('data-' + type);\r\n if(typeof attribute !== 'undefined' && attribute){\r\n setSrc(element, type);\r\n }\r\n });\r\n\r\n if(element.is('source')){\r\n var typeToPlay = element.closest('video').length ? 'video' : 'audio';\r\n element.closest(typeToPlay).get(0).load();\r\n }\r\n });\r\n }", "function forceLoadAll() {\n checkLazyElements(true);\n }", "function forceLoadAll() {\n checkLazyElements(true);\n }", "function forceLoadAll() {\n checkLazyElements(true);\n }", "function fullInit(options)\n\t{\n\t\tvar data = options.data;\n\t\tvar mutations = data;\n\n\t\t// convert to a collection if required\n\t\t// (if not an array, assuming it is a MutationCollection)\n\t\tif (_.isArray(data))\n\t\t{\n\t\t\tmutations = new MutationCollection(data);\n\t\t}\n\n\t\t_util.processMutationData(mutations);\n\t}", "constructor(opts) {\n this.init(opts || {});\n }", "function initSliders() {\n\t\tvar $sliderList = $(sliderSelector);\n\t\tvar i = $sliderList.length;\n\t\tvar $slider;\n\t\tvar carousel;\n\n\t\twhile (i--) {\n\t\t\t$slider = $($sliderList[i]);\n\n\t\t\tif ($slider.data('loaded') !== 'true') {\n\t\t\t\tcarousel = new Carousel($slider);\n\t\t\t\tcarousel.init();\n\t\t\t}\n\t\t}\n\t}", "onLoad(options) {\n this.fetchWeather();\n this.fetchMovies();\n }", "initializer(options) {\n options.property = 'scene';\n options.repeats = true;\n if (!(options.items instanceof Array)) {\n options.names = [];\n let items = [];\n for (let name in options.items) {\n options.names.push(name);\n items.push(options.items[name]);\n }\n options.items = items;\n }\n super.initializer(options);\n }", "function init() {\n var _this = this;\n\n this._get('options').plugins.forEach(function (plugin) {\n // check if plugin definition is string or object\n var Plugin = undefined;\n var pluginName = undefined;\n var pluginOptions = {};\n if (typeof plugin === 'string') {\n pluginName = plugin;\n } else if ((typeof plugin === 'undefined' ? 'undefined' : babelHelpers.typeof(plugin)) === 'object') {\n pluginName = plugin.name;\n pluginOptions = plugin.options || {};\n }\n\n Plugin = find(pluginName);\n _this._get('plugins')[plugin] = new Plugin(_this, pluginOptions);\n\n addClass(_this._get('$container'), pluginClass(pluginName));\n });\n }", "function lazyWithPreload(importFunction) {\n const Component = lazy(importFunction)\n Component.preload = importFunction\n return Component\n}", "initialize() {\n for (const ds of this.dataSources) {\n ds.visit((node) => node.initialize());\n }\n }", "function loadImages(imagesToLoad) {\n\timagesToLoad.forEach(lazyImage => {\n\t\tthis.fireLazyEvent(lazyImage.image);\n\t\tlazyImage.resolved = true;\n\t});\n}", "function lazyLoad(destiny) {\n if (!options.lazyLoading) {\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function (element) {\n ['src', 'srcset'].forEach(function (type) {\n var attribute = element.getAttribute('data-' + type);\n\n if (attribute != null && attribute) {\n setSrc(element, type);\n element.addEventListener('load', function () {\n onMediaLoad(destiny);\n });\n }\n });\n\n if (matches(element, 'source')) {\n var elementToPlay = closest(element, 'video, audio');\n\n if (elementToPlay) {\n elementToPlay.load();\n\n elementToPlay.onloadeddata = function () {\n onMediaLoad(destiny);\n };\n }\n }\n });\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\n ['src', 'srcset'].forEach(function(type){\n var attribute = element.getAttribute('data-' + type);\n if(attribute != null && attribute){\n setSrc(element, type);\n element.addEventListener('load', function(){\n onMediaLoad(destiny);\n });\n }\n });\n\n if(matches(element, 'source')){\n var elementToPlay = closest(element, 'video, audio');\n if(elementToPlay){\n elementToPlay.load();\n elementToPlay.onloadeddata = function(){\n onMediaLoad(destiny);\n };\n }\n }\n });\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\n ['src', 'srcset'].forEach(function(type){\n var attribute = element.getAttribute('data-' + type);\n if(attribute != null && attribute){\n setSrc(element, type);\n element.addEventListener('load', function(){\n onMediaLoad(destiny);\n });\n }\n });\n\n if(matches(element, 'source')){\n var elementToPlay = closest(element, 'video, audio');\n if(elementToPlay){\n elementToPlay.load();\n elementToPlay.onloadeddata = function(){\n onMediaLoad(destiny);\n };\n }\n }\n });\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\n ['src', 'srcset'].forEach(function(type){\n var attribute = element.getAttribute('data-' + type);\n if(attribute != null && attribute){\n setSrc(element, type);\n element.addEventListener('load', function(){\n onMediaLoad(destiny);\n });\n }\n });\n\n if(matches(element, 'source')){\n var elementToPlay = closest(element, 'video, audio');\n if(elementToPlay){\n elementToPlay.load();\n elementToPlay.onloadeddata = function(){\n onMediaLoad(destiny);\n }\n }\n }\n });\n }", "function loadFurtherCarouselSlides(){\n\t$(\".carousel .item\").each(function(n) {\n\t\tif(!$(this).hasClass(\"loadfast\")){\n\t\t\timgURL = $(this).attr(\"data-image\");\n\t\t\tif(cloudinaryAccount){\n\t\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\n\t\t\t\tpreload(cloudinaryURL);\n\t\t\t}\n\t\t}\n\t});\t\n}", "initModulesDynamic() {\n if (this.isDynamicInitialized) {\n return;\n }\n for (let i = 0; i < this.modules.length; i++) {\n this.modules[i].initDynamic(this);\n }\n this.isDynamicInitialized = true;\n }", "function preload() {\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "initRelations() {\n const me = this,\n relations = me.constructor.relations;\n if (!relations) return; // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not better...\n\n me.stores.forEach(store => {\n if (!store.modelRelations) store.initRelations(); // TODO: not at all tested for multiple stores, can't imagine it works as is\n\n const relatedRecords = [];\n store.modelRelations && store.modelRelations.forEach(config => {\n relatedRecords.push({\n related: me.initRelation(config),\n config\n });\n });\n store.updateRecordRelationCache(me, relatedRecords);\n });\n }", "init() {\n for (let i = 0; i < this._airportListToLoad.length; i++) {\n const airport = this._airportListToLoad[i];\n\n this.airport_load(airport);\n }\n }", "load(l) {\n if( typeof l === 'undefined' ) {\n throw(new Error('Illegal to pass undefined to load'));\n }\n if( this.willChop.length !== 0 ){\n throw(new Error('Illegal to load more than once'));\n }\n // FIXME: rename to willDestroy\n this.willChop = l;\n this.chopIntoPrecompute();\n\n // console.log(this.precompute);\n\n // this.willChopOriginal = this.willChopOriginal.concat(l); // lazy\n }", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n\r\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\r\n ['src', 'srcset'].forEach(function(type){\r\n var attribute = element.getAttribute('data-' + type);\r\n if(attribute != null && attribute){\r\n setSrc(element, type);\r\n element.addEventListener('load', function(){\r\n onMediaLoad(destiny);\r\n });\r\n }\r\n });\r\n\r\n if(matches(element, 'source')){\r\n var elementToPlay = closest(element, 'video, audio');\r\n if(elementToPlay){\r\n elementToPlay.load();\r\n elementToPlay.onloadeddata = function(){\r\n onMediaLoad(destiny);\r\n };\r\n }\r\n }\r\n });\r\n }", "function loadFirstCarouselSlides(){\n\t$(\".carousel .item\").each(function(n) {\n\t\tif($(this).hasClass(\"loadfast\")){\n\t\t\timgURL = $(this).attr(\"data-image\");\n\t\t\tif(cloudinaryAccount){\n\t\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\n\t\t\t\tpreload(cloudinaryURL);\n\t\t\t}\n\t\t}\n\t});\n}", "function preload() {\n\tclickablesManager = new ClickableManager('data/clickableLayout.csv');\n\tadventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function setupInstanceVars(args) {\n for(let a in args) {\n this[a] = args[a];\n }\n}", "initModels() {\n this.models = {};\n this.collections = {};\n MODELS.forEach(modulePath => {\n const { modelClass, collectionClass } = require(modulePath)(this.bookshelf);\n if (modelClass) {\n this.models[modelClass.prototype.modelName] = modelClass;\n }\n\n if (collectionClass) {\n this.collections[collectionClass.prototype.collectionName] = collectionClass;\n }\n });\n }", "load(options) {\n return this.dispatcher.load(options);\n }", "initSlideshow() {\n this.imagesLoaded = 0;\n this.currentIndex = 0;\n this.setNextSlide();\n this.slides.each((idx, slide) => {\n $('<img>').on('load', $.proxy(this.loadImage, this)).attr('src', $(slide).attr('src'));\n });\n }", "function Cache_AutoLoad()\n{\n\t//helpers\n\tvar id;\n\t//now try to access the stored screen instances\n\tfor (id in __MappedScreenInstances)\n\t{\n\t\t//store this\n\t\tthis.Storage[__CACHE_TYPE_SCREEN_INSTANCE][id] = __MappedScreenInstances[id];\n\t}\n\t//now try to access the stored raw screens\n\tfor (id in __MappedRawScreens)\n\t{\n\t\t//store this\n\t\tthis.Storage[__CACHE_TYPE_SCREEN_RAW][id] = __MappedRawScreens[id];\n\t}\n\t//now try to acces sthe stored messages\n\tfor (id in __MappedTutorialMessages)\n\t{\n\t\t//store this\n\t\tthis.Storage[__CACHE_TYPE_MESSAGES][id] = __MappedTutorialMessages[id];\n\t}\n\t//now try to access the stored states\n\tfor (id in __MappedStates)\n\t{\n\t\t//store this\n\t\tthis.Storage[__CACHE_TYPE_STATE][id] = WI4_State_Constructor(__MappedStates[id]);\n\t}\n\t//now try to access the stored sub screens\n\tfor (id in __MappedSubScreens)\n\t{\n\t\t//store this\n\t\tthis.Storage[__CACHE_TYPE_SCREEN_SUB][id] = WI4_SubScreen_Constructor(__MappedSubScreens[id]);\n\t}\n\t//now try to access the stored tutorials\n\tfor (id in __MappedTutorials)\n\t{\n\t\t//store this\n\t\tthis.Storage[__CACHE_TYPE_TUT][id] = WI4_Tut_Constructor(__MappedTutorials[id]);\n\t}\n}", "initPool() {\n this.pool = [];\n for (let choice of this.choices) {\n for (let i = 0; i < choice[1].totalNumber; i++) this.pool.push(choice[0])\n }\n }", "function invokeLazyExecutedCallbacks()\n{\n if (_lazyExecutedCallbacks && _lazyExecutedCallbacks.length > 0)\n for(var i=0; i<_lazyExecutedCallbacks.length; i++)\n _lazyExecutedCallbacks[i]();\n}", "async init(urls) {\n this.urls = urls;\n this.model = await loadHostedPretrainedModel(urls.model);\n await this.loadMetadata();\n return this; fromfrom\n }" ]
[ "0.68609226", "0.6349685", "0.63411105", "0.6311932", "0.6129534", "0.5950062", "0.5943736", "0.56813186", "0.55987024", "0.5565064", "0.5565064", "0.5565064", "0.5528223", "0.55218416", "0.5516596", "0.5491772", "0.5474313", "0.54665387", "0.54581374", "0.5450568", "0.5435935", "0.5435935", "0.5435935", "0.5435935", "0.5432684", "0.5432684", "0.5421963", "0.5409349", "0.53991234", "0.53991234", "0.53991234", "0.53991234", "0.5381386", "0.5371896", "0.5371896", "0.5371896", "0.532367", "0.5321727", "0.53200084", "0.5319348", "0.5317795", "0.5286645", "0.5272579", "0.52573293", "0.52505416", "0.5245527", "0.5239462", "0.5227999", "0.520791", "0.52074414", "0.52074414", "0.51928335", "0.5190565", "0.51882935", "0.5185456", "0.5185456", "0.5185456", "0.5185456", "0.51837975", "0.51778764", "0.517189", "0.5165725", "0.51640373", "0.5150993", "0.51444584", "0.51205057", "0.50863254", "0.5081071", "0.5081071", "0.5081071", "0.50541306", "0.5043063", "0.5042892", "0.5039718", "0.5039373", "0.50198185", "0.4999637", "0.4993238", "0.49801487", "0.49748158", "0.49739003", "0.49739003", "0.49702856", "0.49676302", "0.49667358", "0.4946656", "0.49444446", "0.49435258", "0.4930186", "0.49300048", "0.49267998", "0.49173558", "0.49152833", "0.49150681", "0.49112484", "0.4898864", "0.48933104", "0.4888269", "0.48848104", "0.48840636" ]
0.62588924
4
THE FOLLOWING FUNCTIONS SHOULD BE MOVED TO SEPERATE FILES loops through all players in the given game and assigns opponents, equal to the next player in the list this is a recursive function that runs until all players have been assigned an opponent
function setPlayerOpponents(gamefound, index, players, game_ID) { // when the recursive function reaches the terminate state - begin the game if(index == gamefound.players.length) beginGame(game_ID, players); else { let i = index; // create a promise object that resolves once the player has been assigned an opponent // it then moves on to the next player in the list let promise = new Promise(function(resolve, reject) { let player_ID = gamefound.players[i]; // do some updates to the player, then jump to next iteration Player.find({'playerID': player_ID}, function(err, playerfound) { if(err) console.error(err); playerfound = playerfound[0]; // player opponent is next player in list, the last player gets the first player as opponent let opponent_ID = (i == gamefound.players.length-1) ? gamefound.players[0] : gamefound.players[i+1]; Player.find({'playerID': opponent_ID}, function(err, opponentfound) { if(err) console.error(err); if(!opponentfound[0]) reject("No player found!"); opponentfound = opponentfound[0]; playerfound.opponent = opponentfound.username; playerfound.opponentPassword = opponentfound.password; playerfound.hiddenFiles = false; playerfound.save(function(err) { if(err) console.error(err); players.push(playerfound); // once the player opponent has been updated - resolve and move to next player resolve(players); }); }); }); }); promise.then( result => { i++; setPlayerOpponents(gamefound, i, result, game_ID); return players; }, error => { console.log(error); } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOpponents() {\n\n // get the count of users waiting\n var users_waiting = getUsersWaiting();\n // if number of users waiting for game >= 2 then assign the game\n if (users_waiting >= 2) {\n\n var max_two = 1;\n for (var socket_id in users_pool) {\n\n if (users_pool[socket_id] == 0) {\n\n users_pool[socket_id] = 1;\n if (max_two == 1) {\n\n var user_1 = socket_id;\n } else if (max_two == 2) {\n\n var user_2 = socket_id;\n break;\n }\n\n max_two++;\n }\n }\n\n // assign users to each other. TODO : refactor\n user_games[user_1] = user_2;\n user_games[user_2] = user_1;\n }\n\n // if client's socket id found in user_games then user has been\n // assigned with opponent and game can be started.\n if (user_games[socket.id]) {\n\n var from = socket.id;\n var to = user_games[socket.id];\n var start_data = {\n 'turn': 0,\n 'sign': 'X', // cross\n 'masterBit': 1\n };\n io.sockets.socket(to).emit('start_game_data', start_data);\n start_data['turn'] = 1;\n start_data['sign'] = '0'; // zero\n start_data['masterBit'] = 0;\n io.sockets.socket(from).emit('start_game_data', start_data);\n // run the timer as soon as opponents are connected\n timer();\n }\n\n }", "function determineOpponents(inCommon, playerID, enemyID){\n var playerTeam;\n var enemyTeam;\n var whoWon;\n\n for(var i = 0; i< inCommon.length; i++){\n //dont kill the API!\n if(inCommon.length < 11){\n $.getJSON(\"https://na.api.pvp.net/api/lol/na/v2.2/match/\" + inCommon[i] + \"?api_key=\" + API_KEY, function(match){\n console.log(\"Setting incommon: \" + inCommon)\n for(var i = 0; i < match.participantIdentities.length; i++){\n if(match.participantIdentities[i].player.summonerId == playerID){\n var partitipantID = match.participantIdentities[i].participantId;\n playerTeam = match.participants[partitipantID-1].teamId;\n }\n if(match.participantIdentities[i].player.summonerId == enemyID){\n var partitipantID = match.participantIdentities[i].participantId;\n enemyTeam = match.participants[partitipantID-1].teamId;\n }\n }\n\n if(playerTeam == enemyTeam){ /*do nothing*/ }\n else{\n if(playerTeam == 100){\n win(match.teams[0].winner, inCommon.length);\n }\n else{\n win(match.teams[1].winner, inCommon.length); \n }\n }\n\n \n });\n if(i == (inCommon.length - 1)){\n // winPercentage(); \n }\n }\n \n }\n }", "function nextTurn() {\n //faire les modifications necessaire\n lastPlayer = lastPlayer < listPlayers.length - 1 ? lastPlayer + 1 : 0;\n modifyPlayerPanel();\n // var currentPlayer = document.getElementById(\"current-player\");\n // currentPlayer.innerHTML = \"Current player : \" + listPlayers[lastPlayer].name;\n listCheckbox.forEach((checkbox) => {\n document.getElementById(checkbox).checked = false;\n });\n saveListPlayers();\n if (is_victory().victory === true) {\n hideGame(true);\n endRanking = document.getElementById(\"end-ranking\");\n endRanking.innerHTML =\n \"This is the end of the game. Player \" +\n is_victory().player +\n \" won the match.\";\n }\n}", "function getPath() {\r\n \r\n document.querySelector(\".instructions\").classList.add(\"hidden\")\r\n var startPlayer = toTitleCase(document.getElementById(\"playerInput1\").value).replace(\"JR.\",\"Jr.\")\r\n var endPlayer = toTitleCase(document.getElementById(\"playerInput2\").value).replace(\"JR.\",\"Jr.\")\r\n if(!players[startPlayer]||!players[endPlayer]){\r\n document.getElementById(\"connections-list\").innerHTML = \"Player not found: try retyping your player and selecting from the dropdown.\";\r\n return false;\r\n }\r\n\r\n let seenTeams = []\r\n let nextTeams = []\r\n let seenPlayers = [[startPlayer,[startPlayer]]]\r\n let nextPlayers = [[startPlayer,[startPlayer]]]\r\n let winArray = [];\r\n\r\n counter = 0;\r\n\r\n\r\n while(winArray.length<1){\r\n\r\n\r\n //queue up teams\r\n\r\n if(nextPlayers[0]){\r\n players[nextPlayers[0][0]].forEach(team =>{\r\n\r\n if(seenTeams.includes(team)){\r\n return;\r\n }\r\n\r\n\r\n queueObject = [team,nextPlayers[0][1].concat(team)]\r\n\r\n seenTeams.push(team)\r\n nextTeams.push(queueObject)\r\n\r\n \r\n })\r\n nextPlayers.shift();\r\n }\r\n\r\n //queue up players\r\n if(nextTeams[0]){\r\n teams[nextTeams[0][0]].forEach(player =>{\r\n\r\n if(seenPlayers.includes(player)){\r\n return;\r\n }\r\n \r\n \r\n queueObject = [player,nextTeams[0][1].concat(player)]\r\n\r\n if(player===endPlayer){\r\n winArray = queueObject[1]\r\n }\r\n seenPlayers.push(player)\r\n nextPlayers.push(queueObject)\r\n \r\n })\r\n nextTeams.shift();\r\n }\r\n\r\n }\r\n displayConnections(winArray);\r\n}", "function pairingFourSideScoreBoard(RoundName){\n var remainingPairings=TEAM_NUMBER;\n var currentRow=0;\n var scoreBoardSheet = ss.getSheetByName(SHEET_SCOREBOARD);\n var range = scoreBoardSheet.getRange(4, 1, TEAM_NUMBER,4+SIDES_PER_ROUND);\n var dataGrid = range.getValues();//Data sorted\n var bracketSize;\n var rand;\n var properOpponent;\n var govIndex=0;\n var rand2;\n var rand3;\n var rand4;\n var teamname_rand2;\n var teamname_rand3;\n var teamname_rand4;\n var OpeGov = [];\n var CloGov = [];\n var OpeOpp = [];\n var CloOpp = [];\n var itr=TEAM_NUMBER*80;\n var values;\n while(remainingPairings>0){\n bracketSize=obtainBracketSize(dataGrid,currentRow);\n values=scoreBoardSheet.getRange(currentRow+4, 2, bracketSize).getValues();\n var RepresentativeArray=obtainPartialAffiliationNumbers(currentRow,bracketSize);\n var non_affiliated_rounds=nonAffiliatedMatches(RepresentativeArray,bracketSize);\n while(values.length>Number(non_affiliated_rounds*SIDES_PER_ROUND)&&LIMIT_INTER_AFF_ROUNDS){\n rand= values.indexOf(findTeamRepresented(RepresentativeArray,values));// assignation before looping on random values\n properOpponent=false;\n var random = Math.ceil(Math.random()*4 );//To allow most represented to be 1 of 4 positions\n switch(random) {\n case 1 :\n OpeGov.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand2= randomIndexTeam(values.length);\n rand3= randomIndexTeam(values.length);\n rand4= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(OpeGov[govIndex])!=obtainAffiliationDebater(values[rand2])&&\n obtainAffiliationDebater(OpeGov[govIndex])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(OpeGov[govIndex])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(values[rand3])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand4])){\n updateRepresented(RepresentativeArray,values[rand2]);\n updateRepresented(RepresentativeArray,values[rand3]);\n updateRepresented(RepresentativeArray,values[rand4]);\n OpeOpp.push(values[rand2]);\n CloGov.push(values[rand3]);\n CloOpp.push(values[rand4]);\n teamname_rand2=values[rand2];\n teamname_rand3=values[rand3];\n teamname_rand4=values[rand4];\n values.splice(values.indexOf(teamname_rand2),1);\n values.splice(values.indexOf(teamname_rand3),1);\n values.splice(values.indexOf(teamname_rand4),1);\n govIndex+=1;\n properOpponent=true;\n }\n CheckIterationMax(itr);\n }\n break;\n case 2:\n OpeOpp.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand2= randomIndexTeam(values.length);\n rand3= randomIndexTeam(values.length);\n rand4= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(OpeOpp[govIndex])!=obtainAffiliationDebater(values[rand2])&&\n obtainAffiliationDebater(OpeOpp[govIndex])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(OpeOpp[govIndex])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(values[rand3])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand4])){\n updateRepresented(RepresentativeArray,values[rand2]);\n updateRepresented(RepresentativeArray,values[rand3]);\n updateRepresented(RepresentativeArray,values[rand4]);\n OpeGov.push(values[rand2]);\n CloGov.push(values[rand3]);\n CloOpp.push(values[rand4]);\n teamname_rand2=values[rand2];\n teamname_rand3=values[rand3];\n teamname_rand4=values[rand4];\n values.splice(values.indexOf(teamname_rand2),1);\n values.splice(values.indexOf(teamname_rand3),1);\n values.splice(values.indexOf(teamname_rand4),1);\n govIndex+=1;\n properOpponent=true;\n }\n CheckIterationMax(itr);\n }\n break;\n case 3:\n CloGov.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand2= randomIndexTeam(values.length);\n rand3= randomIndexTeam(values.length);\n rand4= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(CloGov[govIndex])!=obtainAffiliationDebater(values[rand2])&&\n obtainAffiliationDebater(CloGov[govIndex])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(CloGov[govIndex])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(values[rand3])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand4])){\n updateRepresented(RepresentativeArray,values[rand2]);\n updateRepresented(RepresentativeArray,values[rand3]);\n updateRepresented(RepresentativeArray,values[rand4]);\n OpeGov.push(values[rand2]);\n OpeOpp.push(values[rand3]);\n CloOpp.push(values[rand4]);\n teamname_rand2=values[rand2];\n teamname_rand3=values[rand3];\n teamname_rand4=values[rand4];\n values.splice(values.indexOf(teamname_rand2),1);\n values.splice(values.indexOf(teamname_rand3),1);\n values.splice(values.indexOf(teamname_rand4),1);\n govIndex+=1;\n properOpponent=true;\n }\n CheckIterationMax(itr);\n }\n break;\n case 4:\n CloOpp.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand2= randomIndexTeam(values.length);\n rand3= randomIndexTeam(values.length);\n rand4= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(CloOpp[govIndex])!=obtainAffiliationDebater(values[rand2])&&\n obtainAffiliationDebater(CloOpp[govIndex])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(CloOpp[govIndex])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(values[rand3])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand4])){\n updateRepresented(RepresentativeArray,values[rand2]);\n updateRepresented(RepresentativeArray,values[rand3]);\n updateRepresented(RepresentativeArray,values[rand4]);\n OpeGov.push(values[rand2]);\n OpeOpp.push(values[rand3]);\n CloGov.push(values[rand4]);\n teamname_rand2=values[rand2];\n teamname_rand3=values[rand3];\n teamname_rand4=values[rand4];\n values.splice(values.indexOf(teamname_rand2),1);\n values.splice(values.indexOf(teamname_rand3),1);\n values.splice(values.indexOf(teamname_rand4),1);\n govIndex+=1;\n properOpponent=true;\n }\n CheckIterationMax(itr);\n }\n break;\n \n default:\n throw \"Invalid state switch random pairingScoreboard4side\"; \n break; \n }\n }\n // Designed to randomise the initially selected\n for (var row=0;row<values.length;row+=4) {\n var rand = Math.ceil(Math.random() *4 );\n switch(rand){\n case 1:\n OpeGov.push(values[row]);\n OpeOpp.push(values[row+1]);\n CloGov.push(values[row+2]);\n CloOpp.push(values[row+3]);\n break;\n case 2:\n OpeOpp.push(values[row]);\n OpeGov.push(values[row+3]);\n CloGov.push(values[row+2]);\n CloOpp.push(values[row+1]);\n case 3:\n CloGov.push(values[row]);\n OpeGov.push(values[row+2]);\n OpeOpp.push(values[row+1]);\n CloOpp.push(values[row+3]);\n break;\n case 4:\n CloOpp.push(values[row]);\n OpeOpp.push(values[row+1]);\n CloGov.push(values[row+3]);\n OpeGov.push(values[row+2]);\n break;\n default:\n throw \"Invalid random\";\n }\n updateRepresented(RepresentativeArray,values[row]);\n updateRepresented(RepresentativeArray,values[row+1]);\n updateRepresented(RepresentativeArray,values[row+2]);\n updateRepresented(RepresentativeArray,values[row+3]);\n rand=values[row];\n teamname_rand2=values[row+1];\n teamname_rand3=values[row+2];\n teamname_rand4=values[row+3];\n values.splice(values.indexOf(rand),1);\n values.splice(values.indexOf(teamname_rand2),1);\n values.splice(values.indexOf(teamname_rand3),1);\n values.splice(values.indexOf(teamname_rand4),1);\n }\n currentRow=currentRow+bracketSize;\n remainingPairings=remainingPairings-bracketSize; \n }\n control4Sides(dataGrid,OpeGov,OpeOpp,CloGov,CloOpp);\n var pairingNumber=TEAM_NUMBER/SIDES_PER_ROUND; \n var randomised_order=createArray(pairingNumber,4);\n for(var i = 0;i<pairingNumber;i++){\n randomised_order[i][0]=String(OpeGov[i]);\n randomised_order[i][1]=String(OpeOpp[i]);\n randomised_order[i][2]=String(CloGov[i]);\n randomised_order[i][3]=String(CloOpp[i]);\n }\n shuffleArray(randomised_order);//Randomise for display in random order for pairings to prevent rankings positions\n ss.getSheetByName(RoundName).getRange(3, 2,randomised_order.length,4).setValues(randomised_order);\n \n}", "function pairingTwoSideScoreBoard(RoundName){\n var remainingPairings=TEAM_NUMBER;\n var currentRow=0;\n var scoreBoardSheet = ss.getSheetByName(SHEET_SCOREBOARD);\n var range = scoreBoardSheet.getRange(4, 1, TEAM_NUMBER,6);\n var dataGrid = range.getValues();//Data sorted\n var bracketSize;\n var rand;\n var properOpponent;\n var govIndex=0;\n var newGov = [];\n var newOpp = [];\n var itr=TEAM_NUMBER*40;\n var values;\n while(remainingPairings>0){\n bracketSize=obtainBracketSize(dataGrid,currentRow);\n values=scoreBoardSheet.getRange(currentRow+4, 2, bracketSize).getValues();\n var RepresentativeArray=obtainPartialAffiliationNumbers(currentRow,bracketSize);\n var non_affiliated_rounds=nonAffiliatedMatches(RepresentativeArray,bracketSize);\n while(values.length>Number(non_affiliated_rounds*2)&&LIMIT_INTER_AFF_ROUNDS){\n rand= values.indexOf(findTeamRepresented(RepresentativeArray,values));// assignation before looping on random values\n properOpponent=false;\n var random = Math.ceil(Math.random() *2 );//To allow most represented to be opposition and gov\n if(random%2==0){\n newGov.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(newGov[govIndex])!=obtainAffiliationDebater(values[rand])){\n updateRepresented(RepresentativeArray,values[rand]);// Counterpart to keep findTeamRepresented from getting out of sync with the values array.\n newOpp.push(values[rand]);\n values.splice(rand,1);\n govIndex+=1;\n properOpponent=true;\n }\n itr-=1;\n if(itr<0)\n throw \"Computation limit exceeded. Regenerate round\";// Prevents infinite looping when randomness doesnt prioritize spreading big teams.\n }\n }\n else{\n newOpp.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(newOpp[govIndex])!=obtainAffiliationDebater(values[rand])){\n updateRepresented(RepresentativeArray,values[rand]);// Counterpart to keep findTeamRepresented from getting out of sync with the values array\n newGov.push(values[rand]);\n values.splice(rand,1);\n govIndex+=1;\n properOpponent=true;\n }\n itr-=1;\n if(itr<0)\n throw \"Computation limit exceeded. Regenerate round\";// Prevents infinite looping when unforseen bugs occur.\n }\n }\n }\n for (var row=0;row<values.length;row+=2) {\n var rand = Math.ceil(Math.random() *2 );\n if(rand==1){\n newGov.push(values[row]);\n newOpp.push(values[row+1]); \n }\n else{\n newOpp.push(values[row]);\n newGov.push(values[row+1])\n }\n }\n currentRow=currentRow+bracketSize;\n remainingPairings=remainingPairings-bracketSize; \n }\n control2Sides(dataGrid,newGov,newOpp);\n var pairingNumber=TEAM_NUMBER/SIDES_PER_ROUND; \n var randomised_order=createArray(pairingNumber,2);\n for(var i = 0;i<pairingNumber;i++){\n randomised_order[i][0]=String(newGov[i]);\n randomised_order[i][1]=String(newOpp[i]);\n }\n shuffleArray(randomised_order);//Randomise for display in random order for pairings to prevent rankings positions\n ss.getSheetByName(RoundName).getRange(3, 2,randomised_order.length,2).setValues(randomised_order);\n \n}", "function playGame() {\n var o = Math.floor(Math.random()*20) +1;\n var d = Math.floor(Math.random()*20) +1;\n if(games < 5) {\n var totalO = 0;\n var totalD = 0;\n for(var x=0; x<teamStarters.length; x++) {\n totalO += teamStarters[x].offense;\n totalD += teamStarters[x].defense;\n }\n // offense comparison\n if(o < totalO) {\n teamWins++;\n console.log(\" total team wins: \" + teamWins);\n }\n if(d > totalD) {\n teamWins--;\n console.log(\" total team wins: \" + teamWins);\n }\n // defense comparison\n \n games++\n if(games > 0 && games < 5) {\n inquirer.prompt({type:'list',\n message: 'Do you want to sub a player?',\n choices: teamStarters,\n name:'sub'\n }).then(answers => {\n console.log(answers);\n var totalD = 0;\n for(var x=0; x<teamStarters.length; x++) {\n if (answers.sub == teamStarters[x].name) {\n var hold = teamStarters[x];\n teamStarters[x] = teamSubs[0] \n teamSubs[0] = hold; \n console.log('starters');\n console.log(teamStarters);\n console.log('------')\n console.log('subs');\n console.log(teamSubs);\n }\n }\n });\n \n } // if round 1-last end \n playGame();\n}\n if( games > 2) {\n if( teamWins >0) {\n for(var x=0; x<teamStarters.length; x++) {\n console.log(\"You've won this match\"); \n teamStarters[x].goodGame();\n teamStarters[x].printStats();\n }\n }// end if team wins positive check \n if( teamWins < 0) {\n for(var x=0; x<teamStarters.length; x++) {\n console.log(\"You've lost this match\"); \n teamStarters[x].badGame();\n teamStarters[x].printStats();\n }\n }// end if team wins negative check \n else {}\n }// end if last game check\n}", "function pairingZeroTwoSide(RoundName) {\n var scoreBoardSheet = ss.getSheetByName(SHEET_SCOREBOARD);\n var range = scoreBoardSheet.getRange(4, 2, TEAM_NUMBER);\n var values = range.getValues();\n shuffleArray(values);\n var rand;\n var properOpponent;\n var govIndex=0;\n var newGov = [];\n var newOpp = [];\n var itr=TEAM_NUMBER*40;\n var RepresentativeArray=obtainAffiliationNumbers();\n var non_affiliated_rounds=nonAffiliatedMatches(RepresentativeArray,TEAM_NUMBER);\n while(values.length>Number(non_affiliated_rounds*2)&&LIMIT_INTER_AFF_ROUNDS)\n {\n rand= values.indexOf(findTeamRepresented(RepresentativeArray,values));// assignation before looping on random values\n properOpponent=false;\n var random = Math.ceil(Math.random() *2 );//To allow most represented to be opposition and gov\n if(random%2==0){\n newGov.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(newGov[govIndex])!=obtainAffiliationDebater(values[rand])){\n updateRepresented(RepresentativeArray,values[rand]);// Counterpart to keep findTeamRepresented from getting out of sync with the values array.\n newOpp.push(values[rand]);\n values.splice(rand,1);\n govIndex+=1;\n properOpponent=true;\n }\n itr-=1;\n if(itr<0)\n throw \"Computation limit exceeded. Regenerate round\";// Prevents infinite looping when randomness doesnt prioritize spreading big teams.\n }\n }\n else{\n newOpp.push(values[rand]);\n values.splice(rand,1);\n while(!properOpponent){\n rand= randomIndexTeam(values.length);\n if(obtainAffiliationDebater(newOpp[govIndex])!=obtainAffiliationDebater(values[rand])){\n updateRepresented(RepresentativeArray,values[rand]);// Counterpart to keep findTeamRepresented from getting out of sync with the values array\n newGov.push(values[rand]);\n values.splice(rand,1);\n govIndex+=1;\n properOpponent=true;\n }\n itr-=1;\n if(itr<0)\n throw \"Computation limit exceeded. Regenerate round\";// Prevents infinite looping when unforseen bugs occur.\n }\n }\n }\n for (var row in values) {\n var rand = Math.ceil(Math.random() *2 );//(Number(TEAM_NUMBER))\n if(rand%2==0&&newGov.length<Number(TEAM_NUMBER/2)){\n newGov.push(values[row]);\n }\n else if(newOpp.length<Number(TEAM_NUMBER/2)){\n newOpp.push(values[row]);\n }\n else{\n newGov.push(values[row]);\n }\n }\n ss.getSheetByName(RoundName).getRange(3, 2,newGov.length,1).setValues(newGov);\n ss.getSheetByName(RoundName).getRange(3, 3,newOpp.length,1).setValues(newOpp);\n}", "function OnAutoAssignPressed()\n{\n\t// Assign all of the currently unassigned players to a team, trying\n\t// to keep any players that are in a party on the same team.\n\tGame.AutoAssignPlayersToTeams();\n}", "function addplayers() {\n for (let i in grid) {\n for (let d in grid[i]) {\n if (grid[i][d] == players[0]) {\n x(i,d);\n } else if (grid[i][d] == players[1]) {\n o(i,d);\n }\n }\n }\n}", "function nextTurn(i, j) {\n if (board[j][i] != e) return;\n board[j][i] = currPlayer;\n checkWinner();\n if (currPlayer == p1) currPlayer = p2;\n else currPlayer = p1;\n}", "function nextPlayer()\r\n{\r\n\t// check victory condition first\r\n\tif ( checkVictory() ) return;\r\n\r\n\t// if victory condition not met...\r\n\t// increment the current player id\r\n\tgame.cplayer = (game.cplayer+1)%game.players.length;\r\n\t\r\n\tUI_updateInfo();\r\n\t\t\r\n\t// start next players turn...\r\n\tstartTurn( current() );\r\n}", "function playerAILevel1(outX, outY, wonCells, playerTurn){\n\tvar outsideX = outX;\n\tvar outsideY = outY;\n\tvar opponentTurn;\n\tif(playerTurn == 1){\n\t\topponentTurn = 2;\n\t} else{\n\t\topponentTurn = 1;\n\t}\n\t\n\t//addLog(\"Won cells: \" + wonCells);\n\t \n\t/*--- Check to see if the inner game has been won ---*/\n\tvar wonCheck = false;\n\twhile(wonCheck == false){\n\t\t//addLog(\"Checking cell \" + outsideX + \",\" + outsideY);\n\t\t//If the selected game has already been won, choose a new one\n\t\tif (wonCells[outsideX][outsideY] != 0){\n\t\t\t//addLog(\"The cell was won by \" + wonCells[outsideX][outsideY]);\n\t\t\t//Select a random game to play in and check again\n\t\t\toutsideX = Math.floor(Math.random() * 3);\n\t\t\toutsideY = Math.floor(Math.random() * 3);\n\t\t\t//addLog(\"New cell to check is \" + outsideX + \",\" + outsideY);\n\t\t}\n\t\t//The selected game hasn't been won, continue to move selection\n\t\telse{\n\t\t\t//addLog(\"The following cell is valid \" + outsideX + \",\" + outsideY);\n\t\t\twonCheck = true;\n\t\t}\n\t}\n\t\n\t/*--- Evaluate possible moves ---*/\n\t\n\t//Create a value table for the game\n\t//This holds the point values of each space in the game\n\t//valTable: x by y\n\t/*\n\t\t x0 x1 x2\n\t\ty0 0.0 1.0 2.0\n\t\ty1 0.1 1.1 2.1\n\t\ty2 0.2 1.2 2.2\n\t*/\n\tvar valTable = [[0,0,0],\n\t\t\t\t\t[0,0,0],\n\t\t\t\t\t[0,0,0]];\n\t \n\t var checkVal; //Determines which square you are calculating for\n\t var spaceScore = 0; //Point value for the space being calculated\n\t\n\t//Check the value of possible moves in game x,y\n\tfor(var i = 0; i < 3; i++){ //Check columns (x)\n\t\tfor (var j = 0; j < 3; j++){ //Check rows (y)\n\t\t\tcheckVal = i + \".\" + j; //Which square is being checked\n\t\t\t//addLog(\"Calculating \" + checkVal);\n\t\t\t\n\t\t\t//If the space is taken, set the point value to 0\n\t\t\tif(selected[outsideX][outsideY][i][j] == opponentTurn || selected[outsideX][outsideY][i][j] == playerTurn){\n\t\t\t\tvalTable[i][j] = 0;\n\t\t\t\t//addLog(\"Coords (\" + i + \",\" + j + \") are already filled.\");\n\t\t\t}\n\t\t\t//Otherwise, calculate the value\n\t\t\telse{\n\t\t\t\tswitch(checkVal){\n\t\t\t\t\tcase \"0.0\": //left-top\n\t\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top, middle-bottom, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 1 && y == 2) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"0.1\": //left-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, right-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 2 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"0.2\": //left-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-bottom, middle-top, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 2) || (x == 1 && y == 0) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][1][2] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][1] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.0\": //middle-top\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-bottom, middle-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 2) || (x == 1 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][1][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.1\": //middle-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: middle-center\n\t\t\t\t\t\t\t\tif((x == 1 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middlecolumn\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.2\": //middle-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top, middle-bottom, right-top\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 1 && y == 2) || (x == 2 && y == 0)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][1] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.0\": //right-top\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, middle-bottom, right-top\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 1 && y == 2) || (x == 2 && y == 0)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][1][0] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][1][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][2][1] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][1][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][1][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.1\": //right-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top left-bottom, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 0 && y == 2) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][1][1] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][1][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.2\": //right-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, middle-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 1 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][0] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][1][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//addLog(\"Value table: \" + valTable);\n\t\n\t/*--- Select move from best options ---*/\n\t//Find best score\n\tvar bestOption = valTable[0][0]; //Current best option\n\tfor (var alpha = 0; alpha < 3; alpha++){\n\t\tfor (var beta = 0; beta < 3; beta++){\n\t\t\tif (bestOption < valTable[alpha][beta]){\n\t\t\t\tbestOption = valTable[alpha][beta];\n\t\t\t}\n\t\t}\n\t}\n\t//addLog(\"Best value = \" + bestOption);\n\t\n\t//Find the possible locations of the best score\n\tvar possibleOptions = []; //array holding the possible places to move on the inner board\n\tvar optionCounter = 0; //counter used to increment array position\n\tfor (var ares = 0; ares < 3; ares++){\n\t\tfor (var zeus = 0; zeus < 3; zeus++){\n\t\t\tif (bestOption == valTable[ares][zeus]){\n\t\t\t\tpossibleOptions[optionCounter] = ares;\n\t\t\t\toptionCounter++;\n\t\t\t\tpossibleOptions[optionCounter] = zeus;\n\t\t\t\toptionCounter++;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Randomly select one of the possible locations\n\tvar selectedOption = 0; //Randomly selected x position of best option\n\tvar bestOptionLocation = [0,0,0,0]; //Best option coordinates [outsideX, outsideY, innerX, innerY]\n\tvar optionString = \"\"; //Concatenated possible options for displaying as coordinate pairs\n\tfor(var test = 0; test < possibleOptions.length; test++){\n\t\toptionString = (optionString + \" (\" + possibleOptions[test] + \", \" + possibleOptions[test + 1] + \")\");\n\t\ttest++;\n\t}\n\taddLog(\"Possible options:\");\n\taddLog(optionString);\n\tselectedOption = Math.floor(Math.random() * (possibleOptions.length / 2)); //Randomly select x position of best option\n\t//addLog(\"Number of options = \" + possibleOptions.length / 2);\n\t//addLog(\"Selected option = \" + selectedOption);\n\tbestOptionLocation[0] = outsideX;\n\tbestOptionLocation[1] = outsideY;\n\tbestOptionLocation[2] = possibleOptions[selectedOption * 2];\n\tbestOptionLocation[3] = possibleOptions[(selectedOption * 2) + 1];\n\tif (playerTurn == 1){\n\t\taddLog(\"Red's best move is space (\" + bestOptionLocation[2] + \",\" + bestOptionLocation[3] + \") in game (\" + bestOptionLocation[0] + \",\" + bestOptionLocation[1] + \")\");\n\t} else{\n\t\taddLog(\"Blue's best move is space (\" + bestOptionLocation[2] + \",\" + bestOptionLocation[3] + \") in game (\" + bestOptionLocation[0] + \",\" + bestOptionLocation[1] + \")\");\n\t}\n\treturn bestOptionLocation; //Return the best option's location\n }", "constructor() {\n //numberOfPlayers sets the number of players that can take part in a game, currently hard-coded to 2, could be set by the game's initiator\n let numberOfPlayers = 2;\n this.getNumberOfPlayers = function() {\n return numberOfPlayers;\n }\n //every game gets a unique id\n let id = uuidv4();\n this.getId = function() {\n return id;\n }\n //stores a game's players\n let players = [];\n this.getPlayers = function() {\n return players;\n }\n //adds a player to a game\n this.addPlayer = function(playerId, openGames) {\n players.push(playerId);\n //Every time a player gets added, check if the necessary number of players has been reached so that the game can start\n //In this case the first turn is set to the player that was just added\n if (players.length == numberOfPlayers) {\n let index = openGames.findIndex((openGame) => openGame == id);\n this.setPlayerTurn(playerId);\n return index;\n } else {\n return -1;\n }\n }\n //playerTurn is used to store whose turn it is. This is achieved by simply storing the player's turn.\n let playerTurn;\n this.getPlayerTurn = function(playerId) {\n if (playerId == playerTurn) {\n return true;\n }\n else{\n return false;\n }\n }\n this.setPlayerTurn = function(playerId) {\n playerTurn = playerId\n }\n //makeMove is only setup in a preliminary way. Right now it only passes the turn to the next player in line. It could however also be used to update the board\n this.makeMove = function(playerId){\n let index = players.findIndex(player => player == playerId);\n if (index==players.length-1){\n index=0;\n }\n else{\n index++;\n }\n this.setPlayerTurn(players[index]);\n }\n }", "function genericMove() {\n if (whoseTurn == 'playerTwo') {\n loop1:\n for (var j = 0; j < winningCombos.length; j++) {\n loop2:\n for (var k = 0; k < winningCombos[j].length; k++) {\n if ((playerOneMoves.indexOf(winningCombos[j][k]) == -1) && (playerTwoMoves.indexOf(winningCombos[j][k]) == -1)) {\n placePiece(winningCombos[j][k]);\n checkWin();\n whoseTurn = 'playerOne';\n return;\n }\n else {\n continue loop2;\n } \n }\n }\n }\n}", "function gameOver(board,player,player1){\n //let resultsTMP = [];\n draw();\n for(let i=0; i < cols; i++){\n for(let j=0; j < rows; j++){\n if(board.game[i][j].class==player.name){\n player.points += pointsConn;\n }\n if(board.game[i][j].class == player1.name){\n player1.points += pointsConn;\n }\n }\n }\n player.myTurn = false;\n player.points += player.wins * 25;\n \n player1.myTurn = false;\n player1.points += player1.wins * 25;\n\n if(player.win){\n //if any player wins\n winboards.push(board.copy());\n player.points += 100;\n player.wins += 1;\n results.push(\" Player \" + player.name.toString() + \" wins at board\"+ boards.indexOf(board).toString());\n results.push(\"Stored at: \"+winboards.length);\n player.win = 0;\n wonGames++;\n \n if(player.name == \"myPlayer\" || player.name == \"playerNN\"){\n player.points += 50;\n //at colonies.js\n starta(1);\n if(!automateToggle){\n //at colonies.js\n play();\n automateToggle = true;\n }\n }\n }\n else {\n //if result of game is draw\n //resultsTMP[0] =\"STALLED GAME at board \" + boards.indexOf(board).toString();\n if(player.name == \"myPlayer\" || player.name == \"playerNN\"){\n boardNN = boardNN.copyEmpty();\n player1.points = 0;\n player.points = 0;\n //new boards\n starta(0);\n if(!automateToggle){\n play();\n }\n }\n else{\n //all other stalled games are restarted without new generation\n /* console.log(boards.indexOf(board));\n boards.splice(boards.indexOf(board));\n colony1.splice(colony1.indexOf(player));\n col ony2.splice(colony2.indexOf(player1));*/\n player1.points = 0;\n player.points = 0;\n board = board.copyEmpty();\n stalledGames++;\n }\n }\n //results.push(resultsTMP.join());\n}", "function PlayOneGame(initialDeck)\n{\n\tGameLog(\"[G] This game has \"+ _config.game.players +\" players.\");\n\tGameLog(\"[G] Dealing...\");\n\t\n\tlet checkedInfiniteGame = false;\n\t\n\tlet deck = initialDeck.slice();\n\t\n\tlet players = Players(_config.game.players);\n\tlet pile = [];\n\t\n\tlet dealToPlayer = 0;\n\t\n\twhile(deck.length > 0)\n\t{\n\t\tplayers[dealToPlayer].hand.unshift(deck.shift());\n\t\t\n\t\tdealToPlayer = NextPlayer(players, dealToPlayer);\n\t}\n\t\n\tlet gamePlot = [];\n\tlet initialPlayerIds = [];\n\t\n\tfor(let i = 0, n = players.length; i < n; i++)\n\t{\n\t\tinitialPlayerIds.push(players[i].id);\n\t\t\n\t\tgamePlot[\"_\"+ players[i].id] = [];\n\t}\n\t\n\tgamePlot = GamePlot(gamePlot, players, initialPlayerIds);\n\t\n\tlet playerTurn = 0;\n\t\n\tlet taxesDemanded = 0;\n\tlet taxesPaid = 0;\n\t\n\tlet placeCount = 0;\n\t\n\tlet owed = -1;\n\t\n\twhile(MoreThanOnePlayerActive(players, owed))\n\t{\n\t\tlet nextCard = players[playerTurn].hand.shift();\n\t\t\n\t\tpile.unshift(nextCard);\n\t\tplaceCount++;\n\t\t\n\t\tif(!checkedInfiniteGame && placeCount >= _config.game.infiniteFlag)\n\t\t{\n\t\t\tWriteFile(\"POSSIBLE_INFINITE_GAME.txt\", JSON.stringify({deck: initialDeck}));\n\t\t\tconsole.log(\"POSSIBLE INFINITE GAME DETECTED!!! - SAVED DECK TO FILE\");\n\t\t\t\n\t\t\tcheckedInfiniteGame = true;\n\t\t}\n\t\t\n\t\tlet logLeader = ((taxesDemanded > 0) ? \"[T]\" : \"[P]\");\n\t\tlet logEnder = ((nextCard.DemandsTaxes()) ? \" This demands a tax of \"+ _taxation[nextCard.type] +\" cards from the next player.\" : \"\");\n\t\t\n\t\tGameLog(logLeader +\" Player \"+ players[playerTurn].id +\" places \"+ nextCard.type +\" on the pile. \"+ players[playerTurn].hand.length +\" cards left.\"+ logEnder);\n\t\t\n\t\tif(nextCard.DemandsTaxes())\n\t\t{\n\t\t\ttaxesDemanded = _taxation[nextCard.type];\n\t\t\ttaxesPaid = 0;\n\t\t\t\n\t\t\towed = playerTurn;\n\t\t\t\n\t\t\tfor(let i = 0; i < players.length; i++)\n\t\t\t{\n\t\t\t\tif(i != playerTurn && players[i].hand.length == 0 && i != owed)\n\t\t\t\t{\n\t\t\t\t\tGameLog(\"[L] Player \"+ players[i].id +\" is out of the game!\");\n\t\t\t\t\t\n\t\t\t\t\tplayers.splice(i, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tplayerTurn = NextPlayer(players, playerTurn);\n\t\t}\n\t\telse if(taxesDemanded > 0)\n\t\t{\n\t\t\ttaxesPaid++;\n\t\t\t\n\t\t\tif(taxesPaid == taxesDemanded)\n\t\t\t{\n\t\t\t\tlet grabber = PreviousPlayer(players, playerTurn);\n\t\t\t\t\n\t\t\t\tplayers[grabber].hand = players[grabber].hand.concat(pile);\n\t\t\t\t\n\t\t\t\tpile = [];\n\t\t\t\t\n\t\t\t\ttaxesPaid = 0;\n\t\t\t\ttaxesDemanded = 0;\n\t\t\t\t\n\t\t\t\tGameLog(\"[T] Player \"+ players[grabber].id +\" grabs the pile and adds it to the bottom of theirs. Now they have \"+ players[grabber].hand.length +\" cards.\");\n\t\t\t\t\n\t\t\t\towed = -1;\n\t\t\t\t\n\t\t\t\tplayerTurn = grabber;\n\t\t\t}\n\t\t\t\n\t\t\tlet playerPurged = false;\n\t\t\t\n\t\t\tfor(let i = 0; i < players.length; i++)\n\t\t\t{\n\t\t\t\tif(players[i].hand.length == 0 && i != owed)\n\t\t\t\t{\n\t\t\t\t\tGameLog(\"[L] Player \"+ players[i].id +\" is out of the game!\");\n\t\t\t\t\t\n\t\t\t\t\tplayers.splice(i, 1);\n\t\t\t\t\t\n\t\t\t\t\tplayerPurged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(playerPurged)\n\t\t\t{\n\t\t\t\tif(_config.game.players == 2)\n\t\t\t\t{\n\t\t\t\t\tgamePlot = GamePlot(gamePlot, players, initialPlayerIds);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayerTurn = NextPlayer(players, playerTurn);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(players[playerTurn].hand.length == 0)\n\t\t\t{\n\t\t\t\tGameLog(\"[L] Player \"+ players[playerTurn].id +\" is out of the game!\");\n\t\t\t\n\t\t\t\tplayers.splice(playerTurn, 1);\n\t\t\t}\n\t\t\t\n\t\t\tplayerTurn = NextPlayer(players, playerTurn);\n\t\t}\n\t\t\n\t\tgamePlot = GamePlot(gamePlot, players, initialPlayerIds);\n\t}\n\t\n\tfor(let i = 0, n = players.length; i < n; i++)\n\t{\n\t\tif(players[i].hand.length > 0)\n\t\t{\n\t\t\tGameLog(\"[G] Player \"+ players[i].id +\" wins!\");\n\t\t\tGameLog(placeCount +\" cards were placed during the game.\");\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tGamePlotToFile(gamePlot, initialPlayerIds);\n\t\n\treturn placeCount;\n}", "function nextPlayer() {\n if (currentPlayer == 2) {\n currentPlayer = 1;\n } else {\n currentPlayer++;\n }\n}", "function advancePlayerInTurn() {\r\n if (playerInTurn < players.length -1) {\r\n playerInTurn ++;\r\n }\r\n else {\r\n playerInTurn = 0;\r\n }\r\n}", "function play(newBoard, player){\n\n //count the function calls\n fc++;\n\n //find all available spots\n let availableSpots = emptySpaces(newBoard);\n\n //check for win/lose/draw and return value\n if (winning(newBoard, huPlayer)){\n return {score: -100};\n } else if (winning(newBoard, aiPlayer)){\n return {score: 100};\n } else if (availableSpots.length === 0){\n return {score: 0};\n }\n\n //now collect the scores from each spot to evaluate later\n let moves = [];\n\n //loop through available spots\n for(let i = 0; i < availableSpots.length; i++){\n //create an object for each spots\n let move = {};\n move.index = newBoard[availableSpots[i]];\n\n //set the empty spot to the current player\n newBoard[availableSpots[i]] = player;\n\n //collect teh score resulted from calling play function\n if (player === aiPlayer){\n let result = play(newBoard, huPlayer);\n move.score = result.score;\n } else {\n let result = play(newBoard, aiPlayer);\n move.score = result.score;\n }\n\n //reset the spot to empty\n newBoard[availableSpots[i]] = move.index;\n\n //push the object to the array\n moves.push(move);\n }\n //don't do this. logs 60,000 moves arrays\n //console.log(\"Moves: \", moves);\n\n var bestMove;\n //if it's ai turn, loop and choose move with highest score.\n if(player === aiPlayer){\n let bestScore = -10000;\n for(let i = 0; i < moves.length; i++){\n if(moves[i].score > bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n } else {\n //if it's human turn, loop and choose move with lowest score.\n var bestScore = 10000;\n for(let i = 0; i < moves.length; i++){\n if(moves[i].score < bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n\n //return the chosen move (object) from the moves array\n return moves[bestMove];\n}", "function thwartWin() {\n if (whoseTurn == 'playerTwo') {\n loop1:\n for (var x = 0; x < winningCombos.length; x++) {\n var playerOneScore = 0;\n loop2:\n for (var y = 0; y < winningCombos[x].length; y++) {\n //Assigns point for every spot taken by player1 in winning combo\n console.log(playerOneMoves);\n if (playerOneMoves.indexOf(winningCombos[x][y]) > -1) {\n playerOneScore++; \n }\n //If there are 2 in a row...\n if (playerOneScore == 2) {\n for (var z = 0; z < winningCombos[x].length; z++) {\n //Find the 3rd spot in that row that is empty, and take it\n if (playerOneMoves.indexOf(winningCombos[x][z]) == -1 && playerTwoMoves.indexOf(winningCombos[x][z]) == -1) {\n var emptySpot = winningCombos[x][z];\n placePiece(emptySpot);\n checkWin();\n whoseTurn = 'playerOne';\n return;\n }\n }\n \n }\n } \n }\n }\n}", "function gameAdvance(currCell,player)\n{\n origBoard[currCell]=player;\n document.getElementById(currCell).innerText = player;\n\n // checkif after the current move of player, has he won\n let gameStatus = checkWin(origBoard,player);\n if(gameStatus)\n {\n gameOver(gameStatus);\n return 1;\n }\n return 0;\n}", "function nextMove() {\n if (endGame(currentState) == false) {\n markBoard(currentState);\n currentState.whichPlayerPlayed = userWinValue;\n var num = computerMakingMove(currentState);\n document.getElementById(num).innerText = computer;\n markBoard(currentState);\n currentState.whichPlayerPlayed = compWinValue;\n }\n endGame(currentState);\n}", "function playerAILevel2(outX, outY, wonCells, playerTurn){\n\tvar outsideX = outX;\n\tvar outsideY = outY;\n\tvar opponentTurn;\n\tif(playerTurn == 1){\n\t\topponentTurn = 2;\n\t} else{\n\t\topponentTurn = 1;\n\t}\n\t\n\t//addLog(\"Won cells: \" + wonCells);\n\t \n\t/*--- Check to see if the inner game has been won ---*/\n\tvar wonCheck = false;\n\twhile(wonCheck == false){\n\t\t//addLog(\"Checking cell \" + outsideX + \",\" + outsideY);\n\t\t//If the selected game has already been won, choose a new one\n\t\tif (wonCells[outsideX][outsideY] != 0){\n\t\t\t//addLog(\"The cell was won by \" + wonCells[outsideX][outsideY]);\n\t\t\t//Select a random game to play in and check again\n\t\t\toutsideX = Math.floor(Math.random() * 3);\n\t\t\toutsideY = Math.floor(Math.random() * 3);\n\t\t\t//addLog(\"New cell to check is \" + outsideX + \",\" + outsideY);\n\t\t}\n\t\t//The selected game hasn't been won, continue to move selection\n\t\telse{\n\t\t\t//addLog(\"The following cell is valid \" + outsideX + \",\" + outsideY);\n\t\t\twonCheck = true;\n\t\t}\n\t}\n\t\n\t/*--- Evaluate possible moves ---*/\n\t\n\t//Create a value table for the game\n\t//This holds the point values of each space in the game\n\t//valTable: x by y\n\t/*\n\t\t x0 x1 x2\n\t\ty0 0.0 1.0 2.0\n\t\ty1 0.1 1.1 2.1\n\t\ty2 0.2 1.2 2.2\n\t*/\n\tvar valTable = [[0,0,0],\n\t\t\t\t\t[0,0,0],\n\t\t\t\t\t[0,0,0]];\n\t \n\t var checkVal; //Determines which square you are calculating for\n\t var spaceScore = 0; //Point value for the space being calculated\n\t\n\t//Check the value of possible moves in game x,y\n\tfor(var i = 0; i < 3; i++){ //Check columns (x)\n\t\tfor (var j = 0; j < 3; j++){ //Check rows (y)\n\t\t\tcheckVal = i + \".\" + j; //Which square is being checked\n\t\t\t//addLog(\"Calculating \" + checkVal);\n\t\t\t\n\t\t\t//If the space is taken, set the point value to 0\n\t\t\tif(selected[outsideX][outsideY][i][j] == opponentTurn || selected[outsideX][outsideY][i][j] == playerTurn){\n\t\t\t\tvalTable[i][j] = 0;\n\t\t\t\t//addLog(\"Coords (\" + i + \",\" + j + \") are already filled.\");\n\t\t\t}\n\t\t\t//Otherwise, calculate the value\n\t\t\telse{\n\t\t\t\tswitch(checkVal){\n\t\t\t\t\tcase \"0.0\": //left-top\n\t\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top, middle-bottom, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 1 && y == 2) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"0.1\": //left-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, right-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 2 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"0.2\": //left-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-bottom, middle-top, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 2) || (x == 1 && y == 0) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][1][2] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][1] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.0\": //middle-top\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-bottom, middle-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 2) || (x == 1 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][1][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.1\": //middle-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: middle-center\n\t\t\t\t\t\t\t\tif((x == 1 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middlecolumn\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.2\": //middle-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top, middle-bottom, right-top\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 1 && y == 2) || (x == 2 && y == 0)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][1] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.0\": //right-top\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, middle-bottom, right-top\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 1 && y == 2) || (x == 2 && y == 0)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][1][0] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][1][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][2][1] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][1][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][1][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.1\": //right-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top left-bottom, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 0 && y == 2) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][1][1] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][1][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.2\": //right-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, middle-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 1 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][0] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][1][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//addLog(\"Value table: \" + valTable);\n\t\n\t/*--- Select move from best options ---*/\n\t//Find best score\n\tvar bestOption = valTable[0][0]; //Current best option\n\tfor (var alpha = 0; alpha < 3; alpha++){\n\t\tfor (var beta = 0; beta < 3; beta++){\n\t\t\tif (bestOption < valTable[alpha][beta]){\n\t\t\t\tbestOption = valTable[alpha][beta];\n\t\t\t}\n\t\t}\n\t}\n\t//addLog(\"Best value = \" + bestOption);\n\t\n\t//Find the possible locations of the best score\n\tvar possibleOptions = []; //array holding the possible places to move on the inner board\n\tvar optionCounter = 0; //counter used to increment array position\n\tfor (var ares = 0; ares < 3; ares++){\n\t\tfor (var zeus = 0; zeus < 3; zeus++){\n\t\t\tif (bestOption == valTable[ares][zeus]){\n\t\t\t\tpossibleOptions[optionCounter] = ares;\n\t\t\t\toptionCounter++;\n\t\t\t\tpossibleOptions[optionCounter] = zeus;\n\t\t\t\toptionCounter++;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Randomly select one of the possible locations\n\tvar selectedOption = 0; //Randomly selected x position of best option\n\tvar bestOptionLocation = [0,0,0,0]; //Best option coordinates [outsideX, outsideY, innerX, innerY]\n\tvar optionString = \"\"; //Concatenated possible options for displaying as coordinate pairs\n\tfor(var test = 0; test < possibleOptions.length; test++){\n\t\toptionString = (optionString + \" (\" + possibleOptions[test] + \", \" + possibleOptions[test + 1] + \")\");\n\t\ttest++;\n\t}\n\t\n\t\n\t\n\t//loop through the possible options so the opponents next move can be analyzed\n\tfor(var next=0; next<possibleOptions.length;next++)\n\t{\n\tif(possibleOptions[next]==0 && possibleOptions[next+1])\n\t{\n\t\t/*--- Check to see if the inner game has been won ---*/\n\tvar wonCheck = false;\n\twhile(wonCheck == false){\n\t\t//addLog(\"Checking cell \" + outsideX + \",\" + outsideY);\n\t\t//If the selected game has already been won, choose a new one\n\t\tif (wonCells[outsideX][outsideY] != 0){\n\t\t\t//addLog(\"The cell was won by \" + wonCells[outsideX][outsideY]);\n\t\t\t//Select a random game to play in and check again\n\t\t\toutsideX = Math.floor(Math.random() * 3);\n\t\t\toutsideY = Math.floor(Math.random() * 3);\n\t\t\t//addLog(\"New cell to check is \" + outsideX + \",\" + outsideY);\n\t\t}\n\t\t//The selected game hasn't been won, continue to move selection\n\t\telse{\n\t\t\t//addLog(\"The following cell is valid \" + outsideX + \",\" + outsideY);\n\t\t\twonCheck = true;\n\t\t}\n\t}\n\t\n\t/*--- Evaluate possible moves ---*/\n\t\n\t//Create a value table for the game\n\t//This holds the point values of each space in the game\n\t//valTable: x by y\n\t/*\n\t\t x0 x1 x2\n\t\ty0 0.0 1.0 2.0\n\t\ty1 0.1 1.1 2.1\n\t\ty2 0.2 1.2 2.2\n\t*/\n\tvar valTable = [[0,0,0],\n\t\t\t\t\t[0,0,0],\n\t\t\t\t\t[0,0,0]];\n\t \n\t var checkVal; //Determines which square you are calculating for\n\t var spaceScore = 0; //Point value for the space being calculated\n\t\n\t//Check the value of possible moves in game x,y\n\tfor(var i = 0; i < 3; i++){ //Check columns (x)\n\t\tfor (var j = 0; j < 3; j++){ //Check rows (y)\n\t\t\tcheckVal = i + \".\" + j; //Which square is being checked\n\t\t\t//addLog(\"Calculating \" + checkVal);\n\t\t\t\n\t\t\t//If the space is taken, set the point value to 0\n\t\t\tif(selected[0][0][i][j] == opponentTurn || selected[0][0][i][j] == playerTurn){\n\t\t\t\tvalTable[i][j] = 0;\n\t\t\t\t//addLog(\"Coords (\" + i + \",\" + j + \") are already filled.\");\n\t\t\t}\n\t\t\t//Otherwise, calculate the value\n\t\t\telse{\n\t\t\t\tswitch(checkVal){\n\t\t\t\t\tcase \"0.0\": //left-top\n\t\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top, middle-bottom, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 1 && y == 2) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[0][0][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[0][0][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[0][0][1][0] == playerTurn && selected[0][0][2][0] == opponentTurn) || (selected[0][0][1][0] == opponentTurn && selected[0][0][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[0][0][1][1] == playerTurn && selected[0][0][2][2] == opponentTurn) || (selected[0][0][1][1] == opponentTurn && selected[0][0][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[0][0][0][1] == playerTurn && selected[0][0][0][2] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"0.1\": //left-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, right-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 2 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"0.2\": //left-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating left-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-bottom, middle-top, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 2) || (x == 1 && y == 0) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][1][2] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][1] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][0][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][2] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Left column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][0][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.0\": //middle-top\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-bottom, middle-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 2) || (x == 1 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][1][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.1\": //middle-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: middle-center\n\t\t\t\t\t\t\t\tif((x == 1 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][0] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middlecolumn\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Diagonals\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"1.2\": //middle-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating middle-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top, middle-bottom, right-top\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 1 && y == 2) || (x == 2 && y == 0)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][1] == opponentTurn) || (selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == opponentTurn && selected[outsideX][outsideY][1][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Middle column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][0] == playerTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.0\": //right-top\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-top.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, middle-bottom, right-top\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 1 && y == 2) || (x == 2 && y == 0)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][1][0] == opponentTurn) || (selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][1][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][2] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][2][1] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == opponentTurn && selected[outsideX][outsideY][1][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Top row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][0] == playerTurn && selected[outsideX][outsideY][1][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][1] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.1\": //right-center\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-center.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-top left-bottom, right-center\n\t\t\t\t\t\t\t\tif((x == 0 && y == 0) || (x == 0 && y == 2) || (x == 2 && y == 1)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][1][1] == opponentTurn) || (selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][2] == opponentTurn) || (selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == opponentTurn && selected[outsideX][outsideY][1][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Center row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][1] == playerTurn && selected[outsideX][outsideY][1][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2.2\": //right-bottom\n\t\t\t\t\t//addLog(\"checkVal = \" + checkVal + \" | Calculating right-bottom.\");\n\t\t\t\t\t\tspaceScore = 1; //Reset score\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--- Check for single space moves ---*/\n\t\t\t\t\t\tfor (var x = 0; x < 3; x++){ //Check columns (x)\n\t\t\t\t\t\t\tfor (var y = 0; y < 3; y++){ //Check rows (y)\n\t\t\t\t\t\t\t//addLog(\"Checking coords(\" + x + \".\" + y + \")\");\n\t\t\t\t\t\t\t\t//Skip spaces that aren't in line with the one being evaluated, and skip the space being evaluated\n\t\t\t\t\t\t\t\t//Skip: left-center, middle-top, right-bottom\n\t\t\t\t\t\t\t\tif((x == 0 && y == 1) || (x == 1 && y == 0) || (x == 2 && y == 2)){\n\t\t\t\t\t\t\t\t\t//Skip\n\t\t\t\t\t\t\t\t\t//addLog(\"This space offers no additional value. Skip.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Add points for blocking an opponent, or lining up a move for self\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == opponentTurn){ //Block\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Blocking an opponent's move: +1. Score = \" + spaceScore);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(selected[outsideX][outsideY][x][y] == playerTurn){ //Set-up\n\t\t\t\t\t\t\t\t\t\tspaceScore++;\n\t\t\t\t\t\t\t\t\t\t//addLog(\"Setting up a move for yourself: +1. Score = \" + spaceScore);\n\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for blocked moves (-1 point)---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][1][2] == opponentTurn) || (selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][0] == opponentTurn) || (selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][1] == opponentTurn) || (selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (opponent) (Second highest priority = 75 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == opponentTurn && selected[outsideX][outsideY][1][2] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == opponentTurn && selected[outsideX][outsideY][0][0] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == opponentTurn && selected[outsideX][outsideY][2][1] == opponentTurn)){\n\t\t\t\t\t\t\tspaceScore = 75;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*--- Check for winning moves (self) (Highest priority = 100 points) ---*/\n\t\t\t\t\t\t//Bottom row\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][0][2] == playerTurn && selected[outsideX][outsideY][1][2] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//diagonal\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][1][1] == playerTurn && selected[outsideX][outsideY][0][0] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Right column\n\t\t\t\t\t\tif ((selected[outsideX][outsideY][2][0] == playerTurn && selected[outsideX][outsideY][2][1] == playerTurn)){\n\t\t\t\t\t\t\tspaceScore = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add the score to the table\n\t\t\t\t\t\tvalTable[i][j] = spaceScore;\n\t\t\t\t\t\t//addLog(checkVal + \" score = \" + valTable[i][j]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//addLog(\"Value table: \" + valTable);\n\t\n\t/*--- Select move from best options ---*/\n\t//Find best score\n\tvar bestOption2 = valTable[0][0]; //Current best option\n\tfor (var alpha = 0; alpha < 3; alpha++){\n\t\tfor (var beta = 0; beta < 3; beta++){\n\t\t\tif (bestOption2 < valTable[alpha][beta]){\n\t\t\t\tbestOption2 = valTable[alpha][beta];\n\t\t\t}\n\t\t}\n\t}\n\t// take the best score and subtract\n\tvar totScore;\n\ttotScore=bestOption+bestOption2;\n\taddLog(\"Best value = \" + bestOption2);\n\t\n\t}\n\t}\n if(possibleOptions[next]==0&&possibleOptions[next+1]==1)\n {\n\t \n }\n if(possibleOptions[next]==0&&possibleOptions[next+1]==2)\n {\n\t \n }if(possibleOptions[next]==1&&possibleOptions[next+1]==0)\n {\n\t \n }if(possibleOptions[next]==1&&possibleOptions[next+1]==1)\n {\n\t \n }if(possibleOptions[next]==1&&possibleOptions[next+1]==2)\n {\n\t \n }\n if(possibleOptions[next]==2&&possibleOptions[next+1]==0)\n {\n\t \n }\n if(possibleOptions[next]==2&&possibleOptions[next+1]==1)\n {\n\t \n }if(possibleOptions[next]==2&&possibleOptions[next+1]==2)\n {\n\t \n }\n\taddLog(\"Possible options:\");\n\taddLog(optionString);\n\tselectedOption = Math.floor(Math.random() * (possibleOptions.length / 2)); //Randomly select x position of best option\n\t//addLog(\"Number of options = \" + possibleOptions.length / 2);\n\t//addLog(\"Selected option = \" + selectedOption);\n\tbestOptionLocation[0] = outsideX;\n\tbestOptionLocation[1] = outsideY;\n\tbestOptionLocation[2] = possibleOptions[selectedOption * 2];\n\tbestOptionLocation[3] = possibleOptions[(selectedOption * 2) + 1];\n\tif (playerTurn == 1){\n\t\taddLog(\"Red's best move is space (\" + bestOptionLocation[2] + \",\" + bestOptionLocation[3] + \") in game (\" + bestOptionLocation[0] + \",\" + bestOptionLocation[1] + \")\");\n\t} else{\n\t\taddLog(\"Blue's best move is space (\" + bestOptionLocation[2] + \",\" + bestOptionLocation[3] + \") in game (\" + bestOptionLocation[0] + \",\" + bestOptionLocation[1] + \")\");\n\t}\n\treturn bestOptionLocation; //Return the best option's location\n }", "function generate_player_list() {\n\tvar start_index = 0\n\tvar last_player = db.collection('players').find({}).sort({_id : -1}).limit(1).toArray();\n\tlast_player.then((last) => {\n\t\tstart_index = 1;\n\t\tif (last && last[0]._id) {\n\t\t\tstart_index = parseInt(last[0]._id);\n\t\t\tconsole.log(\"Restarting at: \", start_index)\n\t\t}\n\t\tvar consecutive_missing_accounts = 0;\n\t\tnew Promise (function(resolve) {\n\t\t\tfunction loop(i, once) {\n\t\t\t\tif (consecutive_missing_accounts > 2000000) {\n\t\t\t\t\tfor (let boundary of boundaries) {\n\t\t\t\t\t\tif (boundary > i) {\n\t\t\t\t\t\t\ti = boundary;\n\t\t\t\t\t\t\tconsecutive_missing_accounts = 0;\n\t\t\t\t\t\t\tconsole.log(\"Boundary reached, jumping to: \", i)\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}\n\t\t\t\tif (i >= 4000000000) {\n\t\t\t\t\tresolve();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar a100_players = [];\n\t\t\t\tfor (var j = 0; j < 100; j++) {\n\t\t\t\t\ta100_players.push(i++);\n\t\t\t\t}\n\t\t\t\tget_wg_data(\"/account/info/?extra=statistics.random&\", [\"statistics.\" + [config.wg.src] + \".battles\"], a100_players, function(data, e) {\n\t\t\t\t\tif (e) {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\tsetTimeout(() => { loop(i-100, true); }, 500); //try this batch again\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (let key of Object.keys(data)) {\n\t\t\t\t\t\t\tif (data[key]) {\n\t\t\t\t\t\t\t\tconsecutive_missing_accounts = 0;\n\t\t\t\t\t\t\t\tif (data[key].statistics[config.wg.src].battles >= config.wg.min_battles_playerlist) {\n\t\t\t\t\t\t\t\t\tdb.collection('players').updateOne({_id:parseInt(key)}, {$set: {battles:parseInt(data[key].statistics[config.wg.src].battles)}}, {upsert: true});\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\tconsecutive_missing_accounts++;\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\tif (!once) {\n\t\t\t\t\tsetTimeout(() => { loop(i);\t}, 100);\n\t\t\t\t}\n\t\t\t}\n\t\t\tloop(start_index);\n\t\t}).then(() => {\n\t\t\tconsole.log(\"Done building player list\")\n\t\t})\n\t})\n}", "function playGame() {\n if (options.indexOf(player.choice) > -1 && options.indexOf(opponent.choice) > -1) {\n if (player.choice === \"rock\" && opponent.choice === \"scissors\") {\n console.log(\"You Win\");\n $('#playerImage').prepend('<img id=\"rock\" src=\"./assets/images/rock.png\" />');\n $('#opponentImage').prepend('<img id=\"scissors\" src=\"./assets/images/scissors.png\" />');\n $('#winLose').text(\"Winner\");\n player.wins++;\n\n } else if (player.choice === \"paper\" && opponent.choice === \"rock\") {\n console.log(\"You Win\");\n $('#playerImage').prepend('<img id=\"paper\" src=\"./assets/images/paper.png\" />');\n $('#opponentImage').prepend('<img id=\"rock\" src=\"./assets/images/rock.png\" />');\n $('#winLose').text(\"Winner\");\n player.wins++;\n\n } else if (player.choice === \"scissors\" && opponent.choice === \"paper\") {\n console.log(\"You Win\");\n $('#playerImage').prepend('<img id=\"scissors\" src=\"./assets/images/scissors.png\" />');\n $('#opponentImage').prepend('<img id=\"paper\" src=\"./assets/images/paper.png\" />');\n $('#winLose').text(\"Winner\");\n player.wins++;\n\n } else if (player.choice === opponent.choice) {\n console.log(\"It's a Tie\");\n $('#winLose').text(\"TIE!\");\n } else {\n\n console.log(\"Opponent Wins\")\n $('#winLose').text(\"LOSER!!\");\n player.losses++;\n\n }\n\n con.update({\n choice: \"\",\n wins: player.wins,\n losses: player.losses\n\n });\n\n $(\"#playerScore\").text(player.wins)\n $(\"#opponentScore\").text(player.losses)\n setTimeout(function () {\n $('#playerImage').html('');\n $('#opponentImage').html('');\n $('#winLose').text(\"\");\n $(\"#player-button\").attr(\"disabled\", false);\n }, 3000);\n\n\n }\n\n\n }", "function opponent(player) {\n if(player === WHITE) {\n return BLACK;\n } else if (player === BLACK) {\n return WHITE;\n } else {\n throw 'invalid player in opp';\n }\n }", "function nextGame(){\n switch (actualGame){\n case game1:\n actualGame = game2;\n break;\n case game2:\n actualGame = game3;\n break;\n case game3:\n actualGame = game1;\n break;\n }\n return actualGame;\n}", "function depthFirstAssigner() {\n\t\t// Save state in case we need to backtrack (need to clone object)\n\t\t// Declared locally since each recursion will have one of these\n\t\tvar ssPromisedPrefs = JSON.parse(JSON.stringify(promisedPrefs));\n\t\tvar ssAssignmentObject = JSON.parse(JSON.stringify(assignmentObject));\n\t\tvar ssUserArr = userArr.slice(0);\n\n\t\t// If we've assigned everybody, we're done!\n\t\tif(Object.keys(promisedPrefs).length === 0 ) {\n\t\t\tconsole.log(\"Found a local solution:\")\n\t\t\tconsole.log(assignmentObject);\n\t\t\treturn true;\n\t\t}\n\n\t\t// If somebody who has been promised a spot has no remaining options, we've failed!!!\n\t\tif(promisedPrefs[userArr[0]][1].length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// console.log(\"_______________________________________\")\n\t\t// console.log(\"Testing \" + userArr[0] + \". Promised Prefs: \" + JSON.stringify(promisedPrefs));\n\n\t\t\n\t\tfor (var k = 0; k<ssPromisedPrefs[ssUserArr[0]][1].length ; k++) {\n\t\t\t\n\t\t\tvar chosenAppointment = ssPromisedPrefs[ssUserArr[0]][1][k];\n\n\t\t\tconsole.log(\"Trying \" + ssUserArr[0] + \" in \" + chosenAppointment);\n\n\t\t\tif(chosenAppointment) {\n\n\t\t\t\t//Choose first option, assign it, do cleanup as before\n\t\t\t\t\n\t\t\t\tassignmentObject[chosenAppointment] = userArr[0];\n\n\t\t\t\t//Removes winner from preference object (and userArr)\n\t\t\t\tdelete promisedPrefs[userArr[0]];\n\t\t\t\t//Nukes all references to that appointment\n\t\t\t\tpromisedPrefs = preferencePopper(promisedPrefs, chosenAppointment); \n\t\t\t\t//Cleans user array to remove removed users\n\t\t\t\tuserArr = userCleaner(userArr,promisedPrefs);\n\t\t\t\t//Removes appointment from list\n\t\t\t\tappointmentArray = appointmentPopper(appointmentArray, chosenAppointment);\n\n\t\t\t\tif(depthFirstAssigner()) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// Resets objects (important for loops above)\n\t\t\t\tpromisedPrefs = JSON.parse(JSON.stringify(ssPromisedPrefs));\n\t\t\t\tassignmentObject = JSON.parse(JSON.stringify(ssAssignmentObject));\n\t\t\t\tuserArr = ssUserArr.slice(0);\n\t\t\t}\n\t\t}\n\n\t\tconsole.log(\"Rewinding from \" + userArr[0]);\n\t\t//console.log(promisedPrefs);\n\t\treturn false;\n\t}", "nextPlayer(){\r\n if (this.turn === 3){\r\n this.turn = 0;\r\n }\r\n else {\r\n this.turn += 1;\r\n }\r\n\r\n if(this.initialPlacementPhase === true){\r\n this.initialPlacementOverCheck();\r\n }\r\n\r\n this.currentPlayer = this.players.array[this.turn];\r\n this.renderPlayerImg();\r\n this.updateTurnOrder();\r\n\r\n if (this.territorySelectedInstance){\r\n this.territorySelectedInstance.tileElement.classList.remove(\"selected\");\r\n this.territorySelectedInstance = null;\r\n this.territorySelected = false;\r\n }\r\n if (this.initialPlacementPhase === false && this.claimTerritoryPhase === false && !this.button){\r\n this.addEndTurnButton();\r\n this.button.innerHTML = \"Place Units\";\r\n }\r\n if (this.placementPhase === true){\r\n this.turnPlaceable = this.currentPlayer.bonusUnits();\r\n this.turnPlaceableEvaluated = true;\r\n }\r\n\r\n this.updateInfoDisplay();\r\n }", "function setDuoer(match, row, players) {\n // Note that the way that this checks if we are duoing checks by seeing if we have duo'd with this person before\n // So you WILL have to manually enter it the first time you duo with a player\n // Also note that if you queue into a game with multiple players on your team that you have duo'd with before\n // This may incorrectly assign the duoing player\n // Hopefully this affects such a small percentage of players that it won't matter\n \n var s = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = s.getSheetByName('Data');\n var index = getSheetTranslationIndex('Duoer') - 1; \n var values = s.getDataRange().getValues();\n for(i = values.length - 1; i > 0; i--) { // go in reverse order since we're most likely to keep duoing with people\n if(players.indexOf(values[i][index]) != -1) {\n setCell('Duoer', row, values[i][index]);\n var pobj = getParticipantObjByName(match, values[i][index]);\n var role = getRoleFromParticipantObj(pobj);\n setCell('Duo Role', row, role); \n break;\n }\n } \n}", "function game() {\n let playAgain = true;\n while (playAgain) {\n let playerScore = 0;\n let aiScore = 0;\n let noWinner = true;\n\n console.log('WELCOME TO ROCK, PAPER, SCISSOR agaist a AI');\n while (noWinner) {\n console.log(`Scoreboard: P-${playerScore} vs. AI-${aiScore}`);\n console.log('Type Rock, Paper, or Scissors: ');\n let playerChoice = prompt();\n let aiChoice = computerPlay();\n console.log(`P-${playerChoice} vs. AI-${aiChoice}`);\n let results = playRound(playerChoice, aiChoice);\n if (results == 1) {\n console.log('Player 1 has won, congrats');\n playerScore++;\n }\n\n if (results == 2) {\n console.log('AI has won, should of choosen better');\n aiScore++;\n }\n\n if (results == 3) {\n console.log('Round was a tie, do over');\n }\n\n if (playerScore == aiScore + 2 || playerScore == aiScore - 2) {\n noWinner = false;\n }\n }\n\n if (playerScore == aiScore + 2) {\n console.log('You have beaten the ai \\n YOU ARE LEGENDARY');\n } else {\n console.log('You lost to the ai, wow');\n }\n\n console.log('try again? 1 = YES, 2 = NO');\n playerChoice = prompt();\n if (playerChoice != 1) {\n console.log('GOODBYE');\n playAgain = false;\n }\n }\n}", "function CheckWinner(){\n // player X\n // 00 10 20\n if(board[0][0] === players[0] && board[1][0] === players[0] && board[2][0] === players[0]){\n console.log(players[0] + ' WIN !!!')\n createP('X WIN !!')\n game = 'end'\n noLoop()\n }\n // 01 11 21\n else if(board[0][1] === players[0] && board[1][1] === players[0] && board[2][1] === players[0]){\n console.log(players[0] + ' WIN !!!')\n game = 'end'\n createP('X WIN !!')\n noLoop()\n }\n // 02 12 22\n else if(board[0][2] === players[0] && board[1][2] === players[0] && board[2][2] === players[0]){\n console.log(players[0] + ' WIN !!!')\n game = 'end'\n winner = players[0]\n createP('X WIN !!')\n noLoop()\n }\n // 00 01 02\n else if(board[0][0] === players[0] && board[0][1] === players[0] && board[0][2] === players[0]){\n console.log(players[0] + ' WIN !!!')\n createP(player[0],' WIN !!')\n game = 'end'\n winner = players[0]\n createP('X WIN !!')\n noLoop()\n }\n // 10 11 12\n else if(board[1][0] === players[0] && board[1][1] === players[0] && board[1][2] === players[0]){\n console.log(players[0] + ' WIN !!!')\n game = 'end'\n winner = players[0]\n createP('X WIN !!')\n noLoop()\n }\n // 20 21 22\n else if(board[2][0] === players[0] && board[2][1] === players[0] && board[2][2] === players[0]){\n console.log(players[0] + ' WIN !!!')\n game = 'end'\n winner = players[0]\n createP('X WIN !!')\n noLoop()\n }\n // 00 11 22\n else if(board[0][0] === players[0] && board[1][1] === players[0] && board[2][2] === players[0]){\n console.log(players[0] + ' WIN !!!')\n game = 'end'\n winner = players[0]\n createP('X WIN !!')\n noLoop()\n }\n // 20 11 02\n else if(board[2][0] === players[0] && board[1][1] === players[0] && board[0][2] === players[0]){\n console.log(players[0] + ' WIN !!!')\n game = 'end'\n winner = players[0]\n createP('X WIN !!')\n noLoop()\n }\n\n // player O\n // 00 10 20\n if(board[0][0] === players[1] && board[1][0] === players[1] && board[2][0] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 01 11 21\n else if(board[0][1] === players[1] && board[1][1] === players[1] && board[2][1] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 02 12 22\n else if(board[0][2] === players[1] && board[1][2] === players[1] && board[2][2] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 00 01 02\n else if(board[0][0] === players[1] && board[0][1] === players[1] && board[0][2] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 10 11 12\n else if(board[1][0] === players[1] && board[1][1] === players[1] && board[1][2] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 20 21 22\n else if(board[2][0] === players[1] && board[2][1] === players[1] && board[2][2] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 00 11 22\n else if(board[0][0] === players[1] && board[1][1] === players[1] && board[2][2] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n // 20 11 02\n else if(board[2][0] === players[1] && board[1][1] === players[1] && board[0][2] === players[1]){\n console.log(players[1] + ' WIN !!!')\n game = 'end'\n winner = players[1]\n createP('O WIN !!')\n noLoop()\n }\n else if(longMatch === 9 && winner === null){\n console.log('DRAW !!!!')\n game = 'end'\n createP('DRAW !!')\n noLoop()\n }\n}", "function turnByTurn() {\n function CurrentPlayer(){\n if (currentPlayer < playersArray.length){\n currentPlayer ++;\n }\n else {\n currentPlayer = 0;\n }\n }\n function EndGame(){\n var stop = false;\n if (currentPlayer.health <= 0){\n stop = true;\n }\n while (!stop){\n stop = Move();\n if (!stop){\n CurrentPlayer();\n }\n else {\n alert(\"Bravo, \" + currentEnemy.name + \" gagne la partie !\")\n }\n }\n }\n function CurrentEnemy(){\n if (currentPlayer=0){\n currentEnemy=1;\n }\n if (currentPlayer=1){\n currentEnemy=0;\n }\n }\n}", "function onNewPlayer(data)\n{\n playerList = data;\n\n console.log(data[0].id);\n \n for (i = 0; i < playerList.length; i++)\n {\n var existingPlayer = new Player(playerList[i].id, playerList[i].username, playerList[i].chips, playerList[i].index);\n if (existingPlayer.getUsername() != \"INVALID_USER\")\n {\n if (existingPlayer.getUsername() == currentPlayer.getUsername())\n {\n currentPlayer = existingPlayer;\n playerAmount(currentPlayer.getUsername(), currentPlayer.getChips());\n console.log(\"Found the current player. His username is \" + currentPlayer.getUsername() + \" and his tableIndex is \" + currentPlayer.getTableIndex());\n }\n currentPlayers[existingPlayer.getTableIndex()] = existingPlayer;\n }\n }\n\n console.log(currentPlayers);\n\n var localIndex;\n \n localIndex = currentPlayer.getTableIndex();\n console.log(\"The player tableIndex is: \" + currentPlayer.getTableIndex());\n var nextPlayerIndex;\n var nextPlayerIterator = 0;\n\n for (i = 0; i< maxPlayers - 1; i++)\n {\n\t// Increase the Iterator by one to indicate the next Player\n nextPlayerIterator++;\n\t// modulo with the current length of players\n nextPlayerIndex = (localIndex + nextPlayerIterator) % currentPlayers.length;\n\tconsole.log(\"The nextPlayerIndex is: \" + nextPlayerIndex);\n //console.log(currentPlayers)\n //console.log(currentPlayers[nextPlayerIndex].getUsername() != \"INVALID_USER\");\n if (currentPlayers[nextPlayerIndex].getUsername() != \"INVALID_USER\")\n {\n console.log(\"got thru\" + nextPlayerIndex + \" fdsfds\" + i);\n drawPlayerAt(nextPlayerIndex, i);\n }\n }\n \n numPlayers++;\n}", "function pairingTwoSideScoreBoard_Top_Bot(RoundName){\n var remainingPairings=TEAM_NUMBER;\n var currentRow=0;\n var scoreBoardSheet = ss.getSheetByName(SHEET_SCOREBOARD);\n var range = scoreBoardSheet.getRange(4, 1, TEAM_NUMBER,6);\n var dataGrid = range.getValues();//Data sorted\n var bracketSize;\n var rand;\n var properOpponent;\n var govIndex=0;\n var newGov = [];\n var newOpp = [];\n var itr=TEAM_NUMBER*40;\n var values;\n while(remainingPairings>0){\n bracketSize=obtainBracketSize(dataGrid,currentRow);\n values=scoreBoardSheet.getRange(currentRow+4, 2, bracketSize).getValues();\n var internalBracketProgression=0;\n var teamname_top,teamname_bottom;\n while(values.length>0){\n teamname_top=values[0];\n teamname_bottom=values[values.length/2];\n newGov.push(teamname_top);\n newOpp.push(teamname_bottom);\n values.splice(values.indexOf(teamname_top),1);\n values.splice(values.indexOf(teamname_bottom),1);\n //internalBracketProgression++;\n }\n currentRow=currentRow+bracketSize;\n remainingPairings=remainingPairings-bracketSize; \n }\n control2Sides(dataGrid,newGov,newOpp);\n var pairingNumber=TEAM_NUMBER/SIDES_PER_ROUND; \n var randomised_order=createArray(pairingNumber,2);\n for(var i = 0;i<pairingNumber;i++){\n randomised_order[i][0]=String(newGov[i]);\n randomised_order[i][1]=String(newOpp[i]);\n }\n shuffleArray(randomised_order);//Randomise for display in random order for pairings to prevent rankings positions\n ss.getSheetByName(RoundName).getRange(3, 2,randomised_order.length,2).setValues(randomised_order);\n \n \n}", "function mainGame(ele){\n //if the game has been won this prevents additional clicks on the board\n if(gameState == \"over\"){\n //asks if you'd like to start a new game or not\n if(confirm(\"Game Over:\\nWould you like to start a new game?\")){\n startGame(); //if yes starts a new game\n return;\n }else{\n return; //if no exits function and nothing happens\n }\n }\n \n //if the element already has a 'X' or an 'O' exit the function and do nothing\n if(ele.innerHTML == 'X' || ele.innerHTML == 'O'){\n return; // exits the function\n }\n \n //whos turn equals 'X' or 'O' so it is used to add an 'X' or an 'O' to the board depending whos turn it is\n ele.innerHTML = whosTurn;\n \n //used to update the game board array (boardArray) see function for more detail\n updateArray(ele);\n //increments the moves variable to keep track of the number of moves taken this game\n moves++;\n \n //calls the didWin() function to determine if a win condition exists\n var winner = didWin(whosTurn); //check for a winner and store in winner variable\n if(winner){ //if a winner exists do the following..\n gameState = \"over\";\n if(winner == \"tie\"){\n updateScore('t');\n setTimeout(function(){alert(\"It is a tie!\")}, 100); //if its a tie updates the score for ties\n return;\n }\n gameWon(winner);\n updateScore(whosTurn); //updates the score based on who one\n setTimeout(function(){alert(whosTurn + \"'s WIN!\")}, 100); //do stuff if someone wins\n return;\n }\n \n //calls the switchPlayer() function to alternate between 'x' or 'o'\n switchPlayer();\n}", "function nextTurn() {\n if (currentPlayer == player1) {\n currentPlayer = player2;\n } else {\n currentPlayer = player1;\n }\n}", "function Player_Versus_Computer(id_2){\r\n //show/hide correct heading for player versus computer\r\n var mode2_COMPUTER = document.getElementById('game_PVP');\r\n var mode1_COMPUTER = document.getElementById('game_PVC');\r\n if(mode1_COMPUTER.style.display === \"none\"){\r\n mode2_COMPUTER .style.display = \"none\";\r\n mode1_COMPUTER.style.display = \"block\";\r\n mode1_COMPUTER.innerText = \"Game Mode: Player 1 Versus Computer\";\r\n mode1_COMPUTER.style=\"margin-left: auto; margin-right: auto\";\r\n }\r\n //show/hide correct table for player versus computer\r\n var showTable_mode1_COMP = document.getElementById('table1');\r\n var showTable_mode2_COMP = document.getElementById('table2');\r\n if(showTable_mode2_COMP.style.display === \"none\"){\r\n showTable_mode1_COMP.style.display = \"none\";\r\n showTable_mode2_COMP.style.display = \"block\";\r\n showTable_mode2_COMP.style=\"margin-left: auto; margin-right: auto\";\r\n }\r\n\r\n var pvc_id = document.getElementById(id_2); //get id_2 location on board\r\n\r\n // Use math.random function to decide which player goes first\r\n if(first_move_mode2 === true){\r\n if(rand_int_mode_2 === 1) { //X goesfirst\r\n first_place_mode_2 = \"X\";\r\n second_place_mode2 = \"O\";\r\n }\r\n else {\r\n first_place_mode_2 = \"O\"; //O goes first\r\n second_place_mode2 = \"X\";\r\n next_move = checkForOpenSpaces(); //find all open spaces\r\n pvc_id = document.getElementById(next_move); //set next placement id\r\n }\r\n pvc_id.innerText = first_place_mode_2; //insert next placement id\r\n first_move_mode2 = false; //set first turn to false\r\n counter_mode2++;\r\n if(first_place_mode_2 == \"O\"){\r\n checkPlayerTurn_MODE2(\"O\");\r\n }\r\n }\r\n else if (flag != true){ //if no one has won the game\r\n if(first_place_mode_2 == \"O\"){ // computer goes first, therefore odd turns\r\n if(counter_mode2%2 == 0){ // computer goes on even number turns\r\n next_move = checkForOpenSpaces();\r\n pvc_id = document.getElementById(next_move);\r\n pvc_id.innerText = \"O\";\r\n flag = checkForWinner_MODE2(first_place_mode_2);\r\n if(flag === false){\r\n checkPlayerTurn_MODE2(\"O\");\r\n }\r\n }\r\n else{\r\n if(pvc_id.innerText.trim() == ''){ // player goes on odd number turns\r\n pvc_id.innerText = \"X\";\r\n flag = checkForWinner_MODE2(second_place_mode2);\r\n }\r\n }\r\n }\r\n else if (first_place_mode_2 == \"X\") { // player goes first, therefore odd turns\r\n if(counter_mode2%2 == 0){ // player goes on even number turns\r\n if(pvc_id.innerText.trim() == ''){\r\n pvc_id.innerText = \"X\";\r\n flag = checkForWinner_MODE2(first_place_mode_2);\r\n }\r\n }\r\n else{\r\n next_move = checkForOpenSpaces();\r\n pvc_id = document.getElementById(next_move);\r\n pvc_id.innerText = \"O\";\r\n flag = checkForWinner_MODE2(first_place_mode_2);\r\n if(flag === false){\r\n checkPlayerTurn_MODE2(\"O\");\r\n }\r\n }\r\n }\r\n counter_mode2++;\r\n }\r\n game_count++;\r\n if(flag != true){ //if no winner, recursively call function for computers turn\r\n if(pvc_id.innerText.trim() == \"X\"){\r\n Player_Versus_Computer(id_2);\r\n }\r\n }\r\n if(flag === true){ //if winner is found, stop timer and display game over\r\n setTimer(true);\r\n GAME_OVER_MODE2();\r\n }\r\n}", "function pairingZeroFourSide(RoundName){\n var scoreBoardSheet = ss.getSheetByName(SHEET_SCOREBOARD);\n var range = scoreBoardSheet.getRange(4, 2, TEAM_NUMBER);\n var values = range.getValues();\n shuffleArray(values);\n var rand;\n var rand2;\n var rand3;\n var rand4;\n var teamname_rand;\n var teamname_rand2;\n var teamname_rand3;\n var teamname_rand4;\n var OpeGov = [];\n var CloGov = [];\n var OpeOpp = [];\n var CloOpp = [];\n var itr=TEAM_NUMBER*80;\n var RepresentativeArray=obtainAffiliationNumbers();\n var non_affiliated_rounds=nonAffiliatedMatches(RepresentativeArray,TEAM_NUMBER);\n if(LIMIT_INTER_AFF_ROUNDS){\n rand= values.indexOf(findTeamRepresented(RepresentativeArray,values));\n while(values.length>Number(non_affiliated_rounds*4)){\n var random = Math.ceil(Math.random()*4 );//To allow most represented to be opposition and gov\n //rand= randomIndexTeam(values.length);\n rand2= randomIndexTeam(values.length);\n rand3= randomIndexTeam(values.length);\n rand4= randomIndexTeam(values.length);\n if(rand!=rand2&&\n rand!=rand3&&\n rand!=rand4&&\n rand2!=rand3&&\n rand3!=rand4&&\n rand2!=rand4&&\n obtainAffiliationDebater(values[rand])!=obtainAffiliationDebater(values[rand2])&&\n obtainAffiliationDebater(values[rand])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(values[rand])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand3])&&\n obtainAffiliationDebater(values[rand3])!=obtainAffiliationDebater(values[rand4])&&\n obtainAffiliationDebater(values[rand2])!=obtainAffiliationDebater(values[rand4])\n ){\n switch(random) {\n case 1 :\n OpeGov.push(values[rand]);\n CloGov.push(values[rand2]);\n OpeOpp.push(values[rand3]);\n CloOpp.push(values[rand4]);\n break;\n case 2 :\n OpeGov.push(values[rand2]);\n CloGov.push(values[rand]);\n OpeOpp.push(values[rand3]);\n CloOpp.push(values[rand4]);\n break;\n case 3 :\n OpeGov.push(values[rand2]);\n CloGov.push(values[rand3]);\n OpeOpp.push(values[rand]);\n CloOpp.push(values[rand4]);\n break;\n case 4 :\n OpeGov.push(values[rand2]);\n CloGov.push(values[rand3]);\n OpeOpp.push(values[rand4]);\n CloOpp.push(values[rand]);\n break;\n default:\n throw \"Invalid state switch random pairingZero4side\"; \n break;\n }\n teamname_rand=values[rand];\n teamname_rand2=values[rand2];\n teamname_rand3=values[rand3];\n teamname_rand4=values[rand4];\n updateRepresented(RepresentativeArray,values[rand2]);\n updateRepresented(RepresentativeArray,values[rand3]);\n updateRepresented(RepresentativeArray,values[rand4]);\n rand= values.indexOf(findTeamRepresented(RepresentativeArray,values));// rand reassigned when all values found\n values.splice(values.indexOf(teamname_rand),1);\n values.splice(values.indexOf(teamname_rand2),1);\n values.splice(values.indexOf(teamname_rand3),1);\n values.splice(values.indexOf(teamname_rand4),1);\n }\n itr-=1;\n if(itr<0)\n throw \"Computation limit exceeded. Regenerate round\";// Prevents infinite looping when unforseen bugs occur.\n }\n while(values.length>0)\n {\n var rand = Math.ceil(Math.random() *4 );\n if(rand%4==0&&OpeGov.length<Number(TEAM_NUMBER/4)){// need to take into account affiliation and record number assigned\n OpeGov.push(values.pop());\n }\n else if(rand%4==1&&CloGov.length<Number(TEAM_NUMBER/4)){\n CloGov.push(values.pop());\n }\n else if(rand%4==2&&OpeOpp.length<Number(TEAM_NUMBER/4)){\n OpeOpp.push(values.pop());\n }\n else if(rand%4==3&&CloOpp.length<Number(TEAM_NUMBER/4)){\n CloOpp.push(values.pop());\n }\n }\n \n }\n else{\n while(values.length>0)\n {\n var rand = Math.ceil(Math.random() *4 );\n if(rand%4==0&&OpeGov.length<Number(TEAM_NUMBER/4)){// need to take into account affiliation and record number assigned\n OpeGov.push(values.pop());\n }\n else if(rand%4==1&&CloGov.length<Number(TEAM_NUMBER/4)){\n CloGov.push(values.pop());\n }\n else if(rand%4==2&&OpeOpp.length<Number(TEAM_NUMBER/4)){\n OpeOpp.push(values.pop());\n }\n else if(rand%4==3&&CloOpp.length<Number(TEAM_NUMBER/4)){\n CloOpp.push(values.pop());\n }\n }\n }\n ss.getSheetByName(RoundName).getRange(3, 2,OpeGov.length,1).setValues(OpeGov);\n ss.getSheetByName(RoundName).getRange(3, 3,CloGov.length,1).setValues(CloGov);\n ss.getSheetByName(RoundName).getRange(3, 4,OpeOpp.length,1).setValues(OpeOpp);\n ss.getSheetByName(RoundName).getRange(3, 5,CloOpp.length,1).setValues(CloOpp); \n}", "function computerTurn() {\n var count = 0;\n var check = true;\n var match = $xo2 + $xo2;\n // check if computer can win or play in a place that prevent the player to win\n while (check === true) {\n count++;\n for (var keys in ticTacToe) {\n if (ticTacToe[keys].matching === match) {\n for (var indexes in ticTacToe[keys].result) {\n if ($(\"#\" + ticTacToe[keys].result[indexes]).text() === \"\") {\n game(ticTacToe[keys].result[indexes]);\n result($xo2);\n check = false;\n return;\n }\n }\n }\n }\n if (count === 1) {\n match = $xo1 + $xo1;\n }\n else if (count === 2) {\n match = $xo2;\n }\n else if (count === 3) {\n check = false;\n }\n }\n\n check = true;\n // if neither the player nor computer has a chance to win\n while (check === true) {\n var random = \"cell\" + (Math.floor(Math.random() * 8) + 1);\n if ($(\"#\" + random).text() === \"\") {\n game(random);\n result($xo2);\n check = false;\n }\n }\n }", "function opponent(player){\n return (player === PLAYER ? COMPUTER : PLAYER);\n}", "function game() {\n for (let i = 0; i < 5; i++) {\n let playerSelect = prompt(\"Pick a move\");\n const computerSelect = computerPlay()\n let compSelect = alert(\"computer just chose: \" + computerSelect);\n console.log(playRound(playerSelect, computerSelect));\n }\n return reportWinner(playerScore, computerScore);\n}", "function nextPlayer(){\n if(activePlayer === 0){ // // kapag si Player 1 ay '0' active Player, tapos nextPlayer magiging Player 2 '1'\n activePlayer = 1; \n roundScore = 0; // removing this would pass the accumulated score to the next player\n \n } else {\n activePlayer = 0; // kapag si Player 2 ay '1' vice versa with Player 1 \n roundScore = 0; \n\n playerCurrentScore.textContent = '0'; // reset current score for the next player's turn \n\n // toggling \"active\" adding if absent; removing if present \n player0Panel.classList.toggle('active');\n player1Panel.classList.toggle('active'); \n }\n }", "function game() {\n // while should allow the game to continue as long as the user and computer are less than three. \n\n\twhile (userScore <= 4 || compScore <= 4) {\n playerSelection = window.prompt(\"Rock, Paper, or Scissors?\").toLocaleLowerCase()\n \n\n\n //nested the function call inside of game to hopefully eliminate the issue with the computerselection not being defined. \n //call function worked. computer currently plays two successive games. user prompted with two input boxes. \n computerSelection = computerPlay();\n picks();\n playRound(playerSelection, computerSelection);\n //ln16 notes, computer plays two successive games and functions, stops too early. \n totals();\n console.log(\"You picked \" + playerSelection)\n console.log(\"The Computer picked \" +computerSelection) \n return games++;\n\t}\n}", "function stay() {\r\n if (!gameInProgress) return alert(\"Game has finished, please start a new game\");\r\n //checking whether there are players left to act \r\n const check = utilFunctions.players.filter(player => player.isAlive)\r\n if (check.length >= 1){\r\n alert(`Player ${utilFunctions.determineCurrentPlayer().name} is next`);\r\n }\r\n else{\r\n // ending the game in case where everyone has acted\r\n utilFunctions.completeDealerCards()\r\n for (let player of utilFunctions.players){\r\n //checking who has won based on their regular and split cards result \r\n if (player.splitSum > 0) {\r\n player.isSplit = false\r\n utilFunctions.determineWinners(player, player.splitSum)\r\n }\r\n player.isAlive = false\r\n utilFunctions.determineWinners(player, player.sum)\r\n }\r\n utilFunctions.startOver()\r\n gameInProgress = false\r\n }\r\n}", "function NextPlayer(players, turn)\n{\n\tturn++;\n\t\n\tif(turn >= players.length)\n\t{\n\t\tturn = 0;\n\t}\n\t\n\treturn turn;\n}", "function playGame(player1, player2, playUntil) {\n player1.score = 0;\n player2.score = 0;\n\n console.log('Player one is: ' + player1.name);\n console.log('Player two is: ' + player2.name);\n\n while (player1.score < playUntil && player2.score < playUntil) {\n var winner = playRound(player1, player2);\n\n if (winner) {\n winner.score++;\n\n if (player1.score === playUntil) {\n return player1;\n } else if (player2.score === playUntil) {\n return player2;\n }\n }\n }\n}", "function nextPlayer(player) \n {\n console.log(player);\n \tif(player == 'X'){\n \t\treturn 'O';\n \t}\n\n \tif(player == 'O'){\n \t\treturn 'X';\n \t}\n \t\n \treturn 'unknown'\n }", "function advanceTurn () {\n currentTurn++;\n if (currentTurn >= players.length) {\n currentTurn = 0;\n }\n\n if (players[currentTurn]) {\n /* highlight the player who's turn it is */\n for (var i = 0; i < players.length; i++) {\n if (currentTurn == i) {\n $gameLabels[i].addClass(\"current\");\n if (i > 0) $gameOpponentAreas[i-1].addClass('current');\n } else {\n $gameLabels[i].removeClass(\"current\");\n if (i > 0) $gameOpponentAreas[i-1].removeClass('current');\n }\n }\n\n /* check to see if they are still in the game */\n if (players[currentTurn].out && currentTurn > 0) {\n /* update their speech and skip their turn */\n players[currentTurn].updateBehaviour(players[currentTurn].forfeit[1] == CAN_SPEAK ?\n addTriggers(players[currentTurn].forfeit[0], ANY_HAND) :\n players[currentTurn].forfeit[0]);\n players[currentTurn].commitBehaviourUpdate();\n \n saveSingleTranscriptEntry(currentTurn);\n\n timeoutID = window.setTimeout(advanceTurn, GAME_DELAY);\n return;\n }\n }\n\n /* allow them to take their turn */\n if (currentTurn == 0) {\n /* Reprocess reactions. */\n updateAllVolatileBehaviours();\n \n commitAllBehaviourUpdates();\n\n /* human player's turn */\n if (humanPlayer.out) {\n allowProgression(eGamePhase.REVEAL);\n } else {\n $gameScreen.addClass('prompt-exchange');\n allowProgression(eGamePhase.EXCHANGE);\n }\n } else if (!players[currentTurn]) {\n /* There is no player here, move on. */\n advanceTurn();\n } else {\n /* AI player's turn */\n makeAIDecision();\n }\n}", "function gameSet(size) {\n if (!size) {\n return;\n }\n boardSize = size;\n\n //Imprimindo tamanho selecionado\n var boardSizeOutput = document.getElementById('boardSizeOutput');\n boardSizeOutput.innerText = size;\n\n updatePlayersDefault(size);\n\n players = JSON.parse(JSON.stringify(playersDefault));\n \n var half = parseInt(size / 2, 10)\n \n prize = [half, half];\n\n pathFinder(size);\n truthPositions = pathsFound.flat();\n truthPositions.push(prize);\n\n createBoard('board', size);\n\n //dando as primeiras cores aos quadrados\n for (var p = 0; p < players.length; p++) {\n players[p].previousPos = null;\n players[p].initialPos = [players[p].pos[0], players[p].pos[1]];\n updatePlayersPosition(players[p]);\n if (p > 0) {\n initialPositions.push([players[p].pos[0], players[p].pos[1]]);\n players[p].id = p - 1;\n }\n }\n\n players = players.slice(1);\n\n endState = false;\n turn = 0;\n curPlayer = 0;\n updateTurnPlayerInfo();\n\n return true;\n}", "function assignAdjudicator2sides(RoundName){\n var scorePlayerRounds = ss.getSheetByName(RoundName);\n if(!scorePlayerRounds){\n throw \"Please generate round : \"+RoundName +\" before integration\";\n }\n var pairingNumber=TEAM_NUMBER/2;\n var colNumAdju=Math.ceil(ADJUDICATOR_NUMBER/pairingNumber);\n var adjuName;\n for (var i = 1; i <= colNumAdju; i++) {\n adjuName = 'Adjudicator ' + i;\n scorePlayerRounds.getRange(2, i+3).setValue(adjuName);\n scorePlayerRounds.setColumnWidth(i+3, 250);\n }\n setAlternatingRowBackgroundColors_(scorePlayerRounds.getRange(3,4,pairingNumber,colNumAdju), '#ffffff', '#eeeeee');\n \n var range = scorePlayerRounds.getRange(3, 2,pairingNumber,2);\n var data = range.getValues();\n var govList=[];\n var oppList=[];\n var iter_Max=TEAM_NUMBER*2;\n for(var i = 0;i<pairingNumber;i++){\n govList.push(data[i][0]);\n oppList.push(data[i][1]);\n }\n var adjuSheet = ss.getSheetByName(SHEET_ADJU);\n var rangeAdju = adjuSheet.getRange(3, 1, ADJUDICATOR_NUMBER,3);\n rangeAdju.sort([{column: 3, ascending: false}, {column: 1, ascending: false}]);\n var dataAdju = rangeAdju.getValues();//Sorted data of adjudicators to experience then team.\n var adjudicator_Names=[];\n for(var i=0;i<ADJUDICATOR_NUMBER;i++)\n {\n adjudicator_Names.push(dataAdju[i][1]); \n }\n var k=0;\n var coladd=0;\n var assigned_adju_data=createArray(pairingNumber,colNumAdju);\n while(adjudicator_Names.length>0){\n for(var i=0;i<pairingNumber;i++){\n for(var j in adjudicator_Names){\n if(k==pairingNumber){\n coladd++;//Progressing to next adjudicator column\n k=0;\n }\n if(obtainAffiliationDebater(govList[i])!=obtainAffiliationAdjudicator(adjudicator_Names[j])&&\n obtainAffiliationDebater(oppList[i])!=obtainAffiliationAdjudicator(adjudicator_Names[j])){\n assigned_adju_data[i][0+coladd]=adjudicator_Names[j];\n adjudicator_Names.splice(j, 1);\n k++;\n break;\n }\n }\n iter_Max--;\n if(iter_Max<0){\n throw \"Couldn't assign adjudicators\";\n }\n }\n }\n ss.getSheetByName(RoundName).getRange(3,4,assigned_adju_data.length,colNumAdju).setValues(assigned_adju_data);\n}", "function nextTurn() {\n let index = floor(random(next.length));\n let position = next.splice(index, 1)[0];\n let i = position[0];\n let j = position[1];\n board[i][j] = players[currentPlayer];\n currentPlayer = (currentPlayer + 1) % players.length;\n}", "getOpponent(id) {\n let opponent = null;\n\n this.players.forEach((player) => {\n if (player.id !== id) {\n opponent = player;\n }\n });\n\n return opponent;\n }", "function nextPlayer() {\n\tif(gamePlaying) {\n\t\troundScore = 0;\n\t\tactivePlayer === 0 ? activePlayer = 1 : activePlayer = 0;\n\t\tdocument.querySelector(\"#current-0\").textContent = '0';\n\t\tdocument.querySelector(\"#current-1\").textContent = '0';\n\t\tdocument.querySelector(\".player-0-panel\").classList.toggle(\"active\");\n\t\tdocument.querySelector(\".player-1-panel\").classList.toggle(\"active\");\n\t}\n}", "function gameLogic(players) {\n const playerOne = players[0];\n const playerTwo = players[1];\n const choiceOne = playerOne.choice;\n const choiceTwo = playerTwo.choice;\n\n const playerOneWinner = {\n winner: playerOne,\n loser: playerTwo\n };\n\n const playerTwoWinner = {\n winner: playerTwo,\n loser: playerOne\n };\n\n if (choiceOne === choiceTwo) {\n return null;\n }\n if (choiceOne === \"rock\") {\n if (choiceTwo === \"paper\") {\n return playerTwoWinner;\n } else {\n return playerOneWinner;\n }\n }\n if (choiceOne === \"paper\") {\n if (choiceTwo === \"scissors\") {\n return playerTwoWinner;\n } else {\n return playerOneWinner;\n }\n }\n if (choiceTwo === \"rock\") {\n return playerTwoWinner;\n } else {\n return playerOneWinner;\n }\n}", "function nextPlayer() {\r\n activePlayer === 0 ? activePlayer = 1 : activePlayer = 0;\r\n roundScore = 0;\r\n\r\n // Set all the current score of both 2 players to 0\r\n\r\n document.getElementById('current-0').textContent = '0';\r\n document.getElementById('current-1').textContent = '0';\r\n\r\n // add active Status to current player\r\n document.querySelector('.player-0-panel').classList.toggle('active');\r\n document.querySelector('.player-1-panel').classList.toggle('active');\r\n\r\n document.querySelector('.dice').style.display = 'none';\r\n}", "function moveAI() {\n function checkEmpty(val) {\n return val[1] == \"empty\";\n }\n\n timesPlayed++;\n if (firstMove == true) {\n rotateBoard(Math.floor(Math.random() * 3));\n firstMove = false;\n }\n var looking = findOnBoard(p2Mark, 2, p1Mark, 0);\n\n if (looking != null) {\n talker.notice(\"computer wins\");\n makeMove(p2Mark, looking.find(checkEmpty)[0]);\n } else {\n looking = findOnBoard(p1Mark, 2, p2Mark, 0);\n if (looking != null) {\n talker.notice(\"opponent two in a row\");\n makeMove(p2Mark, looking.find(checkEmpty)[0]);\n } else {\n if (squares[\"midMid\"] == \"empty\") {\n makeMove(p2Mark, \"midMid\");\n } else {\n looking = findOnBoard(p2Mark, 1, p1Mark, 0);\n\n if (looking != null) {\n looking.reverse();\n makeMove(p2Mark, looking.find(checkEmpty)[0]);\n } else {\n looking = findOnBoard(\"empty\", 3);\n\n if (looking != null) {\n makeMove(p2Mark, looking.find(checkEmpty)[0]);\n } else {\n looking = findOnBoard(\"empty\", 2);\n\n if (looking != null) {\n makeMove(p2Mark, looking.find(checkEmpty)[0]);\n } else {\n looking = findOnBoard(\"empty\", 1);\n\n if (looking != null) {\n makeMove(p2Mark, looking.find(checkEmpty)[0]);\n }\n }\n }\n }\n }\n }\n }\n\n checkEndGame();\n p2Move = false;\n}", "switchPlayer() {\n for(let i=0; i<this.playerBoards.length; ++i){\n this.updateCurrentPlayer()\n if (!this.playerBoards[this.currentPlayer].isGameComplete()){\n this.gameComplete = false;\n return;\n } \n } \n this.gameComplete = true \n }", "function minimax(newBoard, player){\nfc++;\n\n //available spots\n let availSpots = getEmptySpots(newBoard);\n\n // checks for the terminal states such as win, lose, and tie and returning a value accordingly\n if (winning(newBoard, p1)){\n return {score:-1};\n }\n\telse if (winning(newBoard, p2)){\n return {score:1};\n\t}\n else if (availSpots.length === 0){\n \treturn {score:0};\n }\n\n// an array to collect all the objects\n let moves = [];\n\n // loop through available spots\n availSpots.forEach((spot)=> {\n //create an object for each and store the index of that spot that was stored as a number in the object's index key\n let move = {},result;\n \tmove.index = newBoard[spot];\n\n // set the empty spot to the current player\n newBoard[spot] = player;\n\n //if collect the score resulted from calling minimax on the opponent of the current player\n if (player === p2){\n result = minimax(newBoard, p1);\n move.score = result.score;\n }\n else{\n result = minimax(newBoard, p2);\n move.score = result.score;\n }\n\n //reset the spot to empty4\n newBoard[spot] = move.index;\n\n // push the object to the array\n moves.push(move);\n\n });\n\n// if it is the computer's turn loop over the moves and choose the move with the highest score\n let bestMove;\n if(player === p2){\n let bestScore = -10;\n moves.forEach((move, i)=>{\n if(move.score > bestScore){\n bestScore = move.score;\n bestMove = i;\n }\n });\n }else{\n\n// else loop over the moves and choose the move with the lowest score\n let bestScore = 10;\n moves.forEach((move, i)=>{\n if(move.score < bestScore){\n bestScore = move.score;\n bestMove = i;\n }\n });\n }\n\n// return the chosen move (object) from the array to the higher depth\n return moves[bestMove];\n}", "function secureWin() {\n loop1:\n for (var x = 0; x < winningCombos.length; x++) {\n //Works basically the same way as thwartWin (see below for detailed comments). I could probably condense these into the same function w/ different parameters, but not today!\n var playerTwoScore = 0;\n loop2:\n for (var y = 0; y < winningCombos[x].length; y++) {\n console.log(playerTwoMoves);\n if (playerTwoMoves.indexOf(winningCombos[x][y]) > -1) {\n playerTwoScore++; \n console.log(playerTwoScore);\n } \n if (playerTwoScore == 2) {\n for (var z = 0; z < winningCombos[x].length; z++) {\n if (playerTwoMoves.indexOf(winningCombos[x][z]) == -1 && playerOneMoves.indexOf(winningCombos[x][z]) == -1) {\n var emptySpot = winningCombos[x][z];\n placePiece(emptySpot);\n checkWin();\n whoseTurn = 'playerOne';\n gameOver = true;\n return;\n }\n }\n \n }\n }\n \n \n }\n \n}", "function oplayNext2() {\nif($(\".c2\").hasClass(\"xpiece\") && ($(\".a2\").hasClass(\"opiece\") == false)&& ($(\".a2\").hasClass(\"xpiece\") == false)){\n\t\t$(\".a2\").addClass(\"opiece\");\n\t\t\t\t//checkWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\telse if($(\".b1\").hasClass(\"xpiece\") && ($(\".c1\").hasClass(\"opiece\") == false)&& ($(\".c1\").hasClass(\"xpiece\") == false)){\n\t$(\".c1\").addClass(\"opiece\");\n\t\t//\tcheckWin(player);\n\n\t\t\tplayer = \"playerx\";\n\t\t\tpieceClass = \"xpiece\";\n\t}\n\t\telse if($(\".a2\").hasClass(\"xpiece\") && ($(\".a3\").hasClass(\"opiece\") == false)&& ($(\".a3\").hasClass(\"xpiece\") == false)){\n\t\t$(\".a3\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\t\telse if($(\".b3\").hasClass(\"xpiece\") && ($(\".c3\").hasClass(\"opiece\") == false)&& ($(\".c3\").hasClass(\"xpiece\") == false)){\n\t\t$(\".c3\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\telse if($(\".b2\").hasClass(\"xpiece\") == false && $(\".b2\").hasClass(\"opiece\") == false){\n\t\t$(\".b2\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\n\telse if($(\".a1\").hasClass(\"xpiece\") && ($(\".b2\").hasClass(\"opiece\") == false)&& ($(\".b2\").hasClass(\"xpiece\") == false)){\n\t\t$(\".b2\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\t\telse if($(\".b2\").hasClass(\"xpiece\") && ($(\".c1\").hasClass(\"opiece\") == false)&& ($(\".c1\").hasClass(\"xpiece\") == false)){\n\t\t$(\".c1\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\n\telse if($(\".a3\").hasClass(\"xpiece\") && ($(\".b2\").hasClass(\"opiece\") == false)&& ($(\".b2\").hasClass(\"xpiece\") == false)){\n\t\t$(\".b2\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\n\telse if($(\".b3\").hasClass(\"xpiece\") && ($(\".c3\").hasClass(\"opiece\") == false)&& ($(\".c3\").hasClass(\"xpiece\") == false)){\n\t\t$(\".c3\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\telse if($(\".c1\").hasClass(\"xpiece\") && ($(\".b2\").hasClass(\"opiece\") == false)&& ($(\".b2\").hasClass(\"xpiece\") == false)){\n\t\t$(\".b2\").addClass(\"opiece\");\n\t\t\t//\tcheckWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\telse if($(\".c2\").hasClass(\"xpiece\") && ($(\".c3\").hasClass(\"opiece\") == false)&& ($(\".c3\").hasClass(\"xpiece\") == false)){\n\t\t$(\".c3\").addClass(\"opiece\");\n\t\t\t\t//checkWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n\telse if($(\".c3\").hasClass(\"xpiece\") && ($(\".b2\").hasClass(\"opiece\") == false)&& ($(\".b2\").hasClass(\"xpiece\") == false)){\n\t\t$(\".b2\").addClass(\"opiece\");\n\t\t\t\t//checkWin(player);\n\n\t\t\t\tplayer = \"playerx\";\n\t\t\t\tpieceClass = \"xpiece\";\n\t}\n}", "function check() {\n if (playerOrder[playerOrder.length - 1] !== compOrder[playerOrder.length - 1]) // hier vergleicht der Computer die letzte Eingabe ins NutzerArray mit der Zahl, die im ComputerArray steht.\n /*Es wird die jeweils letzte Eingabe vom Nutzer verglichen. z.B. Ist die Länge des Nutzer Arrays nach der ersten Runde eins. Damit die erste Stelle aber verglichen wird, muss man beim Index noch -1 schreiben,\n da der Index der ersten Stelle 0 ist.*/\n good = false; // wenn sie NICHT übereinstimmen ist das boolean falsch, der SPieler hat also einen Fehler gemacht\n //Festlegen, wann das Spiel gewonnen ist//\n if (playerOrder.length == 5 && good && easychosen) { // wenn nach 5 Runden (Also wenn die Länge vom NutzterArray 5 ist) vom Nutzer alles richtig gedrückt wurde und easy gewählt wurde, dann ist das Spiel gewonnen; genauso für die anderen Levels\n winGame(); //Spiel gewonnen für Level easy\n }\n if (playerOrder.length == 15 && good && advancedchosen) { // Genauso wie Oben, nur dass das Spiel für den Schwierigkeitsgrad advanced nach 15 Runden gewonnen ist\n winGame(); //Spiel gewonnen für Level advanced\n }\n if (playerOrder.length == 25 && good && hardchosen) {\n winGame(); //Spiel gewonnen für Level hard\n }\n if (playerOrder.length == 35 && good && extremechosen) {\n winGame(); //Spiel gewonnen für Level extreme\n }\n //Verlieren des Spiels//\n if (good == false) { // Wenn der Spieler einen Fehler macht, also das boolean falsch ist...\n looseGame(); //...Wird die ´Spiel verloren´ Funktion abgespielt\n noise = false; // Dabei sollen beim Aufleuchten der Button aber deren Töne nicht abgespielt werden, da es einen anderen Sound für diesen Fall gibt\n }\n //Für den Rundenwechsel//\n if (turn == playerOrder.length && good && !win) { // Wenn die Runde der Länge des Arrays mit der Nutzterreihenfolge entspricht und bisher kein Fehler gemacht wurde und das Spiel noch nicht gewonnen wurde,...\n turn++; // ...,dann geht das Spiel in die nächste Runde\n playerOrder = []; // Das Array mit der Nutzterreihenfolge wird wieder gelehrt, damit es für die kommende Runde mit der neuen Nutztereingabe befüllt werden kann\n compTurn = true; // Der Computer ist als erstes an der Reihe die willkürliche Reihenfolge zu spielen\n flash = 0; // Es hat in der neuen Runde noch kein Button augeleuchtet, deshalb wird flash wieder auf 0 gesetzt\n turnCounter.innerHTML = turn; // Im Counter wird angezeigt in welcher Runde der Spieler ist\n intervalId = setInterval(gameTurn, 800);\n //PROGRESS BAR VERSUCH nur für easy. So ist es aber umstädlich und zu lang :( //\n //easy//\n if (turn == 2 && easychosen) { //Wenn der Spieler in Runde zwei ist und easy als Schwierigkeit gewählt wurde,\n progressbar.style.width = \"20%\"; //dann steht der Balken bei 20 Prozent usw...\n }\n else if (turn == 3 && easychosen) {\n progressbar.style.width = \"40%\";\n }\n else if (turn == 4 && easychosen) {\n progressbar.style.width = \"60%\";\n }\n else if (turn == 5 && easychosen) {\n progressbar.style.width = \"80%\";\n }\n }\n}", "function minimax(newBoard, player) {\r\n // then we need to find the indexes of the available spots, using the empty square function and set them to availSpots variable\r\n var availSpots = emptySquares(newBoard)\r\n // we check for a terminal state == a winner\r\n if (checkWin(newBoard, huPlayer)) {\r\n return {score: -10}; // if 0 win return -10\r\n } else if (checkWin(newBoard, aiPlayer)){\r\n return {score: 10};// if X win return 20\r\n } else if (availSpots.length === 0) {\r\n return {score: 0}; // the length of the availSpots is 0 = no more room to play = tie game. Return 0\r\n }\r\n // we collect the score from each of the empty spots to evaluate later\r\n var moves = [];\r\n // loop through the availSpots, while collecting each moves and spots\r\n for (var i = 0; i < availSpots.length; i++) {\r\n var move = {};\r\n // set the index number of the empty spot that was collected in move to the index property of the move object\r\n move.index = newBoard[availSpots[i]];\r\n // set the empty spot on the newBoard to the current player \r\n newBoard[availSpots[i]] = player;\r\n // call the minimax function with other Player and the newly changed newBoard.\r\n // if the minimax function doesn't find a terminal state it keeps recursing level by level deeper into the game.\r\n if (player == aiPlayer) {\r\n var result = minimax(newBoard, huPlayer);\r\n move.score = result.score;\r\n } else {\r\n var result = minimax(newBoard, aiPlayer);\r\n move.score = result.score;\r\n }\r\n \r\n newBoard[availSpots[i]] = move.index;\r\n \r\n moves.push(move);\r\n }\r\n \r\n // evaluate the bestSpots\r\n var bestMove;\r\n if(player === aiPlayer) {\r\n var bestScore = -10000;\r\n for(var i = 0; i < moves.length; i++) {\r\n if(moves[i].score > bestScore) { // if +++ possibilities keep the first one\r\n bestScore = moves[i].score;\r\n bestMove = i;\r\n }\r\n }\r\n } else {\r\n var bestScore = 10000;\r\n for(var i = 0; i < moves.length; i++) {\r\n if(moves[i].score < bestScore) { // this time check the lowest score \r\n bestScore = moves[i].score;\r\n bestMove = i;\r\n }\r\n }\r\n}\r\n\r\nreturn moves[bestMove];\r\n \r\n}", "function gamePlay(playerMove) {\n const computerChoice = generateComputerMove();\n //learnt the use of switch statements via tutorial - used to execute one of many blocks of code to be used. \n //switch expression is evaluated once and then compared against the \"case\" for a match then code can be executed. \n //originally used if statements but this was an easier way to execute.\n switch (playerMove + computerChoice) {\n case \"rockscissor\":\n case \"paperrock\":\n case \"scissorspaper\":\n //change console log \"you win\" to call the win function \n winner(playerMove, computerChoice);\n break; //stops the switch statement from continuing to run\n case \"rockpaper\":\n case \"paperscissors\":\n case \"scissorsrock\":\n // change console log to call the lose function \n //lose(playerMove, computerChoice)\n loser(playerMove, computerChoice);\n break;\n case \"rockrock\":\n case \"paperpaper\":\n case \"scissorsscissors\":\n tie(playerMove, computerChoice);\n break;\n\n }\n\n\n}", "function computerTakeTurn(){\r\n\tlet board = []; // shorthand status of the board\r\n\tboard[0] = \"\"; // DO NOT USE\r\n\tboard[1] = document.getElementById(\"one\").innerHTML;\r\n\tboard[2] = document.getElementById(\"two\").innerHTML;\r\n\tboard[3] = document.getElementById(\"three\").innerHTML;\r\n\tboard[4] = document.getElementById(\"four\").innerHTML;\r\n\tboard[5] = document.getElementById(\"five\").innerHTML;\r\n\tboard[6] = document.getElementById(\"six\").innerHTML;\r\n\tboard[7] = document.getElementById(\"seven\").innerHTML;\r\n\tboard[8] = document.getElementById(\"eight\").innerHTML;\r\n\tboard[9] = document.getElementById(\"nine\").innerHTML;\r\n\r\n\tlet idName = \"\";\r\n\r\n\tif(computerDifficulty == \"Easy\"){\r\n\t\t// choose a random box until an empty one is found\r\n\t\tdo{\r\n\t\t\tlet rand = Math.floor(Math.random()*9);\r\n\t\t\tidName = idNames[rand];\r\n\t\t\t\t\r\n\t\t\tif(document.getElementById(idName).innerHTML == \"\") {\r\n\t\t\t\tdocument.getElementById(idName).innerHTML = currentPlayer;\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\r\n\t\t} while(true);\r\n\t}else{\r\n\t\t// The Hard Computer\r\n\t\t// Find where there are two O's in a row and move there to win.\r\n\t\tif(board[1] == \"\" && ((board[2] == \"O\" && board[3] == \"O\") || (board[5] == \"O\" && board[9] == \"O\") || (board[4] == \"O\" && board[7] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[2] == \"\" && ((board[1] == \"O\" && board[3] == \"O\") || (board[5] == \"O\" && board[8] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"two\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[3] == \"\" && ((board[1] == \"O\" && board[2] == \"O\") || (board[5] == \"O\" && board[7] == \"O\") || (board[6] == \"O\" && board[9] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[4] == \"\" && ((board[1] == \"O\" && board[7] == \"O\") || (board[5] == \"O\" && board[6] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"four\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[5] == \"\" && ((board[1] == \"O\" && board[9] == \"O\") || (board[2] == \"O\" && board[8] == \"O\") || (board[3] == \"O\" && board[7] == \"O\") || (board[4] == \"O\" && board[6] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[6] == \"\" && ((board[3] == \"O\" && board[9] == \"O\") || (board[4] == \"O\" && board[5] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"six\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[7] == \"\" && ((board[1] == \"O\" && board[4] == \"O\") || (board[3] == \"O\" && board[5] == \"O\") || (board[8] == \"O\" && board[9] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[8] == \"\" && ((board[2] == \"O\" && board[5] == \"O\") || (board[7] == \"O\" && board[9] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"eight\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[9] == \"\" && ((board[3] == \"O\" && board[6] == \"O\") || (board[1] == \"O\" && board[5] == \"O\") || (board[7] == \"O\" && board[8] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Find where there are two X's in a row and move there to not lose.\r\n\t\tif(board[1] == \"\" && ((board[2] == \"X\" && board[3] == \"X\") || (board[5] == \"X\" && board[9] == \"X\") || (board[4] == \"X\" && board[7] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[2] == \"\" && ((board[1] == \"X\" && board[3] == \"X\") || (board[5] == \"X\" && board[8] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"two\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[3] == \"\" && ((board[1] == \"X\" && board[2] == \"X\") || (board[5] == \"X\" && board[7] == \"X\") || (board[6] == \"X\" && board[9] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[4] == \"\" && ((board[1] == \"X\" && board[7] == \"X\") || (board[5] == \"X\" && board[6] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"four\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[5] == \"\" && ((board[1] == \"X\" && board[9] == \"X\") || (board[2] == \"X\" && board[8] == \"X\") || (board[3] == \"X\" && board[7] == \"X\") || (board[4] == \"X\" && board[6] == \"O\"))) {\r\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[6] == \"\" && ((board[3] == \"X\" && board[9] == \"X\") || (board[4] == \"X\" && board[5] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"six\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[7] == \"\" && ((board[1] == \"X\" && board[4] == \"X\") || (board[3] == \"X\" && board[5] == \"X\") || (board[8] == \"X\" && board[9] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[8] == \"\" && ((board[2] == \"X\" && board[5] == \"X\") || (board[7] == \"X\" && board[9] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"eight\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(board[9] == \"\" && ((board[3] == \"X\" && board[6] == \"X\") || (board[1] == \"X\" && board[5] == \"X\") || (board[7] == \"X\" && board[8] == \"X\"))) {\r\n\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Strategic Moves. Last Priority\r\n\t\t\r\n\t\t// Middle is always the best move, it both allows for the easiest wins as the first player, and consistent draws as the second.\r\n\t\tif(board[5] == \"\") {\r\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// If the computer goes first and the player takes an edge move, victory is guaranteed.\r\n\t\t// take a corner piece roughly opposite the \"X\", then victory is forced.\r\n\t\tif (board[5] == \"O\" && (board[2] == \"X\" || board[4] == \"X\" || board[6] == \"X\" || board[8] == \"X\")) {\r\n\t\t\tlet rand = Math.floor(Math.random()*2);\r\n\t\t\tif (board[2] == \"X\" && board[7] == \"\" && board[9] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"seven\").innerHTML = currentPlayer : document.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[4] == \"X\" && board[3] == \"\" && board[9] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"three\").innerHTML = currentPlayer : document.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[6] == \"X\" && board[1] == \"\" && board[7] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"one\").innerHTML = currentPlayer : document.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[8] == \"X\" && board[1] == \"\" && board[3] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"one\").innerHTML = currentPlayer : document.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If the computer goes first and the player takes a corner move, victory is likely.\r\n\t\t// take a corner piece opposite the \"X\", these will give the computer the best chances.\r\n\t\tif (board[5] == \"O\" && (board[1] == \"X\" || board[3] == \"X\" || board[7] == \"X\" || board[9] == \"X\")) {\r\n\t\t\tif (board[1] == \"X\" && board[9] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[3] == \"X\" && board[7] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[7] == \"X\" && board[3] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[9] == \"X\" && board[1] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If after the computer goes first and the player takes a corner move, and the player takes an edge move.\r\n\t\t// take a corner piece opposite the new edge piece, or block, and victory is guaranteed.\r\n\t\tif (board[5] == \"O\" && (board[1] == \"X\" || board[3] == \"X\" || board[7] == \"X\" || board[9] == \"X\")) {\r\n\t\t\tif (board[1] == \"X\" && board[9] == \"O\" && board[6] == \"X\" && board[7] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[1] == \"X\" && board[9] == \"O\" && board[8] == \"X\" && board[3] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[3] == \"X\" && board[7] == \"O\" && board[4] == \"X\" && board[9] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[3] == \"X\" && board[7] == \"O\" && board[8] == \"X\" && board[1] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[7] == \"X\" && board[3] == \"O\" && board[2] == \"X\" && board[9] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[7] == \"X\" && board[3] == \"O\" && board[6] == \"X\" && board[1] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[9] == \"X\" && board[1] == \"O\" && board[2] == \"X\" && board[7] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[9] == \"X\" && board[1] == \"O\" && board[4] == \"X\" && board[3] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if the computer goes second, and the player takes the center, the computer should take a corner piece.\r\n\t\tif (board[5] == \"X\") {\r\n\t\t\tlet rand = Math.floor(Math.random()*4);\r\n\t\t\tif (rand == 0 && board[1] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (rand == 1 && board[3] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (rand == 2 && board[7] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (rand == 3 && board[9] == \"\"){\r\n\t\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// take another corner piece the turn after if the player takes the corner piece opposite the computer's latest turn, making a line.\r\n\t\tif (board[5] == \"X\" && ((board[1] == \"O\" && board[9] == \"X\") || (board[3] == \"O\" && board[7] == \"X\") || (board[7] == \"O\" && board[3] == \"X\") || (board[9] == \"O\" && board[1] == \"X\"))) {\r\n\t\t\tlet rand = Math.floor(Math.random()*2);\r\n\t\t\tif (board[1] == \"X\" && board[3] == \"\" && board[7] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"three\").innerHTML = currentPlayer : document.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[3] == \"X\" && board[1] == \"\" && board[9] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"one\").innerHTML = currentPlayer : document.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[7] == \"X\" && board[1] == \"\" && board[9] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"one\").innerHTML = currentPlayer : document.getElementById(\"nine\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (board[9] == \"X\" && board[3] == \"\" && board[7] == \"\"){\r\n\t\t\t\trand == 0 ? document.getElementById(\"three\").innerHTML = currentPlayer : document.getElementById(\"seven\").innerHTML = currentPlayer;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If all else fails... random input\r\n\t\tdo{\r\n\t\t\tlet rand = Math.floor(Math.random()*9);\r\n\t\t\tidName = idNames[rand];\r\n\t\t\t\r\n\t\t\tif(document.getElementById(idName).innerHTML == \"\") {\r\n\t\t\t\tdocument.getElementById(idName).innerHTML = currentPlayer;\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t} while(true);\r\n\t}\r\n}// computerTakeTurn", "function nextPlayer() {\r\n\t\r\n\tactivePlayer === 0 ? activePlayer = 1 : activePlayer = 0;\r\n\t\troundscore = 0;\r\n\t\t\r\n\t\t\r\n\t\tdocument.getElementById('current-0').textContent = '0';\r\n\t\tdocument.getElementById('current-1').textContent = '0';\r\n\t\t\r\n\t\t//to change bored for active player the property used here was toggle\r\n\t\tdocument.querySelector('.player-0-panel').classList.toggle('active');\r\n\t\tdocument.querySelector('.player-1-panel').classList.toggle('active');\r\n\t\t\r\n\t\t\r\n\t\t//this also use but for reffrence and we did not archive 100%\r\n\t\t//document.querySelector('.player-0-panel').classList.remove('active');\r\n\t\t//document.querySelector('.player-1-panel').classList.add('active');\r\n\t\t\r\n\t\t\r\n\t\t//to hide dice if is the next players turn\r\n\t\t document.getElementById('dice-1').style.display = 'none';\r\n\t\t document.getElementById('dice-2').style.display = 'none';\r\n\t\t\r\n}", "function playToFive() {\n console.log(\"Let's play Rock, Paper, Scissors\");\n var playerWins = 0;\n var computerWins = 0;\n \n while (playerWins < 5 && computerWins < 5) {\n console.log(\"The score is currently player: \" + playerWins + \", computer: \" + computerWins)\n var playerMove = getPlayerMove();\n var computerMove = getComputerMove();\n var winner = getWinner(playerMove,computerMove);\n \n if (winner === \"player\") {\n playerWins += 1;\n console.log(\"You chose \" + playerMove + \" while the computer chose \" + computerMove + \".\");\n console.log(\"The winner of this round is \" + winner + \".\");\n } else if (winner === \"computer\") {\n computerWins += 1;\n console.log(\"You chose \" + playerMove + \" while the computer chose \" + computerMove + \".\");\n console.log(\"The winner of this round is \" + winner + \".\");\n } else if (winner === \"tie\") {\n console.log(\"You chose \" + playerMove + \" while the computer chose \" + computerMove + \".\");\n console.log(\"This round was a tie. Try again!\");\n }\n }\n\n if (playerWins === 5) {\n console.log(\"You won!\"); \n } else if (computerWins === 5) {\n console.log(\"Computer won.\");\n } \n return [playerWins, computerWins];\n \n}", "function getNextPlayer(game) {\n\t\tvar turns = game.turns;\n\t\tif (!turns || turns.length === 0) {\n\t\t\treturn game.players[0];\n\t\t}\n\n\t\tvar lastTurn = turns.pop();\n\t\tfor (var i = 0; i < game.players.length; i++) {\n\t\t\t//find the player who had the last turn\n\t\t\tif (game.players[i].identifier.equals(lastTurn.playerIdentifier)) {\n\t\t\t\t//then return the next player\n\t\t\t\tvar j = i + 1;\n\t\t\t\tif (j < game.players.length) {\n\t\t\t\t\treturn game.players[j];\n\t\t\t\t} else {\n\t\t\t\t\treturn game.players[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function checkWin(board, player) {\n\n //get the combinations on the board \n //all the places the player played on the board\n let plays = board.reduce((a, e, i) =>\n (e === player) ? a.concat(i) : a , []);\n \n let gameWon = null;\n //loop through winning combinations\n for (let[index, win] of winCombos.entries())\n {\n if (win.every(elem => plays.indexOf(elem) > -1)) \n {\n gameWon = {index: index, player: player};\n break;\n }\n }\n return gameWon;\n\n}", "function changePlayer() {\n // console.log(`Count in changePlay: ${count}`);\n if (count > 8) {\n setTimeout(function() {\n gameOver();\n }, 500);\n } else {\n let pOne = document.getElementById(\"player1\");\n let pTwo = document.getElementById(\"player2\");\n if (document.getElementById(\"player1\").classList.contains(\"active\")) {\n document.getElementById(\"player1\").classList.remove(\"active\");\n document.getElementById(\"player2\").classList.add(\"active\");\n } else {\n document.getElementById(\"player1\").classList.add(\"active\");\n document.getElementById(\"player2\").classList.remove(\"active\");\n }\n if (\n document.getElementById(\"player2\").classList.contains(\"active\") &&\n gameType === \"PvCEasy\"\n ) {\n computerTurnEasy();\n }\n if (pTwo.classList.contains(\"active\") && gameType === \"PvCMedium\") {\n computerTurnMedium();\n }\n }\n} //changePlayer", "function checkForWinnerPlayer(){\n var counter = 0;\n for (var i = 0; i < winners.length; i++){\n for (var j = 0; j < 3; j++) { \n if (alreadyChosenPlayer.indexOf(winners[i][j]) === -1) {\n break;\n }\n else {\n counter += 1;\n }\n if (counter === 3) {\n winner = \"player\";\n }\n }\n counter = 0;\n }\n}", "function nextPlayer(){\n activePLayer === 0 ? activePLayer = 1 : activePLayer = 0; //ternary operator\n roundScore = 0; //so that next player starts from zero\n \n document.getElementById('current-0').textContent=0;\n document.getElementById('current-1').textContent=0;\n \n //to change the active players\n document.querySelector('.player-0-panel').classList.toggle('active');\n document.querySelector('.player-1-panel').classList.toggle('active');\n \n document.getElementById('dice-1').style.display='none';\n document.getElementById('dice-2').style.display='none';\n \n \n}", "function gameRules(p1, p2) {\n document.getElementById('p1Result').innerHTML = \"Player One: \" + choice[p1];\n document.getElementById('p2Result').innerHTML = \"Player Two: \" + choice[p2];\n// Draw\n if (choice[p1] === choice[p2]) {\n document.getElementById('gameResult').innerHTML = \"It\\'s a Draw! \" \n + \"<br />\" \n + \"Player One Choose: \" + choice[p1]\n + \"<br />\" \n + \"Player Two Choose: \" + choice[p2] \n }\n// Rock vs Paper\n else if (choice[p1] === choice[0] && choice[p2] === choice[1] || choice[p2]\n === choice[0] && choice[p1] === choice[1]) {\n document.getElementById('gameResult').innerHTML = choice[1] + \" Beats \" + choice[0]\n if (p1 === 1) {document.getElementById('winner').innerHTML = \"Player one won with \" + choice[p1] \n }\n else {\n document.getElementById('winner').innerHTML = \"Player two won with \" + choice[p2]\n }\n }\n// Paper vs Scissors\n else if (choice[p1] === choice[1] && choice[p2] === choice[2] || choice[p1] === choice[2] && choice[p2] === choice[1]) {\n document.getElementById('gameResult').innerHTML = choice[2] +\" Beats \" + choice[1] \n if (p1 === 2) {document.getElementById('winner').innerHTML = \"Player one won with \" + choice[p1]\n }\n else {\n document.getElementById('winner').innerHTML = \"Player two won with \" + choice[p2]\n }\n\n }\n// Rock vs Scissors\n else if (choice[p1] === choice[0] && choice[p2] === choice[2] || choice[p1] === choice[2] && choice[p2] === choice[0]) { \n document.getElementById('gameResult').innerHTML = choice[0] + \" Beats \" + choice[2] \n if (p1 === 2) {document.getElementById('winner').innerHTML = \"Player one won with \" + choice[p1]\n }\n else {\n document.getElementById('winner').innerHTML = \"Player two won with \" + choice[p2]}\n }\n}", "function getOpponent(player) {\n return player === PLAYERS[0] ? PLAYERS[1] : PLAYERS[0];\n}", "function game()\n {\n \tlet playerScore = 0;\n \tlet computerScore = 0;\n \tlet ties = 0;\n \tconst MAX_ROUNDS = 5;\n\n \tfor(let i = 0; i < MAX_ROUNDS; i++)\n \t{\n \t\tif(!(playerScore === 3 || computerScore === 3))\n \t\t{\n \t\t\tlet outcome = playRound();\n\n\t \t\tif(outcome === \"win\")\n\t \t\t{\n\t \t\t\tplayerScore++;\n\t \t\t}\n\t \t\telse if(outcome === \"lose\")\n\t \t\t{\n\t \t\t\tcomputerScore++;\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\tties++;\n\t \t\t}\n\n\t \t\tgetCurrentScore(playerScore, computerScore, ties);\n\t \t}\n \t}\n\n \tgetOutcome(playerScore, computerScore, ties);\n }", "function gamePlay(event) {\n\n // Alternate between player 1 and player 2\n alternatePlayer(event)\n\n // Get values of each row, column and diagonal\n row1Values = lineValues(document.querySelectorAll(\".r1\"))\n row2Values = lineValues(document.querySelectorAll(\".r2\"))\n row3Values = lineValues(document.querySelectorAll(\".r3\"))\n column1Values = lineValues(document.querySelectorAll(\".c1\"))\n column2Values = lineValues(document.querySelectorAll(\".c2\"))\n column3Values = lineValues(document.querySelectorAll(\".c3\"))\n diagonalsValues = getDiagonalValues(document.querySelectorAll('div'))\n\n // Determine if there are 3 of the same token in a row, column or diagonal\n threeInALine(diagonalsValues[0])\n threeInALine(diagonalsValues[1])\n threeInALine(row1Values)\n threeInALine(row2Values)\n threeInALine(row3Values)\n threeInALine(column1Values)\n threeInALine(column2Values)\n threeInALine(column3Values)\n\n // If the max number of moves (9) is reached and there is no winner, it is considered a draw\n movesCounter++\n if (winner === false && movesCounter === 9) {\n alert(\"draw!\")\n gameStatus.innerText = \"It's a draw! Play again?\"\n endGame()\n }\n}", "function playGame(square) {\n\n // Determine computers move (and play that move) --------- //\n\n function computerMove() {\n\n //If no strong moves are present, computer will move randomly\n \n var computerSquare = Math.ceil(Math.random() * 9);\n var corners = [1, 3, 7, 9];\n var counter = 0;\n \n // Lowest priorty: corner play --------- // \n \n for (var f = 0; f < 4; f++){\n if (takenSquares.indexOf(corners[f]) < 0) {\n computerSquare = corners[f];\n break;\n }\n }\n \n // Next up: play the center -------------- // \n \n for (var q = 0; q < 4; q++) {\n \n if (takenSquares.indexOf(corners[q]) > 0) {\n counter += 1;\n }\n if (counter == 4 && takenSquares.indexOf(5) < 0) {\n computerSquare = 5;\n }\n }\n \n // Higher priority: block the human --------- //\n \n for (var a = 0; a < 8; a++) {\n var winCheck = 0;\n var holder = 0;\n for (var b = 0; b < 3; b++) {\n if (humanMoves.indexOf(winningArray[a][b]) >= 0) {\n winCheck += 1;\n } else {\n holder = winningArray[a][b];\n }\n if (winCheck == 2 && holder > 0 && takenSquares.indexOf(holder) < 0) {\n computerSquare = holder;\n }\n }\n }\n \n\n\n if (takenSquares.indexOf(computerSquare) < 0) {\n computerSquare.toString();\n document.getElementById(computerSquare).innerHTML = pcIcon;\n takenSquares.push(computerSquare);\n pcMoves.push(computerSquare);\n gameOn();\n } else {\n computerMove();\n }\n\n }\n\n // Play human's move --------- //\n\n if (takenSquares.indexOf(parseInt(square)) < 0) {\n\n takenSquares.push(parseInt(square));\n humanMoves.push(parseInt(square));\n document.getElementById(square).innerHTML = playerIcon;\n gameOn();\n\n // Once user's move is played, wait .7 seconds then run computerMove --------- //\n\n if (winner === false) {\n var pcTimer = window.setTimeout(computerMove, 700);\n }\n\n } else {\n alert(\"That square is taken, choose another\");\n }\n\n }", "function game() {\n for (let round = 1; round <= 5; round++) {\n //playerSelection = humanPlay();\n computerSelection = computerPlay();\n let oneRoundGame = playRound(playerSelection, computerSelection);\n console.log(`round # ${round}: Human = ${playerSelection} & AI = ${computerSelection} | ${oneRoundGame} |`);\n }\n}", "function getWinner(playerMove) {\n\n //random number generator for computer move\n randomNum = (Math.floor(Math.random() * 3));\n\n //computer move generator\n //function getComputerMove() {\n if (randomNum === 0) {\n computerMove = 'rock'\n } else if (randomNum === 1) {\n computerMove = 'paper';\n } else if (randomNum === 2) {\n computerMove = 'scissors';\n }\n console.log(computerMove);\n console.log(playerMove);\n //}\n\n//draw/win/lose\n if (playerMove === computerMove) {\n draws = draws + 1\n console.log(\"It's a draw!\");\n displayResult.innerText = \"It's a draw!\";\n } else if (playerMove === 'rock' && computerMove !== 'paper') {\n wins = wins + 1;\n console.log(\"You win!\");\n displayResult.innerText = \"You win!\";\n } else if (playerMove === 'paper' && computerMove !== 'scissors') {\n wins = wins + 1;\n console.log(\"You win!\");\n displayResult.innerText = \"You win!\";\n } else if (playerMove === 'scissors' && computerMove !== 'rock') {\n wins = wins + 1;\n console.log(\"You win!\");\n displayResult.innerText = \"You win!\";\n } else {\n loses = loses + 1;\n console.log(\"You lose!\");\n displayResult.innerText = \"You lose!\";\n }\n\n //games played total \ngamePlays = gamePlays +1;\n\n}", "function nextPlayer(){\n\t\tif (isWinner()){\n\t\t\talert(\"CONGRATS, We have a winner!\"); \n\t\t\tclearButton.innerText = \"Play Again\"; \n\t\t\treturn;\n\t\t}\n\t\tif (turn === \"x\"){\n\t\t\tturn = \"o\";\n\t\t\tboxColor = \"DarkOrange\";\n\t\t}else {\n\t\t\tturn = \"x\";\n\t\t\tboxColor = \"DarkCyan\";\n\t\t}\n\t}", "function win(checkBoard, player){\n if(checkBoard[0] == player && checkBoard[1] == player && checkBoard[2] == player){\n winningCombo = [0,1,2];\n return true\n }\n if(checkBoard[0] == player && checkBoard[3] == player && checkBoard[6] == player){\n winningCombo = [0,3,6];\n return true;\n }\n if(checkBoard[6] == player && checkBoard[7] == player && checkBoard[8] == player){\n winningCombo = [6,7,8];\n return true;\n }\n if(checkBoard[2] == player && checkBoard[5] == player && checkBoard[8] == player){\n winningCombo = [2,5,8];\n return true;\n }\n if(checkBoard[3] == player && checkBoard[4] == player && checkBoard[5] == player){\n winningCombo = [3,4,5];\n return true;\n }\n if(checkBoard[6] == player && checkBoard[4] == player && checkBoard[2] == player){\n winningCombo = [6,4,2];\n return true;\n }\n if(checkBoard[1] == player && checkBoard[4] == player && checkBoard[7] == player){\n winningCombo = [1,4,7];\n return true;\n }\n if(checkBoard[0] == player && checkBoard[4] == player && checkBoard[8] == player){\n winningCombo = [0,4,8];\n return true;\n }\n return false;\n }", "function displayResult () {\n // give the name of the winning pokemon\n const vs = document.getElementById('VS')\n vs.textContent = winner\n // update the results of each team\n const myScore = document.getElementById('myScore')\n myScore.textContent = 'Result: ' + myResult\n const enemyScore = document.getElementById('enemyScore')\n enemyScore.textContent = 'Result: ' + enemyResult\n\n var i = 0\n if (looser.length !== 0) {\n if (looser[0][0] === 'enemy') {\n i = 0\n while (looser[0][1].name !== enemies[i].name) {\n i++\n }\n enemies[i] = [null, null]\n var j = i + 1\n const buttonlooser = document.getElementById('enemy' + j)\n buttonlooser.setAttribute('disabled', true)\n buttonlooser.style.background = 'white'\n } else if (looser[0][0] === 'myteam') {\n i = 0\n while (looser[0][1].name !== myTeam[i].name) {\n i++\n }\n var k = i + 1\n const buttonlooser = document.getElementById('myteam' + k)\n buttonlooser.setAttribute('disabled', true)\n buttonlooser.style.background = 'white'\n }\n }\n\n // if the game is ended, call for the next function and sleep for a sec\n if (nbmatch === 5) {\n setTimeout(displayFinalResult, 1000)\n }\n}", "function checkWin(board, player) {\r\n // the reduce method is going through every element on the board array and give back one single value == the accumulator (a). We initialize the (a) with an empty array. The (e) is the element that we are going through. (i) is the index.\r\n let plays = board.reduce((a, e, i) =>\r\n // if the element equal the player then concat i = take the accumulator array and add the index to that array. If not return the (a) just as it was, don't add anything.\r\n // if the element equal the player then concat i = take the accumulator array and add the index to that array. If not return the (a) just as it was, don't add anything.\r\n (e === player) ? a.concat(i) : a, []);\r\n // if nobody won \"gameWon = null\"\r\n let gameWon = null;\r\n for (let [index, win] of winCombos.entries()) {\r\n //with win.every, we go through every element on the winCombos array, and we check if plays.indexOf(elem) is more than -1 = it means has the player played in every spot that counts for a win. We go through every possibilities to check a win\r\n if (win.every(elem => plays.indexOf(elem) > -1)){\r\n // shows which winCombos was succesful and which player won\r\n gameWon = { index: index, player: player};\r\n break; // we break from the function\r\n } \r\n }\r\n return gameWon;\r\n}", "function game() {\n\tlet playerWin = 0;\n\tlet computerWin = 0;\n\tlet playCount = 0;\n\n\tfor (i = 0; i < 5; i++) {\n\t\tplayerMove = playerPlay();\n\t\tcomputerMove = computerPlay();\n\t\troundResult = playRound(playerChoice, computerChoice);\n\n\t\tif (roundResult === \"win\") {\n\t\t\tplayerWin++;\n\t\t\tplayCount++;\n\t\t\tconsole.log(\n\t\t\t\t`You win! ${playerMove} beats ${computerMove} in Round ${playCount}`\n\t\t\t);\n\t\t} else if (roundResult === \"lose\") {\n\t\t\tcomputerWin++;\n\t\t\tplayCount++;\n\t\t\tconsole.log(`You lose! ${computerMove} beats ${playerMove}`);\n\t\t} else if (roundResult === \"draw\") {\n\t\t\tplayCount++;\n\t\t\tconsole.log(`It\\'s a draw!`);\n\t\t} else {\n\t\t\tconsole.log(`Invaild!`);\n\t\t}\n\t\tplayerPlay();\n\t\tcomputerPlay();\n\t}\n\tconsole.log(\"---Results----\");\n\tif (playerWin > computerWin) {\n\t\tconsole.log(`Player won ${playerWin} rounds, Player wins!`);\n\t} else if (playerWin < computerWin) {\n\t\tconsole.log(`Computer won ${computerWin} rounds, Computer wins!`);\n\t} else {\n\t\tconsole.log(\n\t\t\t`${playCount} rounds were played, Player won ${playerWin} rounds, Computer won ${computerWin} rounds, it was a draw!`\n\t\t);\n\t}\n}", "function computerTakeTurn() {\n\tlet idName = \"\";\n\tlet cb = []; // current board\n\n\tcb[0] = \"\"; // not going to use\n\tcb[1] = document.getElementById(\"one\").innerHTML;\n\tcb[2] = document.getElementById(\"two\").innerHTML;\n\tcb[3] = document.getElementById(\"three\").innerHTML;\n\tcb[4] = document.getElementById(\"four\").innerHTML;\n\tcb[5] = document.getElementById(\"five\").innerHTML;\n\tcb[6] = document.getElementById(\"six\").innerHTML\n\tcb[7] = document.getElementById(\"seven\").innerHTML;\n\tcb[8] = document.getElementById(\"eight\").innerHTML;\n\tcb[9] = document.getElementById(\"nine\").innerHTML;\n\n\t// choose random boxes until an empty box is found\n\tdo {\n\t\tlet rand = parseInt(Math.random()*9) + 1;\n\t\tidName = idNames[rand-1];\n\n\t\t// top row\n\t\tif (cb[1] != \"\" && cb[1] == cb[2] && cb[3] == \"\") {\n\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[2] != \"\" && cb[2] == cb[3] && cb[1] == \"\") {\n\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[1] != \"\" && cb[1] == cb[3] && cb[2] == \"\") {\n\t\t\tdocument.getElementById(\"two\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\t\n\t\t// middle row\n\t\tif (cb[4] != \"\" && cb[4] == cb[5] && cb[6] == \"\") {\n\t\t\tdocument.getElementById(\"six\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[5] != \"\" && cb[5] == cb[6] && cb[4] == \"\") {\n\t\t\tdocument.getElementById(\"four\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[4] != \"\" && cb[4] == cb[6] && cb[5] == \"\") {\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// bottom row\n\t\tif (cb[7] != \"\" && cb[7] == cb[8] && cb[9] == \"\") {\n\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[7] != \"\" && cb[7] == cb[9] && cb[8] == \"\") {\n\t\t\tdocument.getElementById(\"eight\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[8] != \"\" && cb[8] == cb[9] && cb[7] == \"\") {\n\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// left colomn\n\t\tif (cb[1] != \"\" && cb[1] == cb[4] && cb[7] == \"\") {\n\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[4] != \"\" && cb[4] == cb[7] && cb[1] == \"\") {\n\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[1] != \"\" && cb[1] == cb[7] && cb[4] == \"\") {\n\t\t\tdocument.getElementById(\"four\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// middle colomn\n\t\tif (cb[2] != \"\" && cb[2] == cb[5] && cb[8] == \"\") {\n\t\t\tdocument.getElementById(\"eight\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[5] != \"\" && cb[5] == cb[8] && cb[2] == \"\") {\n\t\t\tdocument.getElementById(\"two\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[2] != \"\" && cb[2] == cb[8] && cb[5] == \"\") {\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// right colomn\n\t\tif (cb[3] != \"\" && cb[3] == cb[6] && cb[9] == \"\") {\n\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[6] != \"\" && cb[6] == cb[9] && cb[3] == \"\") {\n\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[3] != \"\" && cb[3] == cb[9] && cb[6] == \"\") {\n\t\t\tdocument.getElementById(\"six\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// top left to bottom right diagonal\n\t\tif (cb[1] != \"\" && cb[1] == cb[5] && cb[9] == \"\") {\n\t\t\tdocument.getElementById(\"nine\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[5] != \"\" && cb[5] == cb[9] && cb[1] == \"\") {\n\t\t\tdocument.getElementById(\"one\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[1] != \"\" && cb[1] == cb[9] && cb[5] == \"\") {\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// top right to bottom left diagonal\n\t\tif (cb[7] != \"\" && cb[7] == cb[3] && cb[5] == \"\") {\n\t\t\tdocument.getElementById(\"five\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[3] != \"\" && cb[3] == cb[5] && cb[7] == \"\") {\n\t\t\tdocument.getElementById(\"seven\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} else if (cb[7] != \"\" && cb[7] == cb[5] && cb[3] == \"\") {\n\t\t\tdocument.getElementById(\"three\").innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t\t// check if div tag is empty \n\t\tif (document.getElementById(idName).innerHTML == \"\") {\n\t\t\tdocument.getElementById(idName).innerHTML = currentPlayer;\n\t\t\tbreak;\n\t\t} // if\n\n\t} while(true);\n\n} // computerTakeTurn()", "function startEvaluation(){\n //console.log('population: ' + neat.population.length)\n highestScore = 0;\n\n //for(var genome in neat.population){\n for(var v=0;v<neat.population.length;v++){\n genome = neat.population[v];\n if(!players[v]){\n //console.log('didnt exist')\n players.push()\n players[v] = new Player(genome, v);\n } else {\n //console.log('existed')\n var oldPos = players[v].getPos()\n var oldScore = players[v].getScore()\n //console.log(oldScore, oldPos)\n players.splice(v,1)\n players[v] = new Player(genome, v);\n\n //fix NaN's\n oldPos.x = isNaN(oldPos.x) ? 0 : oldPos.x\n oldPos.y = isNaN(oldPos.y) ? 0 : oldPos.y\n oldPos.ax = isNaN(oldPos.ax) ? 0 : oldPos.ax\n oldPos.ay = isNaN(oldPos.ay) ? 0 : oldPos.ay\n oldPos.vx = isNaN(oldPos.vx) ? 0 : oldPos.vx\n oldPos.vy = isNaN(oldPos.vy) ? 0 : oldPos.vy\n\n\n players[v].setPos(oldPos)\n players[v].setScore(oldScore * .5)\n }\n }\n\n walker.reset();\n}", "function game(){\n\twhile(rounds<5){\n\t\tconst playerSelection = playerPLay();\n\t\tconst computerSelection = computerPlay();\n\t\tconsole.log(playRound(playerSelection, computerSelection));\n\t\tconsole.log(\"Scoreboard: Won: \" + won + \" Lost: \" + lost + \" Drawn: \" + drawn );\n\t\trounds++;\n\t}\n\n}", "function didYouWin() {\n if (cells[0].textContent == player && cells[1].textContent == player && cells[2].textContent == player) {\n declareWinner(player);\n } else if (cells[3].textContent == player && cells[4].textContent == player && cells[5].textContent == player) {\n declareWinner(player);\n } else if (cells[6].textContent == player && cells[7].textContent == player && cells[8].textContent == player) {\n declareWinner(player);\n } else if (cells[0].textContent == player && cells[3].textContent == player && cells[6].textContent == player) {\n declareWinner(player);\n } else if (cells[1].textContent == player && cells[4].textContent == player && cells[7].textContent == player) {\n declareWinner(player);\n } else if (cells[2].textContent == player && cells[5].textContent == player && cells[8].textContent == player) {\n declareWinner(player);\n } else if (cells[0].textContent == player && cells[4].textContent == player && cells[8].textContent == player) {\n declareWinner(player);\n } else if (cells[2].textContent == player && cells[4].textContent == player && cells[6].textContent == player) {\n declareWinner(player);\n } else {\n // If no one wins the game on this move, check for a tie --\n tieGame();\n }\n}", "function getWinningMove() {\n var winPos = false;\n var opPos = false;\n //console.log(possibleWins);\n //console.log(possibleWinsOp);\n\n //This loop analyses if the AI has two consecutive Os\n for (var i = 0; i < possibleWinsOp.length; i++) {\n for (var j = 0; j < oponentStack.length; j++) {\n possibleWinsOp[i] = possibleWinsOp[i].filter(function(value) {\n return value !== oponentStack[j];\n })\n }\n\n if (possibleWinsOp[i].length == 1 && possibleWinsOp[i][0] !== -1) {\n //console.log(\"Turning on opPos\");\n //console.log(possibleWinsOp);\n opPos = true;\n var draw = possibleWinsOp[i][0].toString().split(\"\");\n draw.push('#');\n draw = draw.reverse();\n //console.log(\"Drawing winning 0 at \" + draw);\n //console.log(possibleWinsOp);\n drawFigure(draw.join(\"\"), ai);\n\n //The oponent will have won the game when this happens\n //so prompt properly.\n alert(\"Lost brah.\");\n location.reload(false);\n }\n }\n\n //This for loop analyses if the oponent has two consecutive\n //Xs\n if (!opPos) {\n var replacer = -2;\n for (var i = 0; i < possibleWins.length; i++) {\n\n for (var j = 0; j < playStack.length; j++) {\n possibleWins[i] = possibleWins[i].filter(function(value) {\n return value !== playStack[j];\n })\n }\n\n if (possibleWins[i].length == 1 && possibleWins[i][0] !== -1) {\n replacer = possibleWins[i][0];\n //console.log(\"Turning on winPos\");\n //console.log(\"Winning combination \" + possibleWins[i]);\n //console.log(possibleWins);\n winPos = true;\n var draw = possibleWins[i][0].toString().split(\"\");\n oponentStack.push(possibleWins[i][0]);\n draw.push(\"#\");\n draw = draw.reverse();\n drawFigure(draw.join(\"\"), ai);\n\n //Now we are goign to mark this value as not a possible win.\n }\n\n }\n //Proper filter.\n for (var i = 0; i < possibleWins.length; i++) {\n for (var j = 0; j < possibleWins[i].length; j++) {\n if (possibleWins[i][j] === replacer) {\n possibleWins[i][j] = -1;\n }\n }\n }\n\n }\n\n //If there are no consecutive Xs or Os, just play wherever.\n if (!winPos && !opPos) {\n //console.log(\"No winning possibilities for each side.\");\n for (var i = 0; i < possibleWinsOp.length; i++) {\n if (possibleWinsOp[i].length == 2) {\n\n if (possibleWinsOp[i][0] !== -1) {\n var draw = possibleWinsOp[i][0].toString().split(\"\");\n oponentStack.push(possibleWinsOp[i][0]);\n draw.push('#');\n draw = draw.reverse();\n drawFigure(draw.join(\"\"), ai);\n break;\n\n } else if (possibleWinsOp[i][1] !== -1) {\n\n var draw = possibleWinsOp[i][1].toString().split(\"\");\n oponentStack.push(possibleWinsOp[i][1]);\n draw.push('#');\n draw = draw.reverse();\n drawFigure(draw.join(\"\"), ai);\n break;\n }\n\n }\n }\n }\n\n}", "function nextPlayer() {\n //für ersten Durchlauf von nextPlayer(ganz oben in der js Datei) wird Standard der erste Spieler ausgewählt,\n //damit dieser als erster an der Reihe ist\n if (defaulthervorheben) {\n document.getElementById(\"playerbox1\").classList.add(\"hervorheben\");\n defaulthervorheben = false;\n return;\n }\n\n //falls im Startbildschirm kein Knopf gedrückt wurde ist totalAmount undefined und es gibt nur einen Spieler\n if (totalAmount == undefined) {\n document.getElementById(\"playerbox1\").classList.add(\"hervorheben\");\n return;\n }\n\n //falls nur explizit ein Spieler ausgewählt wurde ist dieser immer an der Reihe\n if (totalAmount == 1) {\n document.getElementById(\"playerbox1\").classList.add(\"hervorheben\");\n return;\n }\n\n //für den Rest der Möglichkeiten von totalAmount wird jedes Mal eine for-Schleife aufgerufen, wenn nextPlayer() aufgerufen wurde,\n //um den nächsten Spieler zu bestimmen, der die Klasse \"hervorheben\" bekommt\n //dem Spieler der nicht mehr an der Reihe ist wird die Klasse \"hervorheben\" entzogen\n for (let i = 0; i < players.length; i++) {\n //vergleichs Variable wird als Referenz benutzt, um zu sehen wer an der Reihe ist\n if (players[i].getAttribute(\"value\") == vergleich) {\n players[i].classList.remove(\"hervorheben\");\n }\n if (players[(i + 1) % totalAmount].getAttribute(\"value\") == (vergleich + 1) % totalAmount) {\n players[(i + 1) % totalAmount].classList.add(\"hervorheben\");\n }\n }\n\n //Variable wird hochgezählt, damit sie gleich der value des nächsten Spielers ist\n vergleich++;\n //vergleich wird modulo genommen, damit sie in der range von totalAmount bleibt\n vergleich %= totalAmount;\n}", "function checkForWin(player) {\n for (let i = 0; i < winningMoves.length; i++) {\n let winningMove = winningMoves[i];\n for (let j = 0; j < winningMove.length; j++) {\n if (\n player.playerCells.some(\n (playerCellVal) => playerCellVal === winningMove[j]\n ) &&\n player.playerCells.some(\n (playerCellVal) => playerCellVal === winningMove[j + 1]\n ) &&\n player.playerCells.some(\n (playerCellVal) => playerCellVal === winningMove[j + 2]\n )\n ) {\n winner = true;\n player.playerScore += 1;\n markWinningMove(winningMove, player);\n }\n }\n }\n updateAnnouncementBoard(player);\n}", "function playOnce(playerMove, computerMove){\n\n var winner = getWinner(playerMove, computerMove);\n\n winner = getWinner(playerMove, computerMove);\n\n\n if(winner===\"player\" || winner===\"computer\"){\n $('.winner').html(\"<p>\" + winner.toUpperCase() + \" won this round!\" + \"</p>\");\n }\n else{\n $('.winner').html(\"<p>It's a TIE!</p>\");\n }\n\n return winner;\n\n}", "function startTheGame() {\n\n // Removes the previous user who won\n winingUser = undefined;\n\n // Remove all the previous distributed cards for each user\n for (let userIterator = 0; userIterator < numberOfPlayers; userIterator++) {\n users[userIterator].cards = [];\n users[userIterator].doesTripletExist = false;\n users[userIterator].doesSequenceExists = false;\n users[userIterator].doesPairExists = false;\n }\n\n // Remove the HTML node for the previous game \n removeThePreviousCardsForAllUsers();\n\n // Distribute the cards for the deck among the users\n for (let cardsIterator = 0; cardsIterator < numberOfCardsDealt; cardsIterator++) {\n for (let userIterator = 0; userIterator < numberOfPlayers; userIterator++) {\n // Get a new deck if running out of cards\n if (deck1.deck.length < 4) {\n deck1 = new Deck();\n }\n // Get the card from the shuffled deck\n users[userIterator].cards.push(deck1.deal());\n }\n }\n\n // Sort the card in ascending value\n for (let userIterator = 0; userIterator < numberOfPlayers; userIterator++) {\n users[userIterator].sortTheCard();\n }\n\n // Create the HTML element for the each card of the user\n deck1.renderTheDistibutedCards();\n\n // Find the winner\n winingUser = declareTheWinner();\n\n // Add better user message\n if (winingUser) {\n document.getElementById('userWhoWon').innerHTML = winingUser.userName + ' won the game since he has';\n if (winingUser.doesTripletExist) {\n document.getElementById('userWhoWon').innerHTML += ' triplets.';\n }\n else if (winingUser.doesSequenceExists) {\n document.getElementById('userWhoWon').innerHTML += ' sequence.';\n }\n else if (winingUser.doesPairExists) {\n document.getElementById('userWhoWon').innerHTML += ' a pair.';\n }\n else {\n document.getElementById('userWhoWon').innerHTML += ' highest number.';\n }\n }\n}", "function findOpponent(currPlayer, socket)\n{\n\tconsole.log(\"socket room \" +socket.room);\n\tvar room = io.sockets.adapter.rooms[socket.room];\n\tconsole.log(\"opponent room \");\n\t//console.dir(rooms[socket.room].players);\n\tvar key = Object.keys(rooms[socket.room].players);\n\tconsole.log(\"got the key\");\n\t\n\tfor(var i = 0;i<key.length;i++)\n\t{\n\t\tif(rooms[socket.room].players[key[i]] && rooms[socket.room].players[key[i]].id != currPlayer.id)\n\t\t{\n\t\t\tconsole.log(\"curr player id \" + currPlayer.id + \" player id \" + rooms[socket.room].players[key[i]].id);\n\t\t\treturn rooms[socket.room].players[key[i]];\n\t\t}\n\t}\n\t\n\tconsole.log(\"No opponent found\");\n}", "function game() {\n //First round\n let playerSelection = prompt(\"Round one! Rock, Paper or Scissors?\");\n playerSelection = playerSelection.toLowerCase();\n let computerSelection = computerPlay();\n console.log(`You chose ${playerSelection}. Computer chose ${computerSelection}.`);\n console.log(playRound(playerSelection, computerSelection));\n console.log(`You: ${playerScore} points, Computer: ${computerScore} points.`);\n\n //Second round\n playerSelection = prompt(\"Round two! Rock, Paper or Scissors?\");\n playerSelection = playerSelection.toLowerCase();\n computerSelection = computerPlay();\n console.log(`You chose ${playerSelection}. Computer chose ${computerSelection}.`);\n console.log(playRound(playerSelection, computerSelection));\n console.log(`You: ${playerScore} points, Computer: ${computerScore} points.`);\n\n //Third round\n playerSelection = prompt(\"Round three! Rock, Paper or Scissors?\");\n playerSelection = playerSelection.toLowerCase();\n computerSelection = computerPlay();\n console.log(`You chose ${playerSelection}. Computer chose ${computerSelection}.`);\n console.log(playRound(playerSelection, computerSelection));\n console.log(`You: ${playerScore} points, Computer: ${computerScore} points.`);\n\n //Fourth round\n playerSelection = prompt(\"Round four! Rock, Paper or Scissors?\");\n playerSelection = playerSelection.toLowerCase();\n computerSelection = computerPlay();\n console.log(`You chose ${playerSelection}. Computer chose ${computerSelection}.`);\n console.log(playRound(playerSelection, computerSelection));\n console.log(`You: ${playerScore} points, Computer: ${computerScore} points.`);\n\n //Fifth round\n playerSelection = prompt(\"Round five! Rock, Paper or Scissors?\");\n playerSelection = playerSelection.toLowerCase();\n computerSelection = computerPlay();\n console.log(`You chose ${playerSelection}. Computer chose ${computerSelection}.`);\n console.log(playRound(playerSelection, computerSelection));\n console.log(`You: ${playerScore} points, Computer: ${computerScore} points.`);\n\n //Counts the score and announces the winner!\n if (playerScore > computerScore) {\n console.log(\"You won this game! Congratulations!\");\n } else if (computerScore > playerScore) {\n console.log(\"Darn! The computer won. Better luck next time!\");\n } else {\n console.log(\"It's a tie between you and the computer!\");\n }\n}", "function allPlayersReadyForNextRound(){\n return GameLobby.AllReadyForNextRound();\n}", "function compareScores(){\r\n var P1Score = 0;\r\n var P2Score = 0;\r\n var holeOwner,y,p,z,hello,holepic,hole;\r\n \r\n for(var i = 0; i<arrAll.length; i++){\r\n holeOwner = arrAll[i].owner;\r\n if(holeOwner === 0){\r\n y = arr[i].pic;\r\n hello = y.split('_');\r\n holepic = hello[1].split('.');\r\n hole = holepic[0]*1;\r\n P1Score += hole;\r\n }else if(holeOwner === 1){\r\n y = arr[i].pic;\r\n hello = y.split('_');\r\n holepic = hello[1].split('.');\r\n hole = holepic[0]*1;\r\n P2Score += hole; \r\n }else{}\r\n } \r\n \r\n var p1s = document.querySelector('.side_hole_pebbles_'+0).src;\r\n p = p1s.split('/');\r\n z = p[p.length-1];\r\n hello = z.split('_');\r\n holepic = hello[1].split('.');\r\n hole = holepic[0]*1;\r\n P1Score+=hole;\r\n \r\n var p2s = document.querySelector('.side_hole_pebbles_'+1).src;\r\n p = p2s.split('/');\r\n z = p[p.length-1];\r\n hello = z.split('_');\r\n holepic = hello[1].split('.');\r\n hole = holepic[0]*1;\r\n P2Score+=hole;\r\n \r\n console.log('Player one had '+ P1Score+' pebbles.');\r\n console.log('Player two had '+ P2Score+' pebbles.');\r\n \r\n if(P1Score>P2Score){\r\n winner(0);\r\n }else if(P2Score>P1Score){\r\n winner(1);\r\n }else{\r\n winner(2);\r\n }\r\n}", "function playRound(p1,p2){\r\n\r\n // 2 \r\n // Each player has name and getHand() properties.\r\n // they are assigned here so they get a new random # each iteration\r\n p1.hand = getHand();\r\n p2.hand = getHand();\r\n\r\n // console.log(p1, p2); //check that arguments came in correctly\r\n\r\n if(p1.hand === p2.hand){\r\n // console.log(\"It's a tie!\")\r\n p1.score.t++\r\n p2.score.t++\r\n }\r\n if(p1.hand === \"Rock\"){\r\n if(p2.hand === \"Paper\"){\r\n // console.log(p2.name + \" wins!\")\r\n p2.score.w++\r\n p1.score.l++\r\n }\r\n if(p2.hand === \"Scissors\"){\r\n // console.log(p1.name + \" wins!\")\r\n p1.score.w++\r\n p2.score.l++\r\n }\r\n }\r\n if(p1.hand === \"Paper\"){\r\n if(p2.hand === \"Scissors\"){\r\n // console.log(p2.name + \" wins!\")\r\n p2.score.w++\r\n p1.score.l++\r\n }\r\n if(p2.hand === \"Rock\"){\r\n // console.log(p1.name + \" wins!\")\r\n p1.score.w++\r\n p2.score.l++\r\n }\r\n }\r\n if(p1.hand === \"Scissors\"){\r\n if(p2.hand === \"Rock\"){\r\n // console.log(p2.name + \" wins!\")\r\n p2.score.w++\r\n p1.score.l++\r\n }\r\n if(p2.hand === \"Paper\"){\r\n // console.log(p1.name + \" wins!\")\r\n p1.score.w++\r\n p2.score.l++\r\n }\r\n }\r\n if(p1.score.w === 5){\r\n toFive = true;\r\n }\r\n if(p2.score.w === 5){\r\n toFive = true;\r\n }\r\n}", "function currentPlayerIndex(game) {\n const nPlayers = Math.max(1, game.players.length);\n return game.moves.length % game.players.length;\n}" ]
[ "0.58969826", "0.576506", "0.5762794", "0.5749759", "0.5748762", "0.5730111", "0.57104874", "0.5596486", "0.5595238", "0.5588162", "0.5580257", "0.55027974", "0.5490488", "0.5482675", "0.5481226", "0.54650235", "0.5448112", "0.5438046", "0.54368097", "0.5436074", "0.54358995", "0.5433911", "0.5428627", "0.5426954", "0.5413794", "0.5403392", "0.5397704", "0.53953636", "0.53895754", "0.53856796", "0.5376052", "0.5343055", "0.5342811", "0.5341034", "0.53277344", "0.5323579", "0.532065", "0.53104043", "0.530353", "0.5300497", "0.5299263", "0.5297366", "0.5273208", "0.52725637", "0.5272046", "0.5250846", "0.52508265", "0.5247008", "0.52372396", "0.52368206", "0.5232476", "0.52238387", "0.52219266", "0.52212065", "0.5221119", "0.52180326", "0.5213711", "0.5204821", "0.52035606", "0.5187638", "0.5184274", "0.51777595", "0.5177203", "0.5173098", "0.51660573", "0.5163167", "0.51602876", "0.51593745", "0.5151626", "0.5151319", "0.51439166", "0.5142469", "0.5137594", "0.5136761", "0.5136692", "0.51355016", "0.51347196", "0.51335245", "0.51333594", "0.5129412", "0.51283187", "0.51278776", "0.51273054", "0.51252544", "0.5124018", "0.51234573", "0.5123143", "0.51195145", "0.51184297", "0.511519", "0.51144356", "0.51137906", "0.51128995", "0.51099896", "0.51087403", "0.5106797", "0.5092566", "0.5091421", "0.50905985", "0.50905573" ]
0.72497416
0