nomic-ai/cornstack-javascript-v1 · Datasets at Fast360
{
// 获取包含Hugging Face文本的span元素
const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap');
spans.forEach(span => {
if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) {
span.textContent = 'AI快站';
}
});
});
// 替换logo图片的alt属性
document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => {
if (img.alt.match(/Hugging\s*Face/i)) {
img.alt = 'AI快站 logo';
}
});
}
// 替换导航栏中的链接
function replaceNavigationLinks() {
// 已替换标记,防止重复运行
if (window._navLinksReplaced) {
return;
}
// 已经替换过的链接集合,防止重复替换
const replacedLinks = new Set();
// 只在导航栏区域查找和替换链接
const headerArea = document.querySelector('header') || document.querySelector('nav');
if (!headerArea) {
return;
}
// 在导航区域内查找链接
const navLinks = headerArea.querySelectorAll('a');
navLinks.forEach(link => {
// 如果已经替换过,跳过
if (replacedLinks.has(link)) return;
const linkText = link.textContent.trim();
const linkHref = link.getAttribute('href') || '';
// 替换Spaces链接 - 仅替换一次
if (
(linkHref.includes('/spaces') || linkHref === '/spaces' ||
linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) &&
linkText !== 'OCR模型免费转Markdown' &&
linkText !== 'OCR模型免费转Markdown'
) {
link.textContent = 'OCR模型免费转Markdown';
link.href = 'https://fast360.xyz';
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener noreferrer');
replacedLinks.add(link);
}
// 删除Posts链接
else if (
(linkHref.includes('/posts') || linkHref === '/posts' ||
linkText === 'Posts' || linkText.match(/^s*Postss*$/i))
) {
if (link.parentNode) {
link.parentNode.removeChild(link);
}
replacedLinks.add(link);
}
// 替换Docs链接 - 仅替换一次
else if (
(linkHref.includes('/docs') || linkHref === '/docs' ||
linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) &&
linkText !== '模型下载攻略'
) {
link.textContent = '模型下载攻略';
link.href = '/';
replacedLinks.add(link);
}
// 删除Enterprise链接
else if (
(linkHref.includes('/enterprise') || linkHref === '/enterprise' ||
linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i))
) {
if (link.parentNode) {
link.parentNode.removeChild(link);
}
replacedLinks.add(link);
}
});
// 查找可能嵌套的Spaces和Posts文本
const textNodes = [];
function findTextNodes(element) {
if (element.nodeType === Node.TEXT_NODE) {
const text = element.textContent.trim();
if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') {
textNodes.push(element);
}
} else {
for (const child of element.childNodes) {
findTextNodes(child);
}
}
}
// 只在导航区域内查找文本节点
findTextNodes(headerArea);
// 替换找到的文本节点
textNodes.forEach(node => {
const text = node.textContent.trim();
if (text === 'Spaces') {
node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown');
} else if (text === 'Posts') {
// 删除Posts文本节点
if (node.parentNode) {
node.parentNode.removeChild(node);
}
} else if (text === 'Enterprise') {
// 删除Enterprise文本节点
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
});
// 标记已替换完成
window._navLinksReplaced = true;
}
// 替换代码区域中的域名
function replaceCodeDomains() {
// 特别处理span.hljs-string和span.njs-string元素
document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => {
if (span.textContent && span.textContent.includes('huggingface.co')) {
span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
});
// 替换hljs-string类的span中的域名(移除多余的转义符号)
document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => {
if (span.textContent && span.textContent.includes('huggingface.co')) {
span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
});
// 替换pre和code标签中包含git clone命令的域名
document.querySelectorAll('pre, code').forEach(element => {
if (element.textContent && element.textContent.includes('git clone')) {
const text = element.innerHTML;
if (text.includes('huggingface.co')) {
element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
// 处理特定的命令行示例
document.querySelectorAll('pre, code').forEach(element => {
const text = element.innerHTML;
if (text.includes('huggingface.co')) {
// 针对git clone命令的专门处理
if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) {
element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
// 特别处理模型下载页面上的代码片段
document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => {
const content = container.innerHTML;
if (content && content.includes('huggingface.co')) {
container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com');
}
});
// 特别处理模型仓库克隆对话框中的代码片段
try {
// 查找包含"Clone this model repository"标题的对话框
const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]');
if (cloneDialog) {
// 查找对话框中所有的代码片段和命令示例
const codeElements = cloneDialog.querySelectorAll('pre, code, span');
codeElements.forEach(element => {
if (element.textContent && element.textContent.includes('huggingface.co')) {
if (element.innerHTML.includes('huggingface.co')) {
element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com');
} else {
element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
}
// 更精确地定位克隆命令中的域名
document.querySelectorAll('[data-target]').forEach(container => {
const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string');
codeBlocks.forEach(block => {
if (block.textContent && block.textContent.includes('huggingface.co')) {
if (block.innerHTML.includes('huggingface.co')) {
block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com');
} else {
block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com');
}
}
});
});
} catch (e) {
// 错误处理但不打印日志
}
}
// 当DOM加载完成后执行替换
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
replaceHeaderBranding();
replaceNavigationLinks();
replaceCodeDomains();
// 只在必要时执行替换 - 3秒后再次检查
setTimeout(() => {
if (!window._navLinksReplaced) {
console.log('[Client] 3秒后重新检查导航链接');
replaceNavigationLinks();
}
}, 3000);
});
} else {
replaceHeaderBranding();
replaceNavigationLinks();
replaceCodeDomains();
// 只在必要时执行替换 - 3秒后再次检查
setTimeout(() => {
if (!window._navLinksReplaced) {
console.log('[Client] 3秒后重新检查导航链接');
replaceNavigationLinks();
}
}, 3000);
}
// 增加一个MutationObserver来处理可能的动态元素加载
const observer = new MutationObserver(mutations => {
// 检查是否导航区域有变化
const hasNavChanges = mutations.some(mutation => {
// 检查是否存在header或nav元素变化
return Array.from(mutation.addedNodes).some(node => {
if (node.nodeType === Node.ELEMENT_NODE) {
// 检查是否是导航元素或其子元素
if (node.tagName === 'HEADER' || node.tagName === 'NAV' ||
node.querySelector('header, nav')) {
return true;
}
// 检查是否在导航元素内部
let parent = node.parentElement;
while (parent) {
if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') {
return true;
}
parent = parent.parentElement;
}
}
return false;
});
});
// 只在导航区域有变化时执行替换
if (hasNavChanges) {
// 重置替换状态,允许再次替换
window._navLinksReplaced = false;
replaceHeaderBranding();
replaceNavigationLinks();
}
});
// 开始观察document.body的变化,包括子节点
if (document.body) {
observer.observe(document.body, { childList: true, subtree: true });
} else {
document.addEventListener('DOMContentLoaded', () => {
observer.observe(document.body, { childList: true, subtree: true });
});
}
})();
\";\n (function () { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, sendCartDetailsToApi(html)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n }); })();\n}","function viewCart() {\n // special case if there are no items in the cart\n if(cart.length === 0){\n return \"Your shopping cart is empty.\"\n } else {\n // create empty array\n var newArray = [];\n\n for(var i = 0; i < cart.length; i++){\n // special case for first item\n if(i === 0){\n newArray.push(`In your cart, you have ${cart[i].itemName} at $${cart[i].itemPrice}`)\n }\n // special case for last item\n else if(i + 1 === cart.length){\n console.log(\"hi\")\n newArray.push(` and ${cart[i].itemName} at $${cart[i].itemPrice}`);\n }else {\n // convert the Array of Objects into an Array of String\n newArray.push(` ${cart[i].itemName} at $${cart[i].itemPrice}`)\n }\n }\n // In your cart, you have bananas at $17, pancake batter at $5, and eggs at $49.\n return `${newArray.toString()}.`\n }\n}","function displaycart() {\n let cartItems = localStorage.getItem(\"productsInCart\");\n cartItems = JSON.parse(cartItems);\n console.log(cartItems)\n // for basket total price\n let totalPrice = localStorage.getItem(\"totalPrice\");\n // to display shopping products \n let productsIncart = document.querySelector(\".products\");\n if (cartItems && productsIncart) {\n productsIncart.innerHTML = \"\";\n // getting only product object from cartitems\n let cartItemsArray = Object.values(cartItems);\n console.log(Object.values(cartItems))\n //mapping of each item\n cartItemsArray.map(item => {\n // for each product in cart\n productsIncart.innerHTML += `\n
\n
\n
\n
${item.name} \n
\n
${item.price}
\n
\n \n ${item.inCart} \n \n
\n
\n ${item.inCart * item.price}\n
\n `;\n });\n console.log(totalPrice)\n // for basket total in cart.html\n productsIncart.innerHTML += `\n
\n
Basket Total \n ${totalPrice}.00 \n \n `;\n }\n changingQuantityOfCartItems();\n RemoveCartItem();\n\n\n}","function loadCart(){\r\n inames = JSON.parse(sessionStorage.getItem(\"inames\"));\r\n iprice = JSON.parse(sessionStorage.getItem(\"iprice\"));\r\n showCart();\r\n}","function loadShoppingCart() {\n console.log('setShoppingcart')\n \n // reset cart and values\n document.getElementsByClassName('all-cart-product')[0].innerHTML = \"\";\n total_items = 0;\n total = 0;\n\n // render cartItem to cart\n for (var i= 0; i< cart.length; i++){\n\n //update total numer of items\n total_items = total_items + cart[i].quantity;\n\n //update total price\n total = total + (cart[i].price * cart[i].quantity);\n\n var display_individualisation = cart[i].hasIndividualisation === false ? 'none': 'block';\n\n var individualisationwrapper = '';\n for (var k = 0; k < cart[i].individualisation.length; k++){\n individualisationwrapper+= '
'+cart[i].individualisation[k].value+'
';\n }\n \n\n var div = document.createElement('div');\n div.className = \"single-cart clearfix\";\n div.innerHTML = '
\\\n
\\\n
\\\n
\\\n
\\\n
\\\n
#'+ cart[i].itemId +'
\\\n
Preis: '+ cart[i].price.toLocaleString('de-DE', {maximumFractionDigits: 2, minimumFractionDigits: 2, minimumIntegerDigits:1 }) +' €
\\\n
Stück: '+ cart[i].quantity +'
\\\n
'+ individualisationwrapper +'
\\\n
\\\n
\\\n
\\\n
'\n document.getElementsByClassName('all-cart-product')[0].appendChild(div);\n\n } // End for-loop\n\n // set badge number\n document.getElementsByClassName('cart-icon')[0].querySelector('span').innerHTML = total_items;\n\n //set number in detail hover view\n document.getElementsByClassName('cart-items')[0].querySelector('p').innerHTML = $.i18n( 'you have $1 {{plural:$1|item|items}} in your shopping bag', total_items );\n \n // render total price\n document.getElementsByClassName('cart-totals')[0].querySelector('span').innerHTML = total.toLocaleString('de-DE', {maximumFractionDigits: 2, minimumFractionDigits: 2, minimumIntegerDigits:1 }) + ' €';\n\n //disable cart button if cart is empty\n if(total_items === 0){\n document.getElementsByClassName('cart-bottom')[0].style.display = 'none';\n document.getElementsByClassName('all-cart-product')[0].style.display = 'none';\n \n }else{\n document.getElementsByClassName('cart-bottom')[0].style.display = 'block';\n document.getElementsByClassName('all-cart-product')[0].style.display = 'block';\n }\n \n}","function updateCart(){\n\t\tstorage(['items', 'subtotal'], function(err, col){\n\t\t\t//console.log(\"Cart Collection - \" + JSON.stringify(col));\n\n\t\t\t//items = col[0];\n\t\t\t//subtotal = col[1];\n\n\t\t\tif(console) console.log(\"Items in Cart: \" + items);\n\t\t\tif(console) console.log(\"Subtotal of Cart: \" + subtotal);\n\t\t\t\n\t\t\t// update DOM Here\n\t\t\tdocument.getElementById( _options.itemsEleId ).innerHTML = items;\n\t\t\tdocument.getElementById( _options.subtotalEleId ).value = \"$\" + subtotal.toFixed(2);\n\n\t\t\t// reset default quantity input fields of products\n\t\t\tPRODUCTS.updateProducts();\n\t\t});\n\t}","function appendToCart(){\n ui.cartItems.innerHTML = \"\";\n cart.forEach((item)=>{\n ui.appendToCart(item.imgSrc,item.title,item.size,item.price,item.id,item.numberOfUnits);\n })\n}","function displayShoppingCart(){\n var orderedProductsTblBody=document.getElementById(\"orderedProductsTblBody\");\n //ensure we delete all previously added rows from ordered products table\n while(orderedProductsTblBody.rows.length>0) {\n orderedProductsTblBody.deleteRow(0);\n }\n\n //variable to hold total price of shopping cart\n var cart_total_price=0;\n //iterate over array of objects\n for(var product in shoppingCart){\n //add new row \n var row=orderedProductsTblBody.insertRow();\n //create three cells for product properties \n var cellName = row.insertCell(0);\n var cellDescription = row.insertCell(1);\n var cellPrice = row.insertCell(2);\n cellPrice.align=\"right\";\n //fill cells with values from current product object of our array\n cellName.innerHTML = shoppingCart[product].Name;\n cellDescription.innerHTML = shoppingCart[product].Description;\n cellPrice.innerHTML = shoppingCart[product].Price.toFixed(2);\n cart_total_price+=shoppingCart[product].Price;\n }\n //fill total cost of our shopping cart \n var temp = ((1.0919 * (cart_total_price.toFixed(2))) + 12.35);\n \n document.getElementById(\"cart_total\").innerHTML=\"$\" + temp.toFixed(2);\n var x = shoppingCart.length;\n document.getElementById(\"navigationTextCart\").innerHTML=\"Shopping Cart(\" + x + \")\";\n }","function updateShoppingCart(addQty) {\n\tvar totalItems = getTotalItemsCart() + addQty;\n\tdocument.getElementById('shopping-cart-text').innerHTML = totalItems + ' items';\n}","function showCart() {\n // TODO: Find the table body\n var tBody = document.getElementsByTagName('tbody')[0];\n // TODO: Iterate over the items in the cart\n for (var j = 0; j < cart.items.items.length; j++) {\n // TODO: Create a TR\n var cartTR = document.createElement('tr');\n // TODO: Create a TD for the delete link, quantity, and the item\n var removeBtnTD = document.createElement('td');\n var newBtn = document.createElement('button');\n newBtn.textContent = 'Delete this item';\n removeBtnTD.appendChild(newBtn);\n cartTR.appendChild(removeBtnTD);\n\n var pictureTD = document.createElement('td');\n var newPicture = document.createElement('img');\n newPicture.src = cart.items.items[j].product;\n cartTR.appendChild(pictureTD);\n pictureTD.appendChild(newPicture);\n\n var quantityTD = document.createElement('td');\n quantityTD.innerText = cart.items.items[j].quantity;\n cartTR.appendChild(quantityTD);\n\n // TODO: Add the TR to the TBODY and each of the TD's to the TR\n tBody.appendChild(cartTR);}\n}","function updateCartDetails() {\n var numberOfCartItems = 0;\n totalCost = 0;\n\n for (var i = 0; i < cartItems.length; i++) {\n numberOfCartItems = numberOfCartItems + cartItems[i][3];\n totalCost = totalCost + cartItems[i][2] * cartItems[i][3];\n }\n $(\"#numberOfCartItems\").text(numberOfCartItems);\n $(\"#cartItemTotal\").text(totalCost);\n if (numberOfCartItems > 3) {\n $(\".cart-item-container\").addClass(\"scrollable-menu\");\n } else {\n $(\".cart-item-container\").removeClass(\"scrollable-menu\");\n }\n\n displayCartItems();\n}","function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n let product = document.getElementById('items').value;\n let quantity = document.getElementById('quantity').value;\n // TODO: Add a new element to the cartContents div with that information\n let cartContents = document.querySelector('#cartContents');\n let newContent = document.createElement('p');\n newContent.innerText = `${quantity}: ${product}`;\n cartContents.appendChild(newContent);\n\n}","function updateCartPreview() {\n // DONE: Get the item and quantity from the form\n // DONE: Add a new element to the cartContents div with that information\n\n var itemAddedDisplayEl = document.getElementById('cartContents');\n var itemsEl = document.getElementById('items').value;\n var quantityEl = document.getElementById('quantity').value;\n itemAddedDisplayEl.textContent ='Item: ' + itemsEl + ' Quantity: ' + quantityEl;\n}","function loadCart(){\n cart = JSON.parse(sessionStorage.getItem('revonicCart')); // fetching original object items using JSON parse. \n }","function showCart() {\n // localStorage.getItem('items')\n // var cartTable = document.getElementById('cart')\n // if (localStorage.) {\n var allItemsString = localStorage.getItem('items');\n var allItemsData = JSON.parse(allItemsString);\n for (var i = 0; i < Cart.length; i++) {\n var tr = document.createElement('tr');\n var deleteLink = document.createElement('td');\n var deleteQuantity = document.createElement('td');\n var deleteItem = document.createElement('td');\n tr.appendChild(deleteItem);\n tr.appendChild(deleteQuantity);\n tr.appendChild(deleteLink);\n allItemsData.appendChild(tr);\n }\n}","function showCartItems() {\n const billItemContainer = document.querySelector(\".bill-items\");\n billItemContainer.innerHTML = \"\";\n if (cart.length > 0) {\n const billItem = document.createElement(\"div\");\n billItem.classList = \"bill-item\";\n const itemName = document.createElement(\"h4\");\n itemName.innerHTML = \"Name\";\n const itemQuantity = document.createElement(\"p\");\n itemQuantity.innerHTML = \"Qty\";\n const itemPrice = document.createElement(\"p\");\n itemPrice.innerHTML = \"Price\";\n\n billItem.appendChild(itemName);\n billItem.appendChild(itemQuantity);\n billItem.appendChild(itemPrice);\n\n billItemContainer.appendChild(billItem);\n }\n cart.map((item) => {\n const billItem = document.createElement(\"div\");\n billItem.classList = \"bill-item\";\n\n const itemName = document.createElement(\"h5\");\n itemName.innerHTML = item.name;\n const itemQuantity = document.createElement(\"p\");\n itemQuantity.innerHTML = ` x ${item.quantity}`;\n const itemPrice = document.createElement(\"p\");\n itemPrice.innerHTML = \"₹ \" + item.price;\n\n billItem.appendChild(itemName);\n billItem.appendChild(itemQuantity);\n billItem.appendChild(itemPrice);\n\n billItemContainer.appendChild(billItem);\n });\n}"],"string":"[\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n cart.updateCounter();\\n}\",\n \"function renderCart() {\\n\\n loadCart();\\n clearCart();\\n showCart();\\n updateCounter();\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n \\n}\",\n \"function renderCart() {\\r\\n loadCart();\\r\\n clearCart();\\r\\n showCart();\\r\\n}\",\n \"function renderCart() {\\n loadCart();\\n showCart();\\n}\",\n \"function showCart(cart){\\n setShowCarts(!showCarts);\\n fetchCart(cart);\\n }\",\n \"function showCart (req, res) {\\n const cart = req.session.cart\\n const total = Math.round((cart.reduce(function (sum, value) {\\n return sum + value.itemTotal\\n }, 0)) * 100) / 100\\n res.render('pages/cart', {cart, total})\\n}\",\n \"function renderCart() {\\n loadCart();\\n clearCart();\\n showCart();\\n\\n //create for process order\\n}\",\n \"function displayCart() {\\r\\n if (cart.products.length == 0) {\\r\\n document.getElementById('cart').innerHTML = '
No Product ';\\r\\n document.getElementById('order').style.display = 'none';\\r\\n } else {\\r\\n var cartCode = \\\"\\\";\\r\\n for (var i = 0; i < cart.products.length; i++) {\\r\\n var product = cart.products[i];\\r\\n var div = \\\"
\\\" + product.title + \\\" : \\\" + product.price + \\\"
\\\";\\r\\n cartCode += div;\\r\\n }\\r\\n\\r\\n cartCode += \\\"
TOTAL : \\\" + cart.total.toString() + \\\" TND \\\";\\r\\n\\r\\n document.getElementById('cart').innerHTML = cartCode;\\r\\n document.getElementById('order').style.display = 'block';\\r\\n }\\r\\n }\",\n \"function showCart() {\\n let cart = getCart();\\n let cartList = $(\\\"#cartList\\\");\\n let listString = \\\"\\\";\\n\\n if(cart === null){\\n cartList.html(\\\"
No items in cart
\\\");\\n } else {\\n for(let item of cart){\\n listString += \\\"
\\\" + \\\"\\\" + item.name + \\\" \\\" + \\\" \\\" +\\n \\\"$\\\" + item.price + \\\"/hour\\\";\\n }\\n listString += \\\" \\\";\\n cartList.html(listString);\\n }\\n\\n let totalHTML = $(\\\"#total\\\");\\n let total = 0.0;\\n for(let item of cart){\\n let p = parseFloat(item.price);\\n total += p;\\n }\\n totalHTML.html(\\\"$\\\" + total.toString() + \\\" Per Hour\\\");\\n\\n $(\\\"#clearCart\\\").click(clearCart);\\n }\",\n \"function showCart() {\\n // get the value and parse from session storage\\n let cart = JSON.parse(sessionStorage.getItem('cart'));\\n\\n if (cart === null) {\\n cart = [];\\n }\\n // if cart is empty set the table in the cart col md 3 section to display none\\n if (cart.length === 0) {\\n $('#cart').css('display', 'none');\\n $('#empty').text('You have no item in your cart.');\\n } else {\\n // otherwise show table by setting display to block, loop over all items in cart and create a new row for each item.\\n $('#cart').css('display', 'block');\\n\\n let html = '';\\n\\n let duplicates = [];\\n\\n for (let i in cart) {\\n let count = countDuplicates(cart[i].id);\\n\\n if (duplicates.indexOf(cart[i].id)== -1) {\\n html += `\\n
\\n ${count} \\n ${cart[i].title} \\n $${(cart[i].price*count).toFixed(2)} \\n \\n X \\n \\n \\n `;\\n duplicates.push(cart[i].id);\\n }\\n }\\n\\n\\n // send the proper string into the tbody section\\n $('tbody').html(html);\\n }\\n // call update totals\\n updateTotals();\\n }\",\n \"function displayCartItems () {\\r\\n // get cart items div and clear it\\r\\n const cartItemsDiv = document.getElementById('cartItems')\\r\\n cartItemsDiv.innerHTML = ''\\r\\n\\r\\n // retrive the cart and the catalogue fro storage\\r\\n const cart = JSON.parse(sessionStorage.getItem('cart'))\\r\\n const catalogue = JSON.parse(sessionStorage.getItem('catalogue'))\\r\\n\\r\\n // check if the cart is not empty\\r\\n if (cart.length !== 0) {\\r\\n let id = 0 // initiaise the id\\r\\n // iterate through the cart list\\r\\n cart.forEach(index => {\\r\\n // retrive the item object based on the index\\r\\n const item = catalogue[Number(index)]\\r\\n // display the item\\r\\n displayItem(item, id)\\r\\n // increment the id\\r\\n id++\\r\\n })\\r\\n\\r\\n // display the checkout div\\r\\n $('#checkoutDiv').css({ visibility: 'visible' })\\r\\n // get the total div and clear it\\r\\n const divTotal = document.getElementById('divTotal')\\r\\n divTotal.innerHTML = ''\\r\\n\\r\\n // create a h5 elemnt for the sub-total\\r\\n const subTotal = document.createElement('h5')\\r\\n subTotal.setAttribute('id', 'subtotalCartPrice')\\r\\n subTotal.style.textAlign = 'right'\\r\\n\\r\\n // create a h5 elemnt for the VAT\\r\\n const VATtotal = document.createElement('h5')\\r\\n VATtotal.setAttribute('id', 'VAT')\\r\\n VATtotal.style.textAlign = 'right'\\r\\n\\r\\n // create a h5 elemnt for the discount\\r\\n const discount = document.createElement('h5')\\r\\n discount.setAttribute('id', 'discount')\\r\\n discount.style.textAlign = 'right'\\r\\n discount.style.color = 'green'\\r\\n\\r\\n // create a h4 elemnt for the total\\r\\n const total = document.createElement('h4')\\r\\n total.setAttribute('id', 'totalCartPrice')\\r\\n total.style.textAlign = 'right'\\r\\n\\r\\n // create a check-out button\\r\\n const checkOutButton = document.createElement('button')\\r\\n checkOutButton.setAttribute('class', 'btn btn-outline-secondary')\\r\\n checkOutButton.setAttribute('onclick', 'checkout()') // handler function on click\\r\\n checkOutButton.setAttribute('id', 'checkOutButton')\\r\\n checkOutButton.style.float = 'right'\\r\\n checkOutButton.style.color = 'green'\\r\\n\\r\\n // create a cart icon\\r\\n const cartIcon = document.createElement('i')\\r\\n cartIcon.setAttribute('class', 'fas fa-shopping-cart')\\r\\n cartIcon.innerHTML = ' CHECKOUT'\\r\\n\\r\\n // add the icon the button\\r\\n checkOutButton.appendChild(cartIcon)\\r\\n\\r\\n // apped to the total div\\r\\n divTotal.appendChild(subTotal)\\r\\n divTotal.appendChild(VATtotal)\\r\\n divTotal.appendChild(discount)\\r\\n divTotal.appendChild(total)\\r\\n divTotal.appendChild(checkOutButton)\\r\\n\\r\\n // calculate the total & display it\\r\\n getCartTotal()\\r\\n } else {\\r\\n // hide notification and checkout div if cart is empty\\r\\n $('#checkoutDiv').css({ visibility: 'hidden' })\\r\\n $('#cartCounter').css({ visibility: 'hidden' })\\r\\n\\r\\n // if cart empty, clear the cart items div\\r\\n cartItemsDiv.innerHTML = ''\\r\\n // create a h4 element to display the 'cart empty' text\\r\\n const text = document.createElement('h4')\\r\\n text.setAttribute('class', 'text-center')\\r\\n text.innerHTML = 'Cart Empty'\\r\\n // add the text to the cart items div\\r\\n cartItemsDiv.appendChild(text)\\r\\n }\\r\\n}\",\n \"function showCart(cart) {\\n var cart_info = \\\"\\\";\\n for (var key in cart) {\\n if (cart.hasOwnProperty(key)) {\\n cart_info += key + \\\" : \\\" + cart[key] + \\\"\\\\n\\\";\\n }\\n }\\n var modal = document.getElementById(\\\"modal\\\");\\n modal.style.display = \\\"block\\\";\\n var modalContent = document.getElementById(\\\"modal-content\\\");\\n renderCart(modalContent, store)\\n inactiveTime = 0;\\n}\",\n \"function _showCart() {\\n _isCartVisible = true;\\n}\",\n \"function showCart() {\\n\\n const cartItems = JSON.parse(localStorage.getItem('cart')) || [];\\n cart = new Cart(cartItems);\\n // TODO: Find the table body\\n let tableBody= document.querySelector('tbody');\\n // TODO: Iterate over the items in the cart\\n // TODO: Create a TR\\n // TODO: Create a TD for the delete link, quantity, and the item\\n // TODO: Add the TR to the TBODY and each of the TD's to the TR\\n for (let i =0;i\\\" + \\\" \\\" + \\\" \\\" + names + \\\" \\\" + \\\"$\\\" + prices + \\\".00\\\" + \\\" \\\" + qtys + \\\" \\\" + \\\"$\\\" + subtotals + \\\".00\\\" + \\\" \\\" + \\\"\\\" + 'Remove' + \\\" \\\";\\n $('#cart-table').append(newRow);\\n //Update the total cost of items\\n var showTotal = parseInt(getTotal(cart,totalAmount));\\n $('#view-total').text(showTotal);\\n }\\n }\",\n \"function viewCart() {\\n\\n if (cart.length === 0) {\\n return \\\"Your shopping cart is empty.\\\"\\n\\n } else if (cart.length === 1) {\\n return \\\"In your cart, you have \\\" + `${cart[0].itemName} at $${cart[0].itemPrice}.`;\\n\\n } else if (cart.length === 2){\\n return \\\"In your cart, you have \\\" + `${cart[0].itemName} at $${cart[0].itemPrice}, and ${cart[1].itemName} at $${cart[1].itemPrice}.`;\\n\\n } else {\\n var allItemsPriceToView = \\\"In your cart, you have\\\";\\n for (var i=0; i < cart.length-1; i++) {\\n allItemsPriceToView += ` ${cart[i].itemName} at $${cart[i].itemPrice},`;\\n }\\n }\\n return allItemsPriceToView.concat(` and ${cart[cart.length-1].itemName} at $${cart[cart.length-1].itemPrice}.`) ;\\n\\n}\",\n \"function showCart() {\\n\\t$.ajax(\\n\\t{\\n\\t\\turl: 'php_scripts/actions.php',\\n\\t\\ttype: 'POST',\\n\\t\\tdata: 'action=show-cart',\\n\\t\\tdataType: 'JSON',\\n\\t\\tsuccess: function(data) {\\n\\t\\t\\tappendCartToDom(data);\\n\\n\\t\\t\\t//remove loading\\n\\t\\t\\tcloseLoading();\\n\\t\\t},\\n\\t\\terror: function(response) {\\n\\t\\t\\t//log js errors\\n\\t\\t\\tshortTimeMesg('Alert! No items found!', 'short-time-msg-failure');\\n\\n\\t\\t\\t//remove loading\\n\\t\\t\\tcloseLoading();\\n\\t\\t}\\n\\t}\\n\\t);\\n}\",\n \"function viewCart() {\\n $(\\\".modal-body\\\").empty();\\n shoppingCart.forEach(product => {\\n $(\\\".modal-body\\\").append(\\n `${product.product_name}
\\n ${product.stock_quantity}
`\\n );\\n });\\n\\n const total = getTotal();\\n\\n $(\\\".modal-body\\\").append(`
$${total}`);\\n }\",\n \"function cart(){\\n let cart=localStorage.getItem(\\\"cart\\\");\\n (cart)? showCart(cart) :alert(\\\"you don't have a cart yet!\\\")\\n }\",\n \"function updateCartPreview() {\\n // TODO: Get the item and quantity from the form\\n // TODO: Add a new element to the cartContents div with that information\\n}\",\n \"function renderCart() {\\n var prices = [];\\n\\n cartContent.innerHTML = \\\"\\\";\\n\\n cart.items.forEach(function(item) {\\n var itemPrice = parseFloat(item.price.replace(\\\"$ \\\", \\\"\\\")),\\n itemQuantity = parseInt(item.quantity);\\n\\n prices.push(itemPrice * itemQuantity);\\n cartContent.innerHTML += \\\"\\\" + item.name + \\\"
\\\";\\n })\\n\\n var totalPrice = prices.reduce(function(a, b) {\\n return a + b;\\n }, 0);\\n\\n cart.total = totalPrice.toFixed(2);\\n cartTotal.innerHTML = \\\"$ \\\" + cart.total;\\n }\",\n \"function viewCart() {\\n //console.log(cart)\\n var message = \\\"In your cart, you have\\\";\\n if (cart.length === 0) {\\n console.log(\\\"Your shopping cart is empty.\\\")\\n }\\n else if (cart.length === 1) {\\n console.log(message + \\\" \\\" + Object.keys(cart[0]) + \\\" at $\\\" + cart[0][Object.keys(cart[0])] + \\\".\\\")\\n }\\n else if (cart.length >= 2) {\\n var items = []\\n for (var i = 0; i < cart.length; i++) {\\n var itemName = Object.keys(cart[i])\\n var price = cart[i][itemName]\\n items.push(itemName + \\\" at $\\\" + price)\\n if (i != cart.length-1) {\\n cart.length === 2 ? message += \\\" \\\" + items[i] : message += (\\\" \\\" + items[i] + \\\",\\\")\\n }\\n else {\\n message += (\\\" and \\\" + items[i] + \\\".\\\")\\n }\\n }\\n console.log(message)\\n }\\n}\",\n \"function displayCart(){;\\r\\n document.getElementById('main').style.display = 'none'\\r\\n document.getElementById('details-page').style.display = 'none';\\r\\n document.getElementById('cart-container').style.display = 'block';\\r\\n if(cartList.length==0){\\r\\n document.getElementById('cart-with-items').style.display = 'none';\\r\\n document.getElementById('empty-cart').style.display = 'block';\\r\\n }\\r\\n else{\\r\\n document.getElementById('cart-with-items').style.display = 'block';\\r\\n document.getElementById('empty-cart').style.display = 'none';\\r\\n }\\r\\n}\",\n \"function showList() {\\n\\t\\t\\t$state.go('cart.list');\\n\\t\\t}\",\n \"function displayCart(){\\n let cartItems = localStorage.getItem(\\\"productsInCart\\\");\\n cartItems = JSON.parse(cartItems);\\n let productContainer = document.querySelector(\\\".products\\\");\\n let cartCost = localStorage.getItem('totalCost');\\n if(cartItems && productContainer ){\\n productContainer.innerHTML = '';\\n Object.values(cartItems).map(item => {\\n productContainer.innerHTML += `\\n \\n
\\n
\\n
${item.Productnaam} \\n
\\n $${item.Eenheidsprijs},00
\\n \\n \\n ${item.inCart} \\n \\n
\\n \\n $${item.inCart * item.Eenheidsprijs},00\\n
\\n `;\\n });\\n\\n productContainer.innerHTML += `\\n \\n
Basket Total \\n
€${cartCost},00 \\n `;\\n\\n }\\n}\",\n \"renderCarts(cart){\\n \\tif(cart.length>0){\\n \\t\\treturn cart.map(i=>
{i.name} )\\n \\t}else{\\n \\t\\treturn
No Items added \\n \\t}\\n \\t\\n }\",\n \"function getCart(){\\n let items = localStorage.getItem(\\\"cartProducts\\\");\\n items = JSON.parse(items);\\n\\n let container = document.querySelector(\\\".products\\\");\\n\\n // let baskettotal = document.querySelector(\\\".basket-total\\\");\\n\\n let totalCartCost = localStorage.getItem('totalCost');\\n totalCartCost = JSON.parse(totalCartCost);\\n displayCheckout();\\n // run only if items and .cart-container is running.\\n if (items && container) {\\n container.innerHTML = '';\\n\\n // check the values of the cart items\\n Object.values(items).map((item) => {\\n //display each basket item.\\n container.innerHTML += `\\n
\\n
\\n
${item.itemName}
\\n
\\n
\\n
$${item.price},00
\\n
${item.numInCart}
\\n
$${item.price * item.numInCart},00
\\n
\\n `\\n });\\n }\\n}\",\n \"function showItems() {\\n\\tconst qty = getQty()\\n\\tcartQty.innerHTML = `You have ${qty} items in your cart.`\\n\\t//console.log(`You have ${qty} items in your cart.`)\\n\\n\\tlet itemStr = ''\\n\\tfor (let i = 0; i < cart.length; i++) {\\n\\t\\tlet itemTotal = cart[i].price * cart[i].qty\\n\\t\\t//console.log(`- ${cart[i].name} - ${cart[i].price} x ${cart[i].qty}`)\\n\\t\\titemStr += `
\\n\\t\\t${cart[i].name} - ${cart[i].price} x ${cart[i].qty} = ${itemTotal.toFixed(2)}
\\n\\t\\tRemove \\n\\t\\t- \\n\\t\\t+ \\n\\t\\t`\\n\\t}\\n\\n\\t// make a list of all the items in the cart\\n\\titemList.innerHTML = itemStr\\n\\t\\n\\tconst total = getTotal()\\n\\tcartTotal.innerHTML = `Your cart total is: $${total}`\\n\\t//console.log(`Your cart total is: $${total}`)\\n}\",\n \"function viewCart() {\\nvar list = [];\\nif (cart.length === 0) {\\n return 'Your shopping cart is empty.'\\n}\\nfor (var i = 0; i < cart.length; i++) {\\n\\n if (cart.length === 1) {\\n list.push(`In your cart, you have ${cart[0].itemName} at $${cart[0].itemPrice}.`) \\n}\\n\\n else if (cart.length === 2) {\\n list.push(`In your cart, you have ${getCart()[0].itemName} at $${getCart()[0].itemPrice}, and ${getCart()[1].itemName} at $${getCart()[1].itemPrice}.`)\\n}\\n\\nelse{\\n list.push(`In your cart, you have ${getCart()[0].itemName} at $${getCart()[0].itemPrice}, ${getCart()[1].itemName} at $${getCart()[1].itemPrice}, and ${getCart()[2].itemName} at $${getCart()[2].itemPrice}.`)\\n}\\nreturn list;\\n}\\n}\",\n \"function showCart(id) {\\n // get value and parse sessionStorage\\n let cart = JSON.parse(sessionStorage.getItem('cart'));\\n // if cart is empty set the table in the cart col-md-3 section to display none\\n if (cart.length === 0) {\\n $('#cart-checkout').css('display','none');\\n $('#empty').html('
You have no items in your cart. ');\\n $('.total').text('Your cart is empty');\\n }\\n // otherwise show table by setting display to block, loop over all items in cart and create a new row for each item\\n else {\\n let html = \\\"\\\";\\n\\n // send the proper string into the tbody section\\n $('#cart').css('display','block');\\n\\n let duplicates = [];\\n\\n for (let product in cart) {\\n let count = countDuplicates(cart[product].id);\\n\\n if (duplicates.indexOf(cart[product].id) == -1) {\\n html += `\\n
\\n ${count} \\n ${cart[product].title} \\n $${(cart[product].price*count).toFixed(2)} \\n \\n X \\n \\n \\n `;\\n duplicates.push(cart[product].id);\\n }\\n }\\n\\n updateTotals();\\n $('tbody').html(html);\\n }\\n}\",\n \"function displayCart(){\\r\\n let cartItems = localStorage.getItem(\\\"productsInCart\\\");\\r\\n cartItems = JSON.parse(cartItems);\\r\\n let productContainer = document.querySelector\\r\\n (\\\".product\\\");\\r\\n let cartCost = localStorage.getItem('totalCost');\\r\\n\\r\\n console.log(cartItems);\\r\\n if( cartItems && productContainer){\\r\\n productContainer.innerHTML = '';\\r\\n Object.values(cartItems).map(item =>{\\r\\n productContainer.innerHTML += ` \\r\\n
\\r\\n \\r\\n ${item.name}M \\r\\n
\\r\\n
P${item.price}.00
\\r\\n
\\r\\n ${item.inCart} \\r\\n
\\r\\n
\\r\\n P${item.inCart * item.price}.00\\r\\n
\\r\\n `;\\r\\n });\\r\\n\\r\\n productContainer.innerHTML += ` \\r\\n
\\r\\n
\\r\\n Basket Total\\r\\n \\r\\n
\\r\\n P${cartCost}.00\\r\\n \\r\\n `;\\r\\n }\\r\\n}\",\n \"function displayCart() {\\n let cartItems = localStorage.getItem(\\\"productsInCart\\\");\\n cartItems = JSON.parse(cartItems);\\nconsole.log(cartItems);\\nlet cartCost = localStorage.getItem(\\\"totalCost\\\");\\nlet productContainer = document.querySelector(\\\".products\\\");\\n\\n\\nif(cartIems && productContainer){\\n productContainer.innerHTML = '';\\n\\n Object.values(cartItems)\\n .map(item=>{productContainer.innerHTML += `
\\n
\\n
${item.name} `\\n\\n `
$${item.price}.00
`\\n `
\\n ${item.inCart} \\n\\n
`\\n `
$${item.inCart * item.price},00
` \\n });\\n\\n productContainer.innerHTML += `
\\n
Basket Total \\n
$${cartCost}.00 `;\\nconsole.log(productContainer);\\n}\\n}\",\n \"function viewCart() {\\n console.log(buffer);\\n if (cartItems.length === 0) {\\n console.log(\\\"Your cart is empty\\\")\\n whatNext();\\n } else {\\n console.log(\\\"Items in cart:\\\");\\n for (var i = 0; i < cartItems.length; i++) {\\n console.log(cartItems[i] + \\\" x\\\" + CartAmount[i]);\\n }\\n console.log(\\\"\\\\nTotal: $\\\" + cartCost.reduce(add).toFixed(2));\\n inCart();\\n }\\n}\",\n \"function getCart() {\\n // api call to retrieve items in shopping cart\\n API.getCart()\\n .then(res=> {\\n // save how many cart items to the store for updating the cart total number in navbar from the store\\n dispatch({\\n type: \\\"numCartItems\\\",\\n numItems: res.data.length\\n })\\n })\\n}\",\n \"displayCart() {\\n const productsInCart = JSON.parse(localStorage.getItem('cart'));\\n if (productsInCart) {\\n // Si le panier n'est pas vide\\n let productsToDisplay = [];\\n const request = new Request();\\n request.getJson(\\\"/api/cameras/\\\")\\n .then(camerasFromDatabase => {\\n productsInCart.map(product => {\\n // Pour chaque item dans le panier, on cherche la caméra correspondante dans la base de données\\n const matchingCamera = camerasFromDatabase.filter(camera => camera._id == product.id)[0];\\n // On ajoute les bonnes infos à afficher\\n productsToDisplay.push({\\n \\\"id\\\": product.id,\\n \\\"name\\\": matchingCamera.name,\\n \\\"lenseId\\\": product.lenseId,\\n \\\"lenseName\\\": matchingCamera.lenses[product.lenseId],\\n \\\"quantity\\\": product.quantity,\\n \\\"price\\\": matchingCamera.price\\n })\\n })\\n // Construction du tableau html\\n const build = new BuildHtml();\\n build.cart(productsToDisplay);\\n // Ajout de l'event listener pour la suppression de 1 produit\\n const deleteBtns = document.querySelectorAll(\\\"#cartTableBody td:last-child\\\");\\n for (const deleteBtn of deleteBtns) {\\n deleteBtn.addEventListener('click', function() {\\n const cart = new Cart();\\n cart.delete1Item(this);\\n });\\n }\\n // Ajout de la liste des id qui sera envoyée pour la commande\\n let idList = []\\n productsToDisplay.map(product => {\\n for (let i = 0; i < product.quantity; i++) {\\n idList.push(product.id) \\n }\\n })\\n build.addProductListToForm(idList);\\n })\\n .catch(error => {\\n const build = new BuildHtml();\\n const errorDiv = build.errorMessage();\\n const targetDiv = document.getElementById('cartTable');\\n targetDiv.innerText = \\\"\\\";\\n targetDiv.appendChild(errorDiv);\\n })\\n document.querySelector(\\\".cart--btn__purchase\\\").disabled = false;\\n\\n } else {\\n // Si le panier est vide\\n document.getElementById(\\\"cartTable\\\").innerHTML = '
Votre panier est vide !
';\\n document.querySelector(\\\".cart--btn__purchase\\\").disabled = true;\\n }\\n }\",\n \"function Cart(){}\",\n \"function LoadCart()\\n{\\n\\tCart = JSON.parse(localStorage.getItem(\\\"ItemsInShoppingCart\\\"));\\n\\tDisplayItems();\\n\\tadd();\\n\\t//if the cart is not empty display cost and total items in cart page\\n\\t\\tif (TotalCount()>0) {\\n\\tdocument.getElementById('notempty').innerHTML = \\\"Total Items in Cart \\\" + String(TotalCount());\\n\\tdocument.getElementById('order').innerHTML = \\\" \\\";\\n\\tdocument.getElementById('currentprice').innerHTML = String(TotalCost());}\\n\\t\\n}\",\n \"viewCart() {\\n alert(\\\"View Cart\\\");\\n }\",\n \"function renderCart(cart, container) {\\n var idx, item;\\n \\n //empty the container of whatever is there currently\\n container.empty();\\n\\n //for each item in the cart...\\n var instance;\\n var subTotal = 0;\\n var str;\\n for (idx = 0; idx < cart.items.length; ++idx) {\\n item = cart.items[idx];\\n subTotal += +item.price; //Unary operator convert to int\\n instance = $(\\\"#template-cart-item\\\").clone();\\n\\n //Concatenate display string\\n str = item.name + \\\" (\\\";\\n if (item.size != null) {\\n \\tstr += item.size + \\\" - \\\";\\n }\\n str += \\\"$\\\" + item.price + \\\")\\\";\\n\\n\\t\\t//Display the cart item\\n instance.html(\\\"
\\\" + str);\\n\\t\\tvar tempImg = instance.find(\\\"img\\\");\\n\\t\\ttempImg.attr(\\\"data-index\\\", idx);\\n\\t\\ttempImg.addClass(\\\"delete-me\\\");\\n\\n instance.removeClass(\\\"js-template\\\");\\n\\t\\tcontainer.append(instance);\\n\\n\\t\\t//Delete item from cart\\n\\t\\t$(\\\".delete-me\\\").click(function() {\\n\\t\\t var idxToRemove = +(this.getAttribute('data-index'));\\n\\t\\t cart.items.splice(idxToRemove, 1);\\n\\t renderCart(cart, $('.cart-container'));\\n\\t\\t});\\n } //for each cart item\\n\\n\\n $(\\\"#cart-sub-total\\\").html(\\\"Sub-Total: $\\\" + subTotal);\\n var tax = (subTotal * .095).toFixed(2);\\n $(\\\"#cart-tax\\\").html(\\\"Tax: $\\\" + tax);\\n $(\\\"#cart-total\\\").html(\\\"Total: $\\\" + (+subTotal + +tax)); //Unary operators convert to int\\n} //renderCart()\",\n \"function displayCart() {\\n\\tshopcartOverlay.innerHTML = '';\\n\\tshopcartOverlay.style.display = 'block';\\n\\tshopBag.src = '/skate-shop/images/shopbag.svg';\\n\\tshopcartOverlay.style.right = '0';\\n\\tshopBag.src = '/skate-shop/images/xicon.png';\\n\\tlet storedCart = JSON.parse(localStorage.getItem('cart'));\\n\\tlet sum = 0;\\n\\t//INVOKING FUNCTION TO DISPLAY SHOPPING CART LABEL\\n\\tcartLabel();\\n\\t//PRINTING OUT THE CHOSEN ITEMS IN THE USER'S CART\\n\\tif (!storedCart) {\\n\\t\\treturn;\\n\\t} else {\\n\\t\\tstoredCart.forEach((item) => {\\n\\t\\t\\tshopcartOverlay.innerHTML += `\\n\\t\\t\\t
\\n\\t\\t\\t
\\n\\t\\t\\t
${item.name} \\n\\t\\t\\t
\\n\\t\\t\\t
Size: ${item.size}
\\n\\t\\t\\t
X
\\n\\t\\t\\n\\t\\t\\t
$${item.price}.00
\\n\\t\\t\\n\\t\\t\\t
${item.qty}
\\n\\t\\t\\t \\n\\t\\t\\t
$${item.price * item.qty}.00
\\n\\t\\t\\t
\\n\\t\\t\\t `;\\n\\n\\t\\t\\tsum += item.price * item.qty;\\n\\t\\t});\\n\\t}\\n\\n\\tshopcartOverlay.innerHTML += `\\n\\t
\\n\\t
Sub total is: $${sum}.00
\\n\\t
\\n\\t`;\\n\\tupdateCartCounter();\\n\\n\\t//HERE WE ARE CREATING THE DELETE BUTTONS AND INCREASE/DECECREASE ARROWS.\\n\\tlet deleteButtons = shopcartOverlay.querySelectorAll('.deleteButton');\\n\\tdeleteButtons.forEach((button) => {\\n\\t\\tbutton.addEventListener('click', removeFromCart);\\n\\t});\\n\\n\\tlet upArrow = document.querySelectorAll('.fa-angle-up');\\n\\tlet downArrow = document.querySelectorAll('.fa-angle-down');\\n\\tupArrow.forEach((button) => {\\n\\t\\tbutton.addEventListener('click', addMore);\\n\\t});\\n\\tdownArrow.forEach((button) => {\\n\\t\\tbutton.addEventListener('click', reduce);\\n\\t});\\n}\",\n \"function addCart() {\\n\\n\\t//Track number of items in cart\\n\\tif (cart){\\n\\t\\tcart++;\\n\\t}\\n\\telse {\\n\\t\\tcart = 1;\\n\\t}\\n\\n\\t//Display number of items in cart\\n\\tdocument.getElementById(\\\"num_cart\\\").innerHTML = cart;\\n\\tdocument.getElementById(\\\"num_cart\\\").style.display = \\\"inline-block\\\";\\n}\",\n \"function printCart() {\\n\\tconsole.log(\\\"ALL ITEMS IN SHOPPING CART\\\");\\n\\tconsole.log(\\\"-----------------------------\\\")\\n\\t// loops through the shoppingCart array\\n\\tfor (var i = 0; i < shoppingCart.length; i++) {\\n\\t\\t// placeholder variable because I hate typing\\n\\t\\tvar sC = shoppingCart[i];\\n\\t\\tvar sCPrice = sC.purchaseQTY * sC.price_customer\\n\\t\\tconsole.log(\\\"ITEM \\\" + (i + 1) + \\\" IN CART: \\\" + sC.product_name);\\n\\t\\tconsole.log(\\\"QTY: \\\" + sC.purchaseQTY + \\\" @ \\\" + sC.price_customer + \\\" = $\\\" + sCPrice);\\n\\t\\tconsole.log(\\\"-----------------------------\\\");\\n\\t}\\n\\tconsole.log(\\\"TOTAL PRICE OF CART : $\\\" + parseFloat(cartPrice));\\n}\",\n \"function addItemToCart() {}\",\n \"function addItemToCart() {}\",\n \"function showCart() {\\n // TODO: Find the table body\\n\\n // TODO: Iterate over the items in the cart\\n // Done\\n for(var ItemRow = 0 ; ItemRow < cart.items.length ; ItemRow++ ){\\n // TODO: Create a TR\\n // Done\\n var tr = document.createElement('tr');\\n tbody[0].appendChild(tr);\\n // TODO: Create a TD for the delete link, quantity, and the item\\n // Done\\n var td = document.createElement('td');\\n // var aLink = document.createElement('a');\\n td.textContent = 'X';\\n // td.appendChild(aLink);\\n tr.appendChild(td);\\n\\n td = document.createElement('td');\\n tr.appendChild(td);\\n\\n // td.textContent = Product.name;\\n console.log('cart.items : ', cart.items);\\n\\n\\n\\n\\n // for(var itemContent = 1 ; itemContent < 3 ; itemContent++ ){\\n // td = document.createElement('td');\\n // tr.appendChild(td);\\n // td.innerHTML = '' + cart.items[itemContent];\\n // }\\n\\n }\\n \\n \\n // TODO: Add the TR to the TBODY and each of the TD's to the TR\\n\\n}\",\n \"function showCart() {\\n\\n // TODO: Find the table body\\n\\n // TODO: Iterate over the items in the cart\\n // TODO: Create a TR\\nvar trElement=document.createElement('tr');\\n // TODO: Create a TD for the delete link, quantity, and the item\\n var tdRemove=document.createElement('td');\\n var tdQuantity=document.createElement('td');\\n var tdItem=document.createElement('td');\\n\\n // TODO: Add the TR to the TBODY and each of the TD's to the TR\\ntrElement.appendChild(tdRemove);\\ntrElement.appendChild(tdQuantity);\\ntrElement.appendChild(tdItem);\\ntable.appendChild(trElement);\\n\\n}\",\n \"function showCartNum() {\\n //check that all required objects exist in local storage and create local variables with their values\\n var itemsInCart;\\n var inCart;\\n if (sessionStorage.getItem(\\\"itemsInCart\\\") == null) {\\n //exit function if itemsInCart doesn't exist\\n alert(\\\"add: itemsInCart does not exist\\\");\\n return;\\n }\\n else {\\n itemsInCart = JSON.parse(sessionStorage.getItem(\\\"itemsInCart\\\"));\\n }\\n if (sessionStorage.getItem(\\\"inCart\\\") == null) {\\n alert(\\\"add: inCart does not exist\\\");\\n return;\\n }\\n else {\\n inCart = JSON.parse(sessionStorage.getItem(\\\"inCart\\\"));\\n }\\n //update html\\n document.getElementById(\\\"cartsize\\\").innerHTML = itemsInCart.toString();\\n //update html for each item in the store\\n for (var i = 0; i < inCart.length; i++) {\\n var id = \\\"incart\\\" + i;\\n document.getElementById(id).innerHTML = \\\"Amount in cart: \\\" + inCart[i].toString();\\n }\\n}\",\n \"function displayCart() {\\n let cartItems = localStorage.getItem(\\\"productsInCart\\\");\\n // when you grab object from localStorage we want to convert to JS objects\\n cartItems = JSON.parse(cartItems);\\n // check if products container is on page so that it only runs on this HTML page\\n let productContainer = document.querySelector('.products');\\n let cartCost = localStorage.getItem('totalCost');\\n\\n //calc VAT\\n const VAT_RATE = 0.15;\\n let totalVAT = cartCost * VAT_RATE;\\n // made use of unary plus operator, to force an eventual string to be treated\\n // as number, inside parenthesis to make the code more readable\\n // ref: https://stackoverflow.com/questions/8976627/how-to-add-two-strings-as-if-they-were-numbers\\n let sumTotal = (+totalVAT) + (+cartCost);\\n\\n // so we have something in cartItems and it has the container\\n if (cartItems && productContainer) {\\n productContainer.innerHTML = '';\\n Object.values(cartItems).map(item => {\\n productContainer.innerHTML += `\\n
\\n
\\n
\\n
\\n \\n
${item.name} \\n
\\n
\\n Price: ${item.price} \\n
\\n
\\n Quantity: ${item.inCart} \\n
\\n\\n
\\n Total Item Price: R${item.inCart * item.price} \\n
\\n `\\n });\\n productContainer.innerHTML += `\\n
\\n
\\n
Vat: R${totalVAT} \\n \\n Total(incl. Vat): R${sumTotal}\\n \\n \\n
\\n `\\n }\\n checkoutTotal(sumTotal);\\n return sumTotal;\\n}\",\n \"function showCart() {\\n\\n // TODO: Find the table body\\n // var tBody = document.getElementsByTagName('tbody');\\n\\n // TODO: Iterate over the items in the cart\\n for (var i = 0; i < cart.items.length; i++) {\\n // create table row and three table data\\n var row = document.createElement('tr');\\n var dataItem = document.createElement('td');\\n var dataQuantity = document.createElement('td');\\n var dataDelete = document.createElement('td');\\n\\n // fill data\\n dataItem.textContent = cart.items[i].product;\\n dataQuantity.textContent = cart.items[i].quantity;\\n dataDelete.textContent = 'X';\\n\\n // add data to row\\n row.appendChild(dataDelete);\\n row.appendChild(dataQuantity);\\n row.appendChild(dataItem);\\n\\n tBody[0].appendChild(row);\\n }\\n}\",\n \"function updateCart(){if(window.Cart&&window.Cart.updateCart){window.Cart.updateCart();}}\",\n \"function cartItem() {\\n\\titemsArray = JSON.parse(localStorage.getItem('item'));\\n\\tif (itemsArray !== null) {\\n\\t\\thtmlContent = `
(${\\n\\t\\t\\titemsArray.length\\n\\t\\t}) `;\\n\\t\\t$('.fa-shopping-cart')\\n\\t\\t\\t.parent()\\n\\t\\t\\t.html(htmlContent);\\n\\t} else {\\n\\t\\thtmlContent = `
(0) `;\\n\\t\\t$('.fa-shopping-cart')\\n\\t\\t\\t.parent()\\n\\t\\t\\t.html(htmlContent);\\n\\t}\\n}\",\n \"function showCart() {\\n //each component cart\\n $('.carts').empty();\\n $('.cart_component').empty();\\n $('.show_total_price').empty();\\n $('#render_lastcart').empty();\\n $.each(cart, (key, data) => {\\n $('.carts').append(\\n `
\\n \\n \\n \\n
\\n `\\n );\\n $('.cart_component').append(\\n `
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
${data.prodName} \\n
\\n \\n \\n
\\n
\\n
Màu: ${data.proColor} \\n\\n
/ Size: \\n
${data.proSize}
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n xóa \\n
\\n
\\n
`\\n );\\n $('.show_total_price').empty();\\n $('.show_total_price').append(`
Tổng Tiền: ${totalPrice()} VND `);\\n $('#render_lastcart').append(\\n `
\\n
\\n
\\n
${data.prodName.slice(0,20)+'. . .'}
\\n
\\n
${data.prodPrice}đ \\n
X ${data.prodQty}\\n
\\n
\\n
`\\n );\\n });\\n\\n //each total cart total component\\n if(cart.length > 0){\\n $('.number_item').empty();\\n $('.number_item').append(countTotalItem());\\n $('.total_cart').empty();\\n $('.total_cart').append(\\n `\\n
Đặt Hàng \\n
\\n Xem Giỏ Hàng \\n \\n
Tổng: ${totalPrice()}VND \\n `\\n );\\n }\\n if(cart.length < 1){\\n $('.number_item').empty();\\n console.log('ok');\\n $('.number_item').append(`0`);\\n $('.total_cart').empty();\\n $('.total_cart').append(`
Giỏ hàng đang trống `);\\n $('#auto-hide').addClass('invisible');\\n }\\n //event click delete item\\n $('.item-cart-del').on('click', function () {\\n const _self = $(this);\\n const index = _self.attr('itemid');\\n deleteItem(index);\\n });\\n // each component cart page\\n }\",\n \"function renderCart(cartItems) {\\n let cartContainer = document.querySelector(\\\"#cart\\\");\\n cartContainer.innerHTML = \\\"\\\";\\n if (cartItems.length > 0) {\\n \\n cartItems.map((cartItem) => {\\n cartContainer.innerHTML += `\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
${cartItem.product_name} \\n
${cartItem.brand}
\\n
R${cartItem.price}
\\n
\\n\\n
\\n Remove item \\n Checkout \\n
\\n\\n
\\n\\t\\t\\t\\t \\n\\t\\t\\t\\t \\n\\t\\t\\t\\t \\n\\t\\t\\t\\t
\\n
\\n \\n \\n \\n \\n \\n
\\n\\t\\t\\t \\n\\t\\t \\n\\n `;\\n });\\n let totalPrice = cartItems.reduce((total, item) => total + item.price, 0);\\n cartContainer.innerHTML += `
Your total is: ${totalPrice} `;\\n } else {\\n cartContainer.innerHTML = \\\"
No items in cart \\\";\\n }\\n}\",\n \"function renderCart(cartItems) {\\n let cartContainer = document.querySelector(\\\"#cart\\\");\\n cartContainer.innerHTML = \\\"\\\";\\n if (cartItems.length > 0) {\\n cartItems.map((cartItem) => {\\n cartContainer.innerHTML += `\\n
\\n
\\n
\\n
${cartItem.product_name} \\n
${cartItem.brand}
\\n
R${cartItem.price}
\\n
Remove item \\n
\\n \\n
\\n \\n \\n `;\\n });\\n let totalPrice = cartItems.reduce((total, item) => total + item.price, 0);\\n cartContainer.innerHTML += `
Your total is: ${totalPrice} `;\\n } else {\\n cartContainer.innerHTML = \\\"
No items in cart \\\";\\n }\\n}\",\n \"function showCart() {\\n\\n // TODO: Find the table body\\n var tbodyEl = document.getElementById('cart').childNodes[3];\\n\\n // TODO: Iterate over the items in the cart\\n for (var count = 0; count
{\\n displayMyCart(userInfo);\\n }).catch(handleError);\\n }\",\n \"function loadCart(products){\\n\\t\\tvar source = $(\\\"#my-cart-template\\\").html();\\n\\t\\tvar template = Handlebars.compile(source);\\n\\t\\t$(\\\"#my-cart\\\").append(template(products));\\n\\n\\t\\tvar currency = products.productsInCart[0].c_currency;\\n\\t\\tvar subTotalAmount = calculateSubTotal(products);\\n\\t\\tvar discountAmount = subTotalAmount * calculateDiscount(products);\\n\\t\\tvar pcv = calculatePromoCode();\\n\\t\\tvar sa = calculateShipping();\\n\\t\\tvar estimatedTotal = subTotalAmount - discountAmount - pcv + sa;\\n\\n\\t\\t//display calculated values here\\n\\n\\t\\t$(\\\"#count\\\").html(products.productsInCart.length);\\n\\t\\t$(\\\"._cur\\\").html(currency);\\n\\t\\t$(\\\".subtotal_amount\\\").html(displayCurrency(subTotalAmount));\\n\\t\\t$(\\\"._discount_amount\\\").html(displayCurrency(discountAmount));\\n\\t\\t$(\\\".promo_applied_amount\\\").html(displayCurrency(pcv));\\n\\t\\t$(\\\".shipping_amount\\\").html(displayCurrency(sa));\\n\\t\\t$(\\\".estimated_total_amount\\\").html(displayCurrency(estimatedTotal));\\n\\t\\t$(\\\"#e_o_l\\\").prev().css(\\\"display\\\", \\\"none\\\");;\\n\\t}\",\n \"function invokeItemPage(){\\n addCart();\\n displayCounter();\\n addCartForItem('carrot');\\n}\",\n \"function displayCart() {\\n // elements variables\\n\\tlet newElement,\\n\\t\\tc_tr,\\n\\t\\tc_th,\\n\\t\\tc_td,\\n cartDiv,\\n cartTable;\\n // increament and total variables\\n let count = 1,\\n subTotal = 0,\\n totalPrice = 0;\\n\\n\\tcartDiv = document.getElementById(\\\"cart\\\"); // Cart HTML element\\n\\n\\tif (Object.entries(cartItems).length === 0) {\\n\\t\\tcartDiv.innerHTML = \\\"Cart is empty!\\\";\\n\\t} else {\\n\\t\\t// add cart items:\\n\\t\\tcartDiv.innerHTML = \\\"\\\";\\n\\t\\tcartTable = document.createElement(\\\"table\\\");\\n\\t\\tcartTable.className = \\\"table table-sm\\\";\\n\\t\\tcartTable.innerHTML = `\\n \\n \\n No. \\n Item Name \\n Quantity \\n Price \\n Total \\n Action \\n \\n `;\\n\\n\\t\\tcartTableBody = document.createElement(\\\"tbody\\\");\\n // iterating through cartItems to disply in the table body.\\n\\t\\tfor (let key in cartItems) {\\n // calculating subTotal and totalPrice\\n\\t\\t\\tsubTotal = products[key].price * cartItems[key];\\n\\t\\t\\ttotalPrice += subTotal;\\n\\n\\t\\t\\tc_tr = document.createElement(\\\"tr\\\");\\n\\t\\t\\tc_th = document.createElement(\\\"th\\\");\\n\\t\\t\\tc_th.scope = \\\"row\\\";\\n\\t\\t\\tc_th.innerHTML = count;\\n\\t\\t\\tc_tr.appendChild(c_th);\\n\\n\\t\\t\\tc_td = document.createElement(\\\"td\\\");\\n\\t\\t\\tc_td.innerHTML = products[key].name; // item name\\n\\t\\t\\tc_tr.appendChild(c_td);\\n\\t\\t\\t\\n\\t\\t\\tc_td = document.createElement(\\\"td\\\");\\n\\t\\t\\tnewElement = document.createElement(\\\"input\\\"); // item quantity element\\n\\t\\t\\tnewElement.id = \\\"itemQuantity\\\";\\n\\t\\t\\tnewElement.type = \\\"number\\\";\\n\\t\\t\\tnewElement.min = 1;\\n\\t\\t\\tnewElement.dataset.id = key;\\n\\t\\t\\tnewElement.value = cartItems[key];\\n\\t\\t\\tnewElement.addEventListener(\\\"change\\\", updateTotals); // updating cart if quantity changes\\n\\t\\t\\tnewElement.innerHTML = cartItems[key];\\n\\t\\t\\tc_td.appendChild(newElement);\\n\\t\\t\\tc_tr.appendChild(c_td);\\n\\n\\t\\t\\tc_td = document.createElement(\\\"td\\\");\\n\\t\\t\\tc_td.innerHTML = `$${products[key].price}`; // item price\\n\\t\\t\\tc_tr.appendChild(c_td);\\n\\n\\t\\t\\tc_td = document.createElement(\\\"td\\\");\\n c_td.id = `subTotal_${key}`;\\n\\t\\t\\tc_td.innerHTML = `$${subTotal}`; // item subTotal\\n\\t\\t\\tc_tr.appendChild(c_td);\\n\\n\\t\\t\\tc_td = document.createElement(\\\"td\\\");\\n\\t\\t\\tnewElement = document.createElement(\\\"button\\\");\\n\\t\\t\\tnewElement.innerHTML = \\\"X\\\";\\n\\t\\t\\tnewElement.type = \\\"button\\\";\\n\\t\\t\\tnewElement.dataset.id = key;\\n\\t\\t\\tnewElement.className = \\\"btn btn-danger btn-sm\\\";\\n\\t\\t\\tnewElement.addEventListener(\\\"click\\\", removeFromCart); // removing item from Cart if clicked. \\n\\t\\t\\tc_td.appendChild(newElement);\\n\\t\\t\\tc_tr.appendChild(c_td);\\n\\n\\t\\t\\tcartTableBody.appendChild(c_tr);\\n\\t\\t\\tcount += 1; // items counter\\n\\t\\t}\\n\\n\\t\\tcartTable.appendChild(cartTableBody);\\n\\t\\tcartDiv.appendChild(cartTable);\\n\\n\\t\\t//displaying Total\\n\\t\\tnewElement = document.createElement(\\\"div\\\");\\n newElement.id = `total`;\\n\\t\\tnewElement.className = \\\"container text-end\\\";\\n\\t\\tnewElement.innerHTML = `Total : $${totalPrice}`;\\n\\t\\tcartDiv.appendChild(newElement);\\n\\t}\\n}\",\n \"function showCart(){\\n var parentContainer = document.querySelector('div.container')\\n var totalItems = 0;\\n var totalPrice = 0;\\n if(localStorage.getItem('cart')){\\n var cart = JSON.parse(localStorage.getItem('cart'))\\n }\\n else{\\n var msg = document.createElement('p');\\n msg.textContent = 'Sorry, cart is empty';\\n parentContainer.appendChild(msg)\\n var totalItemsSpan = document.querySelector('span.total-items')\\n var totalItemsPrice = document.querySelector('span.total-price')\\n\\n totalItemsSpan.textContent = totalItems;\\n totalItemsPrice.textContent = totalPrice;\\n return;\\n } \\n \\n\\n cart.forEach(function(el){\\n var productDiv = document.createElement('div');\\n\\n //Product Name\\n var productName = document.createElement('p');\\n productName.innerHTML = \\\"Product Name: \\\" + el['name'] + \\\" \\\";\\n productDiv.appendChild(productName);\\n\\n //Product Price\\n var productPrice = document.createElement('p');\\n productPrice.innerHTML = \\\"Price: $ \\\" + el['price'] + \\\" \\\";\\n productDiv.appendChild(productPrice);\\n // --- add to total price\\n totalItems++;\\n totalPrice += Number(el['price']);\\n\\n //Product URL\\n var productImage = document.createElement('p');\\n productImage.innerHTML = \\\"See image at: \\\" + el['url'] + \\\" \\\";\\n productDiv.appendChild(productImage);\\n\\n //Add To Cart Button\\n var addToCartBtn = document.createElement('button');\\n addToCartBtn.textContent = \\\"Add To Cart\\\";\\n addToCartBtn.setAttribute('class', 'add-to-cart');\\n productDiv.appendChild(addToCartBtn);\\n\\n parentContainer.appendChild(productDiv);\\n })\\n\\n var totalItemsSpan = document.querySelector('span.total-items')\\n var totalItemsPrice = document.querySelector('span.total-price')\\n\\n totalItemsSpan.textContent = totalItems;\\n totalItemsPrice.textContent = totalPrice;\\n\\n}\",\n \"function showCart() {\\n document.querySelector(\\\".cart__modal\\\").style.display = \\\"block\\\";\\n document.querySelector(\\\".cart__container\\\").style.display = \\\"block\\\";\\n document.querySelector(\\\".live__list\\\").classList.add(\\\"hidden\\\");\\n document.querySelector(\\\".laugh__list\\\").classList.add(\\\"hidden\\\");\\n document.querySelector(\\\".lounge__list\\\").classList.add(\\\"hidden\\\");\\n}\",\n \"function generateCartButtons() {\\n if (productsInCart.length > 0) {\\n emptyCart.style.display = \\\"block\\\";\\n cartCheckout.style.display = \\\"block\\\"\\n totalPrice.innerHTML = calculateTotalPrice() + \\\" kn\\\";\\n } else {\\n emptyCart.style.display = \\\"none\\\";\\n cartCheckout.style.display = \\\"none\\\";\\n }\\n }\",\n \"function displayCartItems(){\\n\\n //get cart from local storage\\n let cart = localStorage.getItem(\\\"cart\\\"); \\n \\n // split contents of cart local storage into 1d array\\n let bookList = cart.split('@@@');\\n var quantity = [];\\n var cList = \\\"\\\";\\n \\n // Change the 1 outer array into 2 dim array\\n // and create a HTML list\\n for (let z = 0; z\\\";\\n cList += currentBook.title;\\n cList += \\\"\\\"\\n cList += quantity[z];\\n cList += \\\" x $\\\"\\n cList += currentBook.price;\\n cList += \\\" \\\"; \\n }\\n \\n // Get total price\\n var cartTotal = parseInt(localStorage.getItem(\\\"cartTotal\\\"));\\n var tax = 0.0635;\\n var shipping = 4.99\\n \\n\\t// Display the table\\n\\tdocument.getElementById(\\\"checkoutList\\\").innerHTML = cList; \\n document.getElementById(\\\"checkoutSubtotal\\\").innerHTML = \\\"$\\\" + cartTotal.toFixed(2);\\n document.getElementById(\\\"taxes\\\").innerHTML = \\\"$\\\" + (cartTotal * tax).toFixed(2);\\n document.getElementById(\\\"shipping\\\").innerHTML = \\\"$\\\" + 4.99;\\n document.getElementById(\\\"checkoutTotalPrice\\\").innerHTML = \\\"$\\\" + totalCost();\\n localStorage.setItem(\\\"totalPrice\\\",((parseInt(cartTotal)* 1.0635)+4.99).toFixed(2));\\n \\n}\",\n \"function CartPage() {\\n\\treturn ;\\n}\",\n \"function showCart() {\\n\\n // TODO: Find the table body\\n var table = document.getElementById('cart');\\n // TODO: Iterate over the items in the cart\\n for(var i = 0; i < cart.items.length; i++) {\\n // TODO: Create a TR\\n var tr = document.createElement('tr');\\n // TODO: Create a TD for the delete link, quantity, and the item\\n var deleteLinkEl = document.createElement('td');\\n var a = document.createElement('a');\\n a.textContent = 'X';\\n a.href = '#';\\n deleteLinkEl.appendChild(a);\\n\\n var quantityEl = document.createElement('td');\\n quantityEl.textContent = cart.items[i].quantity;\\n\\n var itemEl = document.createElement('td');\\n itemEl.textContent = cart.items[0].product;\\n\\n // TODO: Add the TR to the TBODY and each of the TD's to the TR\\n tr.appendChild(deleteLinkEl);\\n tr.appendChild(quantityEl);\\n tr.appendChild(itemEl);\\n\\n table.appendChild(tr);\\n }\\n}\",\n \"function loadCheckOutPage()\\n{\\n displayCartItems();\\n}\",\n \"function processCartPage() {\\n var _this = this;\\n // Check current page is cart page\\n if (!isCartPage()) {\\n goToCartPage();\\n return;\\n }\\n // Get the body element\\n var content = document.querySelector(\\\"body\\\");\\n var html = \\\"\\\" + content.innerHTML + \\\"\\\";\\n (function () { return __awaiter(_this, void 0, void 0, function () {\\n return __generator(this, function (_a) {\\n switch (_a.label) {\\n case 0: return [4 /*yield*/, sendCartDetailsToApi(html)];\\n case 1:\\n _a.sent();\\n return [2 /*return*/];\\n }\\n });\\n }); })();\\n}\",\n \"function viewCart() {\\n // special case if there are no items in the cart\\n if(cart.length === 0){\\n return \\\"Your shopping cart is empty.\\\"\\n } else {\\n // create empty array\\n var newArray = [];\\n\\n for(var i = 0; i < cart.length; i++){\\n // special case for first item\\n if(i === 0){\\n newArray.push(`In your cart, you have ${cart[i].itemName} at $${cart[i].itemPrice}`)\\n }\\n // special case for last item\\n else if(i + 1 === cart.length){\\n console.log(\\\"hi\\\")\\n newArray.push(` and ${cart[i].itemName} at $${cart[i].itemPrice}`);\\n }else {\\n // convert the Array of Objects into an Array of String\\n newArray.push(` ${cart[i].itemName} at $${cart[i].itemPrice}`)\\n }\\n }\\n // In your cart, you have bananas at $17, pancake batter at $5, and eggs at $49.\\n return `${newArray.toString()}.`\\n }\\n}\",\n \"function displaycart() {\\n let cartItems = localStorage.getItem(\\\"productsInCart\\\");\\n cartItems = JSON.parse(cartItems);\\n console.log(cartItems)\\n // for basket total price\\n let totalPrice = localStorage.getItem(\\\"totalPrice\\\");\\n // to display shopping products \\n let productsIncart = document.querySelector(\\\".products\\\");\\n if (cartItems && productsIncart) {\\n productsIncart.innerHTML = \\\"\\\";\\n // getting only product object from cartitems\\n let cartItemsArray = Object.values(cartItems);\\n console.log(Object.values(cartItems))\\n //mapping of each item\\n cartItemsArray.map(item => {\\n // for each product in cart\\n productsIncart.innerHTML += `\\n \\n
\\n
\\n
${item.name} \\n
\\n ${item.price}
\\n \\n \\n ${item.inCart} \\n \\n
\\n \\n ${item.inCart * item.price}\\n
\\n `;\\n });\\n console.log(totalPrice)\\n // for basket total in cart.html\\n productsIncart.innerHTML += `\\n \\n
Basket Total \\n ${totalPrice}.00 \\n \\n `;\\n }\\n changingQuantityOfCartItems();\\n RemoveCartItem();\\n\\n\\n}\",\n \"function loadCart(){\\r\\n inames = JSON.parse(sessionStorage.getItem(\\\"inames\\\"));\\r\\n iprice = JSON.parse(sessionStorage.getItem(\\\"iprice\\\"));\\r\\n showCart();\\r\\n}\",\n \"function loadShoppingCart() {\\n console.log('setShoppingcart')\\n \\n // reset cart and values\\n document.getElementsByClassName('all-cart-product')[0].innerHTML = \\\"\\\";\\n total_items = 0;\\n total = 0;\\n\\n // render cartItem to cart\\n for (var i= 0; i< cart.length; i++){\\n\\n //update total numer of items\\n total_items = total_items + cart[i].quantity;\\n\\n //update total price\\n total = total + (cart[i].price * cart[i].quantity);\\n\\n var display_individualisation = cart[i].hasIndividualisation === false ? 'none': 'block';\\n\\n var individualisationwrapper = '';\\n for (var k = 0; k < cart[i].individualisation.length; k++){\\n individualisationwrapper+= ''+cart[i].individualisation[k].value+'
';\\n }\\n \\n\\n var div = document.createElement('div');\\n div.className = \\\"single-cart clearfix\\\";\\n div.innerHTML = '\\\\\\n
\\\\\\n
\\\\\\n
\\\\\\n
\\\\\\n
\\\\\\n
#'+ cart[i].itemId +'
\\\\\\n
Preis: '+ cart[i].price.toLocaleString('de-DE', {maximumFractionDigits: 2, minimumFractionDigits: 2, minimumIntegerDigits:1 }) +' €
\\\\\\n
Stück: '+ cart[i].quantity +'
\\\\\\n
'+ individualisationwrapper +'
\\\\\\n
\\\\\\n
\\\\\\n
\\\\\\n
'\\n document.getElementsByClassName('all-cart-product')[0].appendChild(div);\\n\\n } // End for-loop\\n\\n // set badge number\\n document.getElementsByClassName('cart-icon')[0].querySelector('span').innerHTML = total_items;\\n\\n //set number in detail hover view\\n document.getElementsByClassName('cart-items')[0].querySelector('p').innerHTML = $.i18n( 'you have $1 {{plural:$1|item|items}} in your shopping bag', total_items );\\n \\n // render total price\\n document.getElementsByClassName('cart-totals')[0].querySelector('span').innerHTML = total.toLocaleString('de-DE', {maximumFractionDigits: 2, minimumFractionDigits: 2, minimumIntegerDigits:1 }) + ' €';\\n\\n //disable cart button if cart is empty\\n if(total_items === 0){\\n document.getElementsByClassName('cart-bottom')[0].style.display = 'none';\\n document.getElementsByClassName('all-cart-product')[0].style.display = 'none';\\n \\n }else{\\n document.getElementsByClassName('cart-bottom')[0].style.display = 'block';\\n document.getElementsByClassName('all-cart-product')[0].style.display = 'block';\\n }\\n \\n}\",\n \"function updateCart(){\\n\\t\\tstorage(['items', 'subtotal'], function(err, col){\\n\\t\\t\\t//console.log(\\\"Cart Collection - \\\" + JSON.stringify(col));\\n\\n\\t\\t\\t//items = col[0];\\n\\t\\t\\t//subtotal = col[1];\\n\\n\\t\\t\\tif(console) console.log(\\\"Items in Cart: \\\" + items);\\n\\t\\t\\tif(console) console.log(\\\"Subtotal of Cart: \\\" + subtotal);\\n\\t\\t\\t\\n\\t\\t\\t// update DOM Here\\n\\t\\t\\tdocument.getElementById( _options.itemsEleId ).innerHTML = items;\\n\\t\\t\\tdocument.getElementById( _options.subtotalEleId ).value = \\\"$\\\" + subtotal.toFixed(2);\\n\\n\\t\\t\\t// reset default quantity input fields of products\\n\\t\\t\\tPRODUCTS.updateProducts();\\n\\t\\t});\\n\\t}\",\n \"function appendToCart(){\\n ui.cartItems.innerHTML = \\\"\\\";\\n cart.forEach((item)=>{\\n ui.appendToCart(item.imgSrc,item.title,item.size,item.price,item.id,item.numberOfUnits);\\n })\\n}\",\n \"function displayShoppingCart(){\\n var orderedProductsTblBody=document.getElementById(\\\"orderedProductsTblBody\\\");\\n //ensure we delete all previously added rows from ordered products table\\n while(orderedProductsTblBody.rows.length>0) {\\n orderedProductsTblBody.deleteRow(0);\\n }\\n\\n //variable to hold total price of shopping cart\\n var cart_total_price=0;\\n //iterate over array of objects\\n for(var product in shoppingCart){\\n //add new row \\n var row=orderedProductsTblBody.insertRow();\\n //create three cells for product properties \\n var cellName = row.insertCell(0);\\n var cellDescription = row.insertCell(1);\\n var cellPrice = row.insertCell(2);\\n cellPrice.align=\\\"right\\\";\\n //fill cells with values from current product object of our array\\n cellName.innerHTML = shoppingCart[product].Name;\\n cellDescription.innerHTML = shoppingCart[product].Description;\\n cellPrice.innerHTML = shoppingCart[product].Price.toFixed(2);\\n cart_total_price+=shoppingCart[product].Price;\\n }\\n //fill total cost of our shopping cart \\n var temp = ((1.0919 * (cart_total_price.toFixed(2))) + 12.35);\\n \\n document.getElementById(\\\"cart_total\\\").innerHTML=\\\"$\\\" + temp.toFixed(2);\\n var x = shoppingCart.length;\\n document.getElementById(\\\"navigationTextCart\\\").innerHTML=\\\"Shopping Cart(\\\" + x + \\\")\\\";\\n }\",\n \"function updateShoppingCart(addQty) {\\n\\tvar totalItems = getTotalItemsCart() + addQty;\\n\\tdocument.getElementById('shopping-cart-text').innerHTML = totalItems + ' items';\\n}\",\n \"function showCart() {\\n // TODO: Find the table body\\n var tBody = document.getElementsByTagName('tbody')[0];\\n // TODO: Iterate over the items in the cart\\n for (var j = 0; j < cart.items.items.length; j++) {\\n // TODO: Create a TR\\n var cartTR = document.createElement('tr');\\n // TODO: Create a TD for the delete link, quantity, and the item\\n var removeBtnTD = document.createElement('td');\\n var newBtn = document.createElement('button');\\n newBtn.textContent = 'Delete this item';\\n removeBtnTD.appendChild(newBtn);\\n cartTR.appendChild(removeBtnTD);\\n\\n var pictureTD = document.createElement('td');\\n var newPicture = document.createElement('img');\\n newPicture.src = cart.items.items[j].product;\\n cartTR.appendChild(pictureTD);\\n pictureTD.appendChild(newPicture);\\n\\n var quantityTD = document.createElement('td');\\n quantityTD.innerText = cart.items.items[j].quantity;\\n cartTR.appendChild(quantityTD);\\n\\n // TODO: Add the TR to the TBODY and each of the TD's to the TR\\n tBody.appendChild(cartTR);}\\n}\",\n \"function updateCartDetails() {\\n var numberOfCartItems = 0;\\n totalCost = 0;\\n\\n for (var i = 0; i < cartItems.length; i++) {\\n numberOfCartItems = numberOfCartItems + cartItems[i][3];\\n totalCost = totalCost + cartItems[i][2] * cartItems[i][3];\\n }\\n $(\\\"#numberOfCartItems\\\").text(numberOfCartItems);\\n $(\\\"#cartItemTotal\\\").text(totalCost);\\n if (numberOfCartItems > 3) {\\n $(\\\".cart-item-container\\\").addClass(\\\"scrollable-menu\\\");\\n } else {\\n $(\\\".cart-item-container\\\").removeClass(\\\"scrollable-menu\\\");\\n }\\n\\n displayCartItems();\\n}\",\n \"function updateCartPreview() {\\n // TODO: Get the item and quantity from the form\\n let product = document.getElementById('items').value;\\n let quantity = document.getElementById('quantity').value;\\n // TODO: Add a new element to the cartContents div with that information\\n let cartContents = document.querySelector('#cartContents');\\n let newContent = document.createElement('p');\\n newContent.innerText = `${quantity}: ${product}`;\\n cartContents.appendChild(newContent);\\n\\n}\",\n \"function updateCartPreview() {\\n // DONE: Get the item and quantity from the form\\n // DONE: Add a new element to the cartContents div with that information\\n\\n var itemAddedDisplayEl = document.getElementById('cartContents');\\n var itemsEl = document.getElementById('items').value;\\n var quantityEl = document.getElementById('quantity').value;\\n itemAddedDisplayEl.textContent ='Item: ' + itemsEl + ' Quantity: ' + quantityEl;\\n}\",\n \"function loadCart(){\\n cart = JSON.parse(sessionStorage.getItem('revonicCart')); // fetching original object items using JSON parse. \\n }\",\n \"function showCart() {\\n // localStorage.getItem('items')\\n // var cartTable = document.getElementById('cart')\\n // if (localStorage.) {\\n var allItemsString = localStorage.getItem('items');\\n var allItemsData = JSON.parse(allItemsString);\\n for (var i = 0; i < Cart.length; i++) {\\n var tr = document.createElement('tr');\\n var deleteLink = document.createElement('td');\\n var deleteQuantity = document.createElement('td');\\n var deleteItem = document.createElement('td');\\n tr.appendChild(deleteItem);\\n tr.appendChild(deleteQuantity);\\n tr.appendChild(deleteLink);\\n allItemsData.appendChild(tr);\\n }\\n}\",\n \"function showCartItems() {\\n const billItemContainer = document.querySelector(\\\".bill-items\\\");\\n billItemContainer.innerHTML = \\\"\\\";\\n if (cart.length > 0) {\\n const billItem = document.createElement(\\\"div\\\");\\n billItem.classList = \\\"bill-item\\\";\\n const itemName = document.createElement(\\\"h4\\\");\\n itemName.innerHTML = \\\"Name\\\";\\n const itemQuantity = document.createElement(\\\"p\\\");\\n itemQuantity.innerHTML = \\\"Qty\\\";\\n const itemPrice = document.createElement(\\\"p\\\");\\n itemPrice.innerHTML = \\\"Price\\\";\\n\\n billItem.appendChild(itemName);\\n billItem.appendChild(itemQuantity);\\n billItem.appendChild(itemPrice);\\n\\n billItemContainer.appendChild(billItem);\\n }\\n cart.map((item) => {\\n const billItem = document.createElement(\\\"div\\\");\\n billItem.classList = \\\"bill-item\\\";\\n\\n const itemName = document.createElement(\\\"h5\\\");\\n itemName.innerHTML = item.name;\\n const itemQuantity = document.createElement(\\\"p\\\");\\n itemQuantity.innerHTML = ` x ${item.quantity}`;\\n const itemPrice = document.createElement(\\\"p\\\");\\n itemPrice.innerHTML = \\\"₹ \\\" + item.price;\\n\\n billItem.appendChild(itemName);\\n billItem.appendChild(itemQuantity);\\n billItem.appendChild(itemPrice);\\n\\n billItemContainer.appendChild(billItem);\\n });\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.8199349","0.81431025","0.8133412","0.80924135","0.8089521","0.8068178","0.7787415","0.7765276","0.76981735","0.7637878","0.7539286","0.74299216","0.73395485","0.733077","0.73069745","0.7142177","0.7105021","0.70849437","0.7055095","0.7036373","0.7035375","0.6981543","0.6959859","0.690061","0.6867271","0.6854905","0.68249613","0.67887324","0.67676187","0.6762229","0.6738644","0.6714161","0.67117965","0.6700848","0.6697083","0.66721255","0.66632426","0.6649573","0.6639509","0.6639013","0.66378075","0.66108197","0.65949583","0.6584932","0.6572211","0.6572211","0.6566031","0.6555537","0.6544196","0.65303785","0.6487216","0.6486555","0.6484428","0.647699","0.6472853","0.6456912","0.6452567","0.6442823","0.6440311","0.6438655","0.64340454","0.6432576","0.6429647","0.6424538","0.64183307","0.64032775","0.6402287","0.640186","0.64016706","0.63979137","0.6397788","0.6378949","0.63629836","0.6355945","0.6330439","0.6327026","0.6318019","0.63145936","0.6311264","0.6309103","0.6307209","0.63000566","0.62914413","0.6287327"],"string":"[\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.8199349\",\n \"0.81431025\",\n \"0.8133412\",\n \"0.80924135\",\n \"0.8089521\",\n \"0.8068178\",\n \"0.7787415\",\n \"0.7765276\",\n \"0.76981735\",\n \"0.7637878\",\n \"0.7539286\",\n \"0.74299216\",\n \"0.73395485\",\n \"0.733077\",\n \"0.73069745\",\n \"0.7142177\",\n \"0.7105021\",\n \"0.70849437\",\n \"0.7055095\",\n \"0.7036373\",\n \"0.7035375\",\n \"0.6981543\",\n \"0.6959859\",\n \"0.690061\",\n \"0.6867271\",\n \"0.6854905\",\n \"0.68249613\",\n \"0.67887324\",\n \"0.67676187\",\n \"0.6762229\",\n \"0.6738644\",\n \"0.6714161\",\n \"0.67117965\",\n \"0.6700848\",\n \"0.6697083\",\n \"0.66721255\",\n \"0.66632426\",\n \"0.6649573\",\n \"0.6639509\",\n \"0.6639013\",\n \"0.66378075\",\n \"0.66108197\",\n \"0.65949583\",\n \"0.6584932\",\n \"0.6572211\",\n \"0.6572211\",\n \"0.6566031\",\n \"0.6555537\",\n \"0.6544196\",\n \"0.65303785\",\n \"0.6487216\",\n \"0.6486555\",\n \"0.6484428\",\n \"0.647699\",\n \"0.6472853\",\n \"0.6456912\",\n \"0.6452567\",\n \"0.6442823\",\n \"0.6440311\",\n \"0.6438655\",\n \"0.64340454\",\n \"0.6432576\",\n \"0.6429647\",\n \"0.6424538\",\n \"0.64183307\",\n \"0.64032775\",\n \"0.6402287\",\n \"0.640186\",\n \"0.64016706\",\n \"0.63979137\",\n \"0.6397788\",\n \"0.6378949\",\n \"0.63629836\",\n \"0.6355945\",\n \"0.6330439\",\n \"0.6327026\",\n \"0.6318019\",\n \"0.63145936\",\n \"0.6311264\",\n \"0.6309103\",\n \"0.6307209\",\n \"0.63000566\",\n \"0.62914413\",\n \"0.6287327\"\n]"},"document_score":{"kind":"string","value":"0.6980044"},"document_rank":{"kind":"string","value":"38"}}},{"rowIdx":554,"cells":{"query":{"kind":"string","value":"drag_util.js Utility functions for YUI darg and drop applications ///////////////////////////////////// Dependencies from YUI yahoomin.js dommin.js eventmin.js //////////////////// //////////////////////////// selectMultiple Event Handeler Uses Shift or Cmd/Ctrl click to select multiple items in a supplied container element ///// Variables //////////// ev JS Event use_parent Bool apply selected class to the clicked element or it's parent (e.g. for tables event is fired by td but selected class is applied to tr);"},"document":{"kind":"string","value":"function selectMultiple(ev, use_parent){\n var Dom = YAHOO.util.Dom,\n Event = YAHOO.util.Event;\n \n var dd = null;\n var tar = Event.getTarget(ev);\n if(use_parent){\n tar = tar.parentNode;\n } \n var kids = tar.parentNode.getElementsByTagName(tar.tagName);\n //Event.stopEvent(ev);\n //If the shift key is pressed, add it to the list\n if (ev.metaKey || ev.ctrlKey) {\n if (tar.className.search(/selected/) > -1) {\n Dom.removeClass(tar, 'selected');\n } else {\n Dom.addClass(tar, 'selected');\n }\n }else if(ev.shiftKey) {\n var sel = false;\n for (var i = 0 ; i < kids.length ; i++){\n if(!sel && kids.item(i).className.search(/selected/) > -1){\n sel = true;\n }\n if(sel){\n Dom.addClass(kids.item(i), 'selected');\n }\n if(kids.item(i) == tar){ // shift clicked elem reached\n if(!sel){ //selection either below or no other row selected\n for (var ii = i ; ii < kids.length ; ii++){\n if(!sel && kids.item(ii).className.search(/selected/) > -1){\n sel = true;\n }else if(sel && kids.item(ii).className.search(/selected/) == -1){\n break;\n }\n Dom.addClass(kids.item(ii), 'selected');\n }\n if(!sel){ //no second row selected\n for (var ii = i + 1 ; i < kids.length ; i++){\n Dom.removeClass(kids.item(ii), 'selected');\n }\n }\n }\n break; \n }\n }\n }else {\n for (var i = 0 ; i < kids.length ; i++){\n kids.item(i).className = '';\n }\n Dom.addClass(tar, 'selected');\n }\n \n //clear any highlighted text from the defualt shift-click functionality\n clearSelection();\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function initializeMultipleSelectBoxMouseEvent($container) {\r\n\t\tvar $document = $(document);\r\n\t\t/* process container event */\r\n\t\t$container.bind(\"mousedown.\" + PLUGIN_NAMESPACE, function(e) {\r\n\t\t\t/* disable text selection */\r\n\t\t\te.preventDefault();\r\n\t\t\t/* starting row */\r\n\t\t\tvar target = e.target;\r\n\t\t\tvar $target = $(target);\r\n\t\t\tvar $startRow = $target;\r\n\t\t\t/* correct the focus for chrome */\r\n\t\t\tif (target == this) {\r\n\t\t\t\treturn;\r\n\t\t\t} else if ($target.parent()[0] != this) {\r\n\t\t\t\ttarget.focus();\r\n\t\t\t\t$startRow = $target.parents(\".\" + PLUGIN_NAMESPACE + \">*\").eq(0);\r\n\t\t\t} else {\r\n\t\t\t\tthis.focus();\r\n\t\t\t}\r\n\t\t\tvar startIndex = $startRow.getMultipleSelectBoxRowIndex($container);\r\n\t\t\tvar currentIndex = startIndex;\r\n\t\t\t/* trigger callback */\r\n\t\t\tif (!fireOnSelectStartEvent(e, $container, startIndex)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t/* prepare info for drawing */\r\n\t\t\tvar options = $container.getMultipleSelectBoxOptions();\r\n\t\t\tvar containerHistory = $container.getMultipleSelectBoxHistory();\r\n\t\t\t/* opposite and retain selection for touch device */\r\n\t\t\tvar isTouchDeviceMode = options.isTouchDeviceMode;\r\n\t\t\tvar isSelectionOpposite = isTouchDeviceMode;\r\n\t\t\tvar isSelectionRetained = isTouchDeviceMode;\r\n\t\t\tif (options.isKeyEventEnabled) {\r\n\t\t\t\tif (e.shiftKey) {\r\n\t\t\t\t\tcurrentIndex = startIndex;\r\n\t\t\t\t\tstartIndex = containerHistory.selectingStartIndex;\r\n\t\t\t\t} else if (e.ctrlKey) {\r\n\t\t\t\t\tisSelectionOpposite = isSelectionRetained = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/* starting */\r\n\t\t\t$container.addClass(PLUGIN_STYLE_SELECTING).drawMultipleSelectBox(startIndex, currentIndex, {\r\n\t\t\t\t\"isSelectionOpposite\": isSelectionOpposite,\r\n\t\t\t\t\"isSelectionRetained\": isSelectionRetained,\r\n\t\t\t\t\"scrollPos\": null\r\n\t\t\t});\r\n\t\t\t/* listening */\r\n\t\t\tvar scrollHelperFunc = function(e1) {\r\n\t\t\t\toptions.scrollHelper(e1, $container, startIndex, isSelectionRetained);\r\n\t\t\t};\r\n\t\t\t$container.yieldMultipleSelectBox().bind(\"mouseenter.\" + PLUGIN_NAMESPACE, function() {\r\n\t\t\t\tunbindEvents($document, [ \"mousemove\" ]);\r\n\t\t\t}).bind(\"mouseleave.\" + PLUGIN_NAMESPACE, function(e1) {\r\n\t\t\t\tscrollHelperFunc(e1);\r\n\t\t\t\t$document.bind(\"mousemove.\" + PLUGIN_NAMESPACE, function(e2) {\r\n\t\t\t\t\tscrollHelperFunc(e2);\r\n\t\t\t\t});\r\n\t\t\t}).bind(\"mouseover.\" + PLUGIN_NAMESPACE, function(e1) {\r\n\t\t\t\tscrollHelperFunc(e1);\r\n\t\t\t}).one(\"mouseup.\" + PLUGIN_NAMESPACE, function(e1) {\r\n\t\t\t\tscrollHelperFunc(e1);\r\n\t\t\t});\r\n\t\t\t/* IE hacked for mouse up event */\r\n\t\t\tif (isIE) {\r\n\t\t\t\t$document.bind(\"mouseleave.\" + PLUGIN_NAMESPACE, function() {\r\n\t\t\t\t\t$document.one(\"mousemove.\" + PLUGIN_NAMESPACE, function(e1) {\r\n\t\t\t\t\t\tif (!e1.button) {\r\n\t\t\t\t\t\t\tvalidateMultipleSelectBox(e1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t/* select group items automatically */\r\n\t\t$container.getMultipleSelectBoxCachedRows().filter(\".\" + PLUGIN_STYLE_OPTGROUP).bind(\"dblclick.\" + PLUGIN_NAMESPACE, function(e) {\r\n\t\t\tvar $startRow = $(this);\r\n\t\t\t/* trigger callback */\r\n\t\t\tif (!fireOnSelectStartEvent(e, $container, $startRow.getMultipleSelectBoxRowIndex($container))) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar options = $container.getMultipleSelectBoxOptions();\r\n\t\t\tvar maxLimit = options.maxLimit;\r\n\t\t\tvar childGroupItemList = $startRow.getMultipleSelectBoxOptGroupItems();\r\n\t\t\tvar childGroupItemSelectSize = childGroupItemList.length;\r\n\t\t\tif (childGroupItemSelectSize > 0) {\r\n\t\t\t\tif (maxLimit > 0 && childGroupItemSelectSize > maxLimit) {\r\n\t\t\t\t\tchildGroupItemSelectSize = maxLimit;\r\n\t\t\t\t}\r\n\t\t\t\t$container.drawMultipleSelectBox(childGroupItemList.eq(0).getMultipleSelectBoxRowIndex($container), childGroupItemList.eq(childGroupItemSelectSize - 1).getMultipleSelectBoxRowIndex($container), {\r\n\t\t\t\t\t\"scrollPos\": null\r\n\t\t\t\t});\r\n\t\t\t\t/* special case */\r\n\t\t\t\t$container.addClass(PLUGIN_STYLE_SELECTING);\r\n\t\t\t\tvalidateMultipleSelectBox(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}","function initMultipleSelection(element) {\n element.on('click', 'li.type-task, li.type-sub-task', function (eventObject) {\n if (!eventObject.ctrlKey) {\n $('li.selected', element).not(this).removeClass('selected');\n }\n $(this).toggleClass('selected');\n eventObject.stopPropagation();\n });\n}","click(event){\n if(event.target.tagName === \"MULTI-SELECTION\"){\n const onContainerMouseClick = this.onContainerMouseClick;\n\n if(onContainerMouseClick){\n onContainerMouseClick();\n }\n }\n }","function doSelections(event, selectedEles, cols) {\n // Select elements in a range, either across rows or columns\n function selectRange() {\n var frstSelect = selectedEles[0];\n var lstSelect = selectedEles[selectedEles.length - 1];\n if (cols) {\n var flipStart = flipFlipIdx(Math.min(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n var flipEnd = flipFlipIdx(Math.max(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n selectElemsDownRows(Math.min(flipStart, flipEnd), Math.max(flipStart, flipEnd));\n } else {\n var start = Math.min(selectionMinPivot, frstSelect);\n var end = Math.max(selectionMaxPivot, lstSelect);\n selectElemRange(start, end);\n }\n }\n // If not left mouse button then leave it for someone else\n if (event.which != LEFT_MOUSE_BUTTON) {\n return;\n }\n // Just a click - make selection current row/column clicked on\n if (!event.ctrlKey && !event.shiftKey) {\n clearAll();\n selectEles(selectedEles);\n selectionMinPivot = selectedEles[0];\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\n return;\n }\n // Cntrl/Shift click - add to current selections cells between (inclusive) last single selection and cell\n // clicked on\n if (event.ctrlKey && event.shiftKey) {\n selectRange();\n return;\n }\n // Cntrl click - keep current selections and add toggle of selection on the single cell clicked on\n if (event.ctrlKey) {\n toggleEles(selectedEles);\n selectionMinPivot = selectedEles[0];\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\n return;\n }\n // Shift click - make current selections cells between (inclusive) last single selection and cell clicked on\n if (event.shiftKey) {\n clearAll();\n selectRange();\n }\n }","function selectedDblclick( event ) {\n if ( self.cfg.onSelectedDblclick.length > 0 &&\n ( $(event.target).hasClass('selected') || $(event.target).closest('g').hasClass('selected') ) )\n for ( var n=0; n 0)) {\n\t// The click target is one of .brow cell,\n\t// .rbkmkitem_x div, .rtwistieac div, favicon img or .favttext span\n\t// Find cell, for selection\n\tlet cell;\n\tif (className.includes(\"fav\") || className.startsWith(\"rtwistie\")) {\n\t cell = target.parentElement.parentElement;\n\t}\n\telse if (className.startsWith(\"rbkmkitem_\")) {\n\t cell = target.parentElement;\n\t}\n\telse if (className.includes(\"brow\")) {\n\t cell = target;\n\t}\n\n\t// Select result item if recognized\n\t// , and if not already selected=> keep bigger multi-items selection area if right click inside it \n\tif (cell != undefined) {\n\t let button = e.button;\n\t // Do nothing on selection if this is a right click inside a selection range\n\t if ((button != 2) || !cell.classList.contains(rselection.selectHighlight)) {\n//\t\tsetCellHighlight(rcursor, rlastSelOp, cell, rselection.selectIds);\n\t\tif (button == 1) { // If middle click, simple select, no multi-select\n\t\t addCellCursorSelection(cell, rcursor, rselection);\n\t\t}\n\t\telse {\n\t\t let is_ctrlKey = (isMacOS ? e.metaKey : e.ctrlKey);\n\t\t addCellCursorSelection(cell, rcursor, rselection, true, is_ctrlKey, e.shiftKey);\n\t\t}\n\t }\n\t}\n }\n}","set_selected_items(top, left, width, height) {\n this.selection_items.forEach((selected_item, item_index) => {\n if (this.is_element_selected(selected_item.element, top, left, width, height)) {\n selected_item.element.classList.add(this.options.selected_class_name);\n this.selection_items[item_index].is_selected = true;\n } else {\n if (selected_item.is_selected) {\n selected_item.element.classList.add(this.options.selected_class_name);\n this.selection_items[item_index].is_selected = true;\n return;\n }\n }\n });\n }","function defaultScrollHelper(e, $container, startIndex, isSelectionRetained) {\r\n\t\tif (e.type == \"mouseover\") {\r\n\t\t\t/* on mouse down and than mouse over */\r\n\t\t\tvar $childTarget = $(e.target);\r\n\t\t\tif ($container[0] != $childTarget.parent()[0]) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdefaultScrollHelperUtils.stopTimer();\r\n\t\t\t$container.drawMultipleSelectBox(startIndex, $childTarget.getMultipleSelectBoxRowIndex($container), {\r\n\t\t\t\t\"isSelectionRetained\": isSelectionRetained,\r\n\t\t\t\t\"scrollPos\": null\r\n\t\t\t});\r\n\t\t} else if (e.type == \"mouseup\") {\r\n\t\t\t/* on mouse down and than mouse up */\r\n\t\t\tdefaultScrollHelperUtils.stopTimer();\r\n\t\t} else if (e.type == \"mouseleave\") {\r\n\t\t\t/* on mouse down and than mouse leave */\r\n\t\t} else if (e.type == \"mousemove\") {\r\n\t\t\t/* on mouse down and than mouse leave and moving */\r\n\t\t\tvar options = $container.getMultipleSelectBoxOptions();\r\n\t\t\tvar isHorizontalMode = options.isHorizontalMode;\r\n\t\t\tdefaultScrollHelperUtils.mousePos = (isHorizontalMode ? e.pageX : e.pageY);\r\n\t\t\tdefaultScrollHelperUtils.startTimer(function() {\r\n\t\t\t\tvar containerViewport = $container.getMultipleSelectBoxViewport();\r\n\t\t\t\tvar containerBackPos = containerViewport.getTopPos();\r\n\t\t\t\tvar containerFrontPos = containerViewport.getBottomPos();\r\n\t\t\t\tvar containerScrollPos = containerViewport.getScrollTop();\r\n\t\t\t\tvar containerVisibleRange = containerViewport.getHeight();\r\n\t\t\t\tif (isHorizontalMode) {\r\n\t\t\t\t\tcontainerBackPos = containerViewport.getLeftPos();\r\n\t\t\t\t\tcontainerFrontPos = containerViewport.getRightPos();\r\n\t\t\t\t\tcontainerScrollPos = containerViewport.getScrollLeft();\r\n\t\t\t\t\tcontainerVisibleRange = containerViewport.getWidth();\r\n\t\t\t\t}\r\n\t\t\t\tvar scrollToPos = containerScrollPos;\r\n\t\t\t\tvar targetPos = scrollToPos;\r\n\t\t\t\tvar scrollSpeed = options.scrollSpeed;\r\n\t\t\t\t/* mousemove event is triggered when mouse out of the box only */\r\n\t\t\t\tvar mousePos = defaultScrollHelperUtils.mousePos;\r\n\t\t\t\tif (mousePos < containerBackPos) {\r\n\t\t\t\t\tscrollToPos -= scrollSpeed;\r\n\t\t\t\t\ttargetPos = scrollToPos;\r\n\t\t\t\t} else if (mousePos > containerFrontPos) {\r\n\t\t\t\t\tscrollToPos += scrollSpeed;\r\n\t\t\t\t\ttargetPos = scrollToPos + containerVisibleRange;\r\n\t\t\t\t}\r\n\t\t\t\t/* calculate cuurentIndex */\r\n\t\t\t\t$container.drawMultipleSelectBox(startIndex, calculateScrollHelperCurrentIndex($container, targetPos), {\r\n\t\t\t\t\t\"isSelectionRetained\": isSelectionRetained,\r\n\t\t\t\t\t\"scrollPos\": scrollToPos\r\n\t\t\t\t});\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t}","function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}","onMultiSelectionComponentPress(event) {\n if (this.isInactive) {\n return;\n }\n this.fireEvent(\"_selection-requested\", {\n item: this,\n selected: event.target.checked,\n selectionComponentPressed: true\n });\n }","function dragAction() {\n $(\".content-list\").selectable({\n selected: function(event, ui) {\n docListTools();\n },\n unselecting: function(event, ui) {\n docListTools();\n }\n });\n\n $(\".content-list\").find(\".folder\").draggable({\n revert: 'false',\n helper: function(event) {\n var $group = $(\"\", {\n class: \"content-list\"\n });\n if ($(\".folder.ui-selected\").length) {\n var theClone = $(\".folder.ui-selected\").clone();\n theClone = $group.html(theClone);\n } else {\n theClone = $group.html($(this).clone());\n }\n return theClone;\n }\n });\n $(\".content-list\").find(\".data-folder\").droppable({\n tolerance: 'pointer',\n drop: function(event, ui) {\n var dragId = ui.draggable.attr(\"data-id\");\n var dragType = ui.draggable.attr(\"data-type\");\n var dropId = $(this).attr(\"data-id\");\n // relocate(dragId, dragType, dropId);\n if ($(\".folder.ui-selected\").length) {\n $(\".folder.ui-selected\").remove();\n } else {\n ui.draggable.remove();\n }\n\n $(this).removeClass(\"over-now\");\n },\n over: function(event, ui) {\n $(this).addClass(\"over-now\");\n },\n out: function(event, ui) {\n $(this).removeClass(\"over-now\");\n }\n });\n}","function drop_allow(event) {\n u(event.target.parentElement).closest('tr').addClass(\"drop-allow\");\n}","function clickHandler( event /*: JQueryEventObject */ ) {\n if ( $element.hasClass( pausedDragSelectClass ) ) return;\n if ( $element[0].dragData.firstX == $element[0].dragData.lastX\n && $element[0].dragData.firstY == $element[0].dragData.lastY ) {\n if ( $element.hasClass( SELECTED_FOR_DRAGGING_CLASS ) ) {\n $element.removeDragAndSizeSelection();\n } else {\n $element.addDragAndSizeSelection();\n }\n setTimeout( function () {\n var mouseMoveEvent = $.Event( 'mousemove' );\n mouseMoveEvent.pageX = event.pageX;\n mouseMoveEvent.pageY = event.pageY;\n $element.trigger( mouseMoveEvent );\n }, 0 );\n }\n }","function clicked(element)\n{\n // Add classes to the elements\n element.className += selectedClass;\n element.firstElementChild.className += childSelectedClass;\n element.className += selectedHoverClass;\n // If prevElement exists, remove the classes\n if (prevElement)\n {\n removeSelectedClass(prevElement);\n }\n\n // Assign the previous clicked element to the newPrevElement\n prevElement = element;\n}","function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}","function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}","function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}","activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }","function extractEvents$3(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var targetNode=targetInst?getNodeFromInstance(targetInst):window;switch(domEventName){// Track the input node that has focus.\ncase'focusin':if(isTextInputElement(targetNode)||targetNode.contentEditable==='true'){activeElement$1=targetNode;activeElementInst$1=targetInst;lastSelection=null;}break;case'focusout':activeElement$1=null;activeElementInst$1=null;lastSelection=null;break;// Don't fire the event while the user is dragging. This matches the\n// semantics of the native select event.\ncase'mousedown':mouseDown=true;break;case'contextmenu':case'mouseup':case'dragend':mouseDown=false;constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);break;// Chrome and IE fire non-standard event when selection is changed (and\n// sometimes when it hasn't). IE's event fires out of order with respect\n// to key and input events on deletion, so we discard it.\n//\n// Firefox doesn't support selectionchange, so check selection status\n// after each key entry. The selection changes after keydown and before\n// keyup, but we check on keydown as well in the case of holding down a\n// key, when multiple keydown events are fired but only one keyup is.\n// This is also our approach for IE handling, for the reason above.\ncase'selectionchange':if(skipSelectionChangeEvent){break;}// falls through\ncase'keydown':case'keyup':constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);}}","function extractEvents$3(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var targetNode=targetInst?getNodeFromInstance(targetInst):window;switch(domEventName){// Track the input node that has focus.\ncase'focusin':if(isTextInputElement(targetNode)||targetNode.contentEditable==='true'){activeElement$1=targetNode;activeElementInst$1=targetInst;lastSelection=null;}break;case'focusout':activeElement$1=null;activeElementInst$1=null;lastSelection=null;break;// Don't fire the event while the user is dragging. This matches the\n// semantics of the native select event.\ncase'mousedown':mouseDown=true;break;case'contextmenu':case'mouseup':case'dragend':mouseDown=false;constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);break;// Chrome and IE fire non-standard event when selection is changed (and\n// sometimes when it hasn't). IE's event fires out of order with respect\n// to key and input events on deletion, so we discard it.\n//\n// Firefox doesn't support selectionchange, so check selection status\n// after each key entry. The selection changes after keydown and before\n// keyup, but we check on keydown as well in the case of holding down a\n// key, when multiple keydown events are fired but only one keyup is.\n// This is also our approach for IE handling, for the reason above.\ncase'selectionchange':if(skipSelectionChangeEvent){break;}// falls through\ncase'keydown':case'keyup':constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);}}","toggSelAll (c, direct) {\r\n const O = this;\r\n const cloneOriginalEvents = $.extend(true, {}, $._data(O.E.get(0), \"events\")); // clone original select elements events\r\n O.E.off(); // unbind original select elements events because we do not want the following clicks to trigger change on it\r\n\r\n if (O.is_multi) {\r\n // Select all\r\n if (c) {\r\n O.E.find('option:not(:checked):not(:disabled):not(:hidden)').toArray().forEach(option => {\r\n if (!$(option).data('li').hasClass('hidden')) {\r\n option.selected = true;\r\n $(option).data('li').toggleClass('selected', true);\r\n }\r\n });\r\n } else {\r\n // Unselect all\r\n O.E.find('option:checked:not(:disabled):not(:hidden)').toArray().forEach(option => {\r\n if (!$(option).data('li').hasClass('hidden')) {\r\n option.selected = false;\r\n $(option).data('li').toggleClass('selected', false);\r\n }\r\n });\r\n }\r\n } else {\r\n if (!c) O.E[0].selectedIndex = -1;\r\n else console.warn('You called `SelectAll` on a non-multiple select');\r\n }\r\n\r\n // rebind original select elements events\r\n $.each(cloneOriginalEvents, (_, e) => {\r\n $.each(e, (__, ev) => {\r\n O.E.on(ev.type, ev.handler);\r\n });\r\n });\r\n\r\n if((O.is_multi && !settings.okCancelInMulti) || !O.is_multi){\r\n O.callChange(); // call change on original select element\r\n O.setText();\r\n }\r\n\r\n if (!direct) {\r\n if (!O.mob && O.selAll) O.selAll.removeClass('partial').toggleClass('selected', !!c);\r\n O.setText();\r\n O.setPstate();\r\n }\r\n }","function initializeMultipleSelectBoxTouchEvent($container) {\r\n\t\t$container.bind(\"touchstart.\" + PLUGIN_NAMESPACE, function(e) {\r\n\t\t\tvar options = $container.getMultipleSelectBoxOptions();\r\n\t\t\tvar containerViewport = $container.getMultipleSelectBoxViewport();\r\n\t\t\tvar startTouches = e.originalEvent.touches[0];\r\n\t\t\tvar startTouchPos = startTouches.pageY;\r\n\t\t\tvar startContainerScrollPos = containerViewport.getScrollTop();\r\n\t\t\tif (options.isHorizontalMode) {\r\n\t\t\t\tstartTouchPos = startTouches.pageX;\r\n\t\t\t\tstartContainerScrollPos = containerViewport.getScrollLeft();\r\n\t\t\t}\r\n\t\t\t$container.yieldMultipleSelectBox().bind(\"touchmove.\" + PLUGIN_NAMESPACE, function(e1) {\r\n\t\t\t\t/* disable touch scroll */\r\n\t\t\t\te1.preventDefault();\r\n\t\t\t\t/* calculate scroll to position */\r\n\t\t\t\tvar thisTouches = e1.originalEvent.touches[0];\r\n\t\t\t\tif (options.isHorizontalMode) {\r\n\t\t\t\t\t$container.scrollLeft(startContainerScrollPos + (thisTouches.pageX - startTouchPos));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$container.scrollTop(startContainerScrollPos + (thisTouches.pageY - startTouchPos));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}","function SelectionUtil() {\n}","function customizeMultiSelect(){\n /* IE doesn't support event handling on option tag, hence conveted option click event to select onchange event*/\n $('body').on('change','.customize_multiselect', function(){\n var select = $(this);\n var sel_val = $(this).val();\n var sel_opt = '';\n $(select).find(\"option\").each(function () {\n if($(this).val() == sel_val){\n sel_opt = $(this);\n return;\n }\n });\n if ($(sel_opt).attr(\"class\") == undefined || $(sel_opt).attr(\"class\").length == 0 || $(sel_opt).hasClass(\"unclicked\")){\n $(sel_opt).removeClass('unclicked');\n $(sel_opt).addClass('clicked');\n } else {\n $(sel_opt).removeClass('clicked')\n $(sel_opt).addClass('unclicked');\n $(sel_opt).removeAttr(\"selected\");\n }\n $(select).find(\"option.clicked\").attr(\"selected\",\"selected\");\n $(select).find(\"option.unclicked\").removeAttr(\"selected\");\n });\n}","function initializeMultiCheckboxSelection() {\n // Add event listener on li element instead of directly to checkbox in order to allow shift click in firefox.\n // A click on checkboxes in firefox is not triggered, if a modifier is active (shift, alt, ctrl)\n const doesProvideMod = !(navigator.userAgent.indexOf(\"Firefox\") >= 0);\n $('#imageList>li').on('click', (doesProvideMod ? 'input[type=\"checkbox\"]' : 'label'), function(event) {\n const checkbox = doesProvideMod ? this : $(this).siblings('input[type=\"checkbox\"]')[0];\n if( !lastChecked ) {\n lastChecked = checkbox;\n return;\n }\n\n if( event.shiftKey ) {\n var checkBoxes = $('#imageList input[type=\"checkbox\"]').not('#selectFilter');\n var start = $(checkBoxes).index($(checkbox));\n var end = $(checkBoxes).index($(lastChecked));\n\n $(checkBoxes).slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', $(lastChecked).is(':checked'));\n }\n\n $(checkbox).change();\n lastChecked = checkbox;\n });\n}","function selectable(options) {\r\n\treturn this.each(function () {\r\n\t\tvar elem = this;\r\n\t\tvar $elem = $(elem);\r\n\t\tif ($elem.hasClass(selectableClass)) return; // Already done\r\n\t\t$elem.addClass(selectableClass);\r\n\t\tvar opt = initOptions(\"selectable\", selectableDefaults, $elem, {}, options);\r\n\t\topt._prepareChild = prepareChild;\r\n\r\n\t\t$elem.children().each(prepareChild);\r\n\t\t\r\n\t\tfunction prepareChild() {\r\n\t\t\tvar child = $(this);\r\n\t\t\tchild.click(function (event) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\tevent.stopPropagation();\r\n\t\t\t\tlet ctrlKey = !!event.originalEvent.ctrlKey;\r\n\t\t\t\tif (!opt.multi) ctrlKey = false;\r\n\t\t\t\tif (opt.toggle) ctrlKey = true;\r\n\t\t\t\tlet changed = false;\r\n\t\t\t\tif (ctrlKey) {\r\n\t\t\t\t\tchild.toggleClass(\"selected\");\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (!child.hasClass(\"selected\")) {\r\n\t\t\t\t\t\t$elem.children().removeClass(\"selected\");\r\n\t\t\t\t\t\tchild.addClass(\"selected\");\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\t$elem.trigger(\"selectionchange\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}","function createMultipleSelectRect(e) {\n iv.sMultipleSvg = iv.svg.rect().fill('none').stroke({\n width: 2\n });\n iv.sMultipleSvg.x(e.x);\n iv.sMultipleSvg.y(e.y);\n}","function eventMakeSelection(d) {\n selected.push(d.elemNum) // Store clicked node's elemNum to \"selected\" array.\n\n if (layout.properties.selectionMode == \"parent\") {\n parent_id = d.parent_id;\n } else if (layout.properties.selectionMode == \"child\" ) {\n my_id = d.id;\n } else {\n // do nothing\n }\n\n if (layout.properties.clearAll) {\n //clear selections\n app.clearAll();\n self.paint($element);\n } else {\n self.paint($element, layout)\n }\n }","function setCollapsibleEvents() {\n var lists = $(collapsibleClass);\n //Set Drag on Each 'li' in the list\n lists.each(function (index, element) {\n var list = $(element).find('li');\n $.each(list, function (idx, val) {\n $(this).on('dragstart', function (evt) {\n evt.originalEvent.dataTransfer.setData('Text', evt.target.textContent);\n evt.originalEvent.dataTransfer.setData('ID', evt.target.id);\n evt.originalEvent.dataTransfer.setData('Location', 'list');\n });\n });\n });\n }","function onDragEnter(ev)\n{\n // If a valid item, highlight it as a target\n let target = ev.target;\n if ((target.tagName && target.tagName.search(/^(li|div|span|svg|path)$/i) === 0 ) ||\n target.nodeName.search(/^(#text)$/i) === 0)\n {\n if (!target.tagName)\n target = target.parentNode;\n if (target.tagName.search(/^li$/i) !== 0)\n target = target.closest(\"li\");\n if (target !== null)\n target.className += \" dragging\";\n }\n}","handleMouseMultiSelect(cellData, event) {\n const me = this,\n id = cellData.id;\n\n function mergeRange(fromId, toId) {\n const {\n store,\n selectedRecordCollection\n } = me,\n fromIndex = store.indexOf(fromId),\n toIndex = store.indexOf(toId),\n startIndex = Math.min(fromIndex, toIndex),\n endIndex = Math.max(fromIndex, toIndex);\n\n if (startIndex === -1 || endIndex === -1) {\n throw new Error('Record not found in selectRange');\n }\n\n const newRange = store.getRange(startIndex, endIndex + 1, false).filter(row => me.isSelectable(row));\n selectedRecordCollection.splice(0, me.lastRange || 0, newRange);\n me.lastRange = newRange;\n }\n\n if ((event.metaKey || event.ctrlKey) && me.isSelected(id)) {\n // ctrl/cmd deselects row if selected\n me.deselectRow(id);\n } else if (me.selectionMode.multiSelect) {\n if (event.shiftKey && me.startCell) {\n // shift appends selected range (if we have previously focused cell)\n mergeRange(me.startCell.id, id);\n } else if (event.ctrlKey || event.metaKey) {\n // ctrl/cmd adds to selection if using multiselect (and not selected)\n me.selectRow({\n record: id,\n scrollIntoView: false,\n addToSelection: true\n });\n }\n }\n }","function onMouseMoveEventOnHandler(ev){\n if(WorkStore.isSelected()) return;\n\n window.addEventListener(MOUSE_DOWN, onMouseDownHandler);\n document.body.classList.add(\"drag\");\n}","handleMouseMultiSelect(cellData, event) {\n const me = this,\n id = cellData.id;\n\n function mergeRange(fromId, toId) {\n const { store, recordCollection } = me,\n fromIndex = store.indexOf(fromId),\n toIndex = store.indexOf(toId),\n startIndex = Math.min(fromIndex, toIndex),\n endIndex = Math.max(fromIndex, toIndex);\n\n if (startIndex === -1 || endIndex === -1) {\n throw new Error('Record not found in selectRange');\n }\n\n const newRange = store.getRange(startIndex, endIndex + 1, false).filter((row) => me.isSelectable(row));\n recordCollection.splice(0, me.lastRange || 0, newRange);\n me.lastRange = newRange;\n }\n\n if ((event.metaKey || event.ctrlKey) && me.isSelected(id)) {\n // ctrl/cmd deselects row if selected\n me.deselectRow(id);\n } else if (me.selectionMode.multiSelect) {\n if (event.shiftKey && me.startCell) {\n // shift appends selected range (if we have previously focused cell)\n mergeRange(me.startCell.id, id);\n } else if (event.ctrlKey || event.metaKey) {\n // ctrl/cmd adds to selection if using multiselect (and not selected)\n me.selectRow(id, false, true);\n }\n }\n }","function onDragLeave(ev)\n{\n // If current is a valid item, stop highlighting it as a target\n let target = ev.target;\n if ((target.tagName && target.tagName.search(/^(li|div|span|svg|path)$/i) === 0 ) ||\n target.nodeName.search(/^(#text)$/i) === 0)\n {\n if (!target.tagName)\n target = target.parentNode;\n if (target.tagName.search(/^li$/i) !== 0)\n target = target.closest(\"li\");\n if (target !== null)\n target.className = target.className.replace(/ dragging\\b/,'');\n }\n}","_selectedFilesClickHandler(event) {\n const that = this;\n\n if (that.disabled) {\n return;\n }\n\n const target = event.target,\n isItemUploadClicked = target.closest('.jqx-item-upload-button'),\n isItemCancelClicked = target.closest('.jqx-item-cancel-button'),\n isItemAbortClicked = target.closest('.jqx-item-pause-button'),\n clickedItem = target.closest('.jqx-file');\n\n if (isItemUploadClicked) {\n that.uploadFile(clickedItem.index);\n }\n else if (isItemCancelClicked) {\n that.cancelFile(clickedItem.index);\n }\n else if (isItemAbortClicked) {\n that.pauseFile(clickedItem.index);\n }\n }","onSelectedCollectionChange({ added, removed }) {\n const me = this,\n selection = me.selectedEvents,\n selected = added || [],\n deselected = removed || [];\n\n function updateSelection(record, select) {\n const resourceRecord = record.isTask ? record : record.resource,\n eventRecord = record.isAssignment ? record.event : record;\n\n if (eventRecord) {\n const element = me.getElementFromEventRecord(eventRecord, resourceRecord);\n\n me.currentOrientation.toggleCls(eventRecord, resourceRecord, me.eventSelectedCls, select);\n\n if (record.isAssignment) {\n me.getElementsFromEventRecord(eventRecord).forEach((el) => {\n if (el !== element) {\n el.classList[select ? 'add' : 'remove'](me.eventAssignHighlightCls);\n }\n });\n }\n }\n }\n\n selected.forEach((record) => updateSelection(record, true));\n deselected.forEach((record) => updateSelection(record, false));\n\n if (!me.silent) {\n me.trigger('eventSelectionChange', {\n action:\n selection.length > 0\n ? selected.length > 0 && deselected.length > 0\n ? 'update'\n : selected.length > 0\n ? 'select'\n : 'deselect'\n : 'clear',\n selection,\n selected,\n deselected\n });\n }\n }","function dragEnter(e) {\n e.target.closest(\"li\").classList.add(\"over\");\n}","function dragTarget(){\n //prevent default positon in order to allow drop of element\n var e= event;\n e.preventDefault();\n //move element to selected drop target\n let children= Array.from(e.target.parentNode.parentNode.children);\n if (children.indexOf(e.target.parentNode)>children.indexOf(row)){\n e.target.parentNode.after(row);\n }\n else{\n e.target.parnetNode.before(row);\n }\n }","function MultiSelector(list_target, max) {\n this.list_target = list_target;this.count = 0;this.id = 0;if( max ){this.max = max;} else {this.max = -1;};this.addElement = function( element ){if( element.tagName == 'INPUT' && element.type == 'file' ){element.name = 'attachment[file_' + (this.id++) + ']';element.multi_selector = this;element.onchange = function(){var new_element = document.createElement( 'input' );new_element.type = 'file';this.parentNode.insertBefore( new_element, this );this.multi_selector.addElement( new_element );this.multi_selector.addListRow( this );this.style.position = 'absolute';this.style.left = '-1000px';};if( this.max != -1 && this.count >= this.max ){element.disabled = true;};this.count++;this.current_element = element;} else {alert( 'Error: not a file input element' );};};this.addListRow = function( element ){var new_row = document.createElement('li');var new_row_button = document.createElement( 'a' );new_row_button.title = 'Remove This Image';new_row_button.href = '#';new_row_button.innerHTML = 'Remove';new_row.element = element;new_row_button.onclick= function(){this.parentNode.element.parentNode.removeChild( this.parentNode.element );this.parentNode.parentNode.removeChild( this.parentNode );this.parentNode.element.multi_selector.count--;this.parentNode.element.multi_selector.current_element.disabled = false;return false;};new_row.innerHTML = element.value.split('/')[element.value.split('/').length - 1];new_row.appendChild( new_row_button );this.list_target.appendChild( new_row );};\n}","function attachEvents(selection, renderItems) {\r\n var dragBehavior;\r\n \r\n // We want to know all the different types of events that exist in any of the elements. This cryptic oneliner does that.\r\n // Say we have one element with handlers for click and mouseover, and another one with handlers for mouseover and mouseout.\r\n // We will want an array that says [\"click\", \"mouseover\", \"mouseout\"]. We will have to attach all three events to all elements\r\n // because there is no (trivial) way to attach event handlers per element. The handlers will actually be functions that check\r\n // if the given handler exists and only then call it.\r\n var allEvents = _.uniq(_.flatten(_.map(_.pluck(renderItems, \"eventHandlers\"), function (eh) { return _.keys(eh); })));\r\n \r\n // Add all the handlers except for click and dblclick which we take special care of below.\r\n _.each(allEvents, function (ce) {\r\n if (ce === \"click\" || ce === \"dblclick\")\r\n return;\r\n \r\n // drag events aren't native to the browser so we need to attach D3's dragBehavior if such handlers exist.\r\n if (ce === \"dragstart\" || ce === \"drag\" || ce === \"dragend\") {\r\n if (!dragBehavior) {\r\n dragBehavior = d3.behavior.drag()\r\n .origin(function() { \r\n var t = d3.select(this);\r\n return {x: t.attr(\"x\"), y: t.attr(\"y\")};\r\n })\r\n }\r\n \r\n dragBehavior.on(ce, function (d, i) {\r\n d.eventHandlers[ce](d, i, d3.event);\r\n //d3.event.stopPropagation();\r\n });\r\n } else {\r\n selection.on(ce, function (d, i) {\r\n if (d.eventHandlers.hasOwnProperty(ce)) {\r\n d.eventHandlers[ce](d, i, d3.event);\r\n d3.event.stopPropagation();\r\n }\r\n });\r\n }\r\n });\r\n \r\n if (dragBehavior)\r\n selection.call(dragBehavior);\r\n \r\n var doubleClickDelay = 300;\r\n var singleClickTimer;\r\n var storedEvent;\r\n \r\n // Now, as for click and dblclick, we want to make sure they can work together. If only one of them is supplied, there is no problem\r\n // because we can simply attach to that event. However, if both are in use, we need to wait after the first click and see if the user\r\n // indeed meant to double click or not. If no secondary click is recorded within doubleClickDelay milliseconds, it's considered a single click.\r\n selection.on(\"click\", function (d, i) {\r\n if (d.eventHandlers.hasOwnProperty(\"click\") && d.eventHandlers.hasOwnProperty(\"dblclick\")) {\r\n if (singleClickTimer) {\r\n d.eventHandlers.dblclick(d, i, d3.event);\r\n clearTimeout(singleClickTimer);\r\n singleClickTimer = null;\r\n } else {\r\n storedEvent = d3.event;\r\n singleClickTimer = setTimeout(function () {\r\n d.eventHandlers.click(d, i, storedEvent);\r\n singleClickTimer = null;\r\n }, doubleClickDelay);\r\n }\r\n d3.event.stopPropagation();\r\n } else if (d.eventHandlers.hasOwnProperty(\"click\")) {\r\n d.eventHandlers.click(d, i, d3.event);\r\n d3.event.stopPropagation();\r\n }\r\n });\r\n \r\n selection.on(\"dblclick\", function (d, i) {\r\n if (d.eventHandlers.hasOwnProperty(\"dblclick\") && !d.eventHandlers.hasOwnProperty(\"click\")) {\r\n d.eventHandlers.dblclick(d, i, d3.event);\r\n d3.event.stopPropagation();\r\n }\r\n });\r\n }","function highlightSelectedElements(curSelectedElem, isMultiSelected)\n {\n var iframeContents = _iframe.contents();\n var greenborderElem = $(\"
\");\n iframeContents.find(\".perc-region:first\").append(greenborderElem);\n greenborderElem.on('click',function(){\n if(curSelectedElem.prev().hasClass(\"perc-itool-selected-elem\") &&\n curSelectedElem.next().hasClass(\"perc-itool-selected-elem\"))\n return;\n clearItoolSelection();\n });\n if(isMultiSelected) {\n greenborderElem.css('border-color','#00afea');\n }\n //Show it and position\n greenborderElem.show();\n greenborderElem.offset({\n \"top\": curSelectedElem.offset().top,\n \"left\": curSelectedElem.offset().left\n }).height(curSelectedElem.innerHeight() -10 ).width(curSelectedElem.innerWidth()-10);\n }","function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar calendar = t.calendar;\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t// TODO: unbind on destroy\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(start, end) {\n\t\tunselect();\n\n\t\tstart = calendar.moment(start);\n\t\tif (end) {\n\t\t\tend = calendar.moment(end);\n\t\t}\n\t\telse {\n\t\t\tend = defaultSelectionEnd(start);\n\t\t}\n\n\t\trenderSelection(start, end);\n\t\treportSelection(start, end);\n\t}\n\t// TODO: better date normalization. see notes in automated test\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(start, end, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, start, end, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1) // make exclusive\n\t\t\t\t\t);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1), // make exclusive\n\t\t\t\t\t\tev\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}","function onMouseMove(event) {\n\t\t\tif (selectEventTarget(event)) {\n\t\t\t\thighlightSelected(true);\n\t\t\t}\n\t\t}","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 SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\tt.selectionManagerDestroy = destroy;\n\t\n\t\n\t// imports\n\tvar calendar = t.calendar;\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).on('mousedown', documentMousedown);\n\t}\n\n\n\tfunction documentMousedown(ev) {\n\t\tvar ignore = opt('unselectCancel');\n\t\tif (ignore) {\n\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tunselect(ev);\n\t}\n\t\n\n\tfunction select(start, end) {\n\t\tunselect();\n\n\t\tstart = calendar.moment(start);\n\t\tif (end) {\n\t\t\tend = calendar.moment(end);\n\t\t}\n\t\telse {\n\t\t\tend = defaultSelectionEnd(start);\n\t\t}\n\n\t\trenderSelection(start, end);\n\t\treportSelection(start, end);\n\t}\n\t// TODO: better date normalization. see notes in automated test\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(start, end, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, start, end, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1) // make exclusive\n\t\t\t\t\t);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(\n\t\t\t\t\t\tdates[0],\n\t\t\t\t\t\tdates[1].clone().add('days', 1), // make exclusive\n\t\t\t\t\t\tev\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n\tfunction destroy() {\n\t\t$(document).off('mousedown', documentMousedown);\n\t}\n\n\n}","function selectEles(a) {\n for (var i = 0; i < a.length; i++) {\n tds[a[i]].className = 'selected';\n }\n }","function selectColor(e) {\n e.siblings().removeClass(\"selected\");\n e.addClass(\"selected\");\n }","function setupKeyboardEvents(parent, canvas, selection) {\n parent.addEventListener(\"keydown\", keydownHandler, false);\n parent.addEventListener(\n \"mousedown\",\n function () {\n parent.focus();\n },\n false\n );\n\n function keydownHandler(evt) {\n var handled = false;\n var mk = multiselect.modifierKeys(evt);\n switch (evt.which) {\n case 37:\n handled = callArrow(mk, multiselect.LEFT);\n break;\n case 38:\n handled = callArrow(mk, multiselect.UP);\n break;\n case 39:\n handled = callArrow(mk, multiselect.RIGHT);\n break;\n case 40:\n handled = callArrow(mk, multiselect.DOWN);\n break;\n case 32:\n handled = callSpace(mk);\n break;\n case 90:\n handled = callUndoRedo(mk);\n break;\n default:\n return; // exit this handler for unrecognized keys\n }\n if (!handled) return;\n\n // event is recognized\n selection.geometry().drawIndicators(selection, canvas, true, true, false);\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n function callUndoRedo(mk) {\n switch (mk) {\n case multiselect.OPT:\n selection.undo();\n break;\n case multiselect.SHIFT_OPT:\n selection.redo();\n break;\n default:\n return false;\n }\n return true;\n }\n\n function callArrow(mk, dir) {\n switch (mk) {\n case multiselect.NONE:\n selection.arrow(dir);\n break;\n case multiselect.CMD:\n selection.cmdArrow(dir);\n break;\n case multiselect.SHIFT:\n selection.shiftArrow(dir);\n break;\n default:\n return false;\n }\n return true;\n }\n\n function callSpace(mk) {\n switch (mk) {\n case multiselect.NONE:\n selection.space();\n break;\n case multiselect.CMD:\n selection.cmdSpace();\n break;\n case multiselect.SHIFT:\n selection.shiftSpace();\n break;\n default:\n return false;\n }\n return true;\n }\n}","function highlightList(event) {\n // remove previous highlight\n for (var c in catNames) {\n if (catNames[c].classList.contains('selected-cat') === true) {\n catNames[c].classList.remove('selected-cat');\n }\n };\n // highlight name\n event.target.classList.add('selected-cat');\n}","function updateTouchscreenInputForSelect(element){ \n var inputTarget = tstInputTarget;\n var multiple = inputTarget.getAttribute(\"multiple\") == \"multiple\";\n\n if (multiple) {\n var val_arr = inputTarget.value.split(tstMultipleSplitChar);\n var val = \"\";\n \n if (element.innerHTML.length>1)\n val = unescape(element.innerHTML); \n // njih\n else if (element.value.length>1)\n val = element.value;\n \n // Check if the item is already included\n // var idx = val_arr.toString().indexOf(val);\n if (!tstMultipleSelected[tstCurrentPage][val]){ //(idx == -1){\n val_arr.push(val);\n tstMultipleSelected[tstCurrentPage][val] = true;\n } else {\n // val_arr.splice(idx, 1);\n val_arr = removeFromArray(val_arr, val);\n delete(tstMultipleSelected[tstCurrentPage][val]);\n }\n inputTarget.value = val_arr.join(tstMultipleSplitChar);\n if (inputTarget.value.indexOf(tstMultipleSplitChar) == 0)\n inputTarget.value = inputTarget.value.substring(1, inputTarget.value.length);\n } else {\n if (element.value.length>1){\n inputTarget.value = element.value;\n }\n else if (element.innerHTML.length>0){\n inputTarget.value = element.innerHTML;\n }\n }\n\n highlightSelection(element.parentNode.childNodes, inputTarget)\n \n tt_update(inputTarget);\n}","function makeSelectable(e) {\n e.setStyle('user-select', 'text');\n e.setStyle('-webkit-user-select', 'text');\n e.setStyle('-moz-user-select', 'text');\n e.setStyle('-o-user-select', 'text');\n e.setStyle('-khtml-user-select', 'text');\n }","function assignContListClick($target, $ul, clickEvent){\r\n\t$ul.children(\"li\").click(function(){\r\n\t\tsetContSelection($target, $(this));\r\n\t\tif (clickEvent){\r\n\t\t\tclickEvent();\r\n\t\t}\r\n\t});\r\n}","function CdkDragDrop() {}","function CdkDragDrop() {}","function rowSelection(e) {\n var\n // get current HTML row object\n currentRow = this,\n // get current HTML row index\n index = currentRow.offsetTop / (options.rowHeight + options.borderHeight);\n\n if (!options.multiselection)\n // mark all other selected row as unselected \n self.clearSelection();\n\n \n if (! (e.shiftKey || e.metaKey || e.ctrlKey))\n // clear selected row\n self.clearSelection();\n \n if (e.shiftKey && options.multiselection) {\n // Shift is pressed\n var\n _lastSelectedIndex = lastSelectedIndex(),\n // get last selected index\n from = Math.min(_lastSelectedIndex + 1, index),\n to = Math.max(_lastSelectedIndex, index),\n viewPort = getViewPort();\n\n // select all rows between interval\n for (var i = from; i <= to && _currentData[i]; i++) {\n if ($.inArray(i, selectedIndexes()) == -1) {\n selectRow(i);\n if (i >= viewPort.from && i <= viewPort.to) {\n var row = self.rowAt(i);\n $self.trigger('rowSelection', [i, row, true, _currentData[i]]);\n }\n }\n }\n\n } else if (e.ctrlKey || e.metaKey) {\n /* Ctrl is pressed ( CTRL on Mac is identified by metaKey property ) */\n\n // toggle selection\n if ( $.inArray( index, selectedIndexes() ) > -1) {\n unselectRow(index);\n $self.trigger('rowSelection', [index, this, false, _currentData[index]]);\n } else {\n selectRow(index);\n $self.trigger('rowSelection', [index, this, true, _currentData[index]]);\n }\n\n } else {\n // simple click\n selectRow(index);\n $self.trigger('rowSelection', [index, this, true, _currentData[index]]);\n }\n\n }","enableUserSelection() {\n this[addDivListener]('mousedown', this[userSelectionDragListenerSym]);\n }","function makeActiveMultiItem(element) {\n $(element).on('click', function(){\n $(element).removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n}","function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}","function batchEventHook(event) \n{\n var elem = event.target;\n\n // Hook for [delete] checkbox range selection.\n if ( isDeleteCheckbox(elem) && (event.button == 0 || event.keyCode == 32) ) {\n if (event.shiftKey && lastClickedCheckbox) {\n selectCheckboxRange(lastClickedCheckbox, elem);\n }\n lastClickedCheckbox = elem;\n }\n}","function handleMouseDown(evt)\n{\n mylog('Started handleMouseDown with target nodeName '+evt.target.nodeName);\n // With svgweb, mousedown on text elements causes also mousedown on\n // the \"svg\" node on the back, so this check nullifies the second\n // function call\n if (evt.target.nodeName == 'svg')\n return;\n // This is necessary with firefox native renderer, otherwise the\n // \"mousedown\" event would cause the attempt of dragging svg\n // elements\n evt.preventDefault();\n\n var p = mouseCoordsSvg(evt);\n\n if(g['shape'].active)\n // When the current tool corresponds to a shape, mouse events are\n // forwarded to the shape\n g['shape'].mousedown(p.x, p.y);\n else{\n // Other tools not binded with shapes, but that act on a\n // clicked shape. First ignore the operation if the target is\n // 'canvas', then retrieve the shape parent group and execute\n // the action\n var target = evt.target;\n if (target.id == 'canvas'){\n mylog('Ignoring attempt to act on the canvas');\n if (g['tool']=='delete')\n // Activate the \"dragging delete\"\n g['active_tool'] = true;\n }\n else{\n // To search the group and then to come back to the childs\n // can look weird, but this is useful because changing the\n // renderer, the element which raises the event (for\n // example in a text structure) may change\n var group = find_group(target.parentNode);\n switch(g['tool']){\n case 'select':\n var shape = group.childNodes[0];\n // Select is useful only for the links, which have\n // 'text' as top node. They can distinguished by plain\n // text elements because they have a first
\n // element with visibility=\"hidden\"\n if (shape.nodeName == 'text' &&\n shape.childNodes[0].getAttribute('visibility')=='hidden'){\n var url = shape.childNodes[1].data;\n // Urls without the http look nicer, but it has to\n // be added, otherwise they will be taken as\n // relative links\n if (!/http/.test(url))\n url = 'http://'+url;\n window.open(url);\n }\n break;\n case 'edit':\n var shape = group.childNodes[0];\n // Paths can't be edited\n if (shape.nodeName == 'path')\n mylog('Ignoring attempt to edit a path');\n else{\n // Distinguish a 'link' shape\n if (shape.nodeName == 'text' &&\n shape.childNodes[0].getAttribute('visibility')=='hidden')\n var shape_name = 'link';\n else\n var shape_name = shape.nodeName;\n show_additional_panel(shape_name);\n // Copy the old object\n g['shape'] = g['shape_generator'].generate_shape(shape_name);\n g['shape'].copy_shape(shape);\n g['shape'].mousedown(p.x, p.y);\n // Delete the old object: sender_add is called\n // with the asynchronous flag set to true, so the\n // delete update will be sent together with the\n // new shape update.\n var group_id = group.getAttribute('id');\n sender_add('delete', [], group_id, true);\n g['pages'].remove(group);\n }\n break;\n case 'delete':\n delete_object(group);\n g['active_tool'] = true;\n break;\n case 'move':\n g['moving_object'] = group;\n var transMatrix = g['moving_object'].getCTM();\n // g['p'] will be read on mouse up, and to correctly\n // compute the new transformation we must consider the\n // original position of the object, not the one seen\n // by the user and the pointer\n p.x = p.x - Number(transMatrix.e);\n p.y = p.y - Number(transMatrix.f);\n g['active_tool'] = true;\n break;\n }\n }\n }\n // Store the initial mouse position for the other event handlers\n g['p'] = p;\n}","setEvents(){\n const listElements = this.el.childNodes;\n for(let i = 0; i < listElements.length; i++){\n listElements[i].addEventListener('mousedown',this.onItemClickedEvent,true);\n }\n }","selectItem (i) { this.toggSel(true, i); }","function getMoseDownFunc(eventName){return function(ev){ev=ev||window.event;ev.preventDefault?ev.preventDefault():ev.returnValue=false;ev.stopPropagation();var x=ev.pageX||ev.touches[0].pageX;var y=ev.pageY||ev.touches[0].pageY;_this.el.fire(eventName,{x:x,y:y,event:ev});};}// create the selection-rectangle and add the css-class","function getMoseDownFunc(eventName){return function(ev){ev=ev||window.event;ev.preventDefault?ev.preventDefault():ev.returnValue=false;ev.stopPropagation();var x=ev.pageX||ev.touches[0].pageX;var y=ev.pageY||ev.touches[0].pageY;_this.el.fire(eventName,{x:x,y:y,event:ev});};}// create the selection-rectangle and add the css-class","function selectCategoryClickHandler(ev) {\n selectCategory(ev.target);\n}","_handleClick(event) {\n var row = $(event.target).parents('tr:first');\n var rows = this.$element.find('tbody tr');\n\n if (!this.lastChecked) {\n this.lastChecked = row;\n return;\n }\n\n if (event.shiftKey) {\n this.changeMultiple = true;\n\n var start = rows.index(row);\n var end = rows.index(this.lastChecked);\n var from = Math.min(start, end);\n var to = Math.max(start, end) + 1;\n var checked = this.lastChecked.find('input').is(':checked');\n var checkboxes = rows.slice(from, to).find('input');\n\n if (checked) {\n checkboxes.trigger('check.zf.trigger');\n } else {\n checkboxes.trigger('uncheck.zf.trigger');\n }\n\n this.changeMultiple = false;\n }\n\n this.lastChecked = row;\n }","_isDragStartInSelection(ev) {\n const selectedElements = this.root.querySelectorAll('[data-is-selected]');\n for (let i = 0; i < selectedElements.length; i++) {\n const element = selectedElements[i];\n const itemRect = element.getBoundingClientRect();\n if (this._isPointInRectangle(itemRect, { left: ev.clientX, top: ev.clientY })) {\n return true;\n }\n }\n return false;\n }","function selectItem(e) {\n\n for (var i = 0; i < e.currentTarget.parentNode.children.length; i++) {\n e.currentTarget.parentNode.children[i].classList.remove(\"selected\");\n }\n\n e.currentTarget.classList.add(\"selected\");\n console.log($(e.currentTarget).children().eq(1).text());\n updateP1Moves($(e.currentTarget).children().eq(1).text());\n \n}","function handleCheckboxClick(e, highlightClass) {\n\n // if e is an input checkbox, then parentNode is a list element, its and parentNode is an\n // unordered list. Getting all of the tags by \"input\" will therefore return all of the related\n // inputs in this respective list\n var inputs = e.parentNode.parentNode.getElementsByTagName(\"input\");\n\n // The following block handles the checkbox lists that contain \"Any [items].\" If the user\n // selects anything other than \"Any [item]\", then \"Any...\" must be deselected. Otherwise,\n // if the user selects \"Any...\" then all other items currently checked must be deselected. In\n // each group of checkboxes, the \"Any...\" option is represented with an empty string value (\"\").\n\n if (e.value == \"\") { // If the user clicked the \"Any...\" checkbox\n for (var j = 0; j < inputs.length; j++) { // loop through all of this list's checkboxes\n if (inputs[j].value != \"\" && inputs[j].checked) { // if any item (other than \"Any...\") is checked\n inputs[j].checked = \"\"; // uncheck it and\n inputs[j].parentNode.className = \"\"; // unhighlight it\n }\n }\n } else { // Otherwise, the user clicked another checkbox\n for (var i = 0; i < inputs.length; i++) { // loop through this list's checkboxes\n if (inputs[i].value == \"\" && inputs[i].checked) { // find the \"Any...\" checkbox\n inputs[i].checked = \"\"; // uncheck it\n inputs[i].parentNode.className = \"\"; // unhighlight it\n }\n }\n }\n\n // Finally, perform simple highlighting\n if (!e.checked)\n e.parentNode.className = \"\";\n else\n e.parentNode.className = highlightClass;\n}","isMultipleSelection() {\n return this._multiple;\n }","onEventSelectionClick(event, clickedRecord) {\n const me = this;\n\n // Multi selection: CTRL means preserve selection, just add or remove the event.\n // Single selection: CTRL deselects already selected event\n if (me.isEventSelected(clickedRecord)) {\n event.ctrlKey && me.deselectEvent(clickedRecord, me.multiEventSelect);\n } else {\n me.selectEvent(clickedRecord, event.ctrlKey && me.multiEventSelect);\n }\n }","function addSelection(item) {\n //if the owner reference is still null, set it to this item's parent\n //so that further selection is only allowed within the same container\n if (!selections.owner) {\n selections.owner = item.parentNode;\n }\n\n //or if that's already happened then compare it with this item's parent\n //and if they're not the same container, return to prevent selection\n else if (selections.owner != item.parentNode) {\n return;\n }\n\n //set this item's grabbed state\n item.setAttribute('aria-grabbed', 'true');\n\n //add it to the items array\n selections.items.push(item);\n}","function validateMultipleSelectBox(e) {\r\n\t\t/* yield event handler */\r\n\t\treturn $(\".\" + PLUGIN_NAMESPACE).yieldMultipleSelectBox().each(\r\n\t\t\tfunction() {\r\n\t\t\t\tvar $container = $(this);\r\n\t\t\t\tvar options = $container.getMultipleSelectBoxOptions();\r\n\t\t\t\tvar containerHistory = $container.getMultipleSelectBoxHistory();\r\n\t\t\t\tif ($container.isMultipleSelectBoxSelecting()) {\r\n\t\t\t\t\t/* reset style */\r\n\t\t\t\t\t$container.removeClass(PLUGIN_STYLE_SELECTING);\r\n\t\t\t\t\tvar selectedRows = $container.getMultipleSelectBoxSelectedRows();\r\n\t\t\t\t\t/* slide up */\r\n\t\t\t\t\tif (options.isPopupMode) {\r\n\t\t\t\t\t\t$container.slideUp(\"slow\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/* fire event */\r\n\t\t\t\t\t$container.trigger(\"mouseup.\" + PLUGIN_NAMESPACE);\r\n\t\t\t\t\t/* trigger callback */\r\n\t\t\t\t\tif (options.onSelectEnd != null) {\r\n\t\t\t\t\t\toptions.onSelectEnd.apply($container[0], [ e, selectedRows, containerHistory.selectingStartIndex, containerHistory.selectingCurrentIndex, containerHistory.selectedStartIndex, containerHistory.selectedCurrentIndex ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (options.onSelectChange != null && (containerHistory.selectedRows == null || !isJQueryCollectionEquals(containerHistory.selectedRows, selectedRows))) {\r\n\t\t\t\t\t\toptions.onSelectChange.apply($container[0], [ e, selectedRows, containerHistory.selectedRows, containerHistory.selectingStartIndex, containerHistory.selectingCurrentIndex, containerHistory.selectedStartIndex,\r\n\t\t\t\t\t\t\tcontainerHistory.selectedCurrentIndex ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/* reset the field value */\r\n\t\t\t\t\tif (options.submitField != null) {\r\n\t\t\t\t\t\toptions.submitField.val($container.serializeMultipleSelectBox());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontainerHistory.selectedRows = selectedRows;\r\n\t\t\t\t}\r\n\t\t\t\t/* reset history */\r\n\t\t\t\tcontainerHistory.selectedStartIndex = containerHistory.selectingStartIndex;\r\n\t\t\t\tcontainerHistory.selectedCurrentIndex = containerHistory.selectingCurrentIndex;\r\n\t\t\t});\r\n\t}","function CustomSelectableList()\r\n{\r\n\tthis.name = 'cslist';\r\n\tthis.items = new Array();\r\n\tthis.itemIdentifiers = new Array();\r\n\tthis.clickHandlers = new Array();\r\n\tthis.dblClickHandlers = new Array();\r\n\tthis.instanceName = null;\r\n\tthis.obj = \"CSList\";\r\n\tthis.lastId = null;\r\n\r\n\tthis.selectedObj = null;\r\n\t\r\n\tif (this.obj)\r\n\t\teval(this.obj + \"=this\");\r\n\r\n\tthis.unselectedColor = null;\r\n\tthis.selectedColor = null;\r\n\r\n\tthis.attachEventEx = function(target, event, func) \r\n\t{\r\n\t\tif (target.attachEvent)\r\n\t\t\ttarget.attachEvent(\"on\" + event, func);\r\n\t\telse if (target.addEventListener)\r\n\t\t\ttarget.addEventListener(event, func, false);\r\n\t\telse\r\n\t\t\ttarget[\"on\" + event] = func;\r\n\t}\r\n\r\n\tthis.addItem = function(item, itemIndex, clickHandler, doubleClickHandler, objIdentifier) \r\n\t{\r\n\t\tthis.items.push(item);\r\n\t\tthis.clickHandlers.push(clickHandler);\r\n\t\tthis.dblClickHandlers.push(doubleClickHandler);\r\n\t\tthis.itemIdentifiers.push(objIdentifier);\r\n\r\n\t\tvar obj = document.getElementById(item)\r\n\t\tif (obj) {\r\n\t\t\tthis.attachEventEx(obj, \"click\", new Function(this.obj + \".click('\" + item + \"');\"));\r\n\t\t\tthis.attachEventEx(obj, \"dblclick\", new Function(this.obj + \".dblclick('\" + item + \"');\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis.selectFirst = function()\r\n\t{\r\n\t\tif (this.items.length)\r\n\t\t\tthis.click(this.items[0]);\r\n\t}\r\n\r\n\tthis.selectById = function( id )\r\n\t{\r\n\t\tif (id.length)\r\n\t\t\tthis.click(id);\r\n\t\telse\r\n\t\t\tthis.selectFirst();\r\n\t}\r\n\r\n\tthis.selectByObj = function( obj )\r\n\t{\r\n\t\tif ( this.selectedObj != null )\r\n\t\t\tthis.selectedObj.style.backgroundColor = this.unselectedColor;\r\n\r\n\t\tif (obj)\r\n\t\t\tobj.style.backgroundColor = this.selectedColor;\r\n\r\n\t\tthis.selectedObj = obj;\r\n\t}\r\n\r\n\tthis._getItemIndex = function(id)\r\n\t{\r\n\t\treturn id.substr( this.instanceName.length+String(\"item\").length );\r\n\t}\r\n\r\n\tthis.click = function(id)\r\n\t{\r\n\t\tvar itemObj = document.getElementById(id);\r\n\t\tthis.selectByObj( itemObj );\r\n\r\n\t\tvar index = this._getItemIndex(id);\r\n\r\n\t\tif (this.clickHandlers[index] && this.lastId != index) {\r\n\t\t\teval(this.clickHandlers[index]);\r\n\t\t}\r\n\r\n\t\tthis.lastId = index;\r\n\t}\r\n\r\n\tthis.dblclick = function(id)\r\n\t{\r\n\t\tvar itemObj = document.getElementById(id);\r\n\r\n\t\tvar index = this._getItemIndex(id);\r\n\t\tif (this.dblClickHandlers[index]) {\r\n\t\t\teval(this.dblClickHandlers[index]);\r\n\t\t}\r\n\t}\r\n\r\n\tthis.getCurrentData = function()\r\n\t{\r\n\t\tif (this.lastId == null)\r\n\t\t\treturn null;\r\n\r\n\t\treturn this.itemIdentifiers[this.lastId];\r\n\t}\r\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n // Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n // Don't fire the event while the user is dragging. This matches the\n // semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n // Chrome and IE fire non-standard event when selection is changed (and\n // sometimes when it hasn't). IE's event fires out of order with respect\n // to key and input events on deletion, so we discard it.\n //\n // Firefox doesn't support selectionchange, so check selection status\n // after each key entry. The selection changes after keydown and before\n // keyup, but we check on keydown as well in the case of holding down a\n // key, when multiple keydown events are fired but only one keyup is.\n // This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n // falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}","function dragDropped(arg) {\n\t\tif (Y.Lang.isArray(arg.value)) {\n\t\t\targ = arg.value;\n\t\t}\n\n\t\tfor (var i = 0; i < arg.length; i++) {\n\t\t\tif (arg[i].mimeType[0] == \"application/x-folder\") { continue; }// skip folders\n\t\t\tfilesToUpload.push(arg[i]);\n\t\t} \n\n\t\t// now let's disable that pesky drop target.\n\t\tlog(START, \"Now processing \" + filesToUpload.length + \" files...\");\n\t\tenableDropTarget(false);\n\t\tstartNextUploadTest();\n\t}","function findSelectables() {\n\n var a = svg.getBoundingClientRect();\n\n for (var i = selectables.length; i--;) {\n\n var selectable = selectables[i],\n b = selectable.getBoundingClientRect();\n\n if (isColliding(a, b)) {\n selectable.classList.add(\"selected\");\n } else {\n selectable.classList.remove(\"selected\");\n }\n }\n}","function selectDDDragstart (e) {\n selectMenuItem ( 'drag-drop-menu', 'dragstart');\n e.preventDefault();\n}","function ld_course_builder_draggable_helper( selected ) {\n\t\t\n\t\tvar container = $('
').attr('id', 'ld-selector-draggable-group');\n\n\t\tif ( ( typeof selected !== 'undefined' ) && ( selected.length ) ) {\n\t\t\tvar max_width = 0;\n\t\t\tjQuery(selected).each(function( selected_idx, selected_el ) {\n\t\t\t\t//console.log('selected_el[%o]', selected_el );\n\t\t\t\tjQuery('.ld-course-builder-sub-actions', selected_el).hide();\n\t\t\t\tvar el_width = jQuery(selected_el).outerWidth();\n\t\t\t\tif ( el_width > max_width )\n\t\t\t\t\tmax_width = el_width;\n\t\t\t});\n\t\t\n\t\t\tcontainer.css('list-style', 'none');\n\t\t\tcontainer.css('width', max_width + 'px');\n\t\t\tcontainer.append(selected.clone());\n\t\t}\n\t\treturn container;\n\t}","multipleChanged(prev, next) {\n this.ariaMultiSelectable = next ? \"true\" : undefined;\n }","function dropList(e) {\n\t\tstopEvent(e);\n\t\tvar cname = this.className;\n\t\tthis.className = cname ? \"\" : \"on\";\n\t}","_evtMousedown(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n if (Private.nonstandardClick(event)) {\n this.reset();\n return;\n }\n let target = event.target;\n while (target !== document.documentElement) {\n // If the user has made a selection, emit its value and reset the widget.\n if (target.classList.contains(ITEM_CLASS)) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n this._selected.emit(target.getAttribute('data-value'));\n this.reset();\n return;\n }\n // If the mouse event happened anywhere else in the widget, bail.\n if (target === this.node) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n return;\n }\n target = target.parentElement;\n }\n this.reset();\n }"],"string":"[\n \"function initializeMultipleSelectBoxMouseEvent($container) {\\r\\n\\t\\tvar $document = $(document);\\r\\n\\t\\t/* process container event */\\r\\n\\t\\t$container.bind(\\\"mousedown.\\\" + PLUGIN_NAMESPACE, function(e) {\\r\\n\\t\\t\\t/* disable text selection */\\r\\n\\t\\t\\te.preventDefault();\\r\\n\\t\\t\\t/* starting row */\\r\\n\\t\\t\\tvar target = e.target;\\r\\n\\t\\t\\tvar $target = $(target);\\r\\n\\t\\t\\tvar $startRow = $target;\\r\\n\\t\\t\\t/* correct the focus for chrome */\\r\\n\\t\\t\\tif (target == this) {\\r\\n\\t\\t\\t\\treturn;\\r\\n\\t\\t\\t} else if ($target.parent()[0] != this) {\\r\\n\\t\\t\\t\\ttarget.focus();\\r\\n\\t\\t\\t\\t$startRow = $target.parents(\\\".\\\" + PLUGIN_NAMESPACE + \\\">*\\\").eq(0);\\r\\n\\t\\t\\t} else {\\r\\n\\t\\t\\t\\tthis.focus();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tvar startIndex = $startRow.getMultipleSelectBoxRowIndex($container);\\r\\n\\t\\t\\tvar currentIndex = startIndex;\\r\\n\\t\\t\\t/* trigger callback */\\r\\n\\t\\t\\tif (!fireOnSelectStartEvent(e, $container, startIndex)) {\\r\\n\\t\\t\\t\\treturn;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t/* prepare info for drawing */\\r\\n\\t\\t\\tvar options = $container.getMultipleSelectBoxOptions();\\r\\n\\t\\t\\tvar containerHistory = $container.getMultipleSelectBoxHistory();\\r\\n\\t\\t\\t/* opposite and retain selection for touch device */\\r\\n\\t\\t\\tvar isTouchDeviceMode = options.isTouchDeviceMode;\\r\\n\\t\\t\\tvar isSelectionOpposite = isTouchDeviceMode;\\r\\n\\t\\t\\tvar isSelectionRetained = isTouchDeviceMode;\\r\\n\\t\\t\\tif (options.isKeyEventEnabled) {\\r\\n\\t\\t\\t\\tif (e.shiftKey) {\\r\\n\\t\\t\\t\\t\\tcurrentIndex = startIndex;\\r\\n\\t\\t\\t\\t\\tstartIndex = containerHistory.selectingStartIndex;\\r\\n\\t\\t\\t\\t} else if (e.ctrlKey) {\\r\\n\\t\\t\\t\\t\\tisSelectionOpposite = isSelectionRetained = true;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t/* starting */\\r\\n\\t\\t\\t$container.addClass(PLUGIN_STYLE_SELECTING).drawMultipleSelectBox(startIndex, currentIndex, {\\r\\n\\t\\t\\t\\t\\\"isSelectionOpposite\\\": isSelectionOpposite,\\r\\n\\t\\t\\t\\t\\\"isSelectionRetained\\\": isSelectionRetained,\\r\\n\\t\\t\\t\\t\\\"scrollPos\\\": null\\r\\n\\t\\t\\t});\\r\\n\\t\\t\\t/* listening */\\r\\n\\t\\t\\tvar scrollHelperFunc = function(e1) {\\r\\n\\t\\t\\t\\toptions.scrollHelper(e1, $container, startIndex, isSelectionRetained);\\r\\n\\t\\t\\t};\\r\\n\\t\\t\\t$container.yieldMultipleSelectBox().bind(\\\"mouseenter.\\\" + PLUGIN_NAMESPACE, function() {\\r\\n\\t\\t\\t\\tunbindEvents($document, [ \\\"mousemove\\\" ]);\\r\\n\\t\\t\\t}).bind(\\\"mouseleave.\\\" + PLUGIN_NAMESPACE, function(e1) {\\r\\n\\t\\t\\t\\tscrollHelperFunc(e1);\\r\\n\\t\\t\\t\\t$document.bind(\\\"mousemove.\\\" + PLUGIN_NAMESPACE, function(e2) {\\r\\n\\t\\t\\t\\t\\tscrollHelperFunc(e2);\\r\\n\\t\\t\\t\\t});\\r\\n\\t\\t\\t}).bind(\\\"mouseover.\\\" + PLUGIN_NAMESPACE, function(e1) {\\r\\n\\t\\t\\t\\tscrollHelperFunc(e1);\\r\\n\\t\\t\\t}).one(\\\"mouseup.\\\" + PLUGIN_NAMESPACE, function(e1) {\\r\\n\\t\\t\\t\\tscrollHelperFunc(e1);\\r\\n\\t\\t\\t});\\r\\n\\t\\t\\t/* IE hacked for mouse up event */\\r\\n\\t\\t\\tif (isIE) {\\r\\n\\t\\t\\t\\t$document.bind(\\\"mouseleave.\\\" + PLUGIN_NAMESPACE, function() {\\r\\n\\t\\t\\t\\t\\t$document.one(\\\"mousemove.\\\" + PLUGIN_NAMESPACE, function(e1) {\\r\\n\\t\\t\\t\\t\\t\\tif (!e1.button) {\\r\\n\\t\\t\\t\\t\\t\\t\\tvalidateMultipleSelectBox(e1);\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t});\\r\\n\\t\\t\\t}\\r\\n\\t\\t});\\r\\n\\t\\t/* select group items automatically */\\r\\n\\t\\t$container.getMultipleSelectBoxCachedRows().filter(\\\".\\\" + PLUGIN_STYLE_OPTGROUP).bind(\\\"dblclick.\\\" + PLUGIN_NAMESPACE, function(e) {\\r\\n\\t\\t\\tvar $startRow = $(this);\\r\\n\\t\\t\\t/* trigger callback */\\r\\n\\t\\t\\tif (!fireOnSelectStartEvent(e, $container, $startRow.getMultipleSelectBoxRowIndex($container))) {\\r\\n\\t\\t\\t\\treturn;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tvar options = $container.getMultipleSelectBoxOptions();\\r\\n\\t\\t\\tvar maxLimit = options.maxLimit;\\r\\n\\t\\t\\tvar childGroupItemList = $startRow.getMultipleSelectBoxOptGroupItems();\\r\\n\\t\\t\\tvar childGroupItemSelectSize = childGroupItemList.length;\\r\\n\\t\\t\\tif (childGroupItemSelectSize > 0) {\\r\\n\\t\\t\\t\\tif (maxLimit > 0 && childGroupItemSelectSize > maxLimit) {\\r\\n\\t\\t\\t\\t\\tchildGroupItemSelectSize = maxLimit;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t$container.drawMultipleSelectBox(childGroupItemList.eq(0).getMultipleSelectBoxRowIndex($container), childGroupItemList.eq(childGroupItemSelectSize - 1).getMultipleSelectBoxRowIndex($container), {\\r\\n\\t\\t\\t\\t\\t\\\"scrollPos\\\": null\\r\\n\\t\\t\\t\\t});\\r\\n\\t\\t\\t\\t/* special case */\\r\\n\\t\\t\\t\\t$container.addClass(PLUGIN_STYLE_SELECTING);\\r\\n\\t\\t\\t\\tvalidateMultipleSelectBox(e);\\r\\n\\t\\t\\t}\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function initMultipleSelection(element) {\\n element.on('click', 'li.type-task, li.type-sub-task', function (eventObject) {\\n if (!eventObject.ctrlKey) {\\n $('li.selected', element).not(this).removeClass('selected');\\n }\\n $(this).toggleClass('selected');\\n eventObject.stopPropagation();\\n });\\n}\",\n \"click(event){\\n if(event.target.tagName === \\\"MULTI-SELECTION\\\"){\\n const onContainerMouseClick = this.onContainerMouseClick;\\n\\n if(onContainerMouseClick){\\n onContainerMouseClick();\\n }\\n }\\n }\",\n \"function doSelections(event, selectedEles, cols) {\\n // Select elements in a range, either across rows or columns\\n function selectRange() {\\n var frstSelect = selectedEles[0];\\n var lstSelect = selectedEles[selectedEles.length - 1];\\n if (cols) {\\n var flipStart = flipFlipIdx(Math.min(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\\n flipIdx(frstSelect), flipIdx(lstSelect)));\\n var flipEnd = flipFlipIdx(Math.max(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\\n flipIdx(frstSelect), flipIdx(lstSelect)));\\n selectElemsDownRows(Math.min(flipStart, flipEnd), Math.max(flipStart, flipEnd));\\n } else {\\n var start = Math.min(selectionMinPivot, frstSelect);\\n var end = Math.max(selectionMaxPivot, lstSelect);\\n selectElemRange(start, end);\\n }\\n }\\n // If not left mouse button then leave it for someone else\\n if (event.which != LEFT_MOUSE_BUTTON) {\\n return;\\n }\\n // Just a click - make selection current row/column clicked on\\n if (!event.ctrlKey && !event.shiftKey) {\\n clearAll();\\n selectEles(selectedEles);\\n selectionMinPivot = selectedEles[0];\\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\\n return;\\n }\\n // Cntrl/Shift click - add to current selections cells between (inclusive) last single selection and cell\\n // clicked on\\n if (event.ctrlKey && event.shiftKey) {\\n selectRange();\\n return;\\n }\\n // Cntrl click - keep current selections and add toggle of selection on the single cell clicked on\\n if (event.ctrlKey) {\\n toggleEles(selectedEles);\\n selectionMinPivot = selectedEles[0];\\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\\n return;\\n }\\n // Shift click - make current selections cells between (inclusive) last single selection and cell clicked on\\n if (event.shiftKey) {\\n clearAll();\\n selectRange();\\n }\\n }\",\n \"function selectedDblclick( event ) {\\n if ( self.cfg.onSelectedDblclick.length > 0 &&\\n ( $(event.target).hasClass('selected') || $(event.target).closest('g').hasClass('selected') ) )\\n for ( var n=0; n 0)) {\\n\\t// The click target is one of .brow cell,\\n\\t// .rbkmkitem_x div, .rtwistieac div, favicon img or .favttext span\\n\\t// Find cell, for selection\\n\\tlet cell;\\n\\tif (className.includes(\\\"fav\\\") || className.startsWith(\\\"rtwistie\\\")) {\\n\\t cell = target.parentElement.parentElement;\\n\\t}\\n\\telse if (className.startsWith(\\\"rbkmkitem_\\\")) {\\n\\t cell = target.parentElement;\\n\\t}\\n\\telse if (className.includes(\\\"brow\\\")) {\\n\\t cell = target;\\n\\t}\\n\\n\\t// Select result item if recognized\\n\\t// , and if not already selected=> keep bigger multi-items selection area if right click inside it \\n\\tif (cell != undefined) {\\n\\t let button = e.button;\\n\\t // Do nothing on selection if this is a right click inside a selection range\\n\\t if ((button != 2) || !cell.classList.contains(rselection.selectHighlight)) {\\n//\\t\\tsetCellHighlight(rcursor, rlastSelOp, cell, rselection.selectIds);\\n\\t\\tif (button == 1) { // If middle click, simple select, no multi-select\\n\\t\\t addCellCursorSelection(cell, rcursor, rselection);\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t let is_ctrlKey = (isMacOS ? e.metaKey : e.ctrlKey);\\n\\t\\t addCellCursorSelection(cell, rcursor, rselection, true, is_ctrlKey, e.shiftKey);\\n\\t\\t}\\n\\t }\\n\\t}\\n }\\n}\",\n \"set_selected_items(top, left, width, height) {\\n this.selection_items.forEach((selected_item, item_index) => {\\n if (this.is_element_selected(selected_item.element, top, left, width, height)) {\\n selected_item.element.classList.add(this.options.selected_class_name);\\n this.selection_items[item_index].is_selected = true;\\n } else {\\n if (selected_item.is_selected) {\\n selected_item.element.classList.add(this.options.selected_class_name);\\n this.selection_items[item_index].is_selected = true;\\n return;\\n }\\n }\\n });\\n }\",\n \"function defaultScrollHelper(e, $container, startIndex, isSelectionRetained) {\\r\\n\\t\\tif (e.type == \\\"mouseover\\\") {\\r\\n\\t\\t\\t/* on mouse down and than mouse over */\\r\\n\\t\\t\\tvar $childTarget = $(e.target);\\r\\n\\t\\t\\tif ($container[0] != $childTarget.parent()[0]) {\\r\\n\\t\\t\\t\\treturn;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tdefaultScrollHelperUtils.stopTimer();\\r\\n\\t\\t\\t$container.drawMultipleSelectBox(startIndex, $childTarget.getMultipleSelectBoxRowIndex($container), {\\r\\n\\t\\t\\t\\t\\\"isSelectionRetained\\\": isSelectionRetained,\\r\\n\\t\\t\\t\\t\\\"scrollPos\\\": null\\r\\n\\t\\t\\t});\\r\\n\\t\\t} else if (e.type == \\\"mouseup\\\") {\\r\\n\\t\\t\\t/* on mouse down and than mouse up */\\r\\n\\t\\t\\tdefaultScrollHelperUtils.stopTimer();\\r\\n\\t\\t} else if (e.type == \\\"mouseleave\\\") {\\r\\n\\t\\t\\t/* on mouse down and than mouse leave */\\r\\n\\t\\t} else if (e.type == \\\"mousemove\\\") {\\r\\n\\t\\t\\t/* on mouse down and than mouse leave and moving */\\r\\n\\t\\t\\tvar options = $container.getMultipleSelectBoxOptions();\\r\\n\\t\\t\\tvar isHorizontalMode = options.isHorizontalMode;\\r\\n\\t\\t\\tdefaultScrollHelperUtils.mousePos = (isHorizontalMode ? e.pageX : e.pageY);\\r\\n\\t\\t\\tdefaultScrollHelperUtils.startTimer(function() {\\r\\n\\t\\t\\t\\tvar containerViewport = $container.getMultipleSelectBoxViewport();\\r\\n\\t\\t\\t\\tvar containerBackPos = containerViewport.getTopPos();\\r\\n\\t\\t\\t\\tvar containerFrontPos = containerViewport.getBottomPos();\\r\\n\\t\\t\\t\\tvar containerScrollPos = containerViewport.getScrollTop();\\r\\n\\t\\t\\t\\tvar containerVisibleRange = containerViewport.getHeight();\\r\\n\\t\\t\\t\\tif (isHorizontalMode) {\\r\\n\\t\\t\\t\\t\\tcontainerBackPos = containerViewport.getLeftPos();\\r\\n\\t\\t\\t\\t\\tcontainerFrontPos = containerViewport.getRightPos();\\r\\n\\t\\t\\t\\t\\tcontainerScrollPos = containerViewport.getScrollLeft();\\r\\n\\t\\t\\t\\t\\tcontainerVisibleRange = containerViewport.getWidth();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\tvar scrollToPos = containerScrollPos;\\r\\n\\t\\t\\t\\tvar targetPos = scrollToPos;\\r\\n\\t\\t\\t\\tvar scrollSpeed = options.scrollSpeed;\\r\\n\\t\\t\\t\\t/* mousemove event is triggered when mouse out of the box only */\\r\\n\\t\\t\\t\\tvar mousePos = defaultScrollHelperUtils.mousePos;\\r\\n\\t\\t\\t\\tif (mousePos < containerBackPos) {\\r\\n\\t\\t\\t\\t\\tscrollToPos -= scrollSpeed;\\r\\n\\t\\t\\t\\t\\ttargetPos = scrollToPos;\\r\\n\\t\\t\\t\\t} else if (mousePos > containerFrontPos) {\\r\\n\\t\\t\\t\\t\\tscrollToPos += scrollSpeed;\\r\\n\\t\\t\\t\\t\\ttargetPos = scrollToPos + containerVisibleRange;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t/* calculate cuurentIndex */\\r\\n\\t\\t\\t\\t$container.drawMultipleSelectBox(startIndex, calculateScrollHelperCurrentIndex($container, targetPos), {\\r\\n\\t\\t\\t\\t\\t\\\"isSelectionRetained\\\": isSelectionRetained,\\r\\n\\t\\t\\t\\t\\t\\\"scrollPos\\\": scrollToPos\\r\\n\\t\\t\\t\\t});\\r\\n\\t\\t\\t}, 100);\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function drag(e){\\ndraggedItem=e.target;\\ndragging=true;\\n}\",\n \"onMultiSelectionComponentPress(event) {\\n if (this.isInactive) {\\n return;\\n }\\n this.fireEvent(\\\"_selection-requested\\\", {\\n item: this,\\n selected: event.target.checked,\\n selectionComponentPressed: true\\n });\\n }\",\n \"function dragAction() {\\n $(\\\".content-list\\\").selectable({\\n selected: function(event, ui) {\\n docListTools();\\n },\\n unselecting: function(event, ui) {\\n docListTools();\\n }\\n });\\n\\n $(\\\".content-list\\\").find(\\\".folder\\\").draggable({\\n revert: 'false',\\n helper: function(event) {\\n var $group = $(\\\"\\\", {\\n class: \\\"content-list\\\"\\n });\\n if ($(\\\".folder.ui-selected\\\").length) {\\n var theClone = $(\\\".folder.ui-selected\\\").clone();\\n theClone = $group.html(theClone);\\n } else {\\n theClone = $group.html($(this).clone());\\n }\\n return theClone;\\n }\\n });\\n $(\\\".content-list\\\").find(\\\".data-folder\\\").droppable({\\n tolerance: 'pointer',\\n drop: function(event, ui) {\\n var dragId = ui.draggable.attr(\\\"data-id\\\");\\n var dragType = ui.draggable.attr(\\\"data-type\\\");\\n var dropId = $(this).attr(\\\"data-id\\\");\\n // relocate(dragId, dragType, dropId);\\n if ($(\\\".folder.ui-selected\\\").length) {\\n $(\\\".folder.ui-selected\\\").remove();\\n } else {\\n ui.draggable.remove();\\n }\\n\\n $(this).removeClass(\\\"over-now\\\");\\n },\\n over: function(event, ui) {\\n $(this).addClass(\\\"over-now\\\");\\n },\\n out: function(event, ui) {\\n $(this).removeClass(\\\"over-now\\\");\\n }\\n });\\n}\",\n \"function drop_allow(event) {\\n u(event.target.parentElement).closest('tr').addClass(\\\"drop-allow\\\");\\n}\",\n \"function clickHandler( event /*: JQueryEventObject */ ) {\\n if ( $element.hasClass( pausedDragSelectClass ) ) return;\\n if ( $element[0].dragData.firstX == $element[0].dragData.lastX\\n && $element[0].dragData.firstY == $element[0].dragData.lastY ) {\\n if ( $element.hasClass( SELECTED_FOR_DRAGGING_CLASS ) ) {\\n $element.removeDragAndSizeSelection();\\n } else {\\n $element.addDragAndSizeSelection();\\n }\\n setTimeout( function () {\\n var mouseMoveEvent = $.Event( 'mousemove' );\\n mouseMoveEvent.pageX = event.pageX;\\n mouseMoveEvent.pageY = event.pageY;\\n $element.trigger( mouseMoveEvent );\\n }, 0 );\\n }\\n }\",\n \"function clicked(element)\\n{\\n // Add classes to the elements\\n element.className += selectedClass;\\n element.firstElementChild.className += childSelectedClass;\\n element.className += selectedHoverClass;\\n // If prevElement exists, remove the classes\\n if (prevElement)\\n {\\n removeSelectedClass(prevElement);\\n }\\n\\n // Assign the previous clicked element to the newPrevElement\\n prevElement = element;\\n}\",\n \"function SelectionManager() {\\n\\tvar t = this;\\n\\t\\n\\t\\n\\t// exports\\n\\tt.select = select;\\n\\tt.unselect = unselect;\\n\\tt.reportSelection = reportSelection;\\n\\tt.daySelectionMousedown = daySelectionMousedown;\\n\\t\\n\\t\\n\\t// imports\\n\\tvar opt = t.opt;\\n\\tvar trigger = t.trigger;\\n\\tvar defaultSelectionEnd = t.defaultSelectionEnd;\\n\\tvar renderSelection = t.renderSelection;\\n\\tvar clearSelection = t.clearSelection;\\n\\t\\n\\t\\n\\t// locals\\n\\tvar selected = false;\\n\\n\\n\\n\\t// unselectAuto\\n\\tif (opt('selectable') && opt('unselectAuto')) {\\n\\t\\t$(document).mousedown(function(ev) {\\n\\t\\t\\tvar ignore = opt('unselectCancel');\\n\\t\\t\\tif (ignore) {\\n\\t\\t\\t\\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tunselect(ev);\\n\\t\\t});\\n\\t}\\n\\t\\n\\n\\tfunction select(startDate, endDate, allDay) {\\n\\t\\tunselect();\\n\\t\\tif (!endDate) {\\n\\t\\t\\tendDate = defaultSelectionEnd(startDate, allDay);\\n\\t\\t}\\n\\t\\trenderSelection(startDate, endDate, allDay);\\n\\t\\treportSelection(startDate, endDate, allDay);\\n\\t}\\n\\t\\n\\t\\n\\tfunction unselect(ev) {\\n\\t\\tif (selected) {\\n\\t\\t\\tselected = false;\\n\\t\\t\\tclearSelection();\\n\\t\\t\\ttrigger('unselect', null, ev);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tfunction reportSelection(startDate, endDate, allDay, ev) {\\n\\t\\tselected = true;\\n\\t\\ttrigger('select', null, startDate, endDate, allDay, ev);\\n\\t}\\n\\t\\n\\t\\n\\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\\n\\t\\tvar cellToDate = t.cellToDate;\\n\\t\\tvar getIsCellAllDay = t.getIsCellAllDay;\\n\\t\\tvar hoverListener = t.getHoverListener();\\n\\t\\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\\n\\t\\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\\n\\t\\t\\tunselect(ev);\\n\\t\\t\\tvar _mousedownElement = this;\\n\\t\\t\\tvar dates;\\n\\t\\t\\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\\n\\t\\t\\t\\tclearSelection();\\n\\t\\t\\t\\tif (cell && getIsCellAllDay(cell)) {\\n\\t\\t\\t\\t\\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\\n\\t\\t\\t\\t\\trenderSelection(dates[0], dates[1], true);\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\tdates = null;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, ev);\\n\\t\\t\\t$(document).one('mouseup', function(ev) {\\n\\t\\t\\t\\thoverListener.stop();\\n\\t\\t\\t\\tif (dates) {\\n\\t\\t\\t\\t\\tif (+dates[0] == +dates[1]) {\\n\\t\\t\\t\\t\\t\\treportDayClick(dates[0], true, ev);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\treportSelection(dates[0], dates[1], true, ev);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t}\\n\\t}\\n\\n\\n}\",\n \"function SelectionManager() {\\n\\tvar t = this;\\n\\t\\n\\t\\n\\t// exports\\n\\tt.select = select;\\n\\tt.unselect = unselect;\\n\\tt.reportSelection = reportSelection;\\n\\tt.daySelectionMousedown = daySelectionMousedown;\\n\\t\\n\\t\\n\\t// imports\\n\\tvar opt = t.opt;\\n\\tvar trigger = t.trigger;\\n\\tvar defaultSelectionEnd = t.defaultSelectionEnd;\\n\\tvar renderSelection = t.renderSelection;\\n\\tvar clearSelection = t.clearSelection;\\n\\t\\n\\t\\n\\t// locals\\n\\tvar selected = false;\\n\\n\\n\\n\\t// unselectAuto\\n\\tif (opt('selectable') && opt('unselectAuto')) {\\n\\t\\t$(document).mousedown(function(ev) {\\n\\t\\t\\tvar ignore = opt('unselectCancel');\\n\\t\\t\\tif (ignore) {\\n\\t\\t\\t\\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tunselect(ev);\\n\\t\\t});\\n\\t}\\n\\t\\n\\n\\tfunction select(startDate, endDate, allDay) {\\n\\t\\tunselect();\\n\\t\\tif (!endDate) {\\n\\t\\t\\tendDate = defaultSelectionEnd(startDate, allDay);\\n\\t\\t}\\n\\t\\trenderSelection(startDate, endDate, allDay);\\n\\t\\treportSelection(startDate, endDate, allDay);\\n\\t}\\n\\t\\n\\t\\n\\tfunction unselect(ev) {\\n\\t\\tif (selected) {\\n\\t\\t\\tselected = false;\\n\\t\\t\\tclearSelection();\\n\\t\\t\\ttrigger('unselect', null, ev);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tfunction reportSelection(startDate, endDate, allDay, ev) {\\n\\t\\tselected = true;\\n\\t\\ttrigger('select', null, startDate, endDate, allDay, ev);\\n\\t}\\n\\t\\n\\t\\n\\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\\n\\t\\tvar cellToDate = t.cellToDate;\\n\\t\\tvar getIsCellAllDay = t.getIsCellAllDay;\\n\\t\\tvar hoverListener = t.getHoverListener();\\n\\t\\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\\n\\t\\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\\n\\t\\t\\tunselect(ev);\\n\\t\\t\\tvar _mousedownElement = this;\\n\\t\\t\\tvar dates;\\n\\t\\t\\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\\n\\t\\t\\t\\tclearSelection();\\n\\t\\t\\t\\tif (cell && getIsCellAllDay(cell)) {\\n\\t\\t\\t\\t\\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\\n\\t\\t\\t\\t\\trenderSelection(dates[0], dates[1], true);\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\tdates = null;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, ev);\\n\\t\\t\\t$(document).one('mouseup', function(ev) {\\n\\t\\t\\t\\thoverListener.stop();\\n\\t\\t\\t\\tif (dates) {\\n\\t\\t\\t\\t\\tif (+dates[0] == +dates[1]) {\\n\\t\\t\\t\\t\\t\\treportDayClick(dates[0], true, ev);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\treportSelection(dates[0], dates[1], true, ev);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t}\\n\\t}\\n\\n\\n}\",\n \"function SelectionManager() {\\n\\tvar t = this;\\n\\t\\n\\t\\n\\t// exports\\n\\tt.select = select;\\n\\tt.unselect = unselect;\\n\\tt.reportSelection = reportSelection;\\n\\tt.daySelectionMousedown = daySelectionMousedown;\\n\\t\\n\\t\\n\\t// imports\\n\\tvar opt = t.opt;\\n\\tvar trigger = t.trigger;\\n\\tvar defaultSelectionEnd = t.defaultSelectionEnd;\\n\\tvar renderSelection = t.renderSelection;\\n\\tvar clearSelection = t.clearSelection;\\n\\t\\n\\t\\n\\t// locals\\n\\tvar selected = false;\\n\\n\\n\\n\\t// unselectAuto\\n\\tif (opt('selectable') && opt('unselectAuto')) {\\n\\t\\t$(document).mousedown(function(ev) {\\n\\t\\t\\tvar ignore = opt('unselectCancel');\\n\\t\\t\\tif (ignore) {\\n\\t\\t\\t\\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tunselect(ev);\\n\\t\\t});\\n\\t}\\n\\t\\n\\n\\tfunction select(startDate, endDate, allDay) {\\n\\t\\tunselect();\\n\\t\\tif (!endDate) {\\n\\t\\t\\tendDate = defaultSelectionEnd(startDate, allDay);\\n\\t\\t}\\n\\t\\trenderSelection(startDate, endDate, allDay);\\n\\t\\treportSelection(startDate, endDate, allDay);\\n\\t}\\n\\t\\n\\t\\n\\tfunction unselect(ev) {\\n\\t\\tif (selected) {\\n\\t\\t\\tselected = false;\\n\\t\\t\\tclearSelection();\\n\\t\\t\\ttrigger('unselect', null, ev);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tfunction reportSelection(startDate, endDate, allDay, ev) {\\n\\t\\tselected = true;\\n\\t\\ttrigger('select', null, startDate, endDate, allDay, ev);\\n\\t}\\n\\t\\n\\t\\n\\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\\n\\t\\tvar cellToDate = t.cellToDate;\\n\\t\\tvar getIsCellAllDay = t.getIsCellAllDay;\\n\\t\\tvar hoverListener = t.getHoverListener();\\n\\t\\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\\n\\t\\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\\n\\t\\t\\tunselect(ev);\\n\\t\\t\\tvar _mousedownElement = this;\\n\\t\\t\\tvar dates;\\n\\t\\t\\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\\n\\t\\t\\t\\tclearSelection();\\n\\t\\t\\t\\tif (cell && getIsCellAllDay(cell)) {\\n\\t\\t\\t\\t\\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\\n\\t\\t\\t\\t\\trenderSelection(dates[0], dates[1], true);\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\tdates = null;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, ev);\\n\\t\\t\\t$(document).one('mouseup', function(ev) {\\n\\t\\t\\t\\thoverListener.stop();\\n\\t\\t\\t\\tif (dates) {\\n\\t\\t\\t\\t\\tif (+dates[0] == +dates[1]) {\\n\\t\\t\\t\\t\\t\\treportDayClick(dates[0], true, ev);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\treportSelection(dates[0], dates[1], true, ev);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t}\\n\\t}\\n\\n\\n}\",\n \"activeClick() {\\n var $_this = this;\\n var action = this.options.dblClick ? 'dblclick' : 'click';\\n\\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\\n $_this.select($(this).data('SELECT-value'));\\n });\\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\\n $_this.deselect($(this).data('SELECT-value'));\\n });\\n\\n }\",\n \"function extractEvents$3(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var targetNode=targetInst?getNodeFromInstance(targetInst):window;switch(domEventName){// Track the input node that has focus.\\ncase'focusin':if(isTextInputElement(targetNode)||targetNode.contentEditable==='true'){activeElement$1=targetNode;activeElementInst$1=targetInst;lastSelection=null;}break;case'focusout':activeElement$1=null;activeElementInst$1=null;lastSelection=null;break;// Don't fire the event while the user is dragging. This matches the\\n// semantics of the native select event.\\ncase'mousedown':mouseDown=true;break;case'contextmenu':case'mouseup':case'dragend':mouseDown=false;constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);break;// Chrome and IE fire non-standard event when selection is changed (and\\n// sometimes when it hasn't). IE's event fires out of order with respect\\n// to key and input events on deletion, so we discard it.\\n//\\n// Firefox doesn't support selectionchange, so check selection status\\n// after each key entry. The selection changes after keydown and before\\n// keyup, but we check on keydown as well in the case of holding down a\\n// key, when multiple keydown events are fired but only one keyup is.\\n// This is also our approach for IE handling, for the reason above.\\ncase'selectionchange':if(skipSelectionChangeEvent){break;}// falls through\\ncase'keydown':case'keyup':constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);}}\",\n \"function extractEvents$3(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var targetNode=targetInst?getNodeFromInstance(targetInst):window;switch(domEventName){// Track the input node that has focus.\\ncase'focusin':if(isTextInputElement(targetNode)||targetNode.contentEditable==='true'){activeElement$1=targetNode;activeElementInst$1=targetInst;lastSelection=null;}break;case'focusout':activeElement$1=null;activeElementInst$1=null;lastSelection=null;break;// Don't fire the event while the user is dragging. This matches the\\n// semantics of the native select event.\\ncase'mousedown':mouseDown=true;break;case'contextmenu':case'mouseup':case'dragend':mouseDown=false;constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);break;// Chrome and IE fire non-standard event when selection is changed (and\\n// sometimes when it hasn't). IE's event fires out of order with respect\\n// to key and input events on deletion, so we discard it.\\n//\\n// Firefox doesn't support selectionchange, so check selection status\\n// after each key entry. The selection changes after keydown and before\\n// keyup, but we check on keydown as well in the case of holding down a\\n// key, when multiple keydown events are fired but only one keyup is.\\n// This is also our approach for IE handling, for the reason above.\\ncase'selectionchange':if(skipSelectionChangeEvent){break;}// falls through\\ncase'keydown':case'keyup':constructSelectEvent(dispatchQueue,nativeEvent,nativeEventTarget);}}\",\n \"toggSelAll (c, direct) {\\r\\n const O = this;\\r\\n const cloneOriginalEvents = $.extend(true, {}, $._data(O.E.get(0), \\\"events\\\")); // clone original select elements events\\r\\n O.E.off(); // unbind original select elements events because we do not want the following clicks to trigger change on it\\r\\n\\r\\n if (O.is_multi) {\\r\\n // Select all\\r\\n if (c) {\\r\\n O.E.find('option:not(:checked):not(:disabled):not(:hidden)').toArray().forEach(option => {\\r\\n if (!$(option).data('li').hasClass('hidden')) {\\r\\n option.selected = true;\\r\\n $(option).data('li').toggleClass('selected', true);\\r\\n }\\r\\n });\\r\\n } else {\\r\\n // Unselect all\\r\\n O.E.find('option:checked:not(:disabled):not(:hidden)').toArray().forEach(option => {\\r\\n if (!$(option).data('li').hasClass('hidden')) {\\r\\n option.selected = false;\\r\\n $(option).data('li').toggleClass('selected', false);\\r\\n }\\r\\n });\\r\\n }\\r\\n } else {\\r\\n if (!c) O.E[0].selectedIndex = -1;\\r\\n else console.warn('You called `SelectAll` on a non-multiple select');\\r\\n }\\r\\n\\r\\n // rebind original select elements events\\r\\n $.each(cloneOriginalEvents, (_, e) => {\\r\\n $.each(e, (__, ev) => {\\r\\n O.E.on(ev.type, ev.handler);\\r\\n });\\r\\n });\\r\\n\\r\\n if((O.is_multi && !settings.okCancelInMulti) || !O.is_multi){\\r\\n O.callChange(); // call change on original select element\\r\\n O.setText();\\r\\n }\\r\\n\\r\\n if (!direct) {\\r\\n if (!O.mob && O.selAll) O.selAll.removeClass('partial').toggleClass('selected', !!c);\\r\\n O.setText();\\r\\n O.setPstate();\\r\\n }\\r\\n }\",\n \"function initializeMultipleSelectBoxTouchEvent($container) {\\r\\n\\t\\t$container.bind(\\\"touchstart.\\\" + PLUGIN_NAMESPACE, function(e) {\\r\\n\\t\\t\\tvar options = $container.getMultipleSelectBoxOptions();\\r\\n\\t\\t\\tvar containerViewport = $container.getMultipleSelectBoxViewport();\\r\\n\\t\\t\\tvar startTouches = e.originalEvent.touches[0];\\r\\n\\t\\t\\tvar startTouchPos = startTouches.pageY;\\r\\n\\t\\t\\tvar startContainerScrollPos = containerViewport.getScrollTop();\\r\\n\\t\\t\\tif (options.isHorizontalMode) {\\r\\n\\t\\t\\t\\tstartTouchPos = startTouches.pageX;\\r\\n\\t\\t\\t\\tstartContainerScrollPos = containerViewport.getScrollLeft();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t$container.yieldMultipleSelectBox().bind(\\\"touchmove.\\\" + PLUGIN_NAMESPACE, function(e1) {\\r\\n\\t\\t\\t\\t/* disable touch scroll */\\r\\n\\t\\t\\t\\te1.preventDefault();\\r\\n\\t\\t\\t\\t/* calculate scroll to position */\\r\\n\\t\\t\\t\\tvar thisTouches = e1.originalEvent.touches[0];\\r\\n\\t\\t\\t\\tif (options.isHorizontalMode) {\\r\\n\\t\\t\\t\\t\\t$container.scrollLeft(startContainerScrollPos + (thisTouches.pageX - startTouchPos));\\r\\n\\t\\t\\t\\t} else {\\r\\n\\t\\t\\t\\t\\t$container.scrollTop(startContainerScrollPos + (thisTouches.pageY - startTouchPos));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t});\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function SelectionUtil() {\\n}\",\n \"function customizeMultiSelect(){\\n /* IE doesn't support event handling on option tag, hence conveted option click event to select onchange event*/\\n $('body').on('change','.customize_multiselect', function(){\\n var select = $(this);\\n var sel_val = $(this).val();\\n var sel_opt = '';\\n $(select).find(\\\"option\\\").each(function () {\\n if($(this).val() == sel_val){\\n sel_opt = $(this);\\n return;\\n }\\n });\\n if ($(sel_opt).attr(\\\"class\\\") == undefined || $(sel_opt).attr(\\\"class\\\").length == 0 || $(sel_opt).hasClass(\\\"unclicked\\\")){\\n $(sel_opt).removeClass('unclicked');\\n $(sel_opt).addClass('clicked');\\n } else {\\n $(sel_opt).removeClass('clicked')\\n $(sel_opt).addClass('unclicked');\\n $(sel_opt).removeAttr(\\\"selected\\\");\\n }\\n $(select).find(\\\"option.clicked\\\").attr(\\\"selected\\\",\\\"selected\\\");\\n $(select).find(\\\"option.unclicked\\\").removeAttr(\\\"selected\\\");\\n });\\n}\",\n \"function initializeMultiCheckboxSelection() {\\n // Add event listener on li element instead of directly to checkbox in order to allow shift click in firefox.\\n // A click on checkboxes in firefox is not triggered, if a modifier is active (shift, alt, ctrl)\\n const doesProvideMod = !(navigator.userAgent.indexOf(\\\"Firefox\\\") >= 0);\\n $('#imageList>li').on('click', (doesProvideMod ? 'input[type=\\\"checkbox\\\"]' : 'label'), function(event) {\\n const checkbox = doesProvideMod ? this : $(this).siblings('input[type=\\\"checkbox\\\"]')[0];\\n if( !lastChecked ) {\\n lastChecked = checkbox;\\n return;\\n }\\n\\n if( event.shiftKey ) {\\n var checkBoxes = $('#imageList input[type=\\\"checkbox\\\"]').not('#selectFilter');\\n var start = $(checkBoxes).index($(checkbox));\\n var end = $(checkBoxes).index($(lastChecked));\\n\\n $(checkBoxes).slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', $(lastChecked).is(':checked'));\\n }\\n\\n $(checkbox).change();\\n lastChecked = checkbox;\\n });\\n}\",\n \"function selectable(options) {\\r\\n\\treturn this.each(function () {\\r\\n\\t\\tvar elem = this;\\r\\n\\t\\tvar $elem = $(elem);\\r\\n\\t\\tif ($elem.hasClass(selectableClass)) return; // Already done\\r\\n\\t\\t$elem.addClass(selectableClass);\\r\\n\\t\\tvar opt = initOptions(\\\"selectable\\\", selectableDefaults, $elem, {}, options);\\r\\n\\t\\topt._prepareChild = prepareChild;\\r\\n\\r\\n\\t\\t$elem.children().each(prepareChild);\\r\\n\\t\\t\\r\\n\\t\\tfunction prepareChild() {\\r\\n\\t\\t\\tvar child = $(this);\\r\\n\\t\\t\\tchild.click(function (event) {\\r\\n\\t\\t\\t\\tevent.preventDefault();\\r\\n\\t\\t\\t\\tevent.stopPropagation();\\r\\n\\t\\t\\t\\tlet ctrlKey = !!event.originalEvent.ctrlKey;\\r\\n\\t\\t\\t\\tif (!opt.multi) ctrlKey = false;\\r\\n\\t\\t\\t\\tif (opt.toggle) ctrlKey = true;\\r\\n\\t\\t\\t\\tlet changed = false;\\r\\n\\t\\t\\t\\tif (ctrlKey) {\\r\\n\\t\\t\\t\\t\\tchild.toggleClass(\\\"selected\\\");\\r\\n\\t\\t\\t\\t\\tchanged = true;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse {\\r\\n\\t\\t\\t\\t\\tif (!child.hasClass(\\\"selected\\\")) {\\r\\n\\t\\t\\t\\t\\t\\t$elem.children().removeClass(\\\"selected\\\");\\r\\n\\t\\t\\t\\t\\t\\tchild.addClass(\\\"selected\\\");\\r\\n\\t\\t\\t\\t\\t\\tchanged = true;\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\tif (changed) {\\r\\n\\t\\t\\t\\t\\t$elem.trigger(\\\"selectionchange\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t});\\r\\n\\t\\t}\\r\\n\\t});\\r\\n}\",\n \"function createMultipleSelectRect(e) {\\n iv.sMultipleSvg = iv.svg.rect().fill('none').stroke({\\n width: 2\\n });\\n iv.sMultipleSvg.x(e.x);\\n iv.sMultipleSvg.y(e.y);\\n}\",\n \"function eventMakeSelection(d) {\\n selected.push(d.elemNum) // Store clicked node's elemNum to \\\"selected\\\" array.\\n\\n if (layout.properties.selectionMode == \\\"parent\\\") {\\n parent_id = d.parent_id;\\n } else if (layout.properties.selectionMode == \\\"child\\\" ) {\\n my_id = d.id;\\n } else {\\n // do nothing\\n }\\n\\n if (layout.properties.clearAll) {\\n //clear selections\\n app.clearAll();\\n self.paint($element);\\n } else {\\n self.paint($element, layout)\\n }\\n }\",\n \"function setCollapsibleEvents() {\\n var lists = $(collapsibleClass);\\n //Set Drag on Each 'li' in the list\\n lists.each(function (index, element) {\\n var list = $(element).find('li');\\n $.each(list, function (idx, val) {\\n $(this).on('dragstart', function (evt) {\\n evt.originalEvent.dataTransfer.setData('Text', evt.target.textContent);\\n evt.originalEvent.dataTransfer.setData('ID', evt.target.id);\\n evt.originalEvent.dataTransfer.setData('Location', 'list');\\n });\\n });\\n });\\n }\",\n \"function onDragEnter(ev)\\n{\\n // If a valid item, highlight it as a target\\n let target = ev.target;\\n if ((target.tagName && target.tagName.search(/^(li|div|span|svg|path)$/i) === 0 ) ||\\n target.nodeName.search(/^(#text)$/i) === 0)\\n {\\n if (!target.tagName)\\n target = target.parentNode;\\n if (target.tagName.search(/^li$/i) !== 0)\\n target = target.closest(\\\"li\\\");\\n if (target !== null)\\n target.className += \\\" dragging\\\";\\n }\\n}\",\n \"handleMouseMultiSelect(cellData, event) {\\n const me = this,\\n id = cellData.id;\\n\\n function mergeRange(fromId, toId) {\\n const {\\n store,\\n selectedRecordCollection\\n } = me,\\n fromIndex = store.indexOf(fromId),\\n toIndex = store.indexOf(toId),\\n startIndex = Math.min(fromIndex, toIndex),\\n endIndex = Math.max(fromIndex, toIndex);\\n\\n if (startIndex === -1 || endIndex === -1) {\\n throw new Error('Record not found in selectRange');\\n }\\n\\n const newRange = store.getRange(startIndex, endIndex + 1, false).filter(row => me.isSelectable(row));\\n selectedRecordCollection.splice(0, me.lastRange || 0, newRange);\\n me.lastRange = newRange;\\n }\\n\\n if ((event.metaKey || event.ctrlKey) && me.isSelected(id)) {\\n // ctrl/cmd deselects row if selected\\n me.deselectRow(id);\\n } else if (me.selectionMode.multiSelect) {\\n if (event.shiftKey && me.startCell) {\\n // shift appends selected range (if we have previously focused cell)\\n mergeRange(me.startCell.id, id);\\n } else if (event.ctrlKey || event.metaKey) {\\n // ctrl/cmd adds to selection if using multiselect (and not selected)\\n me.selectRow({\\n record: id,\\n scrollIntoView: false,\\n addToSelection: true\\n });\\n }\\n }\\n }\",\n \"function onMouseMoveEventOnHandler(ev){\\n if(WorkStore.isSelected()) return;\\n\\n window.addEventListener(MOUSE_DOWN, onMouseDownHandler);\\n document.body.classList.add(\\\"drag\\\");\\n}\",\n \"handleMouseMultiSelect(cellData, event) {\\n const me = this,\\n id = cellData.id;\\n\\n function mergeRange(fromId, toId) {\\n const { store, recordCollection } = me,\\n fromIndex = store.indexOf(fromId),\\n toIndex = store.indexOf(toId),\\n startIndex = Math.min(fromIndex, toIndex),\\n endIndex = Math.max(fromIndex, toIndex);\\n\\n if (startIndex === -1 || endIndex === -1) {\\n throw new Error('Record not found in selectRange');\\n }\\n\\n const newRange = store.getRange(startIndex, endIndex + 1, false).filter((row) => me.isSelectable(row));\\n recordCollection.splice(0, me.lastRange || 0, newRange);\\n me.lastRange = newRange;\\n }\\n\\n if ((event.metaKey || event.ctrlKey) && me.isSelected(id)) {\\n // ctrl/cmd deselects row if selected\\n me.deselectRow(id);\\n } else if (me.selectionMode.multiSelect) {\\n if (event.shiftKey && me.startCell) {\\n // shift appends selected range (if we have previously focused cell)\\n mergeRange(me.startCell.id, id);\\n } else if (event.ctrlKey || event.metaKey) {\\n // ctrl/cmd adds to selection if using multiselect (and not selected)\\n me.selectRow(id, false, true);\\n }\\n }\\n }\",\n \"function onDragLeave(ev)\\n{\\n // If current is a valid item, stop highlighting it as a target\\n let target = ev.target;\\n if ((target.tagName && target.tagName.search(/^(li|div|span|svg|path)$/i) === 0 ) ||\\n target.nodeName.search(/^(#text)$/i) === 0)\\n {\\n if (!target.tagName)\\n target = target.parentNode;\\n if (target.tagName.search(/^li$/i) !== 0)\\n target = target.closest(\\\"li\\\");\\n if (target !== null)\\n target.className = target.className.replace(/ dragging\\\\b/,'');\\n }\\n}\",\n \"_selectedFilesClickHandler(event) {\\n const that = this;\\n\\n if (that.disabled) {\\n return;\\n }\\n\\n const target = event.target,\\n isItemUploadClicked = target.closest('.jqx-item-upload-button'),\\n isItemCancelClicked = target.closest('.jqx-item-cancel-button'),\\n isItemAbortClicked = target.closest('.jqx-item-pause-button'),\\n clickedItem = target.closest('.jqx-file');\\n\\n if (isItemUploadClicked) {\\n that.uploadFile(clickedItem.index);\\n }\\n else if (isItemCancelClicked) {\\n that.cancelFile(clickedItem.index);\\n }\\n else if (isItemAbortClicked) {\\n that.pauseFile(clickedItem.index);\\n }\\n }\",\n \"onSelectedCollectionChange({ added, removed }) {\\n const me = this,\\n selection = me.selectedEvents,\\n selected = added || [],\\n deselected = removed || [];\\n\\n function updateSelection(record, select) {\\n const resourceRecord = record.isTask ? record : record.resource,\\n eventRecord = record.isAssignment ? record.event : record;\\n\\n if (eventRecord) {\\n const element = me.getElementFromEventRecord(eventRecord, resourceRecord);\\n\\n me.currentOrientation.toggleCls(eventRecord, resourceRecord, me.eventSelectedCls, select);\\n\\n if (record.isAssignment) {\\n me.getElementsFromEventRecord(eventRecord).forEach((el) => {\\n if (el !== element) {\\n el.classList[select ? 'add' : 'remove'](me.eventAssignHighlightCls);\\n }\\n });\\n }\\n }\\n }\\n\\n selected.forEach((record) => updateSelection(record, true));\\n deselected.forEach((record) => updateSelection(record, false));\\n\\n if (!me.silent) {\\n me.trigger('eventSelectionChange', {\\n action:\\n selection.length > 0\\n ? selected.length > 0 && deselected.length > 0\\n ? 'update'\\n : selected.length > 0\\n ? 'select'\\n : 'deselect'\\n : 'clear',\\n selection,\\n selected,\\n deselected\\n });\\n }\\n }\",\n \"function dragEnter(e) {\\n e.target.closest(\\\"li\\\").classList.add(\\\"over\\\");\\n}\",\n \"function dragTarget(){\\n //prevent default positon in order to allow drop of element\\n var e= event;\\n e.preventDefault();\\n //move element to selected drop target\\n let children= Array.from(e.target.parentNode.parentNode.children);\\n if (children.indexOf(e.target.parentNode)>children.indexOf(row)){\\n e.target.parentNode.after(row);\\n }\\n else{\\n e.target.parnetNode.before(row);\\n }\\n }\",\n \"function MultiSelector(list_target, max) {\\n this.list_target = list_target;this.count = 0;this.id = 0;if( max ){this.max = max;} else {this.max = -1;};this.addElement = function( element ){if( element.tagName == 'INPUT' && element.type == 'file' ){element.name = 'attachment[file_' + (this.id++) + ']';element.multi_selector = this;element.onchange = function(){var new_element = document.createElement( 'input' );new_element.type = 'file';this.parentNode.insertBefore( new_element, this );this.multi_selector.addElement( new_element );this.multi_selector.addListRow( this );this.style.position = 'absolute';this.style.left = '-1000px';};if( this.max != -1 && this.count >= this.max ){element.disabled = true;};this.count++;this.current_element = element;} else {alert( 'Error: not a file input element' );};};this.addListRow = function( element ){var new_row = document.createElement('li');var new_row_button = document.createElement( 'a' );new_row_button.title = 'Remove This Image';new_row_button.href = '#';new_row_button.innerHTML = 'Remove';new_row.element = element;new_row_button.onclick= function(){this.parentNode.element.parentNode.removeChild( this.parentNode.element );this.parentNode.parentNode.removeChild( this.parentNode );this.parentNode.element.multi_selector.count--;this.parentNode.element.multi_selector.current_element.disabled = false;return false;};new_row.innerHTML = element.value.split('/')[element.value.split('/').length - 1];new_row.appendChild( new_row_button );this.list_target.appendChild( new_row );};\\n}\",\n \"function attachEvents(selection, renderItems) {\\r\\n var dragBehavior;\\r\\n \\r\\n // We want to know all the different types of events that exist in any of the elements. This cryptic oneliner does that.\\r\\n // Say we have one element with handlers for click and mouseover, and another one with handlers for mouseover and mouseout.\\r\\n // We will want an array that says [\\\"click\\\", \\\"mouseover\\\", \\\"mouseout\\\"]. We will have to attach all three events to all elements\\r\\n // because there is no (trivial) way to attach event handlers per element. The handlers will actually be functions that check\\r\\n // if the given handler exists and only then call it.\\r\\n var allEvents = _.uniq(_.flatten(_.map(_.pluck(renderItems, \\\"eventHandlers\\\"), function (eh) { return _.keys(eh); })));\\r\\n \\r\\n // Add all the handlers except for click and dblclick which we take special care of below.\\r\\n _.each(allEvents, function (ce) {\\r\\n if (ce === \\\"click\\\" || ce === \\\"dblclick\\\")\\r\\n return;\\r\\n \\r\\n // drag events aren't native to the browser so we need to attach D3's dragBehavior if such handlers exist.\\r\\n if (ce === \\\"dragstart\\\" || ce === \\\"drag\\\" || ce === \\\"dragend\\\") {\\r\\n if (!dragBehavior) {\\r\\n dragBehavior = d3.behavior.drag()\\r\\n .origin(function() { \\r\\n var t = d3.select(this);\\r\\n return {x: t.attr(\\\"x\\\"), y: t.attr(\\\"y\\\")};\\r\\n })\\r\\n }\\r\\n \\r\\n dragBehavior.on(ce, function (d, i) {\\r\\n d.eventHandlers[ce](d, i, d3.event);\\r\\n //d3.event.stopPropagation();\\r\\n });\\r\\n } else {\\r\\n selection.on(ce, function (d, i) {\\r\\n if (d.eventHandlers.hasOwnProperty(ce)) {\\r\\n d.eventHandlers[ce](d, i, d3.event);\\r\\n d3.event.stopPropagation();\\r\\n }\\r\\n });\\r\\n }\\r\\n });\\r\\n \\r\\n if (dragBehavior)\\r\\n selection.call(dragBehavior);\\r\\n \\r\\n var doubleClickDelay = 300;\\r\\n var singleClickTimer;\\r\\n var storedEvent;\\r\\n \\r\\n // Now, as for click and dblclick, we want to make sure they can work together. If only one of them is supplied, there is no problem\\r\\n // because we can simply attach to that event. However, if both are in use, we need to wait after the first click and see if the user\\r\\n // indeed meant to double click or not. If no secondary click is recorded within doubleClickDelay milliseconds, it's considered a single click.\\r\\n selection.on(\\\"click\\\", function (d, i) {\\r\\n if (d.eventHandlers.hasOwnProperty(\\\"click\\\") && d.eventHandlers.hasOwnProperty(\\\"dblclick\\\")) {\\r\\n if (singleClickTimer) {\\r\\n d.eventHandlers.dblclick(d, i, d3.event);\\r\\n clearTimeout(singleClickTimer);\\r\\n singleClickTimer = null;\\r\\n } else {\\r\\n storedEvent = d3.event;\\r\\n singleClickTimer = setTimeout(function () {\\r\\n d.eventHandlers.click(d, i, storedEvent);\\r\\n singleClickTimer = null;\\r\\n }, doubleClickDelay);\\r\\n }\\r\\n d3.event.stopPropagation();\\r\\n } else if (d.eventHandlers.hasOwnProperty(\\\"click\\\")) {\\r\\n d.eventHandlers.click(d, i, d3.event);\\r\\n d3.event.stopPropagation();\\r\\n }\\r\\n });\\r\\n \\r\\n selection.on(\\\"dblclick\\\", function (d, i) {\\r\\n if (d.eventHandlers.hasOwnProperty(\\\"dblclick\\\") && !d.eventHandlers.hasOwnProperty(\\\"click\\\")) {\\r\\n d.eventHandlers.dblclick(d, i, d3.event);\\r\\n d3.event.stopPropagation();\\r\\n }\\r\\n });\\r\\n }\",\n \"function highlightSelectedElements(curSelectedElem, isMultiSelected)\\n {\\n var iframeContents = _iframe.contents();\\n var greenborderElem = $(\\\"
\\\");\\n iframeContents.find(\\\".perc-region:first\\\").append(greenborderElem);\\n greenborderElem.on('click',function(){\\n if(curSelectedElem.prev().hasClass(\\\"perc-itool-selected-elem\\\") &&\\n curSelectedElem.next().hasClass(\\\"perc-itool-selected-elem\\\"))\\n return;\\n clearItoolSelection();\\n });\\n if(isMultiSelected) {\\n greenborderElem.css('border-color','#00afea');\\n }\\n //Show it and position\\n greenborderElem.show();\\n greenborderElem.offset({\\n \\\"top\\\": curSelectedElem.offset().top,\\n \\\"left\\\": curSelectedElem.offset().left\\n }).height(curSelectedElem.innerHeight() -10 ).width(curSelectedElem.innerWidth()-10);\\n }\",\n \"function SelectionManager() {\\n\\tvar t = this;\\n\\t\\n\\t\\n\\t// exports\\n\\tt.select = select;\\n\\tt.unselect = unselect;\\n\\tt.reportSelection = reportSelection;\\n\\tt.daySelectionMousedown = daySelectionMousedown;\\n\\t\\n\\t\\n\\t// imports\\n\\tvar calendar = t.calendar;\\n\\tvar opt = t.opt;\\n\\tvar trigger = t.trigger;\\n\\tvar defaultSelectionEnd = t.defaultSelectionEnd;\\n\\tvar renderSelection = t.renderSelection;\\n\\tvar clearSelection = t.clearSelection;\\n\\t\\n\\t\\n\\t// locals\\n\\tvar selected = false;\\n\\n\\n\\n\\t// unselectAuto\\n\\tif (opt('selectable') && opt('unselectAuto')) {\\n\\t\\t// TODO: unbind on destroy\\n\\t\\t$(document).mousedown(function(ev) {\\n\\t\\t\\tvar ignore = opt('unselectCancel');\\n\\t\\t\\tif (ignore) {\\n\\t\\t\\t\\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tunselect(ev);\\n\\t\\t});\\n\\t}\\n\\t\\n\\n\\tfunction select(start, end) {\\n\\t\\tunselect();\\n\\n\\t\\tstart = calendar.moment(start);\\n\\t\\tif (end) {\\n\\t\\t\\tend = calendar.moment(end);\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tend = defaultSelectionEnd(start);\\n\\t\\t}\\n\\n\\t\\trenderSelection(start, end);\\n\\t\\treportSelection(start, end);\\n\\t}\\n\\t// TODO: better date normalization. see notes in automated test\\n\\t\\n\\t\\n\\tfunction unselect(ev) {\\n\\t\\tif (selected) {\\n\\t\\t\\tselected = false;\\n\\t\\t\\tclearSelection();\\n\\t\\t\\ttrigger('unselect', null, ev);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tfunction reportSelection(start, end, ev) {\\n\\t\\tselected = true;\\n\\t\\ttrigger('select', null, start, end, ev);\\n\\t}\\n\\t\\n\\t\\n\\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\\n\\t\\tvar cellToDate = t.cellToDate;\\n\\t\\tvar getIsCellAllDay = t.getIsCellAllDay;\\n\\t\\tvar hoverListener = t.getHoverListener();\\n\\t\\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\\n\\n\\t\\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\\n\\t\\t\\tunselect(ev);\\n\\t\\t\\tvar dates;\\n\\t\\t\\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\\n\\t\\t\\t\\tclearSelection();\\n\\t\\t\\t\\tif (cell && getIsCellAllDay(cell)) {\\n\\t\\t\\t\\t\\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\\n\\t\\t\\t\\t\\trenderSelection(\\n\\t\\t\\t\\t\\t\\tdates[0],\\n\\t\\t\\t\\t\\t\\tdates[1].clone().add('days', 1) // make exclusive\\n\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\tdates = null;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, ev);\\n\\t\\t\\t$(document).one('mouseup', function(ev) {\\n\\t\\t\\t\\thoverListener.stop();\\n\\t\\t\\t\\tif (dates) {\\n\\t\\t\\t\\t\\tif (+dates[0] == +dates[1]) {\\n\\t\\t\\t\\t\\t\\treportDayClick(dates[0], ev);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\treportSelection(\\n\\t\\t\\t\\t\\t\\tdates[0],\\n\\t\\t\\t\\t\\t\\tdates[1].clone().add('days', 1), // make exclusive\\n\\t\\t\\t\\t\\t\\tev\\n\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t}\\n\\t}\\n\\n\\n}\",\n \"function onMouseMove(event) {\\n\\t\\t\\tif (selectEventTarget(event)) {\\n\\t\\t\\t\\thighlightSelected(true);\\n\\t\\t\\t}\\n\\t\\t}\",\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}\",\n \"function SelectionManager() {\\n\\tvar t = this;\\n\\t\\n\\t\\n\\t// exports\\n\\tt.select = select;\\n\\tt.unselect = unselect;\\n\\tt.reportSelection = reportSelection;\\n\\tt.daySelectionMousedown = daySelectionMousedown;\\n\\tt.selectionManagerDestroy = destroy;\\n\\t\\n\\t\\n\\t// imports\\n\\tvar calendar = t.calendar;\\n\\tvar opt = t.opt;\\n\\tvar trigger = t.trigger;\\n\\tvar defaultSelectionEnd = t.defaultSelectionEnd;\\n\\tvar renderSelection = t.renderSelection;\\n\\tvar clearSelection = t.clearSelection;\\n\\t\\n\\t\\n\\t// locals\\n\\tvar selected = false;\\n\\n\\n\\n\\t// unselectAuto\\n\\tif (opt('selectable') && opt('unselectAuto')) {\\n\\t\\t$(document).on('mousedown', documentMousedown);\\n\\t}\\n\\n\\n\\tfunction documentMousedown(ev) {\\n\\t\\tvar ignore = opt('unselectCancel');\\n\\t\\tif (ignore) {\\n\\t\\t\\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tunselect(ev);\\n\\t}\\n\\t\\n\\n\\tfunction select(start, end) {\\n\\t\\tunselect();\\n\\n\\t\\tstart = calendar.moment(start);\\n\\t\\tif (end) {\\n\\t\\t\\tend = calendar.moment(end);\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tend = defaultSelectionEnd(start);\\n\\t\\t}\\n\\n\\t\\trenderSelection(start, end);\\n\\t\\treportSelection(start, end);\\n\\t}\\n\\t// TODO: better date normalization. see notes in automated test\\n\\t\\n\\t\\n\\tfunction unselect(ev) {\\n\\t\\tif (selected) {\\n\\t\\t\\tselected = false;\\n\\t\\t\\tclearSelection();\\n\\t\\t\\ttrigger('unselect', null, ev);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tfunction reportSelection(start, end, ev) {\\n\\t\\tselected = true;\\n\\t\\ttrigger('select', null, start, end, ev);\\n\\t}\\n\\t\\n\\t\\n\\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\\n\\t\\tvar cellToDate = t.cellToDate;\\n\\t\\tvar getIsCellAllDay = t.getIsCellAllDay;\\n\\t\\tvar hoverListener = t.getHoverListener();\\n\\t\\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\\n\\n\\t\\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\\n\\t\\t\\tunselect(ev);\\n\\t\\t\\tvar dates;\\n\\t\\t\\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\\n\\t\\t\\t\\tclearSelection();\\n\\t\\t\\t\\tif (cell && getIsCellAllDay(cell)) {\\n\\t\\t\\t\\t\\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\\n\\t\\t\\t\\t\\trenderSelection(\\n\\t\\t\\t\\t\\t\\tdates[0],\\n\\t\\t\\t\\t\\t\\tdates[1].clone().add('days', 1) // make exclusive\\n\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\tdates = null;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, ev);\\n\\t\\t\\t$(document).one('mouseup', function(ev) {\\n\\t\\t\\t\\thoverListener.stop();\\n\\t\\t\\t\\tif (dates) {\\n\\t\\t\\t\\t\\tif (+dates[0] == +dates[1]) {\\n\\t\\t\\t\\t\\t\\treportDayClick(dates[0], ev);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\treportSelection(\\n\\t\\t\\t\\t\\t\\tdates[0],\\n\\t\\t\\t\\t\\t\\tdates[1].clone().add('days', 1), // make exclusive\\n\\t\\t\\t\\t\\t\\tev\\n\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t}\\n\\t}\\n\\n\\n\\tfunction destroy() {\\n\\t\\t$(document).off('mousedown', documentMousedown);\\n\\t}\\n\\n\\n}\",\n \"function selectEles(a) {\\n for (var i = 0; i < a.length; i++) {\\n tds[a[i]].className = 'selected';\\n }\\n }\",\n \"function selectColor(e) {\\n e.siblings().removeClass(\\\"selected\\\");\\n e.addClass(\\\"selected\\\");\\n }\",\n \"function setupKeyboardEvents(parent, canvas, selection) {\\n parent.addEventListener(\\\"keydown\\\", keydownHandler, false);\\n parent.addEventListener(\\n \\\"mousedown\\\",\\n function () {\\n parent.focus();\\n },\\n false\\n );\\n\\n function keydownHandler(evt) {\\n var handled = false;\\n var mk = multiselect.modifierKeys(evt);\\n switch (evt.which) {\\n case 37:\\n handled = callArrow(mk, multiselect.LEFT);\\n break;\\n case 38:\\n handled = callArrow(mk, multiselect.UP);\\n break;\\n case 39:\\n handled = callArrow(mk, multiselect.RIGHT);\\n break;\\n case 40:\\n handled = callArrow(mk, multiselect.DOWN);\\n break;\\n case 32:\\n handled = callSpace(mk);\\n break;\\n case 90:\\n handled = callUndoRedo(mk);\\n break;\\n default:\\n return; // exit this handler for unrecognized keys\\n }\\n if (!handled) return;\\n\\n // event is recognized\\n selection.geometry().drawIndicators(selection, canvas, true, true, false);\\n evt.preventDefault();\\n evt.stopPropagation();\\n }\\n\\n function callUndoRedo(mk) {\\n switch (mk) {\\n case multiselect.OPT:\\n selection.undo();\\n break;\\n case multiselect.SHIFT_OPT:\\n selection.redo();\\n break;\\n default:\\n return false;\\n }\\n return true;\\n }\\n\\n function callArrow(mk, dir) {\\n switch (mk) {\\n case multiselect.NONE:\\n selection.arrow(dir);\\n break;\\n case multiselect.CMD:\\n selection.cmdArrow(dir);\\n break;\\n case multiselect.SHIFT:\\n selection.shiftArrow(dir);\\n break;\\n default:\\n return false;\\n }\\n return true;\\n }\\n\\n function callSpace(mk) {\\n switch (mk) {\\n case multiselect.NONE:\\n selection.space();\\n break;\\n case multiselect.CMD:\\n selection.cmdSpace();\\n break;\\n case multiselect.SHIFT:\\n selection.shiftSpace();\\n break;\\n default:\\n return false;\\n }\\n return true;\\n }\\n}\",\n \"function highlightList(event) {\\n // remove previous highlight\\n for (var c in catNames) {\\n if (catNames[c].classList.contains('selected-cat') === true) {\\n catNames[c].classList.remove('selected-cat');\\n }\\n };\\n // highlight name\\n event.target.classList.add('selected-cat');\\n}\",\n \"function updateTouchscreenInputForSelect(element){ \\n var inputTarget = tstInputTarget;\\n var multiple = inputTarget.getAttribute(\\\"multiple\\\") == \\\"multiple\\\";\\n\\n if (multiple) {\\n var val_arr = inputTarget.value.split(tstMultipleSplitChar);\\n var val = \\\"\\\";\\n \\n if (element.innerHTML.length>1)\\n val = unescape(element.innerHTML); \\n // njih\\n else if (element.value.length>1)\\n val = element.value;\\n \\n // Check if the item is already included\\n // var idx = val_arr.toString().indexOf(val);\\n if (!tstMultipleSelected[tstCurrentPage][val]){ //(idx == -1){\\n val_arr.push(val);\\n tstMultipleSelected[tstCurrentPage][val] = true;\\n } else {\\n // val_arr.splice(idx, 1);\\n val_arr = removeFromArray(val_arr, val);\\n delete(tstMultipleSelected[tstCurrentPage][val]);\\n }\\n inputTarget.value = val_arr.join(tstMultipleSplitChar);\\n if (inputTarget.value.indexOf(tstMultipleSplitChar) == 0)\\n inputTarget.value = inputTarget.value.substring(1, inputTarget.value.length);\\n } else {\\n if (element.value.length>1){\\n inputTarget.value = element.value;\\n }\\n else if (element.innerHTML.length>0){\\n inputTarget.value = element.innerHTML;\\n }\\n }\\n\\n highlightSelection(element.parentNode.childNodes, inputTarget)\\n \\n tt_update(inputTarget);\\n}\",\n \"function makeSelectable(e) {\\n e.setStyle('user-select', 'text');\\n e.setStyle('-webkit-user-select', 'text');\\n e.setStyle('-moz-user-select', 'text');\\n e.setStyle('-o-user-select', 'text');\\n e.setStyle('-khtml-user-select', 'text');\\n }\",\n \"function assignContListClick($target, $ul, clickEvent){\\r\\n\\t$ul.children(\\\"li\\\").click(function(){\\r\\n\\t\\tsetContSelection($target, $(this));\\r\\n\\t\\tif (clickEvent){\\r\\n\\t\\t\\tclickEvent();\\r\\n\\t\\t}\\r\\n\\t});\\r\\n}\",\n \"function CdkDragDrop() {}\",\n \"function CdkDragDrop() {}\",\n \"function rowSelection(e) {\\n var\\n // get current HTML row object\\n currentRow = this,\\n // get current HTML row index\\n index = currentRow.offsetTop / (options.rowHeight + options.borderHeight);\\n\\n if (!options.multiselection)\\n // mark all other selected row as unselected \\n self.clearSelection();\\n\\n \\n if (! (e.shiftKey || e.metaKey || e.ctrlKey))\\n // clear selected row\\n self.clearSelection();\\n \\n if (e.shiftKey && options.multiselection) {\\n // Shift is pressed\\n var\\n _lastSelectedIndex = lastSelectedIndex(),\\n // get last selected index\\n from = Math.min(_lastSelectedIndex + 1, index),\\n to = Math.max(_lastSelectedIndex, index),\\n viewPort = getViewPort();\\n\\n // select all rows between interval\\n for (var i = from; i <= to && _currentData[i]; i++) {\\n if ($.inArray(i, selectedIndexes()) == -1) {\\n selectRow(i);\\n if (i >= viewPort.from && i <= viewPort.to) {\\n var row = self.rowAt(i);\\n $self.trigger('rowSelection', [i, row, true, _currentData[i]]);\\n }\\n }\\n }\\n\\n } else if (e.ctrlKey || e.metaKey) {\\n /* Ctrl is pressed ( CTRL on Mac is identified by metaKey property ) */\\n\\n // toggle selection\\n if ( $.inArray( index, selectedIndexes() ) > -1) {\\n unselectRow(index);\\n $self.trigger('rowSelection', [index, this, false, _currentData[index]]);\\n } else {\\n selectRow(index);\\n $self.trigger('rowSelection', [index, this, true, _currentData[index]]);\\n }\\n\\n } else {\\n // simple click\\n selectRow(index);\\n $self.trigger('rowSelection', [index, this, true, _currentData[index]]);\\n }\\n\\n }\",\n \"enableUserSelection() {\\n this[addDivListener]('mousedown', this[userSelectionDragListenerSym]);\\n }\",\n \"function makeActiveMultiItem(element) {\\n $(element).on('click', function(){\\n $(element).removeClass(\\\"active\\\");\\n $(this).addClass(\\\"active\\\");\\n });\\n}\",\n \"function drag(e) {\\r\\n draggedItem = e.target;\\r\\n dragging = true;\\r\\n}\",\n \"function batchEventHook(event) \\n{\\n var elem = event.target;\\n\\n // Hook for [delete] checkbox range selection.\\n if ( isDeleteCheckbox(elem) && (event.button == 0 || event.keyCode == 32) ) {\\n if (event.shiftKey && lastClickedCheckbox) {\\n selectCheckboxRange(lastClickedCheckbox, elem);\\n }\\n lastClickedCheckbox = elem;\\n }\\n}\",\n \"function handleMouseDown(evt)\\n{\\n mylog('Started handleMouseDown with target nodeName '+evt.target.nodeName);\\n // With svgweb, mousedown on text elements causes also mousedown on\\n // the \\\"svg\\\" node on the back, so this check nullifies the second\\n // function call\\n if (evt.target.nodeName == 'svg')\\n return;\\n // This is necessary with firefox native renderer, otherwise the\\n // \\\"mousedown\\\" event would cause the attempt of dragging svg\\n // elements\\n evt.preventDefault();\\n\\n var p = mouseCoordsSvg(evt);\\n\\n if(g['shape'].active)\\n // When the current tool corresponds to a shape, mouse events are\\n // forwarded to the shape\\n g['shape'].mousedown(p.x, p.y);\\n else{\\n // Other tools not binded with shapes, but that act on a\\n // clicked shape. First ignore the operation if the target is\\n // 'canvas', then retrieve the shape parent group and execute\\n // the action\\n var target = evt.target;\\n if (target.id == 'canvas'){\\n mylog('Ignoring attempt to act on the canvas');\\n if (g['tool']=='delete')\\n // Activate the \\\"dragging delete\\\"\\n g['active_tool'] = true;\\n }\\n else{\\n // To search the group and then to come back to the childs\\n // can look weird, but this is useful because changing the\\n // renderer, the element which raises the event (for\\n // example in a text structure) may change\\n var group = find_group(target.parentNode);\\n switch(g['tool']){\\n case 'select':\\n var shape = group.childNodes[0];\\n // Select is useful only for the links, which have\\n // 'text' as top node. They can distinguished by plain\\n // text elements because they have a first
\\n // element with visibility=\\\"hidden\\\"\\n if (shape.nodeName == 'text' &&\\n shape.childNodes[0].getAttribute('visibility')=='hidden'){\\n var url = shape.childNodes[1].data;\\n // Urls without the http look nicer, but it has to\\n // be added, otherwise they will be taken as\\n // relative links\\n if (!/http/.test(url))\\n url = 'http://'+url;\\n window.open(url);\\n }\\n break;\\n case 'edit':\\n var shape = group.childNodes[0];\\n // Paths can't be edited\\n if (shape.nodeName == 'path')\\n mylog('Ignoring attempt to edit a path');\\n else{\\n // Distinguish a 'link' shape\\n if (shape.nodeName == 'text' &&\\n shape.childNodes[0].getAttribute('visibility')=='hidden')\\n var shape_name = 'link';\\n else\\n var shape_name = shape.nodeName;\\n show_additional_panel(shape_name);\\n // Copy the old object\\n g['shape'] = g['shape_generator'].generate_shape(shape_name);\\n g['shape'].copy_shape(shape);\\n g['shape'].mousedown(p.x, p.y);\\n // Delete the old object: sender_add is called\\n // with the asynchronous flag set to true, so the\\n // delete update will be sent together with the\\n // new shape update.\\n var group_id = group.getAttribute('id');\\n sender_add('delete', [], group_id, true);\\n g['pages'].remove(group);\\n }\\n break;\\n case 'delete':\\n delete_object(group);\\n g['active_tool'] = true;\\n break;\\n case 'move':\\n g['moving_object'] = group;\\n var transMatrix = g['moving_object'].getCTM();\\n // g['p'] will be read on mouse up, and to correctly\\n // compute the new transformation we must consider the\\n // original position of the object, not the one seen\\n // by the user and the pointer\\n p.x = p.x - Number(transMatrix.e);\\n p.y = p.y - Number(transMatrix.f);\\n g['active_tool'] = true;\\n break;\\n }\\n }\\n }\\n // Store the initial mouse position for the other event handlers\\n g['p'] = p;\\n}\",\n \"setEvents(){\\n const listElements = this.el.childNodes;\\n for(let i = 0; i < listElements.length; i++){\\n listElements[i].addEventListener('mousedown',this.onItemClickedEvent,true);\\n }\\n }\",\n \"selectItem (i) { this.toggSel(true, i); }\",\n \"function getMoseDownFunc(eventName){return function(ev){ev=ev||window.event;ev.preventDefault?ev.preventDefault():ev.returnValue=false;ev.stopPropagation();var x=ev.pageX||ev.touches[0].pageX;var y=ev.pageY||ev.touches[0].pageY;_this.el.fire(eventName,{x:x,y:y,event:ev});};}// create the selection-rectangle and add the css-class\",\n \"function getMoseDownFunc(eventName){return function(ev){ev=ev||window.event;ev.preventDefault?ev.preventDefault():ev.returnValue=false;ev.stopPropagation();var x=ev.pageX||ev.touches[0].pageX;var y=ev.pageY||ev.touches[0].pageY;_this.el.fire(eventName,{x:x,y:y,event:ev});};}// create the selection-rectangle and add the css-class\",\n \"function selectCategoryClickHandler(ev) {\\n selectCategory(ev.target);\\n}\",\n \"_handleClick(event) {\\n var row = $(event.target).parents('tr:first');\\n var rows = this.$element.find('tbody tr');\\n\\n if (!this.lastChecked) {\\n this.lastChecked = row;\\n return;\\n }\\n\\n if (event.shiftKey) {\\n this.changeMultiple = true;\\n\\n var start = rows.index(row);\\n var end = rows.index(this.lastChecked);\\n var from = Math.min(start, end);\\n var to = Math.max(start, end) + 1;\\n var checked = this.lastChecked.find('input').is(':checked');\\n var checkboxes = rows.slice(from, to).find('input');\\n\\n if (checked) {\\n checkboxes.trigger('check.zf.trigger');\\n } else {\\n checkboxes.trigger('uncheck.zf.trigger');\\n }\\n\\n this.changeMultiple = false;\\n }\\n\\n this.lastChecked = row;\\n }\",\n \"_isDragStartInSelection(ev) {\\n const selectedElements = this.root.querySelectorAll('[data-is-selected]');\\n for (let i = 0; i < selectedElements.length; i++) {\\n const element = selectedElements[i];\\n const itemRect = element.getBoundingClientRect();\\n if (this._isPointInRectangle(itemRect, { left: ev.clientX, top: ev.clientY })) {\\n return true;\\n }\\n }\\n return false;\\n }\",\n \"function selectItem(e) {\\n\\n for (var i = 0; i < e.currentTarget.parentNode.children.length; i++) {\\n e.currentTarget.parentNode.children[i].classList.remove(\\\"selected\\\");\\n }\\n\\n e.currentTarget.classList.add(\\\"selected\\\");\\n console.log($(e.currentTarget).children().eq(1).text());\\n updateP1Moves($(e.currentTarget).children().eq(1).text());\\n \\n}\",\n \"function handleCheckboxClick(e, highlightClass) {\\n\\n // if e is an input checkbox, then parentNode is a list element, its and parentNode is an\\n // unordered list. Getting all of the tags by \\\"input\\\" will therefore return all of the related\\n // inputs in this respective list\\n var inputs = e.parentNode.parentNode.getElementsByTagName(\\\"input\\\");\\n\\n // The following block handles the checkbox lists that contain \\\"Any [items].\\\" If the user\\n // selects anything other than \\\"Any [item]\\\", then \\\"Any...\\\" must be deselected. Otherwise,\\n // if the user selects \\\"Any...\\\" then all other items currently checked must be deselected. In\\n // each group of checkboxes, the \\\"Any...\\\" option is represented with an empty string value (\\\"\\\").\\n\\n if (e.value == \\\"\\\") { // If the user clicked the \\\"Any...\\\" checkbox\\n for (var j = 0; j < inputs.length; j++) { // loop through all of this list's checkboxes\\n if (inputs[j].value != \\\"\\\" && inputs[j].checked) { // if any item (other than \\\"Any...\\\") is checked\\n inputs[j].checked = \\\"\\\"; // uncheck it and\\n inputs[j].parentNode.className = \\\"\\\"; // unhighlight it\\n }\\n }\\n } else { // Otherwise, the user clicked another checkbox\\n for (var i = 0; i < inputs.length; i++) { // loop through this list's checkboxes\\n if (inputs[i].value == \\\"\\\" && inputs[i].checked) { // find the \\\"Any...\\\" checkbox\\n inputs[i].checked = \\\"\\\"; // uncheck it\\n inputs[i].parentNode.className = \\\"\\\"; // unhighlight it\\n }\\n }\\n }\\n\\n // Finally, perform simple highlighting\\n if (!e.checked)\\n e.parentNode.className = \\\"\\\";\\n else\\n e.parentNode.className = highlightClass;\\n}\",\n \"isMultipleSelection() {\\n return this._multiple;\\n }\",\n \"onEventSelectionClick(event, clickedRecord) {\\n const me = this;\\n\\n // Multi selection: CTRL means preserve selection, just add or remove the event.\\n // Single selection: CTRL deselects already selected event\\n if (me.isEventSelected(clickedRecord)) {\\n event.ctrlKey && me.deselectEvent(clickedRecord, me.multiEventSelect);\\n } else {\\n me.selectEvent(clickedRecord, event.ctrlKey && me.multiEventSelect);\\n }\\n }\",\n \"function addSelection(item) {\\n //if the owner reference is still null, set it to this item's parent\\n //so that further selection is only allowed within the same container\\n if (!selections.owner) {\\n selections.owner = item.parentNode;\\n }\\n\\n //or if that's already happened then compare it with this item's parent\\n //and if they're not the same container, return to prevent selection\\n else if (selections.owner != item.parentNode) {\\n return;\\n }\\n\\n //set this item's grabbed state\\n item.setAttribute('aria-grabbed', 'true');\\n\\n //add it to the items array\\n selections.items.push(item);\\n}\",\n \"function validateMultipleSelectBox(e) {\\r\\n\\t\\t/* yield event handler */\\r\\n\\t\\treturn $(\\\".\\\" + PLUGIN_NAMESPACE).yieldMultipleSelectBox().each(\\r\\n\\t\\t\\tfunction() {\\r\\n\\t\\t\\t\\tvar $container = $(this);\\r\\n\\t\\t\\t\\tvar options = $container.getMultipleSelectBoxOptions();\\r\\n\\t\\t\\t\\tvar containerHistory = $container.getMultipleSelectBoxHistory();\\r\\n\\t\\t\\t\\tif ($container.isMultipleSelectBoxSelecting()) {\\r\\n\\t\\t\\t\\t\\t/* reset style */\\r\\n\\t\\t\\t\\t\\t$container.removeClass(PLUGIN_STYLE_SELECTING);\\r\\n\\t\\t\\t\\t\\tvar selectedRows = $container.getMultipleSelectBoxSelectedRows();\\r\\n\\t\\t\\t\\t\\t/* slide up */\\r\\n\\t\\t\\t\\t\\tif (options.isPopupMode) {\\r\\n\\t\\t\\t\\t\\t\\t$container.slideUp(\\\"slow\\\");\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t/* fire event */\\r\\n\\t\\t\\t\\t\\t$container.trigger(\\\"mouseup.\\\" + PLUGIN_NAMESPACE);\\r\\n\\t\\t\\t\\t\\t/* trigger callback */\\r\\n\\t\\t\\t\\t\\tif (options.onSelectEnd != null) {\\r\\n\\t\\t\\t\\t\\t\\toptions.onSelectEnd.apply($container[0], [ e, selectedRows, containerHistory.selectingStartIndex, containerHistory.selectingCurrentIndex, containerHistory.selectedStartIndex, containerHistory.selectedCurrentIndex ]);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\tif (options.onSelectChange != null && (containerHistory.selectedRows == null || !isJQueryCollectionEquals(containerHistory.selectedRows, selectedRows))) {\\r\\n\\t\\t\\t\\t\\t\\toptions.onSelectChange.apply($container[0], [ e, selectedRows, containerHistory.selectedRows, containerHistory.selectingStartIndex, containerHistory.selectingCurrentIndex, containerHistory.selectedStartIndex,\\r\\n\\t\\t\\t\\t\\t\\t\\tcontainerHistory.selectedCurrentIndex ]);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t/* reset the field value */\\r\\n\\t\\t\\t\\t\\tif (options.submitField != null) {\\r\\n\\t\\t\\t\\t\\t\\toptions.submitField.val($container.serializeMultipleSelectBox());\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\tcontainerHistory.selectedRows = selectedRows;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t/* reset history */\\r\\n\\t\\t\\t\\tcontainerHistory.selectedStartIndex = containerHistory.selectingStartIndex;\\r\\n\\t\\t\\t\\tcontainerHistory.selectedCurrentIndex = containerHistory.selectingCurrentIndex;\\r\\n\\t\\t\\t});\\r\\n\\t}\",\n \"function CustomSelectableList()\\r\\n{\\r\\n\\tthis.name = 'cslist';\\r\\n\\tthis.items = new Array();\\r\\n\\tthis.itemIdentifiers = new Array();\\r\\n\\tthis.clickHandlers = new Array();\\r\\n\\tthis.dblClickHandlers = new Array();\\r\\n\\tthis.instanceName = null;\\r\\n\\tthis.obj = \\\"CSList\\\";\\r\\n\\tthis.lastId = null;\\r\\n\\r\\n\\tthis.selectedObj = null;\\r\\n\\t\\r\\n\\tif (this.obj)\\r\\n\\t\\teval(this.obj + \\\"=this\\\");\\r\\n\\r\\n\\tthis.unselectedColor = null;\\r\\n\\tthis.selectedColor = null;\\r\\n\\r\\n\\tthis.attachEventEx = function(target, event, func) \\r\\n\\t{\\r\\n\\t\\tif (target.attachEvent)\\r\\n\\t\\t\\ttarget.attachEvent(\\\"on\\\" + event, func);\\r\\n\\t\\telse if (target.addEventListener)\\r\\n\\t\\t\\ttarget.addEventListener(event, func, false);\\r\\n\\t\\telse\\r\\n\\t\\t\\ttarget[\\\"on\\\" + event] = func;\\r\\n\\t}\\r\\n\\r\\n\\tthis.addItem = function(item, itemIndex, clickHandler, doubleClickHandler, objIdentifier) \\r\\n\\t{\\r\\n\\t\\tthis.items.push(item);\\r\\n\\t\\tthis.clickHandlers.push(clickHandler);\\r\\n\\t\\tthis.dblClickHandlers.push(doubleClickHandler);\\r\\n\\t\\tthis.itemIdentifiers.push(objIdentifier);\\r\\n\\r\\n\\t\\tvar obj = document.getElementById(item)\\r\\n\\t\\tif (obj) {\\r\\n\\t\\t\\tthis.attachEventEx(obj, \\\"click\\\", new Function(this.obj + \\\".click('\\\" + item + \\\"');\\\"));\\r\\n\\t\\t\\tthis.attachEventEx(obj, \\\"dblclick\\\", new Function(this.obj + \\\".dblclick('\\\" + item + \\\"');\\\"));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tthis.selectFirst = function()\\r\\n\\t{\\r\\n\\t\\tif (this.items.length)\\r\\n\\t\\t\\tthis.click(this.items[0]);\\r\\n\\t}\\r\\n\\r\\n\\tthis.selectById = function( id )\\r\\n\\t{\\r\\n\\t\\tif (id.length)\\r\\n\\t\\t\\tthis.click(id);\\r\\n\\t\\telse\\r\\n\\t\\t\\tthis.selectFirst();\\r\\n\\t}\\r\\n\\r\\n\\tthis.selectByObj = function( obj )\\r\\n\\t{\\r\\n\\t\\tif ( this.selectedObj != null )\\r\\n\\t\\t\\tthis.selectedObj.style.backgroundColor = this.unselectedColor;\\r\\n\\r\\n\\t\\tif (obj)\\r\\n\\t\\t\\tobj.style.backgroundColor = this.selectedColor;\\r\\n\\r\\n\\t\\tthis.selectedObj = obj;\\r\\n\\t}\\r\\n\\r\\n\\tthis._getItemIndex = function(id)\\r\\n\\t{\\r\\n\\t\\treturn id.substr( this.instanceName.length+String(\\\"item\\\").length );\\r\\n\\t}\\r\\n\\r\\n\\tthis.click = function(id)\\r\\n\\t{\\r\\n\\t\\tvar itemObj = document.getElementById(id);\\r\\n\\t\\tthis.selectByObj( itemObj );\\r\\n\\r\\n\\t\\tvar index = this._getItemIndex(id);\\r\\n\\r\\n\\t\\tif (this.clickHandlers[index] && this.lastId != index) {\\r\\n\\t\\t\\teval(this.clickHandlers[index]);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tthis.lastId = index;\\r\\n\\t}\\r\\n\\r\\n\\tthis.dblclick = function(id)\\r\\n\\t{\\r\\n\\t\\tvar itemObj = document.getElementById(id);\\r\\n\\r\\n\\t\\tvar index = this._getItemIndex(id);\\r\\n\\t\\tif (this.dblClickHandlers[index]) {\\r\\n\\t\\t\\teval(this.dblClickHandlers[index]);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tthis.getCurrentData = function()\\r\\n\\t{\\r\\n\\t\\tif (this.lastId == null)\\r\\n\\t\\t\\treturn null;\\r\\n\\r\\n\\t\\treturn this.itemIdentifiers[this.lastId];\\r\\n\\t}\\r\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\\n\\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\\n\\n switch (domEventName) {\\n // Track the input node that has focus.\\n case 'focusin':\\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\\n activeElement$1 = targetNode;\\n activeElementInst$1 = targetInst;\\n lastSelection = null;\\n }\\n\\n break;\\n\\n case 'focusout':\\n activeElement$1 = null;\\n activeElementInst$1 = null;\\n lastSelection = null;\\n break;\\n // Don't fire the event while the user is dragging. This matches the\\n // semantics of the native select event.\\n\\n case 'mousedown':\\n mouseDown = true;\\n break;\\n\\n case 'contextmenu':\\n case 'mouseup':\\n case 'dragend':\\n mouseDown = false;\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n break;\\n // Chrome and IE fire non-standard event when selection is changed (and\\n // sometimes when it hasn't). IE's event fires out of order with respect\\n // to key and input events on deletion, so we discard it.\\n //\\n // Firefox doesn't support selectionchange, so check selection status\\n // after each key entry. The selection changes after keydown and before\\n // keyup, but we check on keydown as well in the case of holding down a\\n // key, when multiple keydown events are fired but only one keyup is.\\n // This is also our approach for IE handling, for the reason above.\\n\\n case 'selectionchange':\\n if (skipSelectionChangeEvent) {\\n break;\\n }\\n\\n // falls through\\n\\n case 'keydown':\\n case 'keyup':\\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\\n }\\n}\",\n \"function dragDropped(arg) {\\n\\t\\tif (Y.Lang.isArray(arg.value)) {\\n\\t\\t\\targ = arg.value;\\n\\t\\t}\\n\\n\\t\\tfor (var i = 0; i < arg.length; i++) {\\n\\t\\t\\tif (arg[i].mimeType[0] == \\\"application/x-folder\\\") { continue; }// skip folders\\n\\t\\t\\tfilesToUpload.push(arg[i]);\\n\\t\\t} \\n\\n\\t\\t// now let's disable that pesky drop target.\\n\\t\\tlog(START, \\\"Now processing \\\" + filesToUpload.length + \\\" files...\\\");\\n\\t\\tenableDropTarget(false);\\n\\t\\tstartNextUploadTest();\\n\\t}\",\n \"function findSelectables() {\\n\\n var a = svg.getBoundingClientRect();\\n\\n for (var i = selectables.length; i--;) {\\n\\n var selectable = selectables[i],\\n b = selectable.getBoundingClientRect();\\n\\n if (isColliding(a, b)) {\\n selectable.classList.add(\\\"selected\\\");\\n } else {\\n selectable.classList.remove(\\\"selected\\\");\\n }\\n }\\n}\",\n \"function selectDDDragstart (e) {\\n selectMenuItem ( 'drag-drop-menu', 'dragstart');\\n e.preventDefault();\\n}\",\n \"function ld_course_builder_draggable_helper( selected ) {\\n\\t\\t\\n\\t\\tvar container = $('
').attr('id', 'ld-selector-draggable-group');\\n\\n\\t\\tif ( ( typeof selected !== 'undefined' ) && ( selected.length ) ) {\\n\\t\\t\\tvar max_width = 0;\\n\\t\\t\\tjQuery(selected).each(function( selected_idx, selected_el ) {\\n\\t\\t\\t\\t//console.log('selected_el[%o]', selected_el );\\n\\t\\t\\t\\tjQuery('.ld-course-builder-sub-actions', selected_el).hide();\\n\\t\\t\\t\\tvar el_width = jQuery(selected_el).outerWidth();\\n\\t\\t\\t\\tif ( el_width > max_width )\\n\\t\\t\\t\\t\\tmax_width = el_width;\\n\\t\\t\\t});\\n\\t\\t\\n\\t\\t\\tcontainer.css('list-style', 'none');\\n\\t\\t\\tcontainer.css('width', max_width + 'px');\\n\\t\\t\\tcontainer.append(selected.clone());\\n\\t\\t}\\n\\t\\treturn container;\\n\\t}\",\n \"multipleChanged(prev, next) {\\n this.ariaMultiSelectable = next ? \\\"true\\\" : undefined;\\n }\",\n \"function dropList(e) {\\n\\t\\tstopEvent(e);\\n\\t\\tvar cname = this.className;\\n\\t\\tthis.className = cname ? \\\"\\\" : \\\"on\\\";\\n\\t}\",\n \"_evtMousedown(event) {\\n if (this.isHidden || !this._editor) {\\n return;\\n }\\n if (Private.nonstandardClick(event)) {\\n this.reset();\\n return;\\n }\\n let target = event.target;\\n while (target !== document.documentElement) {\\n // If the user has made a selection, emit its value and reset the widget.\\n if (target.classList.contains(ITEM_CLASS)) {\\n event.preventDefault();\\n event.stopPropagation();\\n event.stopImmediatePropagation();\\n this._selected.emit(target.getAttribute('data-value'));\\n this.reset();\\n return;\\n }\\n // If the mouse event happened anywhere else in the widget, bail.\\n if (target === this.node) {\\n event.preventDefault();\\n event.stopPropagation();\\n event.stopImmediatePropagation();\\n return;\\n }\\n target = target.parentElement;\\n }\\n this.reset();\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.64923054","0.64745873","0.6313913","0.62336046","0.5861946","0.5806698","0.57896096","0.5698621","0.5660796","0.56062526","0.55689436","0.5549231","0.5530512","0.55174196","0.549765","0.546832","0.5462681","0.5454696","0.5427804","0.5427804","0.5427804","0.5425037","0.5416513","0.5416513","0.54002714","0.5383086","0.5382684","0.5377326","0.53691137","0.5361874","0.5311658","0.5308211","0.52824736","0.5276573","0.5268588","0.5260891","0.5240748","0.5226757","0.52245617","0.51981145","0.51962477","0.5186361","0.5182172","0.51817364","0.51770395","0.5163307","0.5161557","0.51577514","0.5146852","0.51467985","0.5134127","0.5122279","0.51166195","0.51136947","0.5109408","0.51090026","0.5104298","0.5104298","0.51019406","0.5090308","0.5079695","0.50740457","0.5073462","0.50722516","0.5071018","0.5067003","0.5065843","0.5065843","0.5064359","0.5057702","0.5044094","0.5039945","0.5034139","0.50249547","0.5023872","0.50235254","0.50214106","0.5020625","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50199896","0.50165385","0.50106484","0.5008916","0.5008507","0.50080186","0.50068176","0.5004552"],"string":"[\n \"0.64923054\",\n \"0.64745873\",\n \"0.6313913\",\n \"0.62336046\",\n \"0.5861946\",\n \"0.5806698\",\n \"0.57896096\",\n \"0.5698621\",\n \"0.5660796\",\n \"0.56062526\",\n \"0.55689436\",\n \"0.5549231\",\n \"0.5530512\",\n \"0.55174196\",\n \"0.549765\",\n \"0.546832\",\n \"0.5462681\",\n \"0.5454696\",\n \"0.5427804\",\n \"0.5427804\",\n \"0.5427804\",\n \"0.5425037\",\n \"0.5416513\",\n \"0.5416513\",\n \"0.54002714\",\n \"0.5383086\",\n \"0.5382684\",\n \"0.5377326\",\n \"0.53691137\",\n \"0.5361874\",\n \"0.5311658\",\n \"0.5308211\",\n \"0.52824736\",\n \"0.5276573\",\n \"0.5268588\",\n \"0.5260891\",\n \"0.5240748\",\n \"0.5226757\",\n \"0.52245617\",\n \"0.51981145\",\n \"0.51962477\",\n \"0.5186361\",\n \"0.5182172\",\n \"0.51817364\",\n \"0.51770395\",\n \"0.5163307\",\n \"0.5161557\",\n \"0.51577514\",\n \"0.5146852\",\n \"0.51467985\",\n \"0.5134127\",\n \"0.5122279\",\n \"0.51166195\",\n \"0.51136947\",\n \"0.5109408\",\n \"0.51090026\",\n \"0.5104298\",\n \"0.5104298\",\n \"0.51019406\",\n \"0.5090308\",\n \"0.5079695\",\n \"0.50740457\",\n \"0.5073462\",\n \"0.50722516\",\n \"0.5071018\",\n \"0.5067003\",\n \"0.5065843\",\n \"0.5065843\",\n \"0.5064359\",\n \"0.5057702\",\n \"0.5044094\",\n \"0.5039945\",\n \"0.5034139\",\n \"0.50249547\",\n \"0.5023872\",\n \"0.50235254\",\n \"0.50214106\",\n \"0.5020625\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50199896\",\n \"0.50165385\",\n \"0.50106484\",\n \"0.5008916\",\n \"0.5008507\",\n \"0.50080186\",\n \"0.50068176\",\n \"0.5004552\"\n]"},"document_score":{"kind":"string","value":"0.77628446"},"document_rank":{"kind":"string","value":"0"}}},{"rowIdx":555,"cells":{"query":{"kind":"string","value":"Gets the contents of a file."},"document":{"kind":"string","value":"read(file) {\n return this[FILES][file] || null;\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function getFileContents(filename){\r\n\t\r\n\tvar contents;\r\n\tcontents = fs.readFileSync(filename);\r\n\treturn contents;\r\n}","function getContents(file) {\n\t// Ensure that the file's name is not null.\n\tif(file === null) {\n\t\tself.fail(\"The File object is null.\");\n\t}\n\tif(! file.exists()) {\n\t\tself.fail(\"The file does not exist: \" + file);\n\t}\n\t\n\tvar fileReader;\n\ttry {\n\t\tfileReader = new FileReader(file);\n\t}\n\tcatch(e) {\n\t\tself.fail(\"Could not open the file: \" + e);\n\t\treturn;\n\t}\n\t\n\treturn new String(FileUtils.readFully(fileReader));\n}","function readFile(file) {\n return fetch(file).then(function (response) {\n return response.text();\n });\n }","function readFile(file)\n{\n var content = '';\n\n var stream = Components.classes['@mozilla.org/network/file-input-stream;1']\n .createInstance(Components.interfaces.nsIFileInputStream);\n stream.init(file, 0x01, 0, 0);\n\n var script = Components.classes['@mozilla.org/scriptableinputstream;1']\n .createInstance(Components.interfaces.nsIScriptableInputStream);\n script.init(stream);\n\n if (stream.available()) {\n var data = script.read(4096);\n\n while (data.length > 0) {\n content += data;\n data = script.read(4096);\n }\n }\n\n stream.close();\n script.close();\n\n return content;\n}","function fileContents(filePath, file) {\n return file.contents.toString('utf8');\n}","function fileContents (filePath, file) {\n return file.contents.toString('utf8');\n}","function getFileContent(path) {\n return fs.readFileSync(`${path}`, {\n encoding: 'utf8'\n })\n}","function readFile() {\n return fs.readFileSync(fileName);\n}","getContents() {\n return _fs.default.readFileSync(this.filePath, \"utf8\");\n }","function readFile(file) {\n return fs.readFileSync(file, \"utf8\");\n}","function getContent(fileName) {\n return fs.readFileSync(fileName, { encoding: 'utf8' });\n}","function readFile(path) {\n\t\tvar content = \"\";\n\t\ttry {\n\t\t\tcontent = fs.readFileSync(path).toString();\n\t\t} catch (e) {\n\t\t\tif (e.code === \"ENOENT\") {\n\t\t\t\twarn(\"Source file \" + e.path + \" not found.\");\n\t\t\t} else {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t\treturn content;\n\t}","async function getFileContent(filePath) {\n return (await filePath) ? readFile(filePath) : null;\n}","function read(file) {\n var complete = fs.readFileSync(file, 'utf8')\n return complete\n}","function GetFileBody(file) {\n\treturn fs.readFileSync(InputDir + file).toString('utf-8');\n}","function read_file(path_to_file){\n var data = fs.readFileSync(path_to_file).toString();\n return data;\n}","function getTextFile(theFilename){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readFile(theFilename, 'utf8', function (err, theContent) {\n if (err) {\n resolve(\"\")\n } else {\n resolve(theContent);\n }\n });\n }\n catch (error) {\n resolve(\"\")\n }\n \n }));\n}","function readFromFile(file) {\n let istream = Cc[\"@mozilla.org/network/file-input-stream;1\"].\n createInstance(Ci.nsIFileInputStream);\n istream.init(file, 0x01, 0444,0);\n istream.QueryInterface(Ci.nsILineInputStream);\n dump(\"reading\\n\");\n\n let line = {}, lines = [], hasmore;\n do {\n hasmore = istream.readLine(line);\n dump(\"line:\" + line.value + \"\\n\");\n lines.push(line.value);\n } while(hasmore);\n istream.close();\n dump(\"done reading\\n\");\n return lines;\n}","function readContentFile(filename) {\n var promise = new Promise(async function(resolve, reject) {\n fs.readFile(filename, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n resolve (data);\n });\n });\n return promise;\n}","function readFile(file) {\n return new Promise((resolve, reject) => {\n let chunks = [];\n // Create a readable stream\n let readableStream = fs.createReadStream(file);\n \n readableStream.on('data', chunk => {\n chunks.push(chunk);\n });\n\n readableStream.on('error', err => {\n reject(err)\n })\n \n return readableStream.on('end', () => {\n resolve(chunks);\n });\n });\n}","function readTextFile(file) {\n\tvar rawFile1 = new XMLHttpRequest();\n\trawFile1.open(\"GET\", file, false);\n\trawFile1.onreadystatechange = function() {\n\t\tif(rawFile1.readyState === 4) {\n\t\t\tif(rawFile1.status === 200 || rawFile1.status == 0) {\n\t\t\t\treturn rawFile1.responseText;\n\t\t\t}\n\t\t}\n\t}\n\trawFile1.send(null);\n\treturn rawFile1.responseText;\n}","function getFile(fileName) {\n return fs.readFileSync(path.resolve(__dirname, fileName), \"utf-8\");\n}","function getFile(filePath) {\n return new Promise((resolve, reject) => {\n fs.readFile(filePath, function(error, data) {\n if (error) {\n return reject(error);\n }\n return resolve(data);\n });\n });\n}","readFile(file) {\n return new Promise((resolve, reject) => {\n\n const reader = new FileReader();\n\n reader.onload = res => {\n resolve(res.target.result);\n };\n\n reader.onerror = err => reject(err);\n\n reader.readAsDataURL(file);\n });\n }","function ReadFile(path)\n{\n\treturn _fs.readFileSync(path, \"utf8\").toString();\n}","async read (filepath, options = {}) {\n try {\n let buffer = await this._readFile(filepath, options);\n return buffer\n } catch (err) {\n return null\n }\n }","readFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (evt) => {\n if(evt && evt.target) {\n resolve(evt.target.result);\n }\n reject();\n };\n reader.readAsDataURL(file);\n });\n }","function readFile(file_path) {\n return fs.readFileSync(file_path, 'utf8', function(err, data) { \n if (err) throw err;\n console.log(data);\n });\n}","function readfile(){\n\t\t\tvar txtFile = \"c:/test.txt\"\n\t\t\tvar file = new File([\"\"],txtFile);\n\n\t\t\tfile.open(\"r\"); // open file with read access\n\t\t\tvar str = \"\";\n\t\t\twhile (!file.eof) {\n\t\t\t\t// read each line of text\n\t\t\t\tstr += file.readln() + \"\\n\";\n\t\t\t}\n\t\t\tfile.close();\n\t\t\talert(str);\n\t\t}","function readFile(aFileName) {\n let f = do_get_file(aFileName);\n let s = Cc[\"@mozilla.org/network/file-input-stream;1\"]\n .createInstance(Ci.nsIFileInputStream);\n s.init(f, -1, -1, false);\n try {\n return NetUtil.readInputStreamToString(s, s.available());\n } finally {\n s.close();\n }\n}","function readFile (fullpath){\n\tvar result=\"\";\n\t$.ajax({\n\t\turl: fullpath,\n\t\tasync: false,\n\t\tdataType: \"text\",\n\t\tsuccess: function (data) {\n\t\t\tresult = data;\n\t\t}\n\t});\n\treturn result;\n}","function _getDataFromFile(){\n\tvar fileData = _openFIle();\n\treturn fileData;\n}","function readfile(path)\r\n{\r\n return fs.readFileSync(path,'UTF8',function(data,err)\r\n {\r\n if(err) throw err;\r\n return data\r\n });\r\n}","static read_file(filename, encoding='utf8')\r\n {\r\n let data;\r\n try\r\n {\r\n data = fs.readFileSync(filename, encoding);\r\n }\r\n catch (err)\r\n {\r\n throw new Error(err);\r\n }\r\n return data;\r\n }","function readFile(file) {\n\treturn ''+new String(org.apache.tools.ant.util.FileUtils.readFully(new java.io.FileReader(file)));\n}","function readTextFile(file) {\n //Look into fetch or FileReader\n let rawFile = new XMLHttpRequest();\n let allText;\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = () => (allText = rawFile.responseText);\n rawFile.send(null);\n getElementData(allText, file);\n}","function readFile(file) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n\n // This is called when finished reading\n reader.onload = function (event) {\n // Return an array with one image\n resolve({\n // These are attributes like size, name, type, ...\n lastModifiedDate: file.lastModifiedDate,\n lastModified: file.lastModified,\n name: file.name,\n size: file.size,\n type: file.type,\n\n // This is the files content as base64\n src: event.target.result\n });\n };\n\n if (file.type.indexOf('text/') === 0 || file.type === 'application/json') {\n reader.readAsText(file);\n } else if (file.type.indexOf('image/') === 0) {\n reader.readAsDataURL(file);\n } else {\n reader.readAsBinaryString(file);\n }\n });\n}","function getFileContents(file, callback) {\n\n\t// ajax linker\n\t$.ajax({\n\t\turl : file,\n\n\t\t// on success, call callback\n\t\tsuccess : function(result){\n\t\t\tif ($.isFunction(callback))\n\t\t\t\tcallback.apply(null, [result]);\n\t\t}\n\n\t});\n}","function readFile (file) {\n var str = fs.readFileSync(file, 'utf-8');\n console.log(str);\n}","function getFile(url){\n var req = request.get(url, function(err, res){\n if (err) throw err;\n console.log('Response ok:', res.ok);\n console.log('Response text:', res.text);\n return res.text;\n });\n}","function retriveFile(path) {\n return new Promise((resolve, reject) => {\n var request = new XMLHttpRequest();\n request.open('GET', path, true);\n request.responseType = 'text';\n request.onload = () => resolve({\n fileData: request.response\n });\n request.onerror = reject;\n request.send();\n })\n}","function readFile(fileEntry) {\n\n // Get the file from the file entry\n fileEntry.file(function (file) {\n \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onloadend = function() {\n\n console.log(\"Successful file read: \" + this.result);\n console.log(\"file path: \" + fileEntry.fullPath);\n\n };\n\n }, onError);\n}","function getFileContents(activityXmlFile) {\n\t\ttry {\n\t\t\treturn fs.readFileSync(activityXmlFile);\n\t\t} catch(ex) {\n\t\t\tconsole.log('Error reading activity xml file [', activityXmlFile, ']\\n', ex);\n\t\t\tthrow 'Error reading Activity XML File';\n\t\t}\n\t}","function readFile (file){ \n let data = (fs.readFileSync(file)\n .toString())\n .replace('\\r', '')\n .split('\\n');\n return data;\n}","async getFileContents(file, returnDecryptStreamSeparately = false){\n try{\n let beautifiedPath = await this.beautifyPath(file.config.folder, true);\n let filePath = `${beautifiedPath}${beautifiedPath === \"\" ? \"\" : \"/\"}${file.config.name}.${file.config.ext}`;\n\n return await this.getLocalFileContents(filePath, file.config.isEncrypted, file.config.iv);\n }catch(error){ Logger.log(error); }\n\n return { contents: null, contentType: null, contentLength: 0, readStream: null, };\n }","function read (fileName) {\n return new Promise((resolve, reject) => {\n fs.readFile(fileName, \"utf8\",\n (err, textFileData) => {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(textFileData);\n }\n );\n });\n}","function getFile (file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text)\n })\n}","function openFile(path) {\n\treturn new Promise(function (resolve, reject) {\n\t\tfs.readFile(path, \"utf8\", (err, data) => {\n\t\t\tif (err) reject(err);\n\t\t\tresolve(data);\n\t\t});\n\t});\n}","function getFile(file) {\n fakeAjax(file, function(text) {\n handleResponse(file, text);\n });\n}","function loadFile(file){\n\tlet fs = require('fs');\n\tvar data = fs.readFileSync(file);\n\tvar contents = (JSON.parse(data));\n\treturn contents;\n}","function readTxtFile(file) {\n if (!file.exists) {\n throw \"Cannot find file: \" + decodeURI(file.absoluteURI);\n }\n file.open(\"r\", \"TEXT\");\n file.encoding = \"UTF8\";\n file.lineFeed = \"unix\";\n var str = file.read();\n file.close();\n return str;\n}","async readFile(fileName) {\n const bytes = await this.idb.get(fileName, this.store);\n return bytes;\n }","readFile(mfs, file) {\n try {\n return mfs.readFileSync(path.join(this.confClient.output.path, file), \"utf-8\")\n } catch (error) {}\n }","async function readFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result);\n reader.readAsText(file);\n });\n}","getFile(filePath, options) {\n console.log('api.getFile: ', filePath);\n return this.sendRequest({\n type: 'loadFile',\n filePath: filePath,\n options: options\n })\n .then(function(fileInfo) {\n return {\n filePath: filePath,\n contents: fileInfo.payload.contents\n }\n })\n .catch(function(errorInfo) {\n return undefined;\n });\n }","function readTextFile(file)\n{\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function ()\n {\n if(rawFile.readyState === 4)\n {\n if(rawFile.status === 200 || rawFile.status == 0)\n {\n var allText = rawFile.responseText;\n fileDisplayArea.innerText = allText\n }\n }\n }\n rawFile.send(null);\n}","function getFile(){\n\n\t\treturn this.file;\n\t}","function getFile(file) {\n fakeAjax(file, function (text) {\n fileReceived(file, text);\n });\n }","function readFile() {\n return new Promise((resolve, reject) => {\n fs.readFile(SOURCE, {\n encoding: 'utf-8'\n }, (err, data) => {\n if (err) {\n reject(err);\n // puts the callback given to the .catch in the Promise pending callbacks queue\n } else {\n resolve(data);\n // puts the callback given to the first .then, in the Promise pending callbacks queue\n }\n });\n });\n}","function loadFileToString(file) {\n let frawin = Cc[\"@mozilla.org/network/file-input-stream;1\"]\n .createInstance(Ci.nsIFileInputStream);\n frawin.init(file, -1, 0, 0);\n let fin = Cc[\"@mozilla.org/scriptableinputstream;1\"]\n .createInstance(Ci.nsIScriptableInputStream);\n fin.init(frawin);\n let data = \"\";\n let str = fin.read(4096);\n while (str.length > 0) {\n data += str;\n str = fin.read(4096);\n }\n fin.close();\n\n return data;\n}","function readFileAsync (file, options) {\n return new Promise(function (resolve, reject) {\n fs.readFile(file, options, function (err, data) {\n if (err) {\n reject(err)\n } else {\n resolve(data)\n }\n })\n })\n}","function read(f)\n\t{\n\t\tt = fs.readFileSync(f, 'utf8', (err,txt) => {\n\t\t\tif (err) throw err;\n\t\t});\n\t\treturn t;\n\t}","function getFileContents(caller, path, app, username, zoneFileLookupURL, forceText) {\n return Promise.resolve().then(function () {\n if (username) {\n return getUserAppFileUrl(path, username, app, zoneFileLookupURL);\n } else {\n return (0, _hub.getOrSetLocalGaiaHubConnection)(caller).then(function (gaiaHubConfig) {\n return (0, _hub.getFullReadUrl)(path, gaiaHubConfig);\n });\n }\n }).then(function (readUrl) {\n return new Promise(function (resolve, reject) {\n if (!readUrl) {\n reject(null);\n } else {\n resolve(readUrl);\n }\n });\n }).then(function (readUrl) {\n return fetch(readUrl);\n }).then(function (response) {\n if (response.status !== 200) {\n if (response.status === 404) {\n _logger.Logger.debug('getFile ' + path + ' returned 404, returning null');\n return null;\n } else {\n throw new Error('getFile ' + path + ' failed with HTTP status ' + response.status);\n }\n }\n var contentType = response.headers.get('Content-Type');\n if (forceText || contentType === null || contentType.startsWith('text') || contentType === 'application/json') {\n return response.text();\n } else {\n return response.arrayBuffer();\n }\n });\n}","function readTextFile(file)\n{\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", file, true);\n rawFile.onreadystatechange = function ()\n {\n if(rawFile.readyState === 4)\n {\n if(rawFile.status === 200 || rawFile.status == 0)\n {\n var allText = rawFile.responseText;\n\n alert(allText);\n }\n }\n }\n rawFile.send(null);\n}","read() {\n return fs.readFileSync(this.filepath).toString();\n }","function readTextFile(path) {\n\tfs.readFile(path, function(err, data) {\n\t\treturn String(data);\n\t});\n}","function read(filePath) {\n if (fs.existsSync(filePath)) {\n let isFile = fs.statSync(filePath).isFile;\n if (isFile) {\n let data = fs.readFileSync(filePath, FILE_OPTIONS);\n return data;\n }\n }\n return null;\n}","readReportFromFile() {\n const content = this.utility.readFromFile(this.reportFileName);\n return content;\n }","readFile(filePath) {\n return fs.readFileSync(path.resolve(filePath));\n }","async function getFile(fileId) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"GET\",\n });\n }","function getFile(file) {\n\treturn ASQ(function(done){\n\t\tfakeAjax(file,done);\n\t});\n}","function readFile(filePath, fmt) {\n return new Promise((resolve, reject) =>\n fs.readFile(filePath, fmt || 'utf8', (err, results) =>\n err ? reject(err) : resolve(results))\n );\n}","function read(f)\n{\n t = fs.readFileSync(f, 'utf8', (err,txt) => {\n if (err) throw err;\n });\n return t;\n}","function readFile(file) {\n\tvar read = new FileReader();\n\tread.onloadend = function() {\n\t\tconsole.log(read.result);\n\t};\n\tread.readAsBinaryString(file);\n}","function read_file(filename) {\n var file_data = data.load(filename);\n return file_data;\n}","async function getFile(name) {\n return new Promise(res => {\n fs.readFile(name, 'utf-8', (err, result) => {\n res(result);\n });\n });\n}","function readFile(file, header){\r\n\ttemplateGet(file,HEADER,header);\r\n\tvar isDat = header.fileType==1;\r\n\tvar headerSize = isDat ? 108 : 80;\r\n\tif(isDat)\r\n\t\ttemplateGet(file,DAT_HEADER,header);\r\n\tvar data=file.slice(headerSize, file.length-20);\r\n\t//if(header.compressed==4){\r\n\t//\tdata=pako.inflateRaw(data);\r\n\t//}\r\n\treturn data;\r\n}","async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }","function read(path, method) {\n method = method || 'readAsText';\n return file(path).then(function (fileEntry) {\n return new Promise(function (resolve, reject) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function () {\n resolve(this.result);\n };\n reader[method](file);\n }, reject);\n });\n });\n }","function get_file(url) {\n\tconst request = new XMLHttpRequest()\n\t// This throws a warning about synchronous requests being deprecated\n\trequest.open('GET',url,false)\n\trequest.send()\n\treturn request.responseText\n}","function readFile(filename){\n return new Promise(function(resolve,reject){\n fs.readFile(filename,'utf8',function(err,data){\n err?reject(err):resolve(data);\n });\n })\n}","function fetchFileContents(path, callback)\n{\n\t// Check for file existence first, then perform a read if it exists\n\tfs.exists(path, function(exists)\n\t{\n\t\tif (exists)\n\t\t{\n\t\t\tfs.readFile(path, {encoding: 'utf-8'},\n\t\t\t\tfunction(err, data)\n\t\t\t\t{\n\t\t\t\t\tif (!err)\n\t\t\t\t {\n\t\t\t\t \tcallback(data);\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t \tconsole.log(err);\n\t\t\t\t \tcallback(\"404 - The file at \" + path + \" was inaccessible.\");\n\t\t\t\t }\n\t\t\t\t});\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcallback(\"404 - The file at \" + path + \" was not found.\");\n\t\t}\n\t});\n}","static async readFile(path) {\n return (await Util.promisify(Fs.readFile)(path)).toString('utf-8');\n }","readFile(path_to_file) {\n return new Promise((resolve, reject) => {\n let result = [],\n line_reader = readline.createInterface({\n input : fs.createReadStream(__dirname + path_to_file)\n })\n line_reader.on('line', (line) => {\n result.push(line)\n })\n line_reader.on('close', () => {\n resolve(result)\n })\n })\n }","function readFile(fileEntry) {\n // Get the file from the file entry\n fileEntry.file(function (file) { \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n reader.onloadend = function() {\n console.log(\"Successful file read: \" + reader.result);\n document.getElementById('dataObj').innerHTML = reader.result;\n console.log(\"file path: \" + fileEntry.fullPath);\n };\n });\n }","function readFromFile(file) {\n return new Promise((resolve, reject) => {\n fs.readFile(file, function (err, data) {\n if (err) {\n console.log(err);\n reject(err);\n }\n else {\n resolve(JSON.parse(data));\n }\n });\n });\n}","function read_file(filepath, cb) {\n var param = { fsid: fsid, path: filepath };\n ajax(service_url.read, param, function(err, filecontent, textStatus, jqXHR) {\n if (err) return cb(err);\n if (jqXHR.status != 200) {\n var msg;\n switch (jqXHR.status) {\n case 404:\n msg = lang('s0035'); break;\n case 406:\n msg = lang('s0036'); break;\n case 400:\n msg = lang('s0037'); break;\n default:\n msg = 'Code ' + jqXHR.status +' -- '+ textStatus;\n }\n return cb(new Error(lang('s0038')+ ': '+ filepath+ ', '+ msg));\n }\n var mimetype = jqXHR.getResponseHeader('Content-Type');\n var uptime = jqXHR.getResponseHeader('uptime');\n cb(null, filecontent, uptime, mimetype);\n });\n }","function read(path,method) {\n method = method || 'readAsText';\n return file(path).then(function(fileEntry) {\n return new Promise(function(resolve,reject){\n fileEntry.file(function(file){\n var reader = new FileReader();\n reader.onloadend = function(){\n resolve(this.result);\n };\n reader[method](file);\n },reject);\n });\n });\n }","getFileContent(path: string) {\n fs.readFile(path, 'utf8', (err, data) => {\n this.editorContentCallback(data, path);\n });\n }","readFile(filePath) {\n return RNFetchBlob.fs.readFile(filePath, 'utf8');\n }","function readJSONFile(file)\n{ var allText\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function ()\n {\n if(rawFile.readyState === 4)\n {\n if(rawFile.status === 200 || rawFile.status == 0)\n {\n allText = rawFile.responseText;\n }\n }\n }\n rawFile.send(null);\n return allText;\n}","function loadFile(filePath) {\n var result = null;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", filePath, false);\n xmlhttp.send();\n if (xmlhttp.status==200) {\n result = xmlhttp.responseText;\n }\n return result;\n}","function rFile (file) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n return console.log(err);\n }\n console.log(data);\n });\n}","function loadFile(filePath) {\n var result = null;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", filePath, false);\n xmlhttp.send();\n if (xmlhttp.status==200) {\n result = xmlhttp.responseText;\n }\n return result;\n }","function readAllFromFile(fname) {\n var fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n var file = null;\n try {\n file = fso.OpenTextFile(fname, 1, 0);\n return (file.readAll());\n } finally {\n // Close the file in the finally section to guarantee that it will be closed in any case\n // (if the exception is thrown or not).\n file.Close();\n }\n}","_read () {\n let { filename } = this\n return new Promise((resolve, reject) =>\n fs.readFile((filename), (err, content) => err ? reject(err) : resolve(content))\n ).then(JSON.parse)\n }","static readFile(path) {\n path = pathHelper.resolve(path);\n logger.debug('Checking data file: ' + path);\n\n return fs.readFileSync(path, 'utf8');\n }","fileCall(path) {\n var fileStream = require('fs');\n var f = fileStream.readFileSync(path, 'utf8');\n return f;\n // var arr= f.split('');\n // return arr;\n }","static readFile(filePath, options) {\n return FileSystem._wrapException(() => {\n options = Object.assign(Object.assign({}, READ_FILE_DEFAULT_OPTIONS), options);\n let contents = FileSystem.readFileToBuffer(filePath).toString(options.encoding);\n if (options.convertLineEndings) {\n contents = Text_1.Text.convertTo(contents, options.convertLineEndings);\n }\n return contents;\n });\n }","readin () {\n this.content = readFile(this.path);\n }","function loadFile(filePath) {\r\n var result = null;\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"GET\", filePath, false);\r\n xmlhttp.send();\r\n if (xmlhttp.status === 200) {\r\n result = xmlhttp.responseText;\r\n }\r\n return result;\r\n}"],"string":"[\n \"function getFileContents(filename){\\r\\n\\t\\r\\n\\tvar contents;\\r\\n\\tcontents = fs.readFileSync(filename);\\r\\n\\treturn contents;\\r\\n}\",\n \"function getContents(file) {\\n\\t// Ensure that the file's name is not null.\\n\\tif(file === null) {\\n\\t\\tself.fail(\\\"The File object is null.\\\");\\n\\t}\\n\\tif(! file.exists()) {\\n\\t\\tself.fail(\\\"The file does not exist: \\\" + file);\\n\\t}\\n\\t\\n\\tvar fileReader;\\n\\ttry {\\n\\t\\tfileReader = new FileReader(file);\\n\\t}\\n\\tcatch(e) {\\n\\t\\tself.fail(\\\"Could not open the file: \\\" + e);\\n\\t\\treturn;\\n\\t}\\n\\t\\n\\treturn new String(FileUtils.readFully(fileReader));\\n}\",\n \"function readFile(file) {\\n return fetch(file).then(function (response) {\\n return response.text();\\n });\\n }\",\n \"function readFile(file)\\n{\\n var content = '';\\n\\n var stream = Components.classes['@mozilla.org/network/file-input-stream;1']\\n .createInstance(Components.interfaces.nsIFileInputStream);\\n stream.init(file, 0x01, 0, 0);\\n\\n var script = Components.classes['@mozilla.org/scriptableinputstream;1']\\n .createInstance(Components.interfaces.nsIScriptableInputStream);\\n script.init(stream);\\n\\n if (stream.available()) {\\n var data = script.read(4096);\\n\\n while (data.length > 0) {\\n content += data;\\n data = script.read(4096);\\n }\\n }\\n\\n stream.close();\\n script.close();\\n\\n return content;\\n}\",\n \"function fileContents(filePath, file) {\\n return file.contents.toString('utf8');\\n}\",\n \"function fileContents (filePath, file) {\\n return file.contents.toString('utf8');\\n}\",\n \"function getFileContent(path) {\\n return fs.readFileSync(`${path}`, {\\n encoding: 'utf8'\\n })\\n}\",\n \"function readFile() {\\n return fs.readFileSync(fileName);\\n}\",\n \"getContents() {\\n return _fs.default.readFileSync(this.filePath, \\\"utf8\\\");\\n }\",\n \"function readFile(file) {\\n return fs.readFileSync(file, \\\"utf8\\\");\\n}\",\n \"function getContent(fileName) {\\n return fs.readFileSync(fileName, { encoding: 'utf8' });\\n}\",\n \"function readFile(path) {\\n\\t\\tvar content = \\\"\\\";\\n\\t\\ttry {\\n\\t\\t\\tcontent = fs.readFileSync(path).toString();\\n\\t\\t} catch (e) {\\n\\t\\t\\tif (e.code === \\\"ENOENT\\\") {\\n\\t\\t\\t\\twarn(\\\"Source file \\\" + e.path + \\\" not found.\\\");\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tthrow e;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn content;\\n\\t}\",\n \"async function getFileContent(filePath) {\\n return (await filePath) ? readFile(filePath) : null;\\n}\",\n \"function read(file) {\\n var complete = fs.readFileSync(file, 'utf8')\\n return complete\\n}\",\n \"function GetFileBody(file) {\\n\\treturn fs.readFileSync(InputDir + file).toString('utf-8');\\n}\",\n \"function read_file(path_to_file){\\n var data = fs.readFileSync(path_to_file).toString();\\n return data;\\n}\",\n \"function getTextFile(theFilename){\\n return new Promise($.async(function (resolve, reject) {\\n try {\\n $.fs.readFile(theFilename, 'utf8', function (err, theContent) {\\n if (err) {\\n resolve(\\\"\\\")\\n } else {\\n resolve(theContent);\\n }\\n });\\n }\\n catch (error) {\\n resolve(\\\"\\\")\\n }\\n \\n }));\\n}\",\n \"function readFromFile(file) {\\n let istream = Cc[\\\"@mozilla.org/network/file-input-stream;1\\\"].\\n createInstance(Ci.nsIFileInputStream);\\n istream.init(file, 0x01, 0444,0);\\n istream.QueryInterface(Ci.nsILineInputStream);\\n dump(\\\"reading\\\\n\\\");\\n\\n let line = {}, lines = [], hasmore;\\n do {\\n hasmore = istream.readLine(line);\\n dump(\\\"line:\\\" + line.value + \\\"\\\\n\\\");\\n lines.push(line.value);\\n } while(hasmore);\\n istream.close();\\n dump(\\\"done reading\\\\n\\\");\\n return lines;\\n}\",\n \"function readContentFile(filename) {\\n var promise = new Promise(async function(resolve, reject) {\\n fs.readFile(filename, 'utf8', function (err, data) {\\n if (err) {\\n reject(err);\\n return;\\n }\\n resolve (data);\\n });\\n });\\n return promise;\\n}\",\n \"function readFile(file) {\\n return new Promise((resolve, reject) => {\\n let chunks = [];\\n // Create a readable stream\\n let readableStream = fs.createReadStream(file);\\n \\n readableStream.on('data', chunk => {\\n chunks.push(chunk);\\n });\\n\\n readableStream.on('error', err => {\\n reject(err)\\n })\\n \\n return readableStream.on('end', () => {\\n resolve(chunks);\\n });\\n });\\n}\",\n \"function readTextFile(file) {\\n\\tvar rawFile1 = new XMLHttpRequest();\\n\\trawFile1.open(\\\"GET\\\", file, false);\\n\\trawFile1.onreadystatechange = function() {\\n\\t\\tif(rawFile1.readyState === 4) {\\n\\t\\t\\tif(rawFile1.status === 200 || rawFile1.status == 0) {\\n\\t\\t\\t\\treturn rawFile1.responseText;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\trawFile1.send(null);\\n\\treturn rawFile1.responseText;\\n}\",\n \"function getFile(fileName) {\\n return fs.readFileSync(path.resolve(__dirname, fileName), \\\"utf-8\\\");\\n}\",\n \"function getFile(filePath) {\\n return new Promise((resolve, reject) => {\\n fs.readFile(filePath, function(error, data) {\\n if (error) {\\n return reject(error);\\n }\\n return resolve(data);\\n });\\n });\\n}\",\n \"readFile(file) {\\n return new Promise((resolve, reject) => {\\n\\n const reader = new FileReader();\\n\\n reader.onload = res => {\\n resolve(res.target.result);\\n };\\n\\n reader.onerror = err => reject(err);\\n\\n reader.readAsDataURL(file);\\n });\\n }\",\n \"function ReadFile(path)\\n{\\n\\treturn _fs.readFileSync(path, \\\"utf8\\\").toString();\\n}\",\n \"async read (filepath, options = {}) {\\n try {\\n let buffer = await this._readFile(filepath, options);\\n return buffer\\n } catch (err) {\\n return null\\n }\\n }\",\n \"readFile(file) {\\n return new Promise((resolve, reject) => {\\n const reader = new FileReader();\\n reader.onload = (evt) => {\\n if(evt && evt.target) {\\n resolve(evt.target.result);\\n }\\n reject();\\n };\\n reader.readAsDataURL(file);\\n });\\n }\",\n \"function readFile(file_path) {\\n return fs.readFileSync(file_path, 'utf8', function(err, data) { \\n if (err) throw err;\\n console.log(data);\\n });\\n}\",\n \"function readfile(){\\n\\t\\t\\tvar txtFile = \\\"c:/test.txt\\\"\\n\\t\\t\\tvar file = new File([\\\"\\\"],txtFile);\\n\\n\\t\\t\\tfile.open(\\\"r\\\"); // open file with read access\\n\\t\\t\\tvar str = \\\"\\\";\\n\\t\\t\\twhile (!file.eof) {\\n\\t\\t\\t\\t// read each line of text\\n\\t\\t\\t\\tstr += file.readln() + \\\"\\\\n\\\";\\n\\t\\t\\t}\\n\\t\\t\\tfile.close();\\n\\t\\t\\talert(str);\\n\\t\\t}\",\n \"function readFile(aFileName) {\\n let f = do_get_file(aFileName);\\n let s = Cc[\\\"@mozilla.org/network/file-input-stream;1\\\"]\\n .createInstance(Ci.nsIFileInputStream);\\n s.init(f, -1, -1, false);\\n try {\\n return NetUtil.readInputStreamToString(s, s.available());\\n } finally {\\n s.close();\\n }\\n}\",\n \"function readFile (fullpath){\\n\\tvar result=\\\"\\\";\\n\\t$.ajax({\\n\\t\\turl: fullpath,\\n\\t\\tasync: false,\\n\\t\\tdataType: \\\"text\\\",\\n\\t\\tsuccess: function (data) {\\n\\t\\t\\tresult = data;\\n\\t\\t}\\n\\t});\\n\\treturn result;\\n}\",\n \"function _getDataFromFile(){\\n\\tvar fileData = _openFIle();\\n\\treturn fileData;\\n}\",\n \"function readfile(path)\\r\\n{\\r\\n return fs.readFileSync(path,'UTF8',function(data,err)\\r\\n {\\r\\n if(err) throw err;\\r\\n return data\\r\\n });\\r\\n}\",\n \"static read_file(filename, encoding='utf8')\\r\\n {\\r\\n let data;\\r\\n try\\r\\n {\\r\\n data = fs.readFileSync(filename, encoding);\\r\\n }\\r\\n catch (err)\\r\\n {\\r\\n throw new Error(err);\\r\\n }\\r\\n return data;\\r\\n }\",\n \"function readFile(file) {\\n\\treturn ''+new String(org.apache.tools.ant.util.FileUtils.readFully(new java.io.FileReader(file)));\\n}\",\n \"function readTextFile(file) {\\n //Look into fetch or FileReader\\n let rawFile = new XMLHttpRequest();\\n let allText;\\n rawFile.open(\\\"GET\\\", file, false);\\n rawFile.onreadystatechange = () => (allText = rawFile.responseText);\\n rawFile.send(null);\\n getElementData(allText, file);\\n}\",\n \"function readFile(file) {\\n return new Promise(function (resolve) {\\n var reader = new FileReader();\\n\\n // This is called when finished reading\\n reader.onload = function (event) {\\n // Return an array with one image\\n resolve({\\n // These are attributes like size, name, type, ...\\n lastModifiedDate: file.lastModifiedDate,\\n lastModified: file.lastModified,\\n name: file.name,\\n size: file.size,\\n type: file.type,\\n\\n // This is the files content as base64\\n src: event.target.result\\n });\\n };\\n\\n if (file.type.indexOf('text/') === 0 || file.type === 'application/json') {\\n reader.readAsText(file);\\n } else if (file.type.indexOf('image/') === 0) {\\n reader.readAsDataURL(file);\\n } else {\\n reader.readAsBinaryString(file);\\n }\\n });\\n}\",\n \"function getFileContents(file, callback) {\\n\\n\\t// ajax linker\\n\\t$.ajax({\\n\\t\\turl : file,\\n\\n\\t\\t// on success, call callback\\n\\t\\tsuccess : function(result){\\n\\t\\t\\tif ($.isFunction(callback))\\n\\t\\t\\t\\tcallback.apply(null, [result]);\\n\\t\\t}\\n\\n\\t});\\n}\",\n \"function readFile (file) {\\n var str = fs.readFileSync(file, 'utf-8');\\n console.log(str);\\n}\",\n \"function getFile(url){\\n var req = request.get(url, function(err, res){\\n if (err) throw err;\\n console.log('Response ok:', res.ok);\\n console.log('Response text:', res.text);\\n return res.text;\\n });\\n}\",\n \"function retriveFile(path) {\\n return new Promise((resolve, reject) => {\\n var request = new XMLHttpRequest();\\n request.open('GET', path, true);\\n request.responseType = 'text';\\n request.onload = () => resolve({\\n fileData: request.response\\n });\\n request.onerror = reject;\\n request.send();\\n })\\n}\",\n \"function readFile(fileEntry) {\\n\\n // Get the file from the file entry\\n fileEntry.file(function (file) {\\n \\n // Create the reader\\n var reader = new FileReader();\\n reader.readAsText(file);\\n\\n reader.onloadend = function() {\\n\\n console.log(\\\"Successful file read: \\\" + this.result);\\n console.log(\\\"file path: \\\" + fileEntry.fullPath);\\n\\n };\\n\\n }, onError);\\n}\",\n \"function getFileContents(activityXmlFile) {\\n\\t\\ttry {\\n\\t\\t\\treturn fs.readFileSync(activityXmlFile);\\n\\t\\t} catch(ex) {\\n\\t\\t\\tconsole.log('Error reading activity xml file [', activityXmlFile, ']\\\\n', ex);\\n\\t\\t\\tthrow 'Error reading Activity XML File';\\n\\t\\t}\\n\\t}\",\n \"function readFile (file){ \\n let data = (fs.readFileSync(file)\\n .toString())\\n .replace('\\\\r', '')\\n .split('\\\\n');\\n return data;\\n}\",\n \"async getFileContents(file, returnDecryptStreamSeparately = false){\\n try{\\n let beautifiedPath = await this.beautifyPath(file.config.folder, true);\\n let filePath = `${beautifiedPath}${beautifiedPath === \\\"\\\" ? \\\"\\\" : \\\"/\\\"}${file.config.name}.${file.config.ext}`;\\n\\n return await this.getLocalFileContents(filePath, file.config.isEncrypted, file.config.iv);\\n }catch(error){ Logger.log(error); }\\n\\n return { contents: null, contentType: null, contentLength: 0, readStream: null, };\\n }\",\n \"function read (fileName) {\\n return new Promise((resolve, reject) => {\\n fs.readFile(fileName, \\\"utf8\\\",\\n (err, textFileData) => {\\n if (err) {\\n reject(err);\\n return;\\n }\\n\\n resolve(textFileData);\\n }\\n );\\n });\\n}\",\n \"function getFile (file) {\\n fakeAjax(file, function (text) {\\n fileReceived(file, text)\\n })\\n}\",\n \"function openFile(path) {\\n\\treturn new Promise(function (resolve, reject) {\\n\\t\\tfs.readFile(path, \\\"utf8\\\", (err, data) => {\\n\\t\\t\\tif (err) reject(err);\\n\\t\\t\\tresolve(data);\\n\\t\\t});\\n\\t});\\n}\",\n \"function getFile(file) {\\n fakeAjax(file, function(text) {\\n handleResponse(file, text);\\n });\\n}\",\n \"function loadFile(file){\\n\\tlet fs = require('fs');\\n\\tvar data = fs.readFileSync(file);\\n\\tvar contents = (JSON.parse(data));\\n\\treturn contents;\\n}\",\n \"function readTxtFile(file) {\\n if (!file.exists) {\\n throw \\\"Cannot find file: \\\" + decodeURI(file.absoluteURI);\\n }\\n file.open(\\\"r\\\", \\\"TEXT\\\");\\n file.encoding = \\\"UTF8\\\";\\n file.lineFeed = \\\"unix\\\";\\n var str = file.read();\\n file.close();\\n return str;\\n}\",\n \"async readFile(fileName) {\\n const bytes = await this.idb.get(fileName, this.store);\\n return bytes;\\n }\",\n \"readFile(mfs, file) {\\n try {\\n return mfs.readFileSync(path.join(this.confClient.output.path, file), \\\"utf-8\\\")\\n } catch (error) {}\\n }\",\n \"async function readFile(file) {\\n return new Promise((resolve, reject) => {\\n const reader = new FileReader();\\n reader.onload = () => resolve(reader.result);\\n reader.readAsText(file);\\n });\\n}\",\n \"getFile(filePath, options) {\\n console.log('api.getFile: ', filePath);\\n return this.sendRequest({\\n type: 'loadFile',\\n filePath: filePath,\\n options: options\\n })\\n .then(function(fileInfo) {\\n return {\\n filePath: filePath,\\n contents: fileInfo.payload.contents\\n }\\n })\\n .catch(function(errorInfo) {\\n return undefined;\\n });\\n }\",\n \"function readTextFile(file)\\n{\\n var rawFile = new XMLHttpRequest();\\n rawFile.open(\\\"GET\\\", file, false);\\n rawFile.onreadystatechange = function ()\\n {\\n if(rawFile.readyState === 4)\\n {\\n if(rawFile.status === 200 || rawFile.status == 0)\\n {\\n var allText = rawFile.responseText;\\n fileDisplayArea.innerText = allText\\n }\\n }\\n }\\n rawFile.send(null);\\n}\",\n \"function getFile(){\\n\\n\\t\\treturn this.file;\\n\\t}\",\n \"function getFile(file) {\\n fakeAjax(file, function (text) {\\n fileReceived(file, text);\\n });\\n }\",\n \"function readFile() {\\n return new Promise((resolve, reject) => {\\n fs.readFile(SOURCE, {\\n encoding: 'utf-8'\\n }, (err, data) => {\\n if (err) {\\n reject(err);\\n // puts the callback given to the .catch in the Promise pending callbacks queue\\n } else {\\n resolve(data);\\n // puts the callback given to the first .then, in the Promise pending callbacks queue\\n }\\n });\\n });\\n}\",\n \"function loadFileToString(file) {\\n let frawin = Cc[\\\"@mozilla.org/network/file-input-stream;1\\\"]\\n .createInstance(Ci.nsIFileInputStream);\\n frawin.init(file, -1, 0, 0);\\n let fin = Cc[\\\"@mozilla.org/scriptableinputstream;1\\\"]\\n .createInstance(Ci.nsIScriptableInputStream);\\n fin.init(frawin);\\n let data = \\\"\\\";\\n let str = fin.read(4096);\\n while (str.length > 0) {\\n data += str;\\n str = fin.read(4096);\\n }\\n fin.close();\\n\\n return data;\\n}\",\n \"function readFileAsync (file, options) {\\n return new Promise(function (resolve, reject) {\\n fs.readFile(file, options, function (err, data) {\\n if (err) {\\n reject(err)\\n } else {\\n resolve(data)\\n }\\n })\\n })\\n}\",\n \"function read(f)\\n\\t{\\n\\t\\tt = fs.readFileSync(f, 'utf8', (err,txt) => {\\n\\t\\t\\tif (err) throw err;\\n\\t\\t});\\n\\t\\treturn t;\\n\\t}\",\n \"function getFileContents(caller, path, app, username, zoneFileLookupURL, forceText) {\\n return Promise.resolve().then(function () {\\n if (username) {\\n return getUserAppFileUrl(path, username, app, zoneFileLookupURL);\\n } else {\\n return (0, _hub.getOrSetLocalGaiaHubConnection)(caller).then(function (gaiaHubConfig) {\\n return (0, _hub.getFullReadUrl)(path, gaiaHubConfig);\\n });\\n }\\n }).then(function (readUrl) {\\n return new Promise(function (resolve, reject) {\\n if (!readUrl) {\\n reject(null);\\n } else {\\n resolve(readUrl);\\n }\\n });\\n }).then(function (readUrl) {\\n return fetch(readUrl);\\n }).then(function (response) {\\n if (response.status !== 200) {\\n if (response.status === 404) {\\n _logger.Logger.debug('getFile ' + path + ' returned 404, returning null');\\n return null;\\n } else {\\n throw new Error('getFile ' + path + ' failed with HTTP status ' + response.status);\\n }\\n }\\n var contentType = response.headers.get('Content-Type');\\n if (forceText || contentType === null || contentType.startsWith('text') || contentType === 'application/json') {\\n return response.text();\\n } else {\\n return response.arrayBuffer();\\n }\\n });\\n}\",\n \"function readTextFile(file)\\n{\\n var rawFile = new XMLHttpRequest();\\n rawFile.open(\\\"GET\\\", file, true);\\n rawFile.onreadystatechange = function ()\\n {\\n if(rawFile.readyState === 4)\\n {\\n if(rawFile.status === 200 || rawFile.status == 0)\\n {\\n var allText = rawFile.responseText;\\n\\n alert(allText);\\n }\\n }\\n }\\n rawFile.send(null);\\n}\",\n \"read() {\\n return fs.readFileSync(this.filepath).toString();\\n }\",\n \"function readTextFile(path) {\\n\\tfs.readFile(path, function(err, data) {\\n\\t\\treturn String(data);\\n\\t});\\n}\",\n \"function read(filePath) {\\n if (fs.existsSync(filePath)) {\\n let isFile = fs.statSync(filePath).isFile;\\n if (isFile) {\\n let data = fs.readFileSync(filePath, FILE_OPTIONS);\\n return data;\\n }\\n }\\n return null;\\n}\",\n \"readReportFromFile() {\\n const content = this.utility.readFromFile(this.reportFileName);\\n return content;\\n }\",\n \"readFile(filePath) {\\n return fs.readFileSync(path.resolve(filePath));\\n }\",\n \"async function getFile(fileId) {\\n return await $.ajax({\\n url: domain + \\\"/file/\\\" + encodeURIComponent(fileId),\\n method: \\\"GET\\\",\\n });\\n }\",\n \"function getFile(file) {\\n\\treturn ASQ(function(done){\\n\\t\\tfakeAjax(file,done);\\n\\t});\\n}\",\n \"function readFile(filePath, fmt) {\\n return new Promise((resolve, reject) =>\\n fs.readFile(filePath, fmt || 'utf8', (err, results) =>\\n err ? reject(err) : resolve(results))\\n );\\n}\",\n \"function read(f)\\n{\\n t = fs.readFileSync(f, 'utf8', (err,txt) => {\\n if (err) throw err;\\n });\\n return t;\\n}\",\n \"function readFile(file) {\\n\\tvar read = new FileReader();\\n\\tread.onloadend = function() {\\n\\t\\tconsole.log(read.result);\\n\\t};\\n\\tread.readAsBinaryString(file);\\n}\",\n \"function read_file(filename) {\\n var file_data = data.load(filename);\\n return file_data;\\n}\",\n \"async function getFile(name) {\\n return new Promise(res => {\\n fs.readFile(name, 'utf-8', (err, result) => {\\n res(result);\\n });\\n });\\n}\",\n \"function readFile(file, header){\\r\\n\\ttemplateGet(file,HEADER,header);\\r\\n\\tvar isDat = header.fileType==1;\\r\\n\\tvar headerSize = isDat ? 108 : 80;\\r\\n\\tif(isDat)\\r\\n\\t\\ttemplateGet(file,DAT_HEADER,header);\\r\\n\\tvar data=file.slice(headerSize, file.length-20);\\r\\n\\t//if(header.compressed==4){\\r\\n\\t//\\tdata=pako.inflateRaw(data);\\r\\n\\t//}\\r\\n\\treturn data;\\r\\n}\",\n \"async read(filepath) {\\n try {\\n return await this.reader(filepath, 'utf-8');\\n } catch (error) {\\n return undefined;\\n }\\n }\",\n \"function read(path, method) {\\n method = method || 'readAsText';\\n return file(path).then(function (fileEntry) {\\n return new Promise(function (resolve, reject) {\\n fileEntry.file(function (file) {\\n var reader = new FileReader();\\n reader.onloadend = function () {\\n resolve(this.result);\\n };\\n reader[method](file);\\n }, reject);\\n });\\n });\\n }\",\n \"function get_file(url) {\\n\\tconst request = new XMLHttpRequest()\\n\\t// This throws a warning about synchronous requests being deprecated\\n\\trequest.open('GET',url,false)\\n\\trequest.send()\\n\\treturn request.responseText\\n}\",\n \"function readFile(filename){\\n return new Promise(function(resolve,reject){\\n fs.readFile(filename,'utf8',function(err,data){\\n err?reject(err):resolve(data);\\n });\\n })\\n}\",\n \"function fetchFileContents(path, callback)\\n{\\n\\t// Check for file existence first, then perform a read if it exists\\n\\tfs.exists(path, function(exists)\\n\\t{\\n\\t\\tif (exists)\\n\\t\\t{\\n\\t\\t\\tfs.readFile(path, {encoding: 'utf-8'},\\n\\t\\t\\t\\tfunction(err, data)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tif (!err)\\n\\t\\t\\t\\t {\\n\\t\\t\\t\\t \\tcallback(data);\\n\\t\\t\\t\\t }\\n\\t\\t\\t\\t else\\n\\t\\t\\t\\t {\\n\\t\\t\\t\\t\\t \\tconsole.log(err);\\n\\t\\t\\t\\t \\tcallback(\\\"404 - The file at \\\" + path + \\\" was inaccessible.\\\");\\n\\t\\t\\t\\t }\\n\\t\\t\\t\\t});\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\tcallback(\\\"404 - The file at \\\" + path + \\\" was not found.\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"static async readFile(path) {\\n return (await Util.promisify(Fs.readFile)(path)).toString('utf-8');\\n }\",\n \"readFile(path_to_file) {\\n return new Promise((resolve, reject) => {\\n let result = [],\\n line_reader = readline.createInterface({\\n input : fs.createReadStream(__dirname + path_to_file)\\n })\\n line_reader.on('line', (line) => {\\n result.push(line)\\n })\\n line_reader.on('close', () => {\\n resolve(result)\\n })\\n })\\n }\",\n \"function readFile(fileEntry) {\\n // Get the file from the file entry\\n fileEntry.file(function (file) { \\n // Create the reader\\n var reader = new FileReader();\\n reader.readAsText(file);\\n reader.onloadend = function() {\\n console.log(\\\"Successful file read: \\\" + reader.result);\\n document.getElementById('dataObj').innerHTML = reader.result;\\n console.log(\\\"file path: \\\" + fileEntry.fullPath);\\n };\\n });\\n }\",\n \"function readFromFile(file) {\\n return new Promise((resolve, reject) => {\\n fs.readFile(file, function (err, data) {\\n if (err) {\\n console.log(err);\\n reject(err);\\n }\\n else {\\n resolve(JSON.parse(data));\\n }\\n });\\n });\\n}\",\n \"function read_file(filepath, cb) {\\n var param = { fsid: fsid, path: filepath };\\n ajax(service_url.read, param, function(err, filecontent, textStatus, jqXHR) {\\n if (err) return cb(err);\\n if (jqXHR.status != 200) {\\n var msg;\\n switch (jqXHR.status) {\\n case 404:\\n msg = lang('s0035'); break;\\n case 406:\\n msg = lang('s0036'); break;\\n case 400:\\n msg = lang('s0037'); break;\\n default:\\n msg = 'Code ' + jqXHR.status +' -- '+ textStatus;\\n }\\n return cb(new Error(lang('s0038')+ ': '+ filepath+ ', '+ msg));\\n }\\n var mimetype = jqXHR.getResponseHeader('Content-Type');\\n var uptime = jqXHR.getResponseHeader('uptime');\\n cb(null, filecontent, uptime, mimetype);\\n });\\n }\",\n \"function read(path,method) {\\n method = method || 'readAsText';\\n return file(path).then(function(fileEntry) {\\n return new Promise(function(resolve,reject){\\n fileEntry.file(function(file){\\n var reader = new FileReader();\\n reader.onloadend = function(){\\n resolve(this.result);\\n };\\n reader[method](file);\\n },reject);\\n });\\n });\\n }\",\n \"getFileContent(path: string) {\\n fs.readFile(path, 'utf8', (err, data) => {\\n this.editorContentCallback(data, path);\\n });\\n }\",\n \"readFile(filePath) {\\n return RNFetchBlob.fs.readFile(filePath, 'utf8');\\n }\",\n \"function readJSONFile(file)\\n{ var allText\\n var rawFile = new XMLHttpRequest();\\n rawFile.open(\\\"GET\\\", file, false);\\n rawFile.onreadystatechange = function ()\\n {\\n if(rawFile.readyState === 4)\\n {\\n if(rawFile.status === 200 || rawFile.status == 0)\\n {\\n allText = rawFile.responseText;\\n }\\n }\\n }\\n rawFile.send(null);\\n return allText;\\n}\",\n \"function loadFile(filePath) {\\n var result = null;\\n var xmlhttp = new XMLHttpRequest();\\n xmlhttp.open(\\\"GET\\\", filePath, false);\\n xmlhttp.send();\\n if (xmlhttp.status==200) {\\n result = xmlhttp.responseText;\\n }\\n return result;\\n}\",\n \"function rFile (file) {\\n fs.readFile(file, 'utf8', function (err, data) {\\n if (err) {\\n return console.log(err);\\n }\\n console.log(data);\\n });\\n}\",\n \"function loadFile(filePath) {\\n var result = null;\\n var xmlhttp = new XMLHttpRequest();\\n xmlhttp.open(\\\"GET\\\", filePath, false);\\n xmlhttp.send();\\n if (xmlhttp.status==200) {\\n result = xmlhttp.responseText;\\n }\\n return result;\\n }\",\n \"function readAllFromFile(fname) {\\n var fso = new ActiveXObject(\\\"Scripting.FileSystemObject\\\");\\n var file = null;\\n try {\\n file = fso.OpenTextFile(fname, 1, 0);\\n return (file.readAll());\\n } finally {\\n // Close the file in the finally section to guarantee that it will be closed in any case\\n // (if the exception is thrown or not).\\n file.Close();\\n }\\n}\",\n \"_read () {\\n let { filename } = this\\n return new Promise((resolve, reject) =>\\n fs.readFile((filename), (err, content) => err ? reject(err) : resolve(content))\\n ).then(JSON.parse)\\n }\",\n \"static readFile(path) {\\n path = pathHelper.resolve(path);\\n logger.debug('Checking data file: ' + path);\\n\\n return fs.readFileSync(path, 'utf8');\\n }\",\n \"fileCall(path) {\\n var fileStream = require('fs');\\n var f = fileStream.readFileSync(path, 'utf8');\\n return f;\\n // var arr= f.split('');\\n // return arr;\\n }\",\n \"static readFile(filePath, options) {\\n return FileSystem._wrapException(() => {\\n options = Object.assign(Object.assign({}, READ_FILE_DEFAULT_OPTIONS), options);\\n let contents = FileSystem.readFileToBuffer(filePath).toString(options.encoding);\\n if (options.convertLineEndings) {\\n contents = Text_1.Text.convertTo(contents, options.convertLineEndings);\\n }\\n return contents;\\n });\\n }\",\n \"readin () {\\n this.content = readFile(this.path);\\n }\",\n \"function loadFile(filePath) {\\r\\n var result = null;\\r\\n var xmlhttp = new XMLHttpRequest();\\r\\n xmlhttp.open(\\\"GET\\\", filePath, false);\\r\\n xmlhttp.send();\\r\\n if (xmlhttp.status === 200) {\\r\\n result = xmlhttp.responseText;\\r\\n }\\r\\n return result;\\r\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.790714","0.77232456","0.75610566","0.7484739","0.7429082","0.7402849","0.70870584","0.70229805","0.69181293","0.68460333","0.68416864","0.67938757","0.67254823","0.6645344","0.6645003","0.66349036","0.66026247","0.6600203","0.65757376","0.64575833","0.6452056","0.643963","0.640745","0.63999444","0.6373837","0.63723165","0.636517","0.6363997","0.63458556","0.63346595","0.63185036","0.63165766","0.6312703","0.63123506","0.6282988","0.6278201","0.6268859","0.62541246","0.6198028","0.6191339","0.6178407","0.6176599","0.61718476","0.61388934","0.6133638","0.61291206","0.61133814","0.60887736","0.6076457","0.60459894","0.6045023","0.60406375","0.6040145","0.60380685","0.60315335","0.60185903","0.60142004","0.6011808","0.6002801","0.597518","0.5960802","0.59603184","0.59591466","0.59254557","0.592023","0.59147805","0.5906467","0.5901174","0.5884886","0.58693415","0.586764","0.5862089","0.5860128","0.5860012","0.58583885","0.584551","0.5845253","0.58430564","0.5836899","0.58321077","0.5823499","0.58213454","0.58101517","0.5807126","0.58054304","0.5796165","0.57935065","0.57916695","0.57909703","0.57864887","0.5786416","0.5786127","0.5763726","0.57557243","0.5753459","0.5751203","0.5733438","0.5717191","0.57156","0.5714189","0.5713314"],"string":"[\n \"0.790714\",\n \"0.77232456\",\n \"0.75610566\",\n \"0.7484739\",\n \"0.7429082\",\n \"0.7402849\",\n \"0.70870584\",\n \"0.70229805\",\n \"0.69181293\",\n \"0.68460333\",\n \"0.68416864\",\n \"0.67938757\",\n \"0.67254823\",\n \"0.6645344\",\n \"0.6645003\",\n \"0.66349036\",\n \"0.66026247\",\n \"0.6600203\",\n \"0.65757376\",\n \"0.64575833\",\n \"0.6452056\",\n \"0.643963\",\n \"0.640745\",\n \"0.63999444\",\n \"0.6373837\",\n \"0.63723165\",\n \"0.636517\",\n \"0.6363997\",\n \"0.63458556\",\n \"0.63346595\",\n \"0.63185036\",\n \"0.63165766\",\n \"0.6312703\",\n \"0.63123506\",\n \"0.6282988\",\n \"0.6278201\",\n \"0.6268859\",\n \"0.62541246\",\n \"0.6198028\",\n \"0.6191339\",\n \"0.6178407\",\n \"0.6176599\",\n \"0.61718476\",\n \"0.61388934\",\n \"0.6133638\",\n \"0.61291206\",\n \"0.61133814\",\n \"0.60887736\",\n \"0.6076457\",\n \"0.60459894\",\n \"0.6045023\",\n \"0.60406375\",\n \"0.6040145\",\n \"0.60380685\",\n \"0.60315335\",\n \"0.60185903\",\n \"0.60142004\",\n \"0.6011808\",\n \"0.6002801\",\n \"0.597518\",\n \"0.5960802\",\n \"0.59603184\",\n \"0.59591466\",\n \"0.59254557\",\n \"0.592023\",\n \"0.59147805\",\n \"0.5906467\",\n \"0.5901174\",\n \"0.5884886\",\n \"0.58693415\",\n \"0.586764\",\n \"0.5862089\",\n \"0.5860128\",\n \"0.5860012\",\n \"0.58583885\",\n \"0.584551\",\n \"0.5845253\",\n \"0.58430564\",\n \"0.5836899\",\n \"0.58321077\",\n \"0.5823499\",\n \"0.58213454\",\n \"0.58101517\",\n \"0.5807126\",\n \"0.58054304\",\n \"0.5796165\",\n \"0.57935065\",\n \"0.57916695\",\n \"0.57909703\",\n \"0.57864887\",\n \"0.5786416\",\n \"0.5786127\",\n \"0.5763726\",\n \"0.57557243\",\n \"0.5753459\",\n \"0.5751203\",\n \"0.5733438\",\n \"0.5717191\",\n \"0.57156\",\n \"0.5714189\",\n \"0.5713314\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":556,"cells":{"query":{"kind":"string","value":"Sets the contents of a file."},"document":{"kind":"string","value":"write(file, contents) {\n // validate input\n if (!isString(file)) throw new TypeError('Expected file to be a string; got: ' + typeof file);\n if (isString(contents)) contents = new Buffer(contents);\n else if (contents !== null && !Buffer.isBuffer(contents)) {\n throw new TypeError('Exected contents to be a buffer, string or null; got: ' + typeof contents);\n }\n\n // check what the old contents was before updating it\n const oldContents = this.read(file);\n\n // update our record of this file's contents\n if (contents) this[FILES][file] = contents;\n else delete this[FILES][file];\n\n // decide change type, if any\n let type;\n if (oldContents) {\n if (contents) {\n if (!bufferEqual(oldContents, contents)) type = 'modify';\n }\n else type = 'delete';\n }\n else if (contents) type = 'add';\n\n // respond with a change object, if it changed\n if (type) {\n const change = new Change({file, contents, oldContents, type});\n this.emit('change', change);\n return change;\n }\n\n return null;\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["set file(value) { this._file = value; }","setFileContent(newValue) {\n this._fileContent = newValue;\n }","setFile(file) {\n this.file = file;\n }","set file(value) {\n this._file = value;\n this.renderImage();\n }","function setFile(url){\n\tfile = url;\n}","setFileContents(files) {\n for(let entry of files) {\n this.stream.writeFixedString(entry.data, false);\n }\n }","readin () {\n this.content = readFile(this.path);\n }","setContent(content) {\r\n return this.clone(File, \"$value\", false).postCore({\r\n body: content,\r\n headers: {\r\n \"X-HTTP-Method\": \"PUT\",\r\n },\r\n }).then(_ => new File(this));\r\n }","setFileBuffer(fileBuffer) {\n this.fileBuffer = fileBuffer;\n }","setFile(name, file) {\n this.zone[name].clearRecords()\n this.zone[name].fromFile(file)\n return this\n }","setPath(path) {\n this.filePath = path;\n }","setFile(blob, filename) {\n this.props.callSetFile(blob, filename);\n }","apply(contents) {\n this.filePointer.apply(contents);\n return this;\n }","function updateTextFromFile(file) {\n return new Promise((resolve, reject) => {\n var contents_textfield = document.getElementById('contents_textfield');\n readBlobAsText(file).then(text => {\n contents_textfield.value = text;\n resolve();\n }, err => reject(err));\n });\n}","sendFile_() {\n var content = this.file;\n var end = this.file.size;\n\n if (this.offset || this.chunkSize) {\n // Only bother to slice the file if we're either resuming or uploading in chunks\n if (this.chunkSize) {\n end = Math.min(this.offset + this.chunkSize, this.file.size);\n }\n content = content.slice(this.offset, end);\n }\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", this.url, true);\n xhr.setRequestHeader(\"Content-Type\", this.contentType);\n xhr.setRequestHeader(\n \"Content-Range\",\n \"bytes \" + this.offset + \"-\" + (end - 1) + \"/\" + this.file.size\n );\n xhr.setRequestHeader(\"X-Upload-Content-Type\", this.file.type);\n if (xhr.upload) {\n xhr.upload.addEventListener(\"progress\", this.onProgress);\n }\n xhr.onload = this.onContentUploadSuccess_.bind(this);\n xhr.onerror = this.onContentUploadError_.bind(this);\n xhr.send(content);\n }","function contentWrite(file) {\n console.log(\"Writing file contents\");\n\n const fs = require(\"fs\");\n const writeFile = require('when/node').lift(fs.writeFile);\n writeFile(\"tmp/extracted.\" + file.ext, file.binary)\n .then(function (result) {\n console.log(\"Successfully created file\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}","async function updateFile(fileId, content) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"PUT\",\n data: content,\n });\n }","function remoteSetContentAfterOpen(filepathArg) {\n\tvar hasExecuted = false; //closure variable\n\n\tif (!hasExecuted) { //if never executed before (aka if hasExecuted has still the value it was initialized with)\n\t\thasExecuted = true; //set it to true to prevent execution next time\n\t\tfilepath = filepathArg;\n\t\tfs.readFile(filepathArg, function (err, data) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(\"Read failed: \" + err);\n\t\t\t}\n\t\t\tsetContent(data);\n\t\t});\n\t} else {\n\t\tconsole.log(\"remoteSetContentAfterOpen can only be called once to prevent resetting content accidently\")\n\t}\n}","function writeFile(filePath) {\n try {\n fs.writeFile(filePath, file.content, function (error) {\n // ERRO\n if (error) throw error\n // ARQUIVO SALVO\n file.path = filePath\n file.saved = true\n file.name = path.basename(filePath)\n\n mainWindow.webContents.send('set-file', file)\n })\n } catch (e) {\n console.log(e)\n }\n}","setIn(path, value) {\n if (isEmptyPath(path))\n this.contents = value;\n else if (this.contents == null) {\n this.contents = collectionFromPath(this.schema, Array.from(path), value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.setIn(path, value);\n }\n }","async setFile(output, path) {\n const type = Path.extname(path).substring(1);\n const file = Path.join(this.settings.directory, path);\n const mime = this.settings.strict ? this.settings.types[type] : this.settings.types[type] || 'application/octet-stream';\n if (!mime || !Fs.existsSync(file) || !Fs.lstatSync(file).isFile()) {\n response_1.Response.setStatus(output, 404);\n }\n else {\n response_1.Response.setStatus(output, 200);\n response_1.Response.setContent(output, await Util.promisify(Fs.readFile)(file), mime);\n }\n }","async setFile({path, data, contentType, encoding, sensitivity, credentials}) {\n credentials = credentials || this.credentials\n await this.ensureIndexLoaded()\n this.ensurePermission({path, credentials, write: true})\n\n path = u.packKeys(path)\n\n // Generate fileID, store it on the index, set nodetype\n let fileID = u.uuid()\n this.index.setNodeType(path, u.NT_S3REF)\n this.index.setNodeProperty(path, 'fileID', fileID)\n this.index.setDontDelete(path, true)\n \n // Write the file to s3, write the url to the node\n let ref = await this.s3Client.write({key: fileID, body: data, contentType, encoding})\n let attributes = {}\n attributes[path] = ref\n await this.set({attributes, sensitivity})\n return ref\n }","function setcurrentFile(file) {\n\tfs.readdir(path.resolve(__dirname, \"../\", \"asciiArt\"), function (err, items) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t\t// To validate the text file with filename 'file' exists in the folder\n\t\t\tif (\n\t\t\t\titems.find(\n\t\t\t\t\titem => item.replace(\".txt\", \"\") === file || (file.includes(\".txt\") && file === item)\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfs.readFile(\n\t\t\t\t\tpath.resolve(__dirname, \"../\", \"main.json\"),\n\t\t\t\t\t\"utf8\",\n\t\t\t\t\tfunction readFileCallback(err, data) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar obj = JSON.parse(data); //now it is an object\n\t\t\t\t\t\t\tobj.currentFile = file; //add updated file data\n\t\t\t\t\t\t\tvar json = JSON.stringify(obj); //convert it back to string json\n\t\t\t\t\t\t\tfs.writeFile(\n\t\t\t\t\t\t\t\tpath.resolve(__dirname, \"../\", \"main.json\"),\n\t\t\t\t\t\t\t\tjson,\n\t\t\t\t\t\t\t\t\"utf8\",\n\t\t\t\t\t\t\t\tfunction writeFileCallback(err) {\n\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t\tchalk.keyword(\"green\")(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Successfully swapped file to \" + file\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.log(\n\t\t\t\t\tchalk.keyword(\"red\")(\n\t\t\t\t\t\t\"File does not exist, please create a text file matching that name\"\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconsole.log(\"Files: \");\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\"Name: \" +\n\t\t\t\t\t\tchalk.keyword(\"green\")(item.replace(\".txt\", \"\")) +\n\t\t\t\t\t\t\" Filename: \" +\n\t\t\t\t\t\tchalk.keyword(\"green\")(item)\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}","setContents ({ commit }, data) {\n commit(\n 'setContents',\n data\n )\n }","setIn(path, value) {\n if (Collection.isEmptyPath(path)) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = value;\n }\n else if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.setIn(path, value);\n }\n }","function writeFile(file, content) {\n\tvar writer = new java.io.FileWriter(file);\n\twriter.write(content);\n\twriter.close();\n}","function WriteFile(path, contents)\n{\n\t_fs.writeFileSync(path, contents, \"utf8\");\n}","function editFile(file, currentPlayer) {\n\n let fs = require('fs');\n\n // read the given file \n fs.readFile('./public/files/' + file, 'utf-8', function(err, data){\n if (err) throw err;\n \n // change username and password to correct values \n let username = currentPlayer.opponent;\n let password = currentPlayer.opponentPassword; \n\n let user_start = data.indexOf('') + 10;\n let user_end = data.indexOf(' '); \n data = data.replaceBetween(user_start, user_end, username);\n\n let pass_start = data.indexOf('') + 10; \n let pass_end = data.indexOf(' '); \n data = data.replaceBetween(pass_start, pass_end, password);\n // data = data.replace('[USER]', username);\n // data = data.replace('[PASS]', password);\n\n // write/return the new changed file \n fs.writeFile('./public/files/' + file, data, 'utf-8', function (err) {\n if (err) throw err;\n });\n });\n}","function onChangeFile(event) {\n var files = event.target.files;\n readFile(files);\n }","constructor(file) {\n this._file = file\n this.size = file.size\n }","static io_setfile(filename, base64ContentStr, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_setfile({0},{1})\".format(filename, base64ContentStr));\n Database.setfile(filename, base64ContentStr, fcn);\n }","function setData() {\n return through.obj((file, _enc, cb) => {\n file.data = {\n title: 'Greetings!',\n };\n cb(null, file);\n });\n}","function handleFileChange(event) {\n file.current = event.target.files[0];\n }","function changeFile(event){\n const file = event.target.files[0]\n if(file){\n setFile({file})\n }\n }","setToRemoteFile(file, originalFileName = origFileNameDefault) {\n let [ssName, storageService] = getStorageService();\n this._obj.state = remote_file;\n this._obj.location = file;\n this._obj.originalFileName = originalFileName;\n this._obj.ss = ssName;\n }","function read$2(context, file, fileSet, next) {\n var filePath = file.path;\n\n if (file.contents || file.data.unifiedEngineStreamIn) {\n debug$a('Not reading file `%s` with contents', filePath);\n next();\n } else if (stats$7(file).fatal) {\n debug$a('Not reading failed file `%s`', filePath);\n next();\n } else {\n filePath = path$6.resolve(context.cwd, filePath);\n\n debug$a('Reading `%s` in `%s`', filePath, 'utf8');\n fs$6.readFile(filePath, 'utf8', onread);\n }\n\n function onread(error, contents) {\n debug$a('Read `%s` (error: %s)', filePath, error);\n\n file.contents = contents || '';\n\n next(error);\n }\n}","setToLocalFile(filename, originalFileName=null) {\n this._obj.state = local_file;\n this._obj.location = filename;\n this._obj.originalFileName = originalFileName || path.basename(filename);\n }","set(key, value) {\n if (this.contents == null) {\n this.contents = collectionFromPath(this.schema, [key], value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.set(key, value);\n }\n }","setContent(content) {\r\n return this.clone(AttachmentFile, \"$value\", false).postCore({\r\n body: content,\r\n headers: {\r\n \"X-HTTP-Method\": \"PUT\",\r\n },\r\n }).then(_ => new AttachmentFile(this));\r\n }","function writefile(){\n\t\t\tvar txtFile = \"c:/test.txt\";\n\t\t\tvar file = new File([\"\"],txtFile);\n\t\t\tvar str = \"My string of text\";\n\n\t\t\tfile.open(\"w\"); // open file with write access\n\t\t\tfile.writeln(\"First line of text\");\n\t\t\tfile.writeln(\"Second line of text \" + str);\n\t\t\tfile.write(str);\n\t\t\tfile.close();\n\t\t}","function FileSource(file) {\n _classCallCheck$3(this, FileSource);\n this._file = file;\n this.size = file.size;\n }","function File(filepath, html) {\n\n // If html argument has not been set, set to true\n if(html === undefined) html = true;\n\n // File properties\n this.filePath = filepath;\n this.fileName = this.getName();\n this.fileType = this.getType();\n this.fileExtension = this.getExtension();\n this.fileContents = '';\n this.fileContentsArray;\n\n // Read file\n // this.read(this.filePath, function(err, data) {\n // if(html) this.fileContents = replaceAll(data, ['<', '>'], ['<', '>']);\n // this.fileContentsArray = data.split('\\n');\n // }.bind(this));\n this.readSync(this.filePath, html);\n}","open(file) {\n this.file = file;\n this.input = this.file.input;\n this.state = new State();\n this.state.init(this.options, this.file);\n }","function processSelectedFile(filePath, requestingField) {\n $('#' + requestingField).val(filePath).trigger('change');\n}","function readFile(filepath) {\n fs.readFile(filepath, 'utf-8', function (err, data) {\n if (err) {\n alert(\"An error ocurred reading the file :\" + err.message);\n return;\n }\n // Change how to handle the file content\n content = data;\n // console.log(\"The file content is : \" + data);\n document.getElementById(\"content-editor\").value = content;\n });\n}","function openFile(targetWindow, file) {\n\tconst content = fs.readFileSync(file).toString();\n\ttargetWindow.webContents.send('file-opened', file, content);\n}","set store_file(file_or_fullPath) {\n //\n // file_or_fullPath is a Json file\n if (file_or_fullPath) {\n // ignore if already set\n if (this._store === file_or_fullPath) {\n return;\n }\n this._store = file_or_fullPath;\n return;\n }\n //\n // Else file_or_fullPath is a string full_path\n // ignore if already set\n if (this._store.full_path === file_or_fullPath) {\n return;\n }\n this._store = new Json_File({\n full_path: file_or_fullPath,\n });\n }","setEntry(entry) {\n this.stream.writeString(entry.filename);\n this.stream.writeFixedString(entry.method);\n this.stream.writeInt(entry.originalSize);\n this.stream.writeInt(entry.reserved);\n this.stream.writeInt(entry.timestamp);\n this.stream.writeInt(entry.dataSize);\n }","function newFile() {\n\teditor.reset();\n\tpathToFileBeingEdited = undefined;\n\tparse();\n}","function write_file(aFilePath, aContents, aFileMode) {\n var mode = PR_TRUNCATE;\n if (!aFileMode) aFileMode = 0600;\n var outfile = getFileFromPath(aFilePath);\n if (!outfile.exists()) {\n outfile.create(CI.nsIFile.NORMAL_FILE_TYPE, aFileMode);\n }\n var outStream = CC[\"@mozilla.org/network/file-output-stream;1\"]\n .createInstance(CI.nsIFileOutputStream);\n outStream.init(outfile, PR_WRONLY | PR_CREATE_FILE | mode, aFileMode, 0);\n outStream.write(aContents, aContents.length);\n outStream.close();\n}","function openFile(content, fileExtension) {\n var counter = 1;\n var doc = DocumentManager.createUntitledDocument(counter, fileExtension);\n doc.setText(content);\n }","function saveFile(file, contents){\n\t\tlet fs = require('fs');\n\t\tfs.writeFileSync(file, JSON.stringify(contents));\n\t}","function writeFile(host, fileId, contents) {\n var url = host + '/file/' + extensionKey + '/' + fileId;\n return fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'text/plain',\n },\n body: contents,\n });\n}","function readFile(inputFile) {\n var fr = new FileReader();\n fr.onload = function(e) {\n $(\"#hiddenFile\").val(e.target.result);\n };\n fr.readAsText(inputFile);\n}","writeFile(new_file, content) {\n console.log('Writing to ' + new_file);\n fs.writeFile(new_file, content, 'utf8', (err) => {\n if (err)\n return console.log(err);\n });\n }","set(key, value) {\n if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = Collection.collectionFromPath(this.schema, [key], value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.set(key, value);\n }\n }","static init() {\n fs.writeFile(file, '{}');\n }","function bufferContents( file ){\n if (file.isNull()) return; // ignore\n if (file.isStream()) return this.emit( 'error', new PluginError( 'gulp-kss', 'Streaming not supported' ));\n\n if (!firstFile) firstFile = file;\n\n buffer.push(file.contents.toString( 'utf8' ));\n }","updateDataFile() {\n\t\tthis.getDataFile()\n\t\t.then(() => this.getClient());\n\t}","function FileSource(file) {\n _classCallCheck(this, FileSource);\n\n this._file = file;\n this.size = file.size;\n }","changeVersion({ filePath, version, replacingTag }) {\n logger.section(`Set '${version}' as version in ${filePath}`);\n let versionFile = fs.readFileSync(filePath, 'utf-8');\n this.checkReplacingTag({\n filePath,\n replacingTag,\n checkBuildTask: false\n });\n try {\n let newVersionFile = versionFile.replace(replacingTag, version);\n versionFile = newVersionFile;\n fs.writeFileSync(filePath, versionFile, 'utf-8');\n }\n catch (err) {\n logger.error(err);\n }\n }","set(key, val) {\n this.data[key] = val;\n // Wait, I thought using the node.js' synchronous APIs was bad form?\n // We're not writing a server so there's not nearly the same IO demand on the process\n // Also if we used an async API and our app was quit before the asynchronous write had a chance to complete,\n // we might lose that data. Note that in a real app, we would try/catch this.\n fs.writeFileSync(this.path, JSON.stringify(this.data));\n }","getFileContents() {\n for (let entry of this.files) {\n entry.data = this.stream.getFixedString(entry.size);\n }\n }","function File() {\n _classCallCheck(this, File);\n\n File.initialize(this);\n }","set contents(aContents) {\n // If there are already some contents displayed, replace them.\n if (this._target.hasChildNodes()) {\n this._target.replaceChild(aContents, this._target.firstChild);\n return;\n }\n // These are the first contents ever displayed.\n this._target.appendChild(aContents);\n }","set contents(aContents) {\n // If there are already some contents displayed, replace them.\n if (this._target.hasChildNodes()) {\n this._target.replaceChild(aContents, this._target.firstChild);\n return;\n }\n // These are the first contents ever displayed.\n this._target.appendChild(aContents);\n }","function saveFile(file, contents){\n\tlet fs = require('fs');\n\tfs.writeFileSync(file, JSON.stringify(contents));\n}","function templateSet(file, template, header, offset){\r\n\tvar view = new DataView(file.buffer);\r\n\ttemplate.forEach(function(item){\r\n\t\tvar value = item.name ? header[item.name] : item.value;\r\n\t\tvar arg = item.arg===undefined ? true : item.arg;\r\n\t\tview[\"set\"+item.type](item.pos+ +offset,value,arg);\r\n\t});\r\n}","file(path) {\n\t\tif (typeof path !== 'string') {\n\t\t\tthrow new Error('The \"path\" parameter must be a string');\n\t\t}\n\t\t// just reuse the path name as the store name...will be unique\n\t\tthis.reorderFileStores(path);\n\t}","function uploadFile(){\n var fileToLoad = document.getElementById(\"fileToLoad\").files[0];\n\n var fileReader = new FileReader();\n fileReader.onload = function(fileLoadedEvent) \n {\n var textFromFileLoaded = fileLoadedEvent.target.result;\n document.getElementById(\"content\").value = textFromFileLoaded;\n };\n fileReader.readAsText(fileToLoad, \"UTF-8\");\n }","function updateFileInCache(options, filePath, contents, instance) {\n let fileWatcherEventKind;\n // Update file contents\n const key = instance.filePathKeyMapper(filePath);\n let file = instance.files.get(key);\n if (file === undefined) {\n file = instance.otherFiles.get(key);\n if (file !== undefined) {\n if (!(0, utils_1.isReferencedFile)(instance, filePath)) {\n instance.otherFiles.delete(key);\n instance.files.set(key, file);\n instance.changedFilesList = true;\n }\n }\n else {\n if (instance.watchHost !== undefined) {\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;\n }\n file = { fileName: filePath, version: 0 };\n if (!(0, utils_1.isReferencedFile)(instance, filePath)) {\n instance.files.set(key, file);\n instance.changedFilesList = true;\n }\n }\n }\n if (instance.watchHost !== undefined && contents === undefined) {\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted;\n }\n // filePath is a root file as it was passed to the loader. But it\n // could have been found earlier as a dependency of another file. If\n // that is the case, compiling this file changes the structure of\n // the program and we need to increase the instance version.\n //\n // See https://github.com/TypeStrong/ts-loader/issues/943\n if (!(0, utils_1.isReferencedFile)(instance, filePath) &&\n !instance.rootFileNames.has(filePath) &&\n // however, be careful not to add files from node_modules unless\n // it is allowed by the options.\n (options.allowTsInNodeModules || filePath.indexOf('node_modules') === -1)) {\n instance.version++;\n instance.rootFileNames.add(filePath);\n }\n if (file.text !== contents) {\n file.version++;\n file.text = contents;\n file.modifiedTime = new Date();\n instance.version++;\n if (instance.watchHost !== undefined &&\n fileWatcherEventKind === undefined) {\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Changed;\n }\n }\n // Added in case the files were already updated by the watch API\n if (instance.modifiedFiles && instance.modifiedFiles.get(key)) {\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Changed;\n }\n if (instance.watchHost !== undefined && fileWatcherEventKind !== undefined) {\n instance.hasUnaccountedModifiedFiles =\n instance.watchHost.invokeFileWatcher(filePath, fileWatcherEventKind) ||\n instance.hasUnaccountedModifiedFiles;\n }\n // push this file to modified files hash.\n if (!instance.modifiedFiles) {\n instance.modifiedFiles = new Map();\n }\n instance.modifiedFiles.set(key, true);\n return file.version;\n}","function serveFile(sekiResponse, status, file) {\n\tverbosity(\"FILE = \" + file);\n\n\tfs.readFile(file, function(err, data) {\n\t\tif (err) {\n\t\t\tdata = \"Error :\" + err;\n\t\t\tstatus = 500;\n\t\t}\n\t\tsekiResponse.writeHead(status, sekiHeaders); // queryResponse.headers\n\t\tsekiResponse.write(data, 'binary');\n\t\tsekiResponse.end();\n\t});\n}","setDirty(settingsFile, dirty) {\r\n if (!dirty) {\r\n // Remove the settings file from the dirty settings array if present\r\n const index = this.dirtySettings.indexOf(settingsFile);\r\n if (index !== -1)\r\n this.dirtySettings.splice(index, 1);\r\n }\r\n else {\r\n // Add the settings file to the dirty settings array if it isn't in there yet\r\n const index = this.dirtySettings.indexOf(settingsFile);\r\n if (index === -1)\r\n this.dirtySettings.push(settingsFile);\r\n }\r\n }","function setData(fileData) {\n if (Object(fileData) === fileData) {\n var propertyValue;\n\n for (var p in fileData) {\n if (fileData.hasOwnProperty(p)) {\n propertyValue = fileData[p];\n\n switch (p) {\n case \"id\":\n case \"fileId\":\n if (id && propertyValue !== id)\n throw new Error(\"Can't change ID for a FileData object.\");\n\n id = propertyValue;\n break;\n case \"file\":\n this.cloudUrl = propertyValue.url();\n case \"thumbnail\":\n this.cloudThumbnailUrl = propertyValue.url();\n case \"file\":\n case \"thumbnail\":\n this.requireDownload = true;\n break;\n case \"mimeType\":\n if (Object(propertyValue) === propertyValue)\n this.mimeType = propertyValue;\n else\n this.mimeType = FileData.mimeTypes.index[propertyValue];\n\n break;\n default:\n this[p] = propertyValue;\n }\n }\n }\n\n if (this.localUrl === undefined) {\n this.localUrl = null;\n this.localThumbnailUrl = null;\n }\n }\n else if (typeof(fileData) === \"string\") {\n id = fileData;\n this.fillData(id);\n }\n else\n throw new Error(\"Invalid data for FileData, must be either object or string representing the FileData's ID.\");\n }","function update_file(file) {\n var file_button = document.getElementById(\"file-button\");\n document.getElementById(\"filename\").innerHTML = file.name;\n file_button.innerHTML = \"open file\";\n file_button.className = \"mat-button mdc-button mdc-button--raised blue-button\";\n mdc.ripple.MDCRipple.attachTo(file_button);\n opened_file = file;\n}","function writeFile(file, input_stream) {\n var tmpStream = Components.classes[\"@mozilla.org/network/file-output-stream;1\"\n ].createInstance(Components.interfaces.nsIFileOutputStream);\n\n // 0x02 | 0x20 = WRITE_ONLY | TRUNCATE (recommended by the documentation)\n tmpStream.init(file, 0x02 | 0x20, 0666, 0);\n\n var converter = Components.classes[\"@mozilla.org/intl/converter-output-stream;1\"\n ].createInstance(Components.interfaces.nsIConverterOutputStream);\n converter.init(tmpStream, \"UTF-8\", 0, 0);\n\n var chunk_size = 1024;\n while (input_stream.available()) {\n converter.writeString(input_stream.read(chunk_size));\n }\n\n converter.close();\n}","setFileDetector() {}","function writeFile() {\n const ERR_MESS_WRITE = \"TODO: Trouble writing file\";\n\n todocl.dbx.filesUpload({\n contents: todocl.todoText,\n path: todocl.path,\n mode: 'overwrite',\n autorename: false,\n mute: true\n }).then(function (response) {\n\n }).catch(function (error) {\n todocl.dbx.accessToken = null;\n todocl.out.innerHTML = ERR_MESS_WRITE;\n });\n }","setIndexFile() {\n currentFile = this.getCurrentFile();\n if (currentFile === \"\") {\n atom.notifications.addWarning(\"Path of current File not available\", {\n detail: \"Could not set the index file\",\n dismissable: true\n });\n } else {\n atom.config.set('mcide.indexFile', currentFile);\n }\n }","function set_tags(file_name) {\n fetch('articles/' + file_name + '.md')\n .then((res) => res.text())\n .then((text) => {\n process_tags(file_name, text);\n });\n}","function File(stream) {\n this.stream = stream;\n this.closed = false;\n}","function editFile(path) {\n fs.readFile(path, 'utf-8', function (err, data) {\n if (err) {\n log.error(\"Read file error:\" + err);\n } else {\n if (data.indexOf(oldName)) {\n var re = new RegExp(oldName, \"g\");\n if (data.indexOf(oldName) !== -1) {\n fs.writeFile(path, data.replace(re, newName), function (err) {\n if (err) {\n log.error('Modify file failure' + err);\n } else {\n log.info('Modify file success' + path);\n }\n });\n }\n }\n }\n });\n}","function _file (index) {\n\n\t\t\t\tthis.index = index;\n\t\t\t\t// initialize file\n\t\t\t\tthis.status = 1;\n\t\t\t\t// triggle callback list\n\t\t\t\tthis.Events = [];\n\n\t\t\t}","setCurrentFile(absolutePath) {\n this.lastFilePathSet = absolutePath;\n }","function modifyAudio(file){\n document.getElementById('audio').src = file;\n\n}","setFileID(e) {\n this.fileID = e.target.value;\n this.contenBodyId=this.fileDetails[e.target.value+'contenBodyId'];\n this.versionId=this.fileDetails[e.target.value+'versionId'];\n this.fileExtension=this.fileDetails[e.target.value+'fileExtension'];\n this.versionData=this.fileDetails[e.target.value+'versionData'];\n\n }","overwrite(path, content) {\n return this._base.overwrite(this._fullPath(path), content);\n }","overwrite(path, content) {\n return this._base.overwrite(this._fullPath(path), content);\n }","function saveFile(file, contents){\n\tlet fs = require('fs');\n\tlet data = fs.writeFileSync(file, JSON.stringify(contents));\n}","get file () {\n return this._file\n }","_setCache(key, value) {\n this.fileCache[key] = value;\n }","function commentFile(fileID, text) {\n db.updateData('file', { id: fileID }, { $set: { comment: text } })\n}","function loadFile() {\n dialog.showOpenDialog({ filters: [\n { name: 'txt', extensions: ['txt'] },\n ]}, function(filenames) {\n if(filenames === undefined) return;\n var filename = filenames[0];\n readFromFile(editor, filename);\n loadedfs = filename;\n })\n}","function handleFileSelect(evt){\n var f = evt.target.files[0]; // FileList object\n window.reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function(theFile){\n return function(e){\n editor.setData(e.target.result);\n evt.target.value = null; // allow reload\n };\n })(f);\n // Read file as text\n reader.readAsText(f);\n thisDoc = f.name;\n }","_writeFile(filename, contents) {\n const tempFilename = filename + '.tmp.' + Random.id();\n try {\n fs.writeFileSync(tempFilename, contents);\n fs.renameSync(tempFilename, filename);\n } catch (e) {\n this._cacheDebug(e)\n // ignore errors, it's just a cache\n }\n }","set(absPath, payload) {\n if (!this.enabled) {\n return;\n }\n this.cacheStore.set(absPath, payload);\n }","async function reWrite() {\n await writeFile(`${dir}/testFile.txt`, 'Отсыпь кода на забивку');\n const data = String(fs.readFileSync(`${dir}/testFile.txt`));\n const arrayOfFiles = await readDir(dir);\n writeFile(`${dir}/${arrayOfFiles[0]}`, data);\n console.log('File was successfully rewritten');\n}","getFileContent(path: string) {\n fs.readFile(path, 'utf8', (err, data) => {\n this.editorContentCallback(data, path);\n });\n }","function fileSystem$2(context, file, fileSet, next) {\n var destinationPath;\n\n if (!context.output) {\n debug$2('Ignoring writing to file-system');\n return next()\n }\n\n if (!file.data.unifiedEngineGiven) {\n debug$2('Ignoring programmatically added file');\n return next()\n }\n\n destinationPath = file.path;\n\n if (!destinationPath) {\n debug$2('Cannot write file without a `destinationPath`');\n return next(new Error('Cannot write file without an output path'))\n }\n\n if (stats(file).fatal) {\n debug$2('Cannot write file with a fatal error');\n return next()\n }\n\n destinationPath = path$4.resolve(context.cwd, destinationPath);\n debug$2('Writing document to `%s`', destinationPath);\n\n file.stored = true;\n\n fs$4.writeFile(destinationPath, file.toString(), next);\n}","function open_file(file) {\n $('#filebrowser').hide();\n\n \n $('#filename').val(file)\n\n var data = new FormData();\n data.append('filename', file);\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', '/openfile', true);\n xhr.onload = function (event) {\n r = JSON.parse(this.responseText);\n editor.setValue(r.text);\n server_last_modified_time = r.mtime;\n $('#menu_save').addClass('disable');\n };\n xhr.send(data);\n}"],"string":"[\n \"set file(value) { this._file = value; }\",\n \"setFileContent(newValue) {\\n this._fileContent = newValue;\\n }\",\n \"setFile(file) {\\n this.file = file;\\n }\",\n \"set file(value) {\\n this._file = value;\\n this.renderImage();\\n }\",\n \"function setFile(url){\\n\\tfile = url;\\n}\",\n \"setFileContents(files) {\\n for(let entry of files) {\\n this.stream.writeFixedString(entry.data, false);\\n }\\n }\",\n \"readin () {\\n this.content = readFile(this.path);\\n }\",\n \"setContent(content) {\\r\\n return this.clone(File, \\\"$value\\\", false).postCore({\\r\\n body: content,\\r\\n headers: {\\r\\n \\\"X-HTTP-Method\\\": \\\"PUT\\\",\\r\\n },\\r\\n }).then(_ => new File(this));\\r\\n }\",\n \"setFileBuffer(fileBuffer) {\\n this.fileBuffer = fileBuffer;\\n }\",\n \"setFile(name, file) {\\n this.zone[name].clearRecords()\\n this.zone[name].fromFile(file)\\n return this\\n }\",\n \"setPath(path) {\\n this.filePath = path;\\n }\",\n \"setFile(blob, filename) {\\n this.props.callSetFile(blob, filename);\\n }\",\n \"apply(contents) {\\n this.filePointer.apply(contents);\\n return this;\\n }\",\n \"function updateTextFromFile(file) {\\n return new Promise((resolve, reject) => {\\n var contents_textfield = document.getElementById('contents_textfield');\\n readBlobAsText(file).then(text => {\\n contents_textfield.value = text;\\n resolve();\\n }, err => reject(err));\\n });\\n}\",\n \"sendFile_() {\\n var content = this.file;\\n var end = this.file.size;\\n\\n if (this.offset || this.chunkSize) {\\n // Only bother to slice the file if we're either resuming or uploading in chunks\\n if (this.chunkSize) {\\n end = Math.min(this.offset + this.chunkSize, this.file.size);\\n }\\n content = content.slice(this.offset, end);\\n }\\n\\n var xhr = new XMLHttpRequest();\\n xhr.open(\\\"PUT\\\", this.url, true);\\n xhr.setRequestHeader(\\\"Content-Type\\\", this.contentType);\\n xhr.setRequestHeader(\\n \\\"Content-Range\\\",\\n \\\"bytes \\\" + this.offset + \\\"-\\\" + (end - 1) + \\\"/\\\" + this.file.size\\n );\\n xhr.setRequestHeader(\\\"X-Upload-Content-Type\\\", this.file.type);\\n if (xhr.upload) {\\n xhr.upload.addEventListener(\\\"progress\\\", this.onProgress);\\n }\\n xhr.onload = this.onContentUploadSuccess_.bind(this);\\n xhr.onerror = this.onContentUploadError_.bind(this);\\n xhr.send(content);\\n }\",\n \"function contentWrite(file) {\\n console.log(\\\"Writing file contents\\\");\\n\\n const fs = require(\\\"fs\\\");\\n const writeFile = require('when/node').lift(fs.writeFile);\\n writeFile(\\\"tmp/extracted.\\\" + file.ext, file.binary)\\n .then(function (result) {\\n console.log(\\\"Successfully created file\\\");\\n })\\n .catch(function (err) {\\n console.log(err);\\n });\\n}\",\n \"async function updateFile(fileId, content) {\\n return await $.ajax({\\n url: domain + \\\"/file/\\\" + encodeURIComponent(fileId),\\n method: \\\"PUT\\\",\\n data: content,\\n });\\n }\",\n \"function remoteSetContentAfterOpen(filepathArg) {\\n\\tvar hasExecuted = false; //closure variable\\n\\n\\tif (!hasExecuted) { //if never executed before (aka if hasExecuted has still the value it was initialized with)\\n\\t\\thasExecuted = true; //set it to true to prevent execution next time\\n\\t\\tfilepath = filepathArg;\\n\\t\\tfs.readFile(filepathArg, function (err, data) {\\n\\t\\t\\tif (err) {\\n\\t\\t\\t\\tconsole.log(\\\"Read failed: \\\" + err);\\n\\t\\t\\t}\\n\\t\\t\\tsetContent(data);\\n\\t\\t});\\n\\t} else {\\n\\t\\tconsole.log(\\\"remoteSetContentAfterOpen can only be called once to prevent resetting content accidently\\\")\\n\\t}\\n}\",\n \"function writeFile(filePath) {\\n try {\\n fs.writeFile(filePath, file.content, function (error) {\\n // ERRO\\n if (error) throw error\\n // ARQUIVO SALVO\\n file.path = filePath\\n file.saved = true\\n file.name = path.basename(filePath)\\n\\n mainWindow.webContents.send('set-file', file)\\n })\\n } catch (e) {\\n console.log(e)\\n }\\n}\",\n \"setIn(path, value) {\\n if (isEmptyPath(path))\\n this.contents = value;\\n else if (this.contents == null) {\\n this.contents = collectionFromPath(this.schema, Array.from(path), value);\\n }\\n else if (assertCollection(this.contents)) {\\n this.contents.setIn(path, value);\\n }\\n }\",\n \"async setFile(output, path) {\\n const type = Path.extname(path).substring(1);\\n const file = Path.join(this.settings.directory, path);\\n const mime = this.settings.strict ? this.settings.types[type] : this.settings.types[type] || 'application/octet-stream';\\n if (!mime || !Fs.existsSync(file) || !Fs.lstatSync(file).isFile()) {\\n response_1.Response.setStatus(output, 404);\\n }\\n else {\\n response_1.Response.setStatus(output, 200);\\n response_1.Response.setContent(output, await Util.promisify(Fs.readFile)(file), mime);\\n }\\n }\",\n \"async setFile({path, data, contentType, encoding, sensitivity, credentials}) {\\n credentials = credentials || this.credentials\\n await this.ensureIndexLoaded()\\n this.ensurePermission({path, credentials, write: true})\\n\\n path = u.packKeys(path)\\n\\n // Generate fileID, store it on the index, set nodetype\\n let fileID = u.uuid()\\n this.index.setNodeType(path, u.NT_S3REF)\\n this.index.setNodeProperty(path, 'fileID', fileID)\\n this.index.setDontDelete(path, true)\\n \\n // Write the file to s3, write the url to the node\\n let ref = await this.s3Client.write({key: fileID, body: data, contentType, encoding})\\n let attributes = {}\\n attributes[path] = ref\\n await this.set({attributes, sensitivity})\\n return ref\\n }\",\n \"function setcurrentFile(file) {\\n\\tfs.readdir(path.resolve(__dirname, \\\"../\\\", \\\"asciiArt\\\"), function (err, items) {\\n\\t\\tif (err) {\\n\\t\\t\\tconsole.log(err);\\n\\t\\t} else {\\n\\t\\t\\t// To validate the text file with filename 'file' exists in the folder\\n\\t\\t\\tif (\\n\\t\\t\\t\\titems.find(\\n\\t\\t\\t\\t\\titem => item.replace(\\\".txt\\\", \\\"\\\") === file || (file.includes(\\\".txt\\\") && file === item)\\n\\t\\t\\t\\t)\\n\\t\\t\\t) {\\n\\t\\t\\t\\tfs.readFile(\\n\\t\\t\\t\\t\\tpath.resolve(__dirname, \\\"../\\\", \\\"main.json\\\"),\\n\\t\\t\\t\\t\\t\\\"utf8\\\",\\n\\t\\t\\t\\t\\tfunction readFileCallback(err, data) {\\n\\t\\t\\t\\t\\t\\tif (err) {\\n\\t\\t\\t\\t\\t\\t\\tconsole.log(err);\\n\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\tvar obj = JSON.parse(data); //now it is an object\\n\\t\\t\\t\\t\\t\\t\\tobj.currentFile = file; //add updated file data\\n\\t\\t\\t\\t\\t\\t\\tvar json = JSON.stringify(obj); //convert it back to string json\\n\\t\\t\\t\\t\\t\\t\\tfs.writeFile(\\n\\t\\t\\t\\t\\t\\t\\t\\tpath.resolve(__dirname, \\\"../\\\", \\\"main.json\\\"),\\n\\t\\t\\t\\t\\t\\t\\t\\tjson,\\n\\t\\t\\t\\t\\t\\t\\t\\t\\\"utf8\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\tfunction writeFileCallback(err) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tif (err) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tconsole.log(err);\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tconsole.log(\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tchalk.keyword(\\\"green\\\")(\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"Successfully swapped file to \\\" + file\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tconsole.log(\\n\\t\\t\\t\\t\\tchalk.keyword(\\\"red\\\")(\\n\\t\\t\\t\\t\\t\\t\\\"File does not exist, please create a text file matching that name\\\"\\n\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t);\\n\\t\\t\\t\\tconsole.log(\\\"Files: \\\");\\n\\t\\t\\t\\titems.forEach(item => {\\n\\t\\t\\t\\t\\tconsole.log(\\n\\t\\t\\t\\t\\t\\t\\\"Name: \\\" +\\n\\t\\t\\t\\t\\t\\tchalk.keyword(\\\"green\\\")(item.replace(\\\".txt\\\", \\\"\\\")) +\\n\\t\\t\\t\\t\\t\\t\\\" Filename: \\\" +\\n\\t\\t\\t\\t\\t\\tchalk.keyword(\\\"green\\\")(item)\\n\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t}\\n\\t});\\n}\",\n \"setContents ({ commit }, data) {\\n commit(\\n 'setContents',\\n data\\n )\\n }\",\n \"setIn(path, value) {\\n if (Collection.isEmptyPath(path)) {\\n // @ts-expect-error We can't really know that this matches Contents.\\n this.contents = value;\\n }\\n else if (this.contents == null) {\\n // @ts-expect-error We can't really know that this matches Contents.\\n this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);\\n }\\n else if (assertCollection(this.contents)) {\\n this.contents.setIn(path, value);\\n }\\n }\",\n \"function writeFile(file, content) {\\n\\tvar writer = new java.io.FileWriter(file);\\n\\twriter.write(content);\\n\\twriter.close();\\n}\",\n \"function WriteFile(path, contents)\\n{\\n\\t_fs.writeFileSync(path, contents, \\\"utf8\\\");\\n}\",\n \"function editFile(file, currentPlayer) {\\n\\n let fs = require('fs');\\n\\n // read the given file \\n fs.readFile('./public/files/' + file, 'utf-8', function(err, data){\\n if (err) throw err;\\n \\n // change username and password to correct values \\n let username = currentPlayer.opponent;\\n let password = currentPlayer.opponentPassword; \\n\\n let user_start = data.indexOf('') + 10;\\n let user_end = data.indexOf(' '); \\n data = data.replaceBetween(user_start, user_end, username);\\n\\n let pass_start = data.indexOf('') + 10; \\n let pass_end = data.indexOf(' '); \\n data = data.replaceBetween(pass_start, pass_end, password);\\n // data = data.replace('[USER]', username);\\n // data = data.replace('[PASS]', password);\\n\\n // write/return the new changed file \\n fs.writeFile('./public/files/' + file, data, 'utf-8', function (err) {\\n if (err) throw err;\\n });\\n });\\n}\",\n \"function onChangeFile(event) {\\n var files = event.target.files;\\n readFile(files);\\n }\",\n \"constructor(file) {\\n this._file = file\\n this.size = file.size\\n }\",\n \"static io_setfile(filename, base64ContentStr, fcn) {\\n if (window.Settings.enableLog)\\n WebUtils.log(\\\"Web.io_setfile({0},{1})\\\".format(filename, base64ContentStr));\\n Database.setfile(filename, base64ContentStr, fcn);\\n }\",\n \"function setData() {\\n return through.obj((file, _enc, cb) => {\\n file.data = {\\n title: 'Greetings!',\\n };\\n cb(null, file);\\n });\\n}\",\n \"function handleFileChange(event) {\\n file.current = event.target.files[0];\\n }\",\n \"function changeFile(event){\\n const file = event.target.files[0]\\n if(file){\\n setFile({file})\\n }\\n }\",\n \"setToRemoteFile(file, originalFileName = origFileNameDefault) {\\n let [ssName, storageService] = getStorageService();\\n this._obj.state = remote_file;\\n this._obj.location = file;\\n this._obj.originalFileName = originalFileName;\\n this._obj.ss = ssName;\\n }\",\n \"function read$2(context, file, fileSet, next) {\\n var filePath = file.path;\\n\\n if (file.contents || file.data.unifiedEngineStreamIn) {\\n debug$a('Not reading file `%s` with contents', filePath);\\n next();\\n } else if (stats$7(file).fatal) {\\n debug$a('Not reading failed file `%s`', filePath);\\n next();\\n } else {\\n filePath = path$6.resolve(context.cwd, filePath);\\n\\n debug$a('Reading `%s` in `%s`', filePath, 'utf8');\\n fs$6.readFile(filePath, 'utf8', onread);\\n }\\n\\n function onread(error, contents) {\\n debug$a('Read `%s` (error: %s)', filePath, error);\\n\\n file.contents = contents || '';\\n\\n next(error);\\n }\\n}\",\n \"setToLocalFile(filename, originalFileName=null) {\\n this._obj.state = local_file;\\n this._obj.location = filename;\\n this._obj.originalFileName = originalFileName || path.basename(filename);\\n }\",\n \"set(key, value) {\\n if (this.contents == null) {\\n this.contents = collectionFromPath(this.schema, [key], value);\\n }\\n else if (assertCollection(this.contents)) {\\n this.contents.set(key, value);\\n }\\n }\",\n \"setContent(content) {\\r\\n return this.clone(AttachmentFile, \\\"$value\\\", false).postCore({\\r\\n body: content,\\r\\n headers: {\\r\\n \\\"X-HTTP-Method\\\": \\\"PUT\\\",\\r\\n },\\r\\n }).then(_ => new AttachmentFile(this));\\r\\n }\",\n \"function writefile(){\\n\\t\\t\\tvar txtFile = \\\"c:/test.txt\\\";\\n\\t\\t\\tvar file = new File([\\\"\\\"],txtFile);\\n\\t\\t\\tvar str = \\\"My string of text\\\";\\n\\n\\t\\t\\tfile.open(\\\"w\\\"); // open file with write access\\n\\t\\t\\tfile.writeln(\\\"First line of text\\\");\\n\\t\\t\\tfile.writeln(\\\"Second line of text \\\" + str);\\n\\t\\t\\tfile.write(str);\\n\\t\\t\\tfile.close();\\n\\t\\t}\",\n \"function FileSource(file) {\\n _classCallCheck$3(this, FileSource);\\n this._file = file;\\n this.size = file.size;\\n }\",\n \"function File(filepath, html) {\\n\\n // If html argument has not been set, set to true\\n if(html === undefined) html = true;\\n\\n // File properties\\n this.filePath = filepath;\\n this.fileName = this.getName();\\n this.fileType = this.getType();\\n this.fileExtension = this.getExtension();\\n this.fileContents = '';\\n this.fileContentsArray;\\n\\n // Read file\\n // this.read(this.filePath, function(err, data) {\\n // if(html) this.fileContents = replaceAll(data, ['<', '>'], ['<', '>']);\\n // this.fileContentsArray = data.split('\\\\n');\\n // }.bind(this));\\n this.readSync(this.filePath, html);\\n}\",\n \"open(file) {\\n this.file = file;\\n this.input = this.file.input;\\n this.state = new State();\\n this.state.init(this.options, this.file);\\n }\",\n \"function processSelectedFile(filePath, requestingField) {\\n $('#' + requestingField).val(filePath).trigger('change');\\n}\",\n \"function readFile(filepath) {\\n fs.readFile(filepath, 'utf-8', function (err, data) {\\n if (err) {\\n alert(\\\"An error ocurred reading the file :\\\" + err.message);\\n return;\\n }\\n // Change how to handle the file content\\n content = data;\\n // console.log(\\\"The file content is : \\\" + data);\\n document.getElementById(\\\"content-editor\\\").value = content;\\n });\\n}\",\n \"function openFile(targetWindow, file) {\\n\\tconst content = fs.readFileSync(file).toString();\\n\\ttargetWindow.webContents.send('file-opened', file, content);\\n}\",\n \"set store_file(file_or_fullPath) {\\n //\\n // file_or_fullPath is a Json file\\n if (file_or_fullPath) {\\n // ignore if already set\\n if (this._store === file_or_fullPath) {\\n return;\\n }\\n this._store = file_or_fullPath;\\n return;\\n }\\n //\\n // Else file_or_fullPath is a string full_path\\n // ignore if already set\\n if (this._store.full_path === file_or_fullPath) {\\n return;\\n }\\n this._store = new Json_File({\\n full_path: file_or_fullPath,\\n });\\n }\",\n \"setEntry(entry) {\\n this.stream.writeString(entry.filename);\\n this.stream.writeFixedString(entry.method);\\n this.stream.writeInt(entry.originalSize);\\n this.stream.writeInt(entry.reserved);\\n this.stream.writeInt(entry.timestamp);\\n this.stream.writeInt(entry.dataSize);\\n }\",\n \"function newFile() {\\n\\teditor.reset();\\n\\tpathToFileBeingEdited = undefined;\\n\\tparse();\\n}\",\n \"function write_file(aFilePath, aContents, aFileMode) {\\n var mode = PR_TRUNCATE;\\n if (!aFileMode) aFileMode = 0600;\\n var outfile = getFileFromPath(aFilePath);\\n if (!outfile.exists()) {\\n outfile.create(CI.nsIFile.NORMAL_FILE_TYPE, aFileMode);\\n }\\n var outStream = CC[\\\"@mozilla.org/network/file-output-stream;1\\\"]\\n .createInstance(CI.nsIFileOutputStream);\\n outStream.init(outfile, PR_WRONLY | PR_CREATE_FILE | mode, aFileMode, 0);\\n outStream.write(aContents, aContents.length);\\n outStream.close();\\n}\",\n \"function openFile(content, fileExtension) {\\n var counter = 1;\\n var doc = DocumentManager.createUntitledDocument(counter, fileExtension);\\n doc.setText(content);\\n }\",\n \"function saveFile(file, contents){\\n\\t\\tlet fs = require('fs');\\n\\t\\tfs.writeFileSync(file, JSON.stringify(contents));\\n\\t}\",\n \"function writeFile(host, fileId, contents) {\\n var url = host + '/file/' + extensionKey + '/' + fileId;\\n return fetch(url, {\\n method: 'POST',\\n headers: {\\n 'Content-Type': 'text/plain',\\n },\\n body: contents,\\n });\\n}\",\n \"function readFile(inputFile) {\\n var fr = new FileReader();\\n fr.onload = function(e) {\\n $(\\\"#hiddenFile\\\").val(e.target.result);\\n };\\n fr.readAsText(inputFile);\\n}\",\n \"writeFile(new_file, content) {\\n console.log('Writing to ' + new_file);\\n fs.writeFile(new_file, content, 'utf8', (err) => {\\n if (err)\\n return console.log(err);\\n });\\n }\",\n \"set(key, value) {\\n if (this.contents == null) {\\n // @ts-expect-error We can't really know that this matches Contents.\\n this.contents = Collection.collectionFromPath(this.schema, [key], value);\\n }\\n else if (assertCollection(this.contents)) {\\n this.contents.set(key, value);\\n }\\n }\",\n \"static init() {\\n fs.writeFile(file, '{}');\\n }\",\n \"function bufferContents( file ){\\n if (file.isNull()) return; // ignore\\n if (file.isStream()) return this.emit( 'error', new PluginError( 'gulp-kss', 'Streaming not supported' ));\\n\\n if (!firstFile) firstFile = file;\\n\\n buffer.push(file.contents.toString( 'utf8' ));\\n }\",\n \"updateDataFile() {\\n\\t\\tthis.getDataFile()\\n\\t\\t.then(() => this.getClient());\\n\\t}\",\n \"function FileSource(file) {\\n _classCallCheck(this, FileSource);\\n\\n this._file = file;\\n this.size = file.size;\\n }\",\n \"changeVersion({ filePath, version, replacingTag }) {\\n logger.section(`Set '${version}' as version in ${filePath}`);\\n let versionFile = fs.readFileSync(filePath, 'utf-8');\\n this.checkReplacingTag({\\n filePath,\\n replacingTag,\\n checkBuildTask: false\\n });\\n try {\\n let newVersionFile = versionFile.replace(replacingTag, version);\\n versionFile = newVersionFile;\\n fs.writeFileSync(filePath, versionFile, 'utf-8');\\n }\\n catch (err) {\\n logger.error(err);\\n }\\n }\",\n \"set(key, val) {\\n this.data[key] = val;\\n // Wait, I thought using the node.js' synchronous APIs was bad form?\\n // We're not writing a server so there's not nearly the same IO demand on the process\\n // Also if we used an async API and our app was quit before the asynchronous write had a chance to complete,\\n // we might lose that data. Note that in a real app, we would try/catch this.\\n fs.writeFileSync(this.path, JSON.stringify(this.data));\\n }\",\n \"getFileContents() {\\n for (let entry of this.files) {\\n entry.data = this.stream.getFixedString(entry.size);\\n }\\n }\",\n \"function File() {\\n _classCallCheck(this, File);\\n\\n File.initialize(this);\\n }\",\n \"set contents(aContents) {\\n // If there are already some contents displayed, replace them.\\n if (this._target.hasChildNodes()) {\\n this._target.replaceChild(aContents, this._target.firstChild);\\n return;\\n }\\n // These are the first contents ever displayed.\\n this._target.appendChild(aContents);\\n }\",\n \"set contents(aContents) {\\n // If there are already some contents displayed, replace them.\\n if (this._target.hasChildNodes()) {\\n this._target.replaceChild(aContents, this._target.firstChild);\\n return;\\n }\\n // These are the first contents ever displayed.\\n this._target.appendChild(aContents);\\n }\",\n \"function saveFile(file, contents){\\n\\tlet fs = require('fs');\\n\\tfs.writeFileSync(file, JSON.stringify(contents));\\n}\",\n \"function templateSet(file, template, header, offset){\\r\\n\\tvar view = new DataView(file.buffer);\\r\\n\\ttemplate.forEach(function(item){\\r\\n\\t\\tvar value = item.name ? header[item.name] : item.value;\\r\\n\\t\\tvar arg = item.arg===undefined ? true : item.arg;\\r\\n\\t\\tview[\\\"set\\\"+item.type](item.pos+ +offset,value,arg);\\r\\n\\t});\\r\\n}\",\n \"file(path) {\\n\\t\\tif (typeof path !== 'string') {\\n\\t\\t\\tthrow new Error('The \\\"path\\\" parameter must be a string');\\n\\t\\t}\\n\\t\\t// just reuse the path name as the store name...will be unique\\n\\t\\tthis.reorderFileStores(path);\\n\\t}\",\n \"function uploadFile(){\\n var fileToLoad = document.getElementById(\\\"fileToLoad\\\").files[0];\\n\\n var fileReader = new FileReader();\\n fileReader.onload = function(fileLoadedEvent) \\n {\\n var textFromFileLoaded = fileLoadedEvent.target.result;\\n document.getElementById(\\\"content\\\").value = textFromFileLoaded;\\n };\\n fileReader.readAsText(fileToLoad, \\\"UTF-8\\\");\\n }\",\n \"function updateFileInCache(options, filePath, contents, instance) {\\n let fileWatcherEventKind;\\n // Update file contents\\n const key = instance.filePathKeyMapper(filePath);\\n let file = instance.files.get(key);\\n if (file === undefined) {\\n file = instance.otherFiles.get(key);\\n if (file !== undefined) {\\n if (!(0, utils_1.isReferencedFile)(instance, filePath)) {\\n instance.otherFiles.delete(key);\\n instance.files.set(key, file);\\n instance.changedFilesList = true;\\n }\\n }\\n else {\\n if (instance.watchHost !== undefined) {\\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;\\n }\\n file = { fileName: filePath, version: 0 };\\n if (!(0, utils_1.isReferencedFile)(instance, filePath)) {\\n instance.files.set(key, file);\\n instance.changedFilesList = true;\\n }\\n }\\n }\\n if (instance.watchHost !== undefined && contents === undefined) {\\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted;\\n }\\n // filePath is a root file as it was passed to the loader. But it\\n // could have been found earlier as a dependency of another file. If\\n // that is the case, compiling this file changes the structure of\\n // the program and we need to increase the instance version.\\n //\\n // See https://github.com/TypeStrong/ts-loader/issues/943\\n if (!(0, utils_1.isReferencedFile)(instance, filePath) &&\\n !instance.rootFileNames.has(filePath) &&\\n // however, be careful not to add files from node_modules unless\\n // it is allowed by the options.\\n (options.allowTsInNodeModules || filePath.indexOf('node_modules') === -1)) {\\n instance.version++;\\n instance.rootFileNames.add(filePath);\\n }\\n if (file.text !== contents) {\\n file.version++;\\n file.text = contents;\\n file.modifiedTime = new Date();\\n instance.version++;\\n if (instance.watchHost !== undefined &&\\n fileWatcherEventKind === undefined) {\\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Changed;\\n }\\n }\\n // Added in case the files were already updated by the watch API\\n if (instance.modifiedFiles && instance.modifiedFiles.get(key)) {\\n fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Changed;\\n }\\n if (instance.watchHost !== undefined && fileWatcherEventKind !== undefined) {\\n instance.hasUnaccountedModifiedFiles =\\n instance.watchHost.invokeFileWatcher(filePath, fileWatcherEventKind) ||\\n instance.hasUnaccountedModifiedFiles;\\n }\\n // push this file to modified files hash.\\n if (!instance.modifiedFiles) {\\n instance.modifiedFiles = new Map();\\n }\\n instance.modifiedFiles.set(key, true);\\n return file.version;\\n}\",\n \"function serveFile(sekiResponse, status, file) {\\n\\tverbosity(\\\"FILE = \\\" + file);\\n\\n\\tfs.readFile(file, function(err, data) {\\n\\t\\tif (err) {\\n\\t\\t\\tdata = \\\"Error :\\\" + err;\\n\\t\\t\\tstatus = 500;\\n\\t\\t}\\n\\t\\tsekiResponse.writeHead(status, sekiHeaders); // queryResponse.headers\\n\\t\\tsekiResponse.write(data, 'binary');\\n\\t\\tsekiResponse.end();\\n\\t});\\n}\",\n \"setDirty(settingsFile, dirty) {\\r\\n if (!dirty) {\\r\\n // Remove the settings file from the dirty settings array if present\\r\\n const index = this.dirtySettings.indexOf(settingsFile);\\r\\n if (index !== -1)\\r\\n this.dirtySettings.splice(index, 1);\\r\\n }\\r\\n else {\\r\\n // Add the settings file to the dirty settings array if it isn't in there yet\\r\\n const index = this.dirtySettings.indexOf(settingsFile);\\r\\n if (index === -1)\\r\\n this.dirtySettings.push(settingsFile);\\r\\n }\\r\\n }\",\n \"function setData(fileData) {\\n if (Object(fileData) === fileData) {\\n var propertyValue;\\n\\n for (var p in fileData) {\\n if (fileData.hasOwnProperty(p)) {\\n propertyValue = fileData[p];\\n\\n switch (p) {\\n case \\\"id\\\":\\n case \\\"fileId\\\":\\n if (id && propertyValue !== id)\\n throw new Error(\\\"Can't change ID for a FileData object.\\\");\\n\\n id = propertyValue;\\n break;\\n case \\\"file\\\":\\n this.cloudUrl = propertyValue.url();\\n case \\\"thumbnail\\\":\\n this.cloudThumbnailUrl = propertyValue.url();\\n case \\\"file\\\":\\n case \\\"thumbnail\\\":\\n this.requireDownload = true;\\n break;\\n case \\\"mimeType\\\":\\n if (Object(propertyValue) === propertyValue)\\n this.mimeType = propertyValue;\\n else\\n this.mimeType = FileData.mimeTypes.index[propertyValue];\\n\\n break;\\n default:\\n this[p] = propertyValue;\\n }\\n }\\n }\\n\\n if (this.localUrl === undefined) {\\n this.localUrl = null;\\n this.localThumbnailUrl = null;\\n }\\n }\\n else if (typeof(fileData) === \\\"string\\\") {\\n id = fileData;\\n this.fillData(id);\\n }\\n else\\n throw new Error(\\\"Invalid data for FileData, must be either object or string representing the FileData's ID.\\\");\\n }\",\n \"function update_file(file) {\\n var file_button = document.getElementById(\\\"file-button\\\");\\n document.getElementById(\\\"filename\\\").innerHTML = file.name;\\n file_button.innerHTML = \\\"open file\\\";\\n file_button.className = \\\"mat-button mdc-button mdc-button--raised blue-button\\\";\\n mdc.ripple.MDCRipple.attachTo(file_button);\\n opened_file = file;\\n}\",\n \"function writeFile(file, input_stream) {\\n var tmpStream = Components.classes[\\\"@mozilla.org/network/file-output-stream;1\\\"\\n ].createInstance(Components.interfaces.nsIFileOutputStream);\\n\\n // 0x02 | 0x20 = WRITE_ONLY | TRUNCATE (recommended by the documentation)\\n tmpStream.init(file, 0x02 | 0x20, 0666, 0);\\n\\n var converter = Components.classes[\\\"@mozilla.org/intl/converter-output-stream;1\\\"\\n ].createInstance(Components.interfaces.nsIConverterOutputStream);\\n converter.init(tmpStream, \\\"UTF-8\\\", 0, 0);\\n\\n var chunk_size = 1024;\\n while (input_stream.available()) {\\n converter.writeString(input_stream.read(chunk_size));\\n }\\n\\n converter.close();\\n}\",\n \"setFileDetector() {}\",\n \"function writeFile() {\\n const ERR_MESS_WRITE = \\\"TODO: Trouble writing file\\\";\\n\\n todocl.dbx.filesUpload({\\n contents: todocl.todoText,\\n path: todocl.path,\\n mode: 'overwrite',\\n autorename: false,\\n mute: true\\n }).then(function (response) {\\n\\n }).catch(function (error) {\\n todocl.dbx.accessToken = null;\\n todocl.out.innerHTML = ERR_MESS_WRITE;\\n });\\n }\",\n \"setIndexFile() {\\n currentFile = this.getCurrentFile();\\n if (currentFile === \\\"\\\") {\\n atom.notifications.addWarning(\\\"Path of current File not available\\\", {\\n detail: \\\"Could not set the index file\\\",\\n dismissable: true\\n });\\n } else {\\n atom.config.set('mcide.indexFile', currentFile);\\n }\\n }\",\n \"function set_tags(file_name) {\\n fetch('articles/' + file_name + '.md')\\n .then((res) => res.text())\\n .then((text) => {\\n process_tags(file_name, text);\\n });\\n}\",\n \"function File(stream) {\\n this.stream = stream;\\n this.closed = false;\\n}\",\n \"function editFile(path) {\\n fs.readFile(path, 'utf-8', function (err, data) {\\n if (err) {\\n log.error(\\\"Read file error:\\\" + err);\\n } else {\\n if (data.indexOf(oldName)) {\\n var re = new RegExp(oldName, \\\"g\\\");\\n if (data.indexOf(oldName) !== -1) {\\n fs.writeFile(path, data.replace(re, newName), function (err) {\\n if (err) {\\n log.error('Modify file failure' + err);\\n } else {\\n log.info('Modify file success' + path);\\n }\\n });\\n }\\n }\\n }\\n });\\n}\",\n \"function _file (index) {\\n\\n\\t\\t\\t\\tthis.index = index;\\n\\t\\t\\t\\t// initialize file\\n\\t\\t\\t\\tthis.status = 1;\\n\\t\\t\\t\\t// triggle callback list\\n\\t\\t\\t\\tthis.Events = [];\\n\\n\\t\\t\\t}\",\n \"setCurrentFile(absolutePath) {\\n this.lastFilePathSet = absolutePath;\\n }\",\n \"function modifyAudio(file){\\n document.getElementById('audio').src = file;\\n\\n}\",\n \"setFileID(e) {\\n this.fileID = e.target.value;\\n this.contenBodyId=this.fileDetails[e.target.value+'contenBodyId'];\\n this.versionId=this.fileDetails[e.target.value+'versionId'];\\n this.fileExtension=this.fileDetails[e.target.value+'fileExtension'];\\n this.versionData=this.fileDetails[e.target.value+'versionData'];\\n\\n }\",\n \"overwrite(path, content) {\\n return this._base.overwrite(this._fullPath(path), content);\\n }\",\n \"overwrite(path, content) {\\n return this._base.overwrite(this._fullPath(path), content);\\n }\",\n \"function saveFile(file, contents){\\n\\tlet fs = require('fs');\\n\\tlet data = fs.writeFileSync(file, JSON.stringify(contents));\\n}\",\n \"get file () {\\n return this._file\\n }\",\n \"_setCache(key, value) {\\n this.fileCache[key] = value;\\n }\",\n \"function commentFile(fileID, text) {\\n db.updateData('file', { id: fileID }, { $set: { comment: text } })\\n}\",\n \"function loadFile() {\\n dialog.showOpenDialog({ filters: [\\n { name: 'txt', extensions: ['txt'] },\\n ]}, function(filenames) {\\n if(filenames === undefined) return;\\n var filename = filenames[0];\\n readFromFile(editor, filename);\\n loadedfs = filename;\\n })\\n}\",\n \"function handleFileSelect(evt){\\n var f = evt.target.files[0]; // FileList object\\n window.reader = new FileReader();\\n // Closure to capture the file information.\\n reader.onload = (function(theFile){\\n return function(e){\\n editor.setData(e.target.result);\\n evt.target.value = null; // allow reload\\n };\\n })(f);\\n // Read file as text\\n reader.readAsText(f);\\n thisDoc = f.name;\\n }\",\n \"_writeFile(filename, contents) {\\n const tempFilename = filename + '.tmp.' + Random.id();\\n try {\\n fs.writeFileSync(tempFilename, contents);\\n fs.renameSync(tempFilename, filename);\\n } catch (e) {\\n this._cacheDebug(e)\\n // ignore errors, it's just a cache\\n }\\n }\",\n \"set(absPath, payload) {\\n if (!this.enabled) {\\n return;\\n }\\n this.cacheStore.set(absPath, payload);\\n }\",\n \"async function reWrite() {\\n await writeFile(`${dir}/testFile.txt`, 'Отсыпь кода на забивку');\\n const data = String(fs.readFileSync(`${dir}/testFile.txt`));\\n const arrayOfFiles = await readDir(dir);\\n writeFile(`${dir}/${arrayOfFiles[0]}`, data);\\n console.log('File was successfully rewritten');\\n}\",\n \"getFileContent(path: string) {\\n fs.readFile(path, 'utf8', (err, data) => {\\n this.editorContentCallback(data, path);\\n });\\n }\",\n \"function fileSystem$2(context, file, fileSet, next) {\\n var destinationPath;\\n\\n if (!context.output) {\\n debug$2('Ignoring writing to file-system');\\n return next()\\n }\\n\\n if (!file.data.unifiedEngineGiven) {\\n debug$2('Ignoring programmatically added file');\\n return next()\\n }\\n\\n destinationPath = file.path;\\n\\n if (!destinationPath) {\\n debug$2('Cannot write file without a `destinationPath`');\\n return next(new Error('Cannot write file without an output path'))\\n }\\n\\n if (stats(file).fatal) {\\n debug$2('Cannot write file with a fatal error');\\n return next()\\n }\\n\\n destinationPath = path$4.resolve(context.cwd, destinationPath);\\n debug$2('Writing document to `%s`', destinationPath);\\n\\n file.stored = true;\\n\\n fs$4.writeFile(destinationPath, file.toString(), next);\\n}\",\n \"function open_file(file) {\\n $('#filebrowser').hide();\\n\\n \\n $('#filename').val(file)\\n\\n var data = new FormData();\\n data.append('filename', file);\\n\\n var xhr = new XMLHttpRequest();\\n xhr.open('POST', '/openfile', true);\\n xhr.onload = function (event) {\\n r = JSON.parse(this.responseText);\\n editor.setValue(r.text);\\n server_last_modified_time = r.mtime;\\n $('#menu_save').addClass('disable');\\n };\\n xhr.send(data);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.710111","0.69011784","0.67491597","0.60025394","0.5962338","0.5741352","0.5706499","0.5573751","0.5539292","0.54850197","0.5431247","0.5369234","0.529847","0.52593386","0.52385753","0.52270186","0.5182997","0.51553184","0.5150205","0.5150192","0.5131616","0.5095263","0.50907236","0.50887966","0.5081817","0.50754184","0.50679797","0.50407845","0.5022877","0.5013733","0.50105727","0.49887577","0.49883553","0.4982263","0.49808902","0.4960887","0.48950803","0.48886147","0.48729482","0.4848164","0.47992563","0.47829646","0.47738042","0.47544822","0.4716563","0.47113279","0.47049308","0.47044766","0.4680367","0.4671702","0.46636772","0.46617684","0.46545836","0.46507695","0.463516","0.4626422","0.46097434","0.46082935","0.46073","0.46044776","0.45865366","0.45849755","0.4582347","0.45712766","0.4570726","0.4570726","0.4567422","0.4560231","0.4554833","0.4553282","0.45454997","0.45416006","0.45151326","0.45135763","0.44979268","0.4481399","0.44770327","0.4476252","0.44762057","0.44757077","0.4472594","0.4472505","0.4469521","0.44543606","0.44523638","0.44505647","0.4442079","0.4442079","0.44417506","0.44361278","0.44351968","0.44337642","0.44225973","0.4420068","0.4413787","0.44063243","0.4405162","0.44021073","0.4398593","0.4398551"],"string":"[\n \"0.710111\",\n \"0.69011784\",\n \"0.67491597\",\n \"0.60025394\",\n \"0.5962338\",\n \"0.5741352\",\n \"0.5706499\",\n \"0.5573751\",\n \"0.5539292\",\n \"0.54850197\",\n \"0.5431247\",\n \"0.5369234\",\n \"0.529847\",\n \"0.52593386\",\n \"0.52385753\",\n \"0.52270186\",\n \"0.5182997\",\n \"0.51553184\",\n \"0.5150205\",\n \"0.5150192\",\n \"0.5131616\",\n \"0.5095263\",\n \"0.50907236\",\n \"0.50887966\",\n \"0.5081817\",\n \"0.50754184\",\n \"0.50679797\",\n \"0.50407845\",\n \"0.5022877\",\n \"0.5013733\",\n \"0.50105727\",\n \"0.49887577\",\n \"0.49883553\",\n \"0.4982263\",\n \"0.49808902\",\n \"0.4960887\",\n \"0.48950803\",\n \"0.48886147\",\n \"0.48729482\",\n \"0.4848164\",\n \"0.47992563\",\n \"0.47829646\",\n \"0.47738042\",\n \"0.47544822\",\n \"0.4716563\",\n \"0.47113279\",\n \"0.47049308\",\n \"0.47044766\",\n \"0.4680367\",\n \"0.4671702\",\n \"0.46636772\",\n \"0.46617684\",\n \"0.46545836\",\n \"0.46507695\",\n \"0.463516\",\n \"0.4626422\",\n \"0.46097434\",\n \"0.46082935\",\n \"0.46073\",\n \"0.46044776\",\n \"0.45865366\",\n \"0.45849755\",\n \"0.4582347\",\n \"0.45712766\",\n \"0.4570726\",\n \"0.4570726\",\n \"0.4567422\",\n \"0.4560231\",\n \"0.4554833\",\n \"0.4553282\",\n \"0.45454997\",\n \"0.45416006\",\n \"0.45151326\",\n \"0.45135763\",\n \"0.44979268\",\n \"0.4481399\",\n \"0.44770327\",\n \"0.4476252\",\n \"0.44762057\",\n \"0.44757077\",\n \"0.4472594\",\n \"0.4472505\",\n \"0.4469521\",\n \"0.44543606\",\n \"0.44523638\",\n \"0.44505647\",\n \"0.4442079\",\n \"0.4442079\",\n \"0.44417506\",\n \"0.44361278\",\n \"0.44351968\",\n \"0.44337642\",\n \"0.44225973\",\n \"0.4420068\",\n \"0.4413787\",\n \"0.44063243\",\n \"0.4405162\",\n \"0.44021073\",\n \"0.4398593\",\n \"0.4398551\"\n]"},"document_score":{"kind":"string","value":"0.5394224"},"document_rank":{"kind":"string","value":"11"}}},{"rowIdx":557,"cells":{"query":{"kind":"string","value":"Returns an array of all the file paths currently in the virtual folder."},"document":{"kind":"string","value":"getAllPaths() {\n return Object.keys(this[FILES]);\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function getAllFilePaths() {\n \n //holds all the file paths being tracked by storyteller\n var allFilePaths = [];\n \n //go through each file/dir mapping\n for(var filePath in pathToIdMap) {\n if(pathToIdMap.hasOwnProperty(filePath)) {\n \n //if the file exists in the allFiles collection we know it is a file\n if(allFiles[getIdFromFilePath(filePath)]) {\n allFilePaths.push(filePath); \n }\n }\n }\n \n return allFilePaths;\n}","getFilePaths(dirPath){\n return new Promise( (resolve, reject) => {\n this.fspath.paths(dirPath, function(err, paths) {\n if (err) reject(err);\n resolve(paths);\n })\n })\n }","function getPaths() {\n try {\n return require.cache ? Object.keys(require.cache) : [];\n }\n catch (e) {\n return [];\n }\n}","function pathNames() {\n return getPathNames(urlBase.pathname);\n }","getLocalResourceRoots() {\n const localResourceRoots = [];\n const workspaceFolder = vscode_1.workspace.getWorkspaceFolder(this.uri);\n if (workspaceFolder) {\n localResourceRoots.push(workspaceFolder.uri);\n }\n else if (!this.uri.scheme || this.uri.scheme === 'file') {\n localResourceRoots.push(vscode_1.Uri.file(path.dirname(this.uri.fsPath)));\n }\n // add vega preview js scripts\n localResourceRoots.push(vscode_1.Uri.file(path.join(this._extensionPath, 'scripts')));\n this._logger.logMessage(logger_1.LogLevel.Debug, 'getLocalResourceRoots():', localResourceRoots);\n return localResourceRoots;\n }","getFiles() {\n const {\n files\n } = this.getState();\n return Object.values(files);\n }","function getCurrentFilenames(dirPath) { \n let files = []\n // console.log(`Current files in: ${dirPath}`); \n fs.readdirSync(dirPath).forEach(file => { \n // console.log(\" \" + file);\n files.push(file)\n });\n return files\n}","getAllFiles() {\n return this.cache.getOrAdd('getAllFiles', () => {\n let result = [];\n let dependencies = this.dependencyGraph.getAllDependencies(this.dependencyGraphKey);\n for (let dependency of dependencies) {\n //load components by their name\n if (dependency.startsWith('component:')) {\n let comp = this.program.getComponent(dependency.replace(/$component:/, ''));\n if (comp) {\n result.push(comp.file);\n }\n }\n else {\n let file = this.program.getFile(dependency);\n if (file) {\n result.push(file);\n }\n }\n }\n this.logDebug('getAllFiles', () => result.map(x => x.pkgPath));\n return result;\n });\n }","getOwnFiles() {\n //source scope only inherits files from global, so just return all files. This function mostly exists to assist XmlScope\n return this.getAllFiles();\n }","getFiles() {\n if (this._files) {\n return this._files;\n }\n this._files = glob.sync(`${this._changesPath}/**/*.json`);\n return this._files || [];\n }","listFileNames(path) {\n return fs_1.readdirSync(path) || [];\n }","function listFiles()\r\n{\r\n\tvar f = fso.GetFolder(curdir);\r\n\r\n\tfor(var fc = new Enumerator(f.Files);!fc.atEnd();fc.moveNext()){\r\n\t\t//\tIs this a good idea? making all file Paths relative to the FusionEngine directory?\r\n\t\tstats( relativeFilename(fc.item().Path) );\t\t\r\n\t}\r\n}","function readFilePaths(files) {\n const locations = [];\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const location = path.join(__dirname, \"../../../\", file);\n locations.push(location);\n }\n return locations;\n }","function getRouteFilePaths(){\n return new Promise(\n (resolve, reject)=>{\n const controllerPath = path.join(__dirname, '..', 'controller')\n dir.files(controllerPath, (err, filePathArray)=>{\n if(err){\n return reject(err)\n }\n //console.log(filePathArray)\n resolve(filePathArray)\n });\n });\n}","function pathNames() {\n return getPathNames(urlBase.pathname);\n }","function extractVueFiles(folderPath) {\n let results = [];\n fs.readdirSync(folderPath).forEach((pathName) => {\n const computedPath = path.join(folderPath, pathName);\n const stat = fs.statSync(computedPath);\n if (stat && stat.isDirectory()) {\n results = results.concat(extractVueFiles(computedPath));\n } else if (path.extname(computedPath).toLowerCase() === '.vue') {\n results.push(computedPath);\n }\n });\n return results;\n}","function files() {\n _throwIfNotInitialized();\n return props.files;\n}","uris() {\n return this.files.keys();\n }","files() {\n return [];\n }","getFiles() {\n let files = this.state.cursor().get( 'files' )\n return files\n ? files.toList()\n : null\n }","async getAllFilesOfLocalDirectoryRecursively(path){\n try{\n const items = await fs.promises.readdir(path).then(async data => {\n let files = [];\n for(let item of data){\n const isItemDir = await fs.promises.stat(`${path}/${item}`).then(stats => {return stats.isDirectory()}).catch(error => {return false;});\n if(isItemDir){\n const filesOfCurrentDir = await this.getAllFilesOfLocalDirectoryRecursively(`${path}/${item}`);\n files = [...files, ...filesOfCurrentDir];\n }else{\n files.push(`${path}/${item}`);\n }\n }\n\n return files;\n }).catch(error => {\n return [];\n });\n\n return items;\n }catch(error){ Logger.log(error); }\n\n return [];\n }","async getDependentPaths() {\n return [];\n }","function getAllDirPaths() {\n\t\t\n //holds all the dir paths being tracked by storyteller\n var allDirPaths = [];\n \n //go through each file/dir mapping\n for(var dirPath in pathToIdMap) {\n if(pathToIdMap.hasOwnProperty(dirPath)) {\n \n //if the dir exists in the allDirs collection we know it is a dir\n if(allDirs[getIdFromDirPath(dirPath)]) {\n allDirPaths.push(dirPath); \n }\n }\n }\n \n return allDirPaths;\n}","function getArrSelectedFiles(){\r\n\t\t\r\n\t\tvar arrFiles = [];\r\n\t\tvar arrItems = getArrSelectedItems();\r\n\t\t\r\n\t\tjQuery.each(arrItems, function(index, item){\r\n\t\t\tarrFiles.push(item.file);\r\n\t\t});\r\n\t\t\r\n\t\treturn(arrFiles);\r\n\t}","getFiles() { throw new Error('Should be overridden in subclass.') }","function readFiles() {\n return fs.readdirAsync(pathPrevDir);\n}","async function listFiles ({\n dir,\n gitdir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(dir, '.git'),\n fs: _fs\n}) {\n const fs = new FileSystem(_fs);\n let filenames;\n await GitIndexManager.acquire(\n { fs, filepath: `${gitdir}/index` },\n async function (index) {\n filenames = index.entries.map(x => x.path);\n }\n );\n return filenames\n}","getFileNames() {\n return this._fileNames;\n }","configFiles() {\n return this.storeId ? this.getConfigFiles(this.storeId) : [];\n }","_listing(path) {\n\t\tconst statResult = new Promise((resolve, reject) => {\n\t\t\tfs.readdir(path, (error, fileList) => {\n\t\t\t\tresolve(fileList);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t});\n\t\treturn statResult;\n\t}","getPathNames() {\n return Object.keys(paths)\n }","get files() {\n return this._files;\n }","function readDir_getPaths(folder_path) {\n\treturn new Promise((resolve,reject) => {\n\t\tfs.readdir(folder_path, (err,files) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\tresolve(JSON.stringify(files.map(file_name => folder_path + \"/\" + file_name)));\n\t\t\t}\n\t\t})\n\t})\n}","toArray() {\r\n return this._paths.slice(0);\r\n }","readdirCached() {\n const children = this.children();\n return children.slice(0, children.provisional);\n }","GetAllScenePaths() {}","function listFiles() {\n\t\n\t// git log --grep=hourly --name-only --pretty=\"format:\" --reverse --oneline | grep log\n\texec('cd ' + repoPath + ' && git log --grep=hourly --name-only --pretty=\"format:\" --reverse --oneline | grep log', function(err, stdout, stderr) {\n\t\tif (err || stderr)\n\t\t\tthrow err\n\t\telse {\n\t\t\t\n\t\t\tfiles = stdout.split('\\n').map(path => path.replace('data', 'data/raw'))\n\t\t\t\n\t\t\t//remove the last two invalid entry from the array\n\t\t\tfiles.pop()\n\t\t\t\n\t\t\t\n\t\t\tprogressScale.domain([0, files.length-1])\n\t\t\tconsole.log('files', files.length)\n\t\t\t//~console.log('last files', files[files.length-2])\n\t\t\t//~console.log('last files', files[files.length-1])\n\t\t\t\n\t\t\tconsole.log('...all files identified')\t\t\t\n\n\t\t\tnext()\n\t\t}\n\t})\n\t\n}","function walkFolderCollect()\n\t\t{\n\t\t\tfunction collect(element)\n\t\t\t{\n\t\t\t\tpaths.push(element.path);\n\t\t\t}\n\n\t\t\tvar paths = [];\n\t\t\tUtils.walkFolder('{user}', collect);\n\t\t\tlist(paths)\n\t\t}","function getFiles(srcpath) {\r\n return fs.readdirSync(srcpath);\r\n}","function getListFiles() {\n console.log(this);\n return true;\n }","async function getPathsToWatch(siteDir) {\n const context = await server_1.loadContext(siteDir);\n const pluginConfigs = server_1.loadPluginConfigs(context);\n const plugins = await init_1.default({\n pluginConfigs,\n context,\n });\n return lodash_1.flatten(plugins.map((plugin) => { var _a, _b; return (_b = (_a = plugin === null || plugin === void 0 ? void 0 : plugin.getPathsToWatch) === null || _a === void 0 ? void 0 : _a.call(plugin)) !== null && _b !== void 0 ? _b : []; }));\n}","function getSrcFiles () {\n return Object.keys(this._.CHANGEMAP);\n}","function getFiles(pattern) {\n const reportFiles = [];\n shelljs_shell.ls(pattern).forEach(function (file) {\n core.debug('file: ' + file);\n reportFiles.push(`${getWorkspaceDir()}/${file}`);\n });\n return reportFiles;\n}","function getRealPaths(startPath) {\n // Check each folder in the wikis folder to see if it has a\n // tiddlywiki.info file\n let realFolders = [];\n try {\n const folderContents = fs.readdirSync(startPath);\n folderContents.forEach(function (item) {\n const fullName = path.join(startPath, item);\n if(fs.statSync(fullName).isDirectory()) {\n if($tw.ServerSide.wikiExists(fullName)) {\n realFolders.push(fullName);\n }\n // Check if there are subfolders that contain wikis and recurse\n const nextPath = path.join(startPath,item)\n if(fs.statSync(nextPath).isDirectory()) {\n realFolders = realFolders.concat(getRealPaths(nextPath));\n }\n }\n })\n } catch (e) {\n $tw.Bob.logger.log('Error getting wiki paths', e, {level:1});\n }\n return realFolders;\n }","function refresh_asset_paths()\n{\n\t function walk(dir, done) {\n\t\tvar results = [];\n\t\ttry\n\t\t{\n\t\t\tvar list = fs.readdirSync(dir);\n\t\t\tvar i = 0;\n\n\t\t\t(function next() {\n\t\t\t var file = list[i++];\n\t\t\t if (!file) return done(null, results);\n\t\t\t file = dir + '/' + file;\n\t\t\t fs.stat(file, function(err, stat) {\n\t\t\t if (stat && stat.isDirectory()) {\n\t\t\t walk(file, function(err, res) {\n\t\t\t results = results.concat(res);\n\t\t\t next();\n\t\t\t });\n\t\t\t } else {\n\t\t\t results.push(file.replace('\\\\', '/').replace('static/', ''));\n\t\t\t next();\n\t\t\t }\n\t\t\t });\n\t\t\t})();\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tconsole.error('Could not walk ' + dir + ' ' + e);\n\t\t}\n\t};\n\n\tasset_paths = [];\n\twalk('static/voxels', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/imgs', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/sounds', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/shaders', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/meshes', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n}","getLookupPaths() {\n return this.lookups.map(lookup => lookup.path.path());\n }","static getRecentFiles(evt){\n let filePaths = FolderData.recentFilePaths;\n IpcResponder.respond(evt, \"files-recent\", {filePaths});\n }","function getDirFiles(theDirectory){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readdir(theDirectory, function (err, files) {\n if (err) {\n resolve([])\n }\n resolve(files);\n });\n }\n catch (error) {\n resolve([])\n }\n }));\n\n \n\n \n\n}","getFiles() {\n return Resource.find({})\n }","getTexFilesList() {\n return fs.listSync(this.projectPath, [\".tex\"]);\n }","function _getFileList(folder, callback) {\n var files = [];\n \n klaw(folder)\n .on('data', function(item) {\n if (item.stats.isFile() && isAllowed(item.path))\n files.push(item.path);\n })\n .on('end', function() {\n callback(files);\n });\n}","function getFileList(path) {\n\tvar paths = fs.readdirSync(path);\n\tvar files = [];\n\tvar stats, item, i;\n\n\t// sort files from directories\n\tfor (i = paths.length - 1; i >= 0; i--) {\n\t\titem = paths[i];\n\n\t\tif (item.charAt(0) == '.') return [];\n\n\t\titem = path + '/' + item;\n\n\t\ttry {\n\t\t\tstats = fs.statSync(item);\n\n\t\t\t// files or directories\n\t\t\tif ( ! stats.isDirectory() ) files.push(item);\n\t\t\telse files = files.concat(getFileList(item));\n\t\t}\n\t\tcatch (e) {\n\t\t\tconsole.log('GetSmartJS: Couldn\\'t find path:', item);\n\t\t}\n\t}\n\n\treturn files;\n}","getFileList(path, dir) {\n if (!path) {\n return [];\n }\n\n let files = [];\n this.formatKeys.forEach(\n function(key) {\n this.getExtensionsFromKey(key).forEach(function(extension) {\n files.push((dir ? dir + \"/\" : \"\") + path + \".\" + extension);\n });\n }.bind(this)\n );\n\n return files;\n }","getFilesSync(pathToContent, recursive = false) {\n let files = [];\n if (recursive !== false) recursive = this.toBoolean(recursive);\n\n if (!this.is(pathToContent, String)) return files;\n pathToContent = path.normalize(pathToContent);\n\n if (this.isFileSync(pathToContent)) {\n files.push(pathToContent);\n } else if (this.isDirectorySync(pathToContent)) {\n const contents = fs.readdirSync(pathToContent, 'utf8');\n for(let content of contents) {\n const contentPath = path.join(pathToContent, content);\n if (this.isFileSync(contentPath)) files.push(contentPath);\n else if (recursive && this.isDirectorySync(contentPath)) files = [...files, ...this.getFilesSync(contentPath, recursive)];\n }\n } else {\n console.error(`${colors.red('safe-regex-cli error: no such file or directory \"' + pathToContent + '\".')}`);\n }\n return files;\n }","function walk(folder){\n var filenames=[];\n // get relative filenames from folder\n var folderContent=fs.readdirSync(folder);\n // iterate over the folder content to handle nested folders\n _.each(folderContent,function(filename){\n // build absolute filename\n var absoluteFilename=folder+path.sep+filename;\n // get file stats\n var stat=fs.statSync(absoluteFilename);\n if(stat.isDirectory()){\n // directory case => add filenames fetched from recursive call\n filenames=filenames.concat(walk(absoluteFilename));\n }\n else{\n // file case => simply add it\n filenames.push(absoluteFilename);\n }\n });\n return filenames;\n }","getFolderItems(folderPath) {\r\n return new Promise(function (resolve, reject) {\r\n fs.readdir(folderPath, function (err, items) {\r\n if (err) {\r\n return reject(err);\r\n }\r\n var results = [];\r\n items.forEach(item => {\r\n try {\r\n results.push(new FileInfo_1.FileInfo(path.join(folderPath, item)));\r\n }\r\n catch (err) {\r\n // silently ignore permissions errors\r\n }\r\n });\r\n resolve(results);\r\n });\r\n });\r\n }","async function folderList () {\n return bucket.getFiles({\n // TODO: changing frequency may break this?\n maxResults: 365 * 24 / config.get('archiver.frequency'),\n delimiter: '/',\n }).then((data) => {\n const response = data[2];\n return response.prefixes.map(val => val.replace(/\\//, ''));\n });\n}","function GetPagesList()\n{\n var list = []; // Initialise array\n var files = fs.readdirSync(\"pages\"); // Node JS sync List files in folder.\n for (var i = 0; i < files.length; i++)\n {\n list[i] = []; // Initialise array item into 2D Array\n list[i][0] = files[i]; //filename\n list[i][1] = files[i].replace(/\\.[^\\.]*$/,''); //pagename\n }\n return list;\n}","async readdir() {\n if (!this.canReaddir()) {\n return [];\n }\n const children = this.children();\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional);\n }\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath();\n if (this.#asyncReaddirInFlight) {\n await this.#asyncReaddirInFlight;\n }\n else {\n /* c8 ignore start */\n let resolve = () => { };\n /* c8 ignore stop */\n this.#asyncReaddirInFlight = new Promise(res => (resolve = res));\n try {\n for (const e of await this.#fs.promises.readdir(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children);\n }\n this.#readdirSuccess(children);\n }\n catch (er) {\n this.#readdirFail(er.code);\n children.provisional = 0;\n }\n this.#asyncReaddirInFlight = undefined;\n resolve();\n }\n return children.slice(0, children.provisional);\n }","function getFilePaths(funcs) {\n return new BbPromise(function(resolve, reject) {\n var paths = [];\n\n if (funcs && (funcs.length > 0)) {\n funcs.forEach(function(val, idx) {\n paths.push(testFilePath(val));\n });\n return resolve(paths);\n }\n // No funcs provided, list all test files\n fs.readdirSync(testFolder).filter(function(file){\n // Only keep the .js files\n return file.substr(-3) === '.js';\n }).forEach(function(file) {\n paths.push(path.join(testFolder, file));\n });\n return resolve(paths);\n });\n }","function getAllPages() {\n var filepath = getCurrentPath();\n console.log('file path: ', filepath);\n htmlFiles = fs.readdirSync(filepath)\n .filter(function (file) {\n return file.includes('.html');\n }).map(function (file) {\n var correctPath = pathLib.resolve(filepath, file);\n if (correctPath == undefined) {\n pagesToImageObjs('current path is undefined', null);\n }\n return {\n file: file,\n contents: fs.readFileSync(correctPath, 'utf8')\n };\n });\n return htmlFiles;\n}","async _fileList() {\n return (await readFile('list.txt', {\n encoding: 'utf-8'\n })).trim().split('\\n');\n }","static listaArquivos(dirPath) {\n return new Promise((resolve, reject)=> {\n try {\n fs.readdir(dirPath, (err, files) => {\n if (err) {\n reject(err);\n } else {\n resolve(files);\n }\n });\n } catch (err) {\n reject(err);\n }\n });\n }","function getFileList(entryPoint, context) {\n let entryFiles = [];\n if (typeof entryPoint === \"string\") {\n // If path is string use as is\n entryFiles.push(path.resolve(context, entryPoint));\n }\n else {\n // Else exclude paths with node_modules\n // (webpack-dev-server files, prepended to entry files in the array)\n const filteredPaths = entryPoint.filter(entryPath => !entryPath.includes('node_modules'));\n filteredPaths.forEach(entryPath => {\n entryFiles.push(path.resolve(context, entryPath));\n });\n }\n return entryFiles;\n}","listDir(path) {\n return backend.listDir(path);\n }","function getAllFilenames() {\n return fs.readdirAsync(articlesPath).filter(function(filename) {\n return !testIfDirectory(filename);\n });\n}","async readdir (filepath) {\n try {\n return await this._readdir(filepath)\n } catch (err) {\n return []\n }\n }","function file_cache_list() {\n\t\tconsole.log(Object.keys(wkof.file_cache.dir).sort().join('\\n'));\n\t}","getFileExplorers() {\n return this.app.workspace.getLeavesOfType('file-explorer');\n }","function _getFilesInFolder(dir) {\n var results = [];\n fs.readdirSync(dir).forEach(function(file) {\n file_dir = dir+'/'+file;\n var stat = fs.statSync(file_dir);\n if (stat && stat.isDirectory()) {\n results = results.concat(_getAllFilesFromFolder(file_dir));\n } else results.push(file);\n\n });\n return results;\n}","function ls( path ) {\n return _readdir( path );\n}","function listDataFiles() {\n try {\n return fsPromises.readdir(DATA_DIRECTORY);\n } catch (err) {\n console.error('Error occured while reading directory!', err);\n }\n}","scanAppDir() {\n return glob.sync(path.resolve(this.app.appPath, '**'), {\n nodir: true,\n });\n }","getFiles() {\n recursive(this.path, (err, files) => {\n for(var i in files) {\n var f = files[i];\n var stat = fs.statSync(f);\n\n if(stat.isFile()) {\n var basename = path.basename(f);\n var masks = [/^script\\.js$/, /^style\\.css$/, /^styles\\.css$/, /^.*\\.less$/];\n // if(basename == 'script.js' || basename == 'style.css' || basename == 'styles.css') {\n if( this.checkMask(basename, masks) ) {\n if(! this.files.includes(f)) {\n this.files.push(f);\n\n // if file has`t compressed copy make it\n if(! this.isFileCompressed(f)) {\n this.compressFile(f);\n }\n\n this.watcher(f);\n }\n }\n }\n }\n });\n }","static getFiles(path){\n\t\treturn (context, source) => {\n\t\t\tif (source == undefined) source=null;\n\t\t\tvar fs = context.createProvider(\"default:fs\");\n\t\t\tvar res = Lib.getFiles(fs, path);\n\t\t\tif (source == null){\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn source.concat(res);\n\t\t}\n\t}","function getFiles (absolutePath){\n var fileArray = [];\n var directoryArray = [absolutePath];\n return readDirectory(fileArray, directoryArray);\n}","function getFilesData(pathToFile) {\n findFilesData(pathToFile);\n var tempFiles = filesData;\n filesData = [];\n return tempFiles;\n}","loadFiles(){\n if(this.paths.length == 0)\n throw 'Set one or more paths.';\n\n for(var i in this.paths){\n var fc = new this.fc(this.paths[i]);\n\n var file_array = fc.getFiles();\n\n for(var i in file_array){\n /**\n * Ignore double files.\n */\n if(!this.files.includes(file_array[i])){\n this.files.push(file_array[i]);\n }\n }\n }\n }","items() {\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n const directories = this.$store.getters.getSelectedDirectoryDirectories\n // Sort by type and alphabetically\n .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))\n .filter((dir) => dir.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));\n\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n const files = this.$store.getters.getSelectedDirectoryFiles\n // Sort by type and alphabetically\n .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))\n .filter((file) => file.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));\n\n return [...directories, ...files];\n }","readdir(dirpath) {\n return RNFS.readDir(dirpath)\n .then(files => {\n return files.map(file => file.name);\n });\n }","getDevFilesToCopy () {\n const filesToCopy = [`${settings.paths.dev.root}/**/*`]\n const ignore = [\n settings.paths.dev.js,\n settings.paths.dev.css\n ]\n\n ignore.forEach((ignoreValue) => {\n filesToCopy.push(`!${ignoreValue}`, `!${ignoreValue}/**`)\n })\n\n return filesToCopy\n }","function findFiles(auth, dir) {\n let query = \"?q='\" + dir + \"'+in+parents\"\n let headers = {\n \"Authorization\": \"Bearer \" + auth.credentials.access_token\n }\n\n let url = DRIVE_URL + query\n\n return axios({ url, headers }).then( res => {\n\n if ( !res.data.files ) throw new Error('folder not found')\n\n return res.data.files\n })\n}","function findConfigfiles (root) {\n ['app/index.html', 'app/run.js'].reduce(function(configFiles, file) {\n if(path.exists(file)) configFiles.push(file)\n return configFiles;\n }, []);\n }","get RenderPaths() {}","function iterate(currentPath)\n{\n\tvar folders = [],\n\t\tfiles = [],\n\t\tmain = null;\n\t\n\tcurrentPath = path.resolve(currentPath);\n\t\n\tfs.readdirSync(currentPath).forEach(function(file)\n\t{\n\t\tvar item = path.normalize(path.join(currentPath, file));\n\t\t\n\t\tif(file == \"lib\")\n\t\t\tArray.prototype.unshift.apply(folders, iterate(item));\n\t\telse if(file == \"main.js\")\n\t\t\tmain = item;\n\t\telse if(fs.lstatSync(item).isDirectory())\n\t\t\tArray.prototype.push.apply(folders, iterate(item));\n\t\telse\n\t\t\tfiles.push(item);\n\t});\n\t\n\tif(main)\n\t\tfiles.push(main);\n\t\n\tArray.prototype.push.apply(folders, files);\n\t\n\treturn folders;\n}","getAllMyFiles (scrpt_id) {\n\t\t\tthis.$axios.get('api/getAllMyFiles/'+scrpt_id).then(res => {\n\t\t\t\tthis.docFileArr = res.data.doc_file;\n\t\t\t\tthis.allFigFiles = res.data.fig_files;\n\t\t\t});\n\t\t}","function walkSyncJS(dir) {\n let files = fs.readdirSync(dir);\n let filelist = [];\n files.forEach(function(file) {\n let fullPath = path.join(dir, file);\n if (fs.statSync(fullPath).isDirectory()) {\n filelist = filelist.concat(walkSyncJS(fullPath));\n } else if(file.endsWith('.js')) {\n filelist.push(fullPath);\n }\n });\n\n return filelist;\n}","getAssetRoots() {\n return [__dirname];\n }","function getFiles(callback) {\n var directory = '../public/blog';\n var walk = require('walk'), fs = require('fs'), options, walker;\n var walker = walk.walk('./public/blog', {followLinks: false});\n\n var fs = [];\n\n walker.on(\"file\", function (root, file, next) {\n var fileDir = \"public/blog\";\n var f = root + \"/\" + file['name'].substring(0, file['name'].lastIndexOf('.'));\n\n if (f.toLowerCase() != (\"./\" + fileDir + '/').toLowerCase()) {\n var localUrl = f;\n var date = f.replace(\"./public/blog/\", \"\").replace(new RegExp('/', 'g'), \":\");\n var name = date.substring(date.lastIndexOf(':') + 1, date.length);\n date = date.substring(0, date.lastIndexOf(':')).replace(new RegExp(':', 'g'), \"-\");\n\n // push without /blog prefix\n if (name.length > 0 && date.length > 0)\n fs.push({url: f.substring(f.indexOf('/')), date: date, name: name, localUrl: localUrl});\n }\n next();\n });\n\n walker.on(\"end\", function () {\n callback(fs);\n });\n }","function getPDFFilesFromCurFolder() {\n var files = folder.getFiles();\n var allFileNameUrls = [];\n\n while (files.hasNext()) {\n var file = files.next();\n\n var fileName = file.getName();\n if(fileName.endsWith(\".pdf\") && !fileName.includes(\"_protected\")){\n // Create Pre-Signed URL from PDF.co\n var respPresignedUrl = getPDFcoPreSignedURL(fileName)\n\n if(!respPresignedUrl.error){\n var fileData = file.getBlob();\n if(uploadFileToPresignedURL(respPresignedUrl.presignedUrl, fileData)){\n // Add Url\n allFileNameUrls.push({url: respPresignedUrl.url, fileName: fileName});\n }\n }\n }\n }\n\n return allFileNameUrls;\n}","async listComponentsWithTrackDir() {\n if (this.consumer.isLegacy) return [];\n const workspaceComponents = await this.getFromFileSystem(_constants().COMPONENT_ORIGINS.AUTHORED);\n return workspaceComponents.filter(component => {\n const componentMap = component.componentMap;\n if (!componentMap) throw new Error('listComponentsWithIndividualFiles componentMap is missing');\n return Boolean(componentMap.trackDir);\n });\n }","getPaths () {\n if (this._paths) {\n return this._paths\n }\n\n const paths = []\n\n let proto = this\n\n // 1. should has a own property `configFileName`\n // 2. this.configFileName should be a string\n // 3. has a own property `nodePath` or not\n\n // Loop back for the prototype chain\n while (proto) {\n proto = Object.getPrototypeOf(proto)\n\n // There is no caviar.config.js in caviar,\n // So just stop\n if (proto === ConfigLoader.prototype) {\n break\n }\n\n if (!hasOwnProperty(proto, 'configFile')) {\n throw error('CONFIG_FILE_GETTER_REQUIRED')\n }\n\n const {\n configFile\n } = proto\n\n if (!isString(configFile)) {\n throw error('INVALID_CONFIG_FILE', configFile)\n }\n\n const nodePath = hasOwnProperty(proto, 'nodePath')\n ? checkNodePath(proto.nodePath)\n : UNDEFINED\n\n paths.push({\n nodePath: nodePath && realNodePath(nodePath),\n configFile: realConfigFile(configFile)\n })\n }\n\n log('config-loader: paths: %s', inspect(paths))\n\n return this._paths = paths\n }","dirList (path) {\n const dirPaths = []\n const collectList = (path) => {\n return new Promise((resolve, reject) => {\n this.readdir(path).then((ls) => {\n const promises = Object.keys(ls).map((item, index) => {\n if (ls[item].isDirectory && !dirPaths.includes(item)) {\n dirPaths.push(item)\n resolve(dirPaths)\n }\n return new Promise((resolve, reject) => { resolve() })\n })\n Promise.all(promises).then(() => { resolve(dirPaths) })\n })\n })\n }\n return collectList(path)\n }","function getRecipeList(){\n var recipe_files = [];\n //passsing directoryPath and callback function\n fs.readdir(__dirname + '/data', function (err, files) {\n //handling error\n if (err) {\n return console.log('Unable to scan directory: ' + err);\n } \n //listing all files using forEach\n files.forEach(function (file) {\n // Do whatever you want to do with the file\n console.log(file);\n recipe_files.push(file);\n });\n });\n\n return recipe_files;\n}","static async GetFileNames(){\n\t\tvar returnMe = [];\n\t\t//get all file names using async \n\t\t_retrieveKeys = async () => {\n\t\t\ttry {\n\t\t\t\tconst value = await AsyncStorage.getAllKeys();\n\t\t\t\tif (value !== null) {\n\t\t\t\t\tfor(fileNumber in value){\n\t\t\t\t\t\t//whats the filename according to our filesystem\n\t\t\t\t\t\tvar fileName = value[fileNumber];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//return all filenames that ARENT \"GlobalData\"\n\t\t\t\t\t\tif(fileName != \"GlobalData\"){\n\t\t\t\t\t\t\treturnMe.push(value[fileNumber]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturnMe.sort(this.sortFileNames);\n\t\t\t\t}\n\t\t\t\treturn returnMe;\n\t\t\t\t\n\t\t\t} catch (error) {\n\t\t\t\t// Error saving data\n\t\t\t\talert(error);\n\t\t\t}\n\t\t}\n\t\t \n\t\t return _retrieveKeys();\n\t}","function filesInDir(dir) {\n return Q.nfcall(fs.readdir, dir).catch(() => []);\n}","function getViews () {\n\t\t// grunt.log.writeln('Getting views:');\n\t\t// use fs to read the views folder; fs.readdirSync()\n\t\tvar views = fs.readdirSync(getViewsDir())\n\t\t\t// filter to only select other dirs and not files\n\t\t\t.filter(function(name){\n\t\t\t\treturn grunt.file.isDir(getViewsDir() + name);\n\t\t\t});\n\t\t// grunt.log.writeln('/********');\n\t\t// grunt.log.writeln(' * Views:');\n\t\t// views.forEach(function(name) {\n\t\t// \tgrunt.log.writeln(' * - ' + name);\n\t\t// });\n\t\t// grunt.log.writeln('********/');\n\t\t// grunt.log.writeln('');\n\t\treturn views;\n\t}","async listComponentsWithIndividualFiles() {\n if (this.consumer.isLegacy) return [];\n const workspaceComponents = await this.getFromFileSystem(_constants().COMPONENT_ORIGINS.AUTHORED);\n return workspaceComponents.filter(component => {\n const componentMap = component.componentMap;\n if (!componentMap) throw new Error('listComponentsWithIndividualFiles componentMap is missing');\n return Boolean(!componentMap.trackDir && !componentMap.rootDir);\n });\n }","function getAllPaths() {\n let pathList = [];\n let pathNodes = $(\"svg[id='svg']\").find(\"path\");\n $.each(pathNodes, (key, Node) => {\n pathList.push({\n name: Node.getAttribute(\"id\"),\n data: Node.getAttribute(\"d\")\n });\n });\n return pathList;\n}","getAllBranches() {\n this.checkInit();\n\n return this.cfgObj.getFileNames();\n }"],"string":"[\n \"function getAllFilePaths() {\\n \\n //holds all the file paths being tracked by storyteller\\n var allFilePaths = [];\\n \\n //go through each file/dir mapping\\n for(var filePath in pathToIdMap) {\\n if(pathToIdMap.hasOwnProperty(filePath)) {\\n \\n //if the file exists in the allFiles collection we know it is a file\\n if(allFiles[getIdFromFilePath(filePath)]) {\\n allFilePaths.push(filePath); \\n }\\n }\\n }\\n \\n return allFilePaths;\\n}\",\n \"getFilePaths(dirPath){\\n return new Promise( (resolve, reject) => {\\n this.fspath.paths(dirPath, function(err, paths) {\\n if (err) reject(err);\\n resolve(paths);\\n })\\n })\\n }\",\n \"function getPaths() {\\n try {\\n return require.cache ? Object.keys(require.cache) : [];\\n }\\n catch (e) {\\n return [];\\n }\\n}\",\n \"function pathNames() {\\n return getPathNames(urlBase.pathname);\\n }\",\n \"getLocalResourceRoots() {\\n const localResourceRoots = [];\\n const workspaceFolder = vscode_1.workspace.getWorkspaceFolder(this.uri);\\n if (workspaceFolder) {\\n localResourceRoots.push(workspaceFolder.uri);\\n }\\n else if (!this.uri.scheme || this.uri.scheme === 'file') {\\n localResourceRoots.push(vscode_1.Uri.file(path.dirname(this.uri.fsPath)));\\n }\\n // add vega preview js scripts\\n localResourceRoots.push(vscode_1.Uri.file(path.join(this._extensionPath, 'scripts')));\\n this._logger.logMessage(logger_1.LogLevel.Debug, 'getLocalResourceRoots():', localResourceRoots);\\n return localResourceRoots;\\n }\",\n \"getFiles() {\\n const {\\n files\\n } = this.getState();\\n return Object.values(files);\\n }\",\n \"function getCurrentFilenames(dirPath) { \\n let files = []\\n // console.log(`Current files in: ${dirPath}`); \\n fs.readdirSync(dirPath).forEach(file => { \\n // console.log(\\\" \\\" + file);\\n files.push(file)\\n });\\n return files\\n}\",\n \"getAllFiles() {\\n return this.cache.getOrAdd('getAllFiles', () => {\\n let result = [];\\n let dependencies = this.dependencyGraph.getAllDependencies(this.dependencyGraphKey);\\n for (let dependency of dependencies) {\\n //load components by their name\\n if (dependency.startsWith('component:')) {\\n let comp = this.program.getComponent(dependency.replace(/$component:/, ''));\\n if (comp) {\\n result.push(comp.file);\\n }\\n }\\n else {\\n let file = this.program.getFile(dependency);\\n if (file) {\\n result.push(file);\\n }\\n }\\n }\\n this.logDebug('getAllFiles', () => result.map(x => x.pkgPath));\\n return result;\\n });\\n }\",\n \"getOwnFiles() {\\n //source scope only inherits files from global, so just return all files. This function mostly exists to assist XmlScope\\n return this.getAllFiles();\\n }\",\n \"getFiles() {\\n if (this._files) {\\n return this._files;\\n }\\n this._files = glob.sync(`${this._changesPath}/**/*.json`);\\n return this._files || [];\\n }\",\n \"listFileNames(path) {\\n return fs_1.readdirSync(path) || [];\\n }\",\n \"function listFiles()\\r\\n{\\r\\n\\tvar f = fso.GetFolder(curdir);\\r\\n\\r\\n\\tfor(var fc = new Enumerator(f.Files);!fc.atEnd();fc.moveNext()){\\r\\n\\t\\t//\\tIs this a good idea? making all file Paths relative to the FusionEngine directory?\\r\\n\\t\\tstats( relativeFilename(fc.item().Path) );\\t\\t\\r\\n\\t}\\r\\n}\",\n \"function readFilePaths(files) {\\n const locations = [];\\n for (let i = 0; i < files.length; i++) {\\n const file = files[i];\\n const location = path.join(__dirname, \\\"../../../\\\", file);\\n locations.push(location);\\n }\\n return locations;\\n }\",\n \"function getRouteFilePaths(){\\n return new Promise(\\n (resolve, reject)=>{\\n const controllerPath = path.join(__dirname, '..', 'controller')\\n dir.files(controllerPath, (err, filePathArray)=>{\\n if(err){\\n return reject(err)\\n }\\n //console.log(filePathArray)\\n resolve(filePathArray)\\n });\\n });\\n}\",\n \"function pathNames() {\\n return getPathNames(urlBase.pathname);\\n }\",\n \"function extractVueFiles(folderPath) {\\n let results = [];\\n fs.readdirSync(folderPath).forEach((pathName) => {\\n const computedPath = path.join(folderPath, pathName);\\n const stat = fs.statSync(computedPath);\\n if (stat && stat.isDirectory()) {\\n results = results.concat(extractVueFiles(computedPath));\\n } else if (path.extname(computedPath).toLowerCase() === '.vue') {\\n results.push(computedPath);\\n }\\n });\\n return results;\\n}\",\n \"function files() {\\n _throwIfNotInitialized();\\n return props.files;\\n}\",\n \"uris() {\\n return this.files.keys();\\n }\",\n \"files() {\\n return [];\\n }\",\n \"getFiles() {\\n let files = this.state.cursor().get( 'files' )\\n return files\\n ? files.toList()\\n : null\\n }\",\n \"async getAllFilesOfLocalDirectoryRecursively(path){\\n try{\\n const items = await fs.promises.readdir(path).then(async data => {\\n let files = [];\\n for(let item of data){\\n const isItemDir = await fs.promises.stat(`${path}/${item}`).then(stats => {return stats.isDirectory()}).catch(error => {return false;});\\n if(isItemDir){\\n const filesOfCurrentDir = await this.getAllFilesOfLocalDirectoryRecursively(`${path}/${item}`);\\n files = [...files, ...filesOfCurrentDir];\\n }else{\\n files.push(`${path}/${item}`);\\n }\\n }\\n\\n return files;\\n }).catch(error => {\\n return [];\\n });\\n\\n return items;\\n }catch(error){ Logger.log(error); }\\n\\n return [];\\n }\",\n \"async getDependentPaths() {\\n return [];\\n }\",\n \"function getAllDirPaths() {\\n\\t\\t\\n //holds all the dir paths being tracked by storyteller\\n var allDirPaths = [];\\n \\n //go through each file/dir mapping\\n for(var dirPath in pathToIdMap) {\\n if(pathToIdMap.hasOwnProperty(dirPath)) {\\n \\n //if the dir exists in the allDirs collection we know it is a dir\\n if(allDirs[getIdFromDirPath(dirPath)]) {\\n allDirPaths.push(dirPath); \\n }\\n }\\n }\\n \\n return allDirPaths;\\n}\",\n \"function getArrSelectedFiles(){\\r\\n\\t\\t\\r\\n\\t\\tvar arrFiles = [];\\r\\n\\t\\tvar arrItems = getArrSelectedItems();\\r\\n\\t\\t\\r\\n\\t\\tjQuery.each(arrItems, function(index, item){\\r\\n\\t\\t\\tarrFiles.push(item.file);\\r\\n\\t\\t});\\r\\n\\t\\t\\r\\n\\t\\treturn(arrFiles);\\r\\n\\t}\",\n \"getFiles() { throw new Error('Should be overridden in subclass.') }\",\n \"function readFiles() {\\n return fs.readdirAsync(pathPrevDir);\\n}\",\n \"async function listFiles ({\\n dir,\\n gitdir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(dir, '.git'),\\n fs: _fs\\n}) {\\n const fs = new FileSystem(_fs);\\n let filenames;\\n await GitIndexManager.acquire(\\n { fs, filepath: `${gitdir}/index` },\\n async function (index) {\\n filenames = index.entries.map(x => x.path);\\n }\\n );\\n return filenames\\n}\",\n \"getFileNames() {\\n return this._fileNames;\\n }\",\n \"configFiles() {\\n return this.storeId ? this.getConfigFiles(this.storeId) : [];\\n }\",\n \"_listing(path) {\\n\\t\\tconst statResult = new Promise((resolve, reject) => {\\n\\t\\t\\tfs.readdir(path, (error, fileList) => {\\n\\t\\t\\t\\tresolve(fileList);\\n\\t\\t\\t\\treject(error);\\n\\t\\t\\t});\\n\\t\\t});\\n\\t\\treturn statResult;\\n\\t}\",\n \"getPathNames() {\\n return Object.keys(paths)\\n }\",\n \"get files() {\\n return this._files;\\n }\",\n \"function readDir_getPaths(folder_path) {\\n\\treturn new Promise((resolve,reject) => {\\n\\t\\tfs.readdir(folder_path, (err,files) => {\\n\\t\\t\\tif (err) {\\n\\t\\t\\t\\treject(err);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tresolve(JSON.stringify(files.map(file_name => folder_path + \\\"/\\\" + file_name)));\\n\\t\\t\\t}\\n\\t\\t})\\n\\t})\\n}\",\n \"toArray() {\\r\\n return this._paths.slice(0);\\r\\n }\",\n \"readdirCached() {\\n const children = this.children();\\n return children.slice(0, children.provisional);\\n }\",\n \"GetAllScenePaths() {}\",\n \"function listFiles() {\\n\\t\\n\\t// git log --grep=hourly --name-only --pretty=\\\"format:\\\" --reverse --oneline | grep log\\n\\texec('cd ' + repoPath + ' && git log --grep=hourly --name-only --pretty=\\\"format:\\\" --reverse --oneline | grep log', function(err, stdout, stderr) {\\n\\t\\tif (err || stderr)\\n\\t\\t\\tthrow err\\n\\t\\telse {\\n\\t\\t\\t\\n\\t\\t\\tfiles = stdout.split('\\\\n').map(path => path.replace('data', 'data/raw'))\\n\\t\\t\\t\\n\\t\\t\\t//remove the last two invalid entry from the array\\n\\t\\t\\tfiles.pop()\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tprogressScale.domain([0, files.length-1])\\n\\t\\t\\tconsole.log('files', files.length)\\n\\t\\t\\t//~console.log('last files', files[files.length-2])\\n\\t\\t\\t//~console.log('last files', files[files.length-1])\\n\\t\\t\\t\\n\\t\\t\\tconsole.log('...all files identified')\\t\\t\\t\\n\\n\\t\\t\\tnext()\\n\\t\\t}\\n\\t})\\n\\t\\n}\",\n \"function walkFolderCollect()\\n\\t\\t{\\n\\t\\t\\tfunction collect(element)\\n\\t\\t\\t{\\n\\t\\t\\t\\tpaths.push(element.path);\\n\\t\\t\\t}\\n\\n\\t\\t\\tvar paths = [];\\n\\t\\t\\tUtils.walkFolder('{user}', collect);\\n\\t\\t\\tlist(paths)\\n\\t\\t}\",\n \"function getFiles(srcpath) {\\r\\n return fs.readdirSync(srcpath);\\r\\n}\",\n \"function getListFiles() {\\n console.log(this);\\n return true;\\n }\",\n \"async function getPathsToWatch(siteDir) {\\n const context = await server_1.loadContext(siteDir);\\n const pluginConfigs = server_1.loadPluginConfigs(context);\\n const plugins = await init_1.default({\\n pluginConfigs,\\n context,\\n });\\n return lodash_1.flatten(plugins.map((plugin) => { var _a, _b; return (_b = (_a = plugin === null || plugin === void 0 ? void 0 : plugin.getPathsToWatch) === null || _a === void 0 ? void 0 : _a.call(plugin)) !== null && _b !== void 0 ? _b : []; }));\\n}\",\n \"function getSrcFiles () {\\n return Object.keys(this._.CHANGEMAP);\\n}\",\n \"function getFiles(pattern) {\\n const reportFiles = [];\\n shelljs_shell.ls(pattern).forEach(function (file) {\\n core.debug('file: ' + file);\\n reportFiles.push(`${getWorkspaceDir()}/${file}`);\\n });\\n return reportFiles;\\n}\",\n \"function getRealPaths(startPath) {\\n // Check each folder in the wikis folder to see if it has a\\n // tiddlywiki.info file\\n let realFolders = [];\\n try {\\n const folderContents = fs.readdirSync(startPath);\\n folderContents.forEach(function (item) {\\n const fullName = path.join(startPath, item);\\n if(fs.statSync(fullName).isDirectory()) {\\n if($tw.ServerSide.wikiExists(fullName)) {\\n realFolders.push(fullName);\\n }\\n // Check if there are subfolders that contain wikis and recurse\\n const nextPath = path.join(startPath,item)\\n if(fs.statSync(nextPath).isDirectory()) {\\n realFolders = realFolders.concat(getRealPaths(nextPath));\\n }\\n }\\n })\\n } catch (e) {\\n $tw.Bob.logger.log('Error getting wiki paths', e, {level:1});\\n }\\n return realFolders;\\n }\",\n \"function refresh_asset_paths()\\n{\\n\\t function walk(dir, done) {\\n\\t\\tvar results = [];\\n\\t\\ttry\\n\\t\\t{\\n\\t\\t\\tvar list = fs.readdirSync(dir);\\n\\t\\t\\tvar i = 0;\\n\\n\\t\\t\\t(function next() {\\n\\t\\t\\t var file = list[i++];\\n\\t\\t\\t if (!file) return done(null, results);\\n\\t\\t\\t file = dir + '/' + file;\\n\\t\\t\\t fs.stat(file, function(err, stat) {\\n\\t\\t\\t if (stat && stat.isDirectory()) {\\n\\t\\t\\t walk(file, function(err, res) {\\n\\t\\t\\t results = results.concat(res);\\n\\t\\t\\t next();\\n\\t\\t\\t });\\n\\t\\t\\t } else {\\n\\t\\t\\t results.push(file.replace('\\\\\\\\', '/').replace('static/', ''));\\n\\t\\t\\t next();\\n\\t\\t\\t }\\n\\t\\t\\t });\\n\\t\\t\\t})();\\n\\t\\t}\\n\\t\\tcatch(e)\\n\\t\\t{\\n\\t\\t\\tconsole.error('Could not walk ' + dir + ' ' + e);\\n\\t\\t}\\n\\t};\\n\\n\\tasset_paths = [];\\n\\twalk('static/voxels', (err, paths) => { asset_paths = asset_paths.concat(paths); });\\n\\twalk('static/imgs', (err, paths) => { asset_paths = asset_paths.concat(paths); });\\n\\twalk('static/sounds', (err, paths) => { asset_paths = asset_paths.concat(paths); });\\n\\twalk('static/shaders', (err, paths) => { asset_paths = asset_paths.concat(paths); });\\n\\twalk('static/meshes', (err, paths) => { asset_paths = asset_paths.concat(paths); });\\n}\",\n \"getLookupPaths() {\\n return this.lookups.map(lookup => lookup.path.path());\\n }\",\n \"static getRecentFiles(evt){\\n let filePaths = FolderData.recentFilePaths;\\n IpcResponder.respond(evt, \\\"files-recent\\\", {filePaths});\\n }\",\n \"function getDirFiles(theDirectory){\\n return new Promise($.async(function (resolve, reject) {\\n try {\\n $.fs.readdir(theDirectory, function (err, files) {\\n if (err) {\\n resolve([])\\n }\\n resolve(files);\\n });\\n }\\n catch (error) {\\n resolve([])\\n }\\n }));\\n\\n \\n\\n \\n\\n}\",\n \"getFiles() {\\n return Resource.find({})\\n }\",\n \"getTexFilesList() {\\n return fs.listSync(this.projectPath, [\\\".tex\\\"]);\\n }\",\n \"function _getFileList(folder, callback) {\\n var files = [];\\n \\n klaw(folder)\\n .on('data', function(item) {\\n if (item.stats.isFile() && isAllowed(item.path))\\n files.push(item.path);\\n })\\n .on('end', function() {\\n callback(files);\\n });\\n}\",\n \"function getFileList(path) {\\n\\tvar paths = fs.readdirSync(path);\\n\\tvar files = [];\\n\\tvar stats, item, i;\\n\\n\\t// sort files from directories\\n\\tfor (i = paths.length - 1; i >= 0; i--) {\\n\\t\\titem = paths[i];\\n\\n\\t\\tif (item.charAt(0) == '.') return [];\\n\\n\\t\\titem = path + '/' + item;\\n\\n\\t\\ttry {\\n\\t\\t\\tstats = fs.statSync(item);\\n\\n\\t\\t\\t// files or directories\\n\\t\\t\\tif ( ! stats.isDirectory() ) files.push(item);\\n\\t\\t\\telse files = files.concat(getFileList(item));\\n\\t\\t}\\n\\t\\tcatch (e) {\\n\\t\\t\\tconsole.log('GetSmartJS: Couldn\\\\'t find path:', item);\\n\\t\\t}\\n\\t}\\n\\n\\treturn files;\\n}\",\n \"getFileList(path, dir) {\\n if (!path) {\\n return [];\\n }\\n\\n let files = [];\\n this.formatKeys.forEach(\\n function(key) {\\n this.getExtensionsFromKey(key).forEach(function(extension) {\\n files.push((dir ? dir + \\\"/\\\" : \\\"\\\") + path + \\\".\\\" + extension);\\n });\\n }.bind(this)\\n );\\n\\n return files;\\n }\",\n \"getFilesSync(pathToContent, recursive = false) {\\n let files = [];\\n if (recursive !== false) recursive = this.toBoolean(recursive);\\n\\n if (!this.is(pathToContent, String)) return files;\\n pathToContent = path.normalize(pathToContent);\\n\\n if (this.isFileSync(pathToContent)) {\\n files.push(pathToContent);\\n } else if (this.isDirectorySync(pathToContent)) {\\n const contents = fs.readdirSync(pathToContent, 'utf8');\\n for(let content of contents) {\\n const contentPath = path.join(pathToContent, content);\\n if (this.isFileSync(contentPath)) files.push(contentPath);\\n else if (recursive && this.isDirectorySync(contentPath)) files = [...files, ...this.getFilesSync(contentPath, recursive)];\\n }\\n } else {\\n console.error(`${colors.red('safe-regex-cli error: no such file or directory \\\"' + pathToContent + '\\\".')}`);\\n }\\n return files;\\n }\",\n \"function walk(folder){\\n var filenames=[];\\n // get relative filenames from folder\\n var folderContent=fs.readdirSync(folder);\\n // iterate over the folder content to handle nested folders\\n _.each(folderContent,function(filename){\\n // build absolute filename\\n var absoluteFilename=folder+path.sep+filename;\\n // get file stats\\n var stat=fs.statSync(absoluteFilename);\\n if(stat.isDirectory()){\\n // directory case => add filenames fetched from recursive call\\n filenames=filenames.concat(walk(absoluteFilename));\\n }\\n else{\\n // file case => simply add it\\n filenames.push(absoluteFilename);\\n }\\n });\\n return filenames;\\n }\",\n \"getFolderItems(folderPath) {\\r\\n return new Promise(function (resolve, reject) {\\r\\n fs.readdir(folderPath, function (err, items) {\\r\\n if (err) {\\r\\n return reject(err);\\r\\n }\\r\\n var results = [];\\r\\n items.forEach(item => {\\r\\n try {\\r\\n results.push(new FileInfo_1.FileInfo(path.join(folderPath, item)));\\r\\n }\\r\\n catch (err) {\\r\\n // silently ignore permissions errors\\r\\n }\\r\\n });\\r\\n resolve(results);\\r\\n });\\r\\n });\\r\\n }\",\n \"async function folderList () {\\n return bucket.getFiles({\\n // TODO: changing frequency may break this?\\n maxResults: 365 * 24 / config.get('archiver.frequency'),\\n delimiter: '/',\\n }).then((data) => {\\n const response = data[2];\\n return response.prefixes.map(val => val.replace(/\\\\//, ''));\\n });\\n}\",\n \"function GetPagesList()\\n{\\n var list = []; // Initialise array\\n var files = fs.readdirSync(\\\"pages\\\"); // Node JS sync List files in folder.\\n for (var i = 0; i < files.length; i++)\\n {\\n list[i] = []; // Initialise array item into 2D Array\\n list[i][0] = files[i]; //filename\\n list[i][1] = files[i].replace(/\\\\.[^\\\\.]*$/,''); //pagename\\n }\\n return list;\\n}\",\n \"async readdir() {\\n if (!this.canReaddir()) {\\n return [];\\n }\\n const children = this.children();\\n if (this.calledReaddir()) {\\n return children.slice(0, children.provisional);\\n }\\n // else read the directory, fill up children\\n // de-provisionalize any provisional children.\\n const fullpath = this.fullpath();\\n if (this.#asyncReaddirInFlight) {\\n await this.#asyncReaddirInFlight;\\n }\\n else {\\n /* c8 ignore start */\\n let resolve = () => { };\\n /* c8 ignore stop */\\n this.#asyncReaddirInFlight = new Promise(res => (resolve = res));\\n try {\\n for (const e of await this.#fs.promises.readdir(fullpath, {\\n withFileTypes: true,\\n })) {\\n this.#readdirAddChild(e, children);\\n }\\n this.#readdirSuccess(children);\\n }\\n catch (er) {\\n this.#readdirFail(er.code);\\n children.provisional = 0;\\n }\\n this.#asyncReaddirInFlight = undefined;\\n resolve();\\n }\\n return children.slice(0, children.provisional);\\n }\",\n \"function getFilePaths(funcs) {\\n return new BbPromise(function(resolve, reject) {\\n var paths = [];\\n\\n if (funcs && (funcs.length > 0)) {\\n funcs.forEach(function(val, idx) {\\n paths.push(testFilePath(val));\\n });\\n return resolve(paths);\\n }\\n // No funcs provided, list all test files\\n fs.readdirSync(testFolder).filter(function(file){\\n // Only keep the .js files\\n return file.substr(-3) === '.js';\\n }).forEach(function(file) {\\n paths.push(path.join(testFolder, file));\\n });\\n return resolve(paths);\\n });\\n }\",\n \"function getAllPages() {\\n var filepath = getCurrentPath();\\n console.log('file path: ', filepath);\\n htmlFiles = fs.readdirSync(filepath)\\n .filter(function (file) {\\n return file.includes('.html');\\n }).map(function (file) {\\n var correctPath = pathLib.resolve(filepath, file);\\n if (correctPath == undefined) {\\n pagesToImageObjs('current path is undefined', null);\\n }\\n return {\\n file: file,\\n contents: fs.readFileSync(correctPath, 'utf8')\\n };\\n });\\n return htmlFiles;\\n}\",\n \"async _fileList() {\\n return (await readFile('list.txt', {\\n encoding: 'utf-8'\\n })).trim().split('\\\\n');\\n }\",\n \"static listaArquivos(dirPath) {\\n return new Promise((resolve, reject)=> {\\n try {\\n fs.readdir(dirPath, (err, files) => {\\n if (err) {\\n reject(err);\\n } else {\\n resolve(files);\\n }\\n });\\n } catch (err) {\\n reject(err);\\n }\\n });\\n }\",\n \"function getFileList(entryPoint, context) {\\n let entryFiles = [];\\n if (typeof entryPoint === \\\"string\\\") {\\n // If path is string use as is\\n entryFiles.push(path.resolve(context, entryPoint));\\n }\\n else {\\n // Else exclude paths with node_modules\\n // (webpack-dev-server files, prepended to entry files in the array)\\n const filteredPaths = entryPoint.filter(entryPath => !entryPath.includes('node_modules'));\\n filteredPaths.forEach(entryPath => {\\n entryFiles.push(path.resolve(context, entryPath));\\n });\\n }\\n return entryFiles;\\n}\",\n \"listDir(path) {\\n return backend.listDir(path);\\n }\",\n \"function getAllFilenames() {\\n return fs.readdirAsync(articlesPath).filter(function(filename) {\\n return !testIfDirectory(filename);\\n });\\n}\",\n \"async readdir (filepath) {\\n try {\\n return await this._readdir(filepath)\\n } catch (err) {\\n return []\\n }\\n }\",\n \"function file_cache_list() {\\n\\t\\tconsole.log(Object.keys(wkof.file_cache.dir).sort().join('\\\\n'));\\n\\t}\",\n \"getFileExplorers() {\\n return this.app.workspace.getLeavesOfType('file-explorer');\\n }\",\n \"function _getFilesInFolder(dir) {\\n var results = [];\\n fs.readdirSync(dir).forEach(function(file) {\\n file_dir = dir+'/'+file;\\n var stat = fs.statSync(file_dir);\\n if (stat && stat.isDirectory()) {\\n results = results.concat(_getAllFilesFromFolder(file_dir));\\n } else results.push(file);\\n\\n });\\n return results;\\n}\",\n \"function ls( path ) {\\n return _readdir( path );\\n}\",\n \"function listDataFiles() {\\n try {\\n return fsPromises.readdir(DATA_DIRECTORY);\\n } catch (err) {\\n console.error('Error occured while reading directory!', err);\\n }\\n}\",\n \"scanAppDir() {\\n return glob.sync(path.resolve(this.app.appPath, '**'), {\\n nodir: true,\\n });\\n }\",\n \"getFiles() {\\n recursive(this.path, (err, files) => {\\n for(var i in files) {\\n var f = files[i];\\n var stat = fs.statSync(f);\\n\\n if(stat.isFile()) {\\n var basename = path.basename(f);\\n var masks = [/^script\\\\.js$/, /^style\\\\.css$/, /^styles\\\\.css$/, /^.*\\\\.less$/];\\n // if(basename == 'script.js' || basename == 'style.css' || basename == 'styles.css') {\\n if( this.checkMask(basename, masks) ) {\\n if(! this.files.includes(f)) {\\n this.files.push(f);\\n\\n // if file has`t compressed copy make it\\n if(! this.isFileCompressed(f)) {\\n this.compressFile(f);\\n }\\n\\n this.watcher(f);\\n }\\n }\\n }\\n }\\n });\\n }\",\n \"static getFiles(path){\\n\\t\\treturn (context, source) => {\\n\\t\\t\\tif (source == undefined) source=null;\\n\\t\\t\\tvar fs = context.createProvider(\\\"default:fs\\\");\\n\\t\\t\\tvar res = Lib.getFiles(fs, path);\\n\\t\\t\\tif (source == null){\\n\\t\\t\\t\\treturn res;\\n\\t\\t\\t}\\n\\t\\t\\treturn source.concat(res);\\n\\t\\t}\\n\\t}\",\n \"function getFiles (absolutePath){\\n var fileArray = [];\\n var directoryArray = [absolutePath];\\n return readDirectory(fileArray, directoryArray);\\n}\",\n \"function getFilesData(pathToFile) {\\n findFilesData(pathToFile);\\n var tempFiles = filesData;\\n filesData = [];\\n return tempFiles;\\n}\",\n \"loadFiles(){\\n if(this.paths.length == 0)\\n throw 'Set one or more paths.';\\n\\n for(var i in this.paths){\\n var fc = new this.fc(this.paths[i]);\\n\\n var file_array = fc.getFiles();\\n\\n for(var i in file_array){\\n /**\\n * Ignore double files.\\n */\\n if(!this.files.includes(file_array[i])){\\n this.files.push(file_array[i]);\\n }\\n }\\n }\\n }\",\n \"items() {\\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\\n const directories = this.$store.getters.getSelectedDirectoryDirectories\\n // Sort by type and alphabetically\\n .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))\\n .filter((dir) => dir.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));\\n\\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\\n const files = this.$store.getters.getSelectedDirectoryFiles\\n // Sort by type and alphabetically\\n .sort((a, b) => ((a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1))\\n .filter((file) => file.name.toLowerCase().includes(this.$store.state.search.toLowerCase()));\\n\\n return [...directories, ...files];\\n }\",\n \"readdir(dirpath) {\\n return RNFS.readDir(dirpath)\\n .then(files => {\\n return files.map(file => file.name);\\n });\\n }\",\n \"getDevFilesToCopy () {\\n const filesToCopy = [`${settings.paths.dev.root}/**/*`]\\n const ignore = [\\n settings.paths.dev.js,\\n settings.paths.dev.css\\n ]\\n\\n ignore.forEach((ignoreValue) => {\\n filesToCopy.push(`!${ignoreValue}`, `!${ignoreValue}/**`)\\n })\\n\\n return filesToCopy\\n }\",\n \"function findFiles(auth, dir) {\\n let query = \\\"?q='\\\" + dir + \\\"'+in+parents\\\"\\n let headers = {\\n \\\"Authorization\\\": \\\"Bearer \\\" + auth.credentials.access_token\\n }\\n\\n let url = DRIVE_URL + query\\n\\n return axios({ url, headers }).then( res => {\\n\\n if ( !res.data.files ) throw new Error('folder not found')\\n\\n return res.data.files\\n })\\n}\",\n \"function findConfigfiles (root) {\\n ['app/index.html', 'app/run.js'].reduce(function(configFiles, file) {\\n if(path.exists(file)) configFiles.push(file)\\n return configFiles;\\n }, []);\\n }\",\n \"get RenderPaths() {}\",\n \"function iterate(currentPath)\\n{\\n\\tvar folders = [],\\n\\t\\tfiles = [],\\n\\t\\tmain = null;\\n\\t\\n\\tcurrentPath = path.resolve(currentPath);\\n\\t\\n\\tfs.readdirSync(currentPath).forEach(function(file)\\n\\t{\\n\\t\\tvar item = path.normalize(path.join(currentPath, file));\\n\\t\\t\\n\\t\\tif(file == \\\"lib\\\")\\n\\t\\t\\tArray.prototype.unshift.apply(folders, iterate(item));\\n\\t\\telse if(file == \\\"main.js\\\")\\n\\t\\t\\tmain = item;\\n\\t\\telse if(fs.lstatSync(item).isDirectory())\\n\\t\\t\\tArray.prototype.push.apply(folders, iterate(item));\\n\\t\\telse\\n\\t\\t\\tfiles.push(item);\\n\\t});\\n\\t\\n\\tif(main)\\n\\t\\tfiles.push(main);\\n\\t\\n\\tArray.prototype.push.apply(folders, files);\\n\\t\\n\\treturn folders;\\n}\",\n \"getAllMyFiles (scrpt_id) {\\n\\t\\t\\tthis.$axios.get('api/getAllMyFiles/'+scrpt_id).then(res => {\\n\\t\\t\\t\\tthis.docFileArr = res.data.doc_file;\\n\\t\\t\\t\\tthis.allFigFiles = res.data.fig_files;\\n\\t\\t\\t});\\n\\t\\t}\",\n \"function walkSyncJS(dir) {\\n let files = fs.readdirSync(dir);\\n let filelist = [];\\n files.forEach(function(file) {\\n let fullPath = path.join(dir, file);\\n if (fs.statSync(fullPath).isDirectory()) {\\n filelist = filelist.concat(walkSyncJS(fullPath));\\n } else if(file.endsWith('.js')) {\\n filelist.push(fullPath);\\n }\\n });\\n\\n return filelist;\\n}\",\n \"getAssetRoots() {\\n return [__dirname];\\n }\",\n \"function getFiles(callback) {\\n var directory = '../public/blog';\\n var walk = require('walk'), fs = require('fs'), options, walker;\\n var walker = walk.walk('./public/blog', {followLinks: false});\\n\\n var fs = [];\\n\\n walker.on(\\\"file\\\", function (root, file, next) {\\n var fileDir = \\\"public/blog\\\";\\n var f = root + \\\"/\\\" + file['name'].substring(0, file['name'].lastIndexOf('.'));\\n\\n if (f.toLowerCase() != (\\\"./\\\" + fileDir + '/').toLowerCase()) {\\n var localUrl = f;\\n var date = f.replace(\\\"./public/blog/\\\", \\\"\\\").replace(new RegExp('/', 'g'), \\\":\\\");\\n var name = date.substring(date.lastIndexOf(':') + 1, date.length);\\n date = date.substring(0, date.lastIndexOf(':')).replace(new RegExp(':', 'g'), \\\"-\\\");\\n\\n // push without /blog prefix\\n if (name.length > 0 && date.length > 0)\\n fs.push({url: f.substring(f.indexOf('/')), date: date, name: name, localUrl: localUrl});\\n }\\n next();\\n });\\n\\n walker.on(\\\"end\\\", function () {\\n callback(fs);\\n });\\n }\",\n \"function getPDFFilesFromCurFolder() {\\n var files = folder.getFiles();\\n var allFileNameUrls = [];\\n\\n while (files.hasNext()) {\\n var file = files.next();\\n\\n var fileName = file.getName();\\n if(fileName.endsWith(\\\".pdf\\\") && !fileName.includes(\\\"_protected\\\")){\\n // Create Pre-Signed URL from PDF.co\\n var respPresignedUrl = getPDFcoPreSignedURL(fileName)\\n\\n if(!respPresignedUrl.error){\\n var fileData = file.getBlob();\\n if(uploadFileToPresignedURL(respPresignedUrl.presignedUrl, fileData)){\\n // Add Url\\n allFileNameUrls.push({url: respPresignedUrl.url, fileName: fileName});\\n }\\n }\\n }\\n }\\n\\n return allFileNameUrls;\\n}\",\n \"async listComponentsWithTrackDir() {\\n if (this.consumer.isLegacy) return [];\\n const workspaceComponents = await this.getFromFileSystem(_constants().COMPONENT_ORIGINS.AUTHORED);\\n return workspaceComponents.filter(component => {\\n const componentMap = component.componentMap;\\n if (!componentMap) throw new Error('listComponentsWithIndividualFiles componentMap is missing');\\n return Boolean(componentMap.trackDir);\\n });\\n }\",\n \"getPaths () {\\n if (this._paths) {\\n return this._paths\\n }\\n\\n const paths = []\\n\\n let proto = this\\n\\n // 1. should has a own property `configFileName`\\n // 2. this.configFileName should be a string\\n // 3. has a own property `nodePath` or not\\n\\n // Loop back for the prototype chain\\n while (proto) {\\n proto = Object.getPrototypeOf(proto)\\n\\n // There is no caviar.config.js in caviar,\\n // So just stop\\n if (proto === ConfigLoader.prototype) {\\n break\\n }\\n\\n if (!hasOwnProperty(proto, 'configFile')) {\\n throw error('CONFIG_FILE_GETTER_REQUIRED')\\n }\\n\\n const {\\n configFile\\n } = proto\\n\\n if (!isString(configFile)) {\\n throw error('INVALID_CONFIG_FILE', configFile)\\n }\\n\\n const nodePath = hasOwnProperty(proto, 'nodePath')\\n ? checkNodePath(proto.nodePath)\\n : UNDEFINED\\n\\n paths.push({\\n nodePath: nodePath && realNodePath(nodePath),\\n configFile: realConfigFile(configFile)\\n })\\n }\\n\\n log('config-loader: paths: %s', inspect(paths))\\n\\n return this._paths = paths\\n }\",\n \"dirList (path) {\\n const dirPaths = []\\n const collectList = (path) => {\\n return new Promise((resolve, reject) => {\\n this.readdir(path).then((ls) => {\\n const promises = Object.keys(ls).map((item, index) => {\\n if (ls[item].isDirectory && !dirPaths.includes(item)) {\\n dirPaths.push(item)\\n resolve(dirPaths)\\n }\\n return new Promise((resolve, reject) => { resolve() })\\n })\\n Promise.all(promises).then(() => { resolve(dirPaths) })\\n })\\n })\\n }\\n return collectList(path)\\n }\",\n \"function getRecipeList(){\\n var recipe_files = [];\\n //passsing directoryPath and callback function\\n fs.readdir(__dirname + '/data', function (err, files) {\\n //handling error\\n if (err) {\\n return console.log('Unable to scan directory: ' + err);\\n } \\n //listing all files using forEach\\n files.forEach(function (file) {\\n // Do whatever you want to do with the file\\n console.log(file);\\n recipe_files.push(file);\\n });\\n });\\n\\n return recipe_files;\\n}\",\n \"static async GetFileNames(){\\n\\t\\tvar returnMe = [];\\n\\t\\t//get all file names using async \\n\\t\\t_retrieveKeys = async () => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst value = await AsyncStorage.getAllKeys();\\n\\t\\t\\t\\tif (value !== null) {\\n\\t\\t\\t\\t\\tfor(fileNumber in value){\\n\\t\\t\\t\\t\\t\\t//whats the filename according to our filesystem\\n\\t\\t\\t\\t\\t\\tvar fileName = value[fileNumber];\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t//return all filenames that ARENT \\\"GlobalData\\\"\\n\\t\\t\\t\\t\\t\\tif(fileName != \\\"GlobalData\\\"){\\n\\t\\t\\t\\t\\t\\t\\treturnMe.push(value[fileNumber]);\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\treturnMe.sort(this.sortFileNames);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\treturn returnMe;\\n\\t\\t\\t\\t\\n\\t\\t\\t} catch (error) {\\n\\t\\t\\t\\t// Error saving data\\n\\t\\t\\t\\talert(error);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t \\n\\t\\t return _retrieveKeys();\\n\\t}\",\n \"function filesInDir(dir) {\\n return Q.nfcall(fs.readdir, dir).catch(() => []);\\n}\",\n \"function getViews () {\\n\\t\\t// grunt.log.writeln('Getting views:');\\n\\t\\t// use fs to read the views folder; fs.readdirSync()\\n\\t\\tvar views = fs.readdirSync(getViewsDir())\\n\\t\\t\\t// filter to only select other dirs and not files\\n\\t\\t\\t.filter(function(name){\\n\\t\\t\\t\\treturn grunt.file.isDir(getViewsDir() + name);\\n\\t\\t\\t});\\n\\t\\t// grunt.log.writeln('/********');\\n\\t\\t// grunt.log.writeln(' * Views:');\\n\\t\\t// views.forEach(function(name) {\\n\\t\\t// \\tgrunt.log.writeln(' * - ' + name);\\n\\t\\t// });\\n\\t\\t// grunt.log.writeln('********/');\\n\\t\\t// grunt.log.writeln('');\\n\\t\\treturn views;\\n\\t}\",\n \"async listComponentsWithIndividualFiles() {\\n if (this.consumer.isLegacy) return [];\\n const workspaceComponents = await this.getFromFileSystem(_constants().COMPONENT_ORIGINS.AUTHORED);\\n return workspaceComponents.filter(component => {\\n const componentMap = component.componentMap;\\n if (!componentMap) throw new Error('listComponentsWithIndividualFiles componentMap is missing');\\n return Boolean(!componentMap.trackDir && !componentMap.rootDir);\\n });\\n }\",\n \"function getAllPaths() {\\n let pathList = [];\\n let pathNodes = $(\\\"svg[id='svg']\\\").find(\\\"path\\\");\\n $.each(pathNodes, (key, Node) => {\\n pathList.push({\\n name: Node.getAttribute(\\\"id\\\"),\\n data: Node.getAttribute(\\\"d\\\")\\n });\\n });\\n return pathList;\\n}\",\n \"getAllBranches() {\\n this.checkInit();\\n\\n return this.cfgObj.getFileNames();\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.66810745","0.62842715","0.61882734","0.6179658","0.6170243","0.61617494","0.6159305","0.6144904","0.61183137","0.61148167","0.6114717","0.6114136","0.611184","0.6051959","0.6038199","0.60099494","0.59697807","0.595084","0.5949616","0.59400827","0.5939316","0.593854","0.5932895","0.59132886","0.5905","0.586446","0.5829084","0.5783972","0.5771515","0.5764975","0.5724567","0.57176685","0.57135487","0.5667401","0.56636757","0.5641175","0.5634357","0.5620668","0.56087035","0.5590496","0.55801785","0.5580024","0.5575625","0.5569536","0.556646","0.55622184","0.5551398","0.55367637","0.55338085","0.55275977","0.5525159","0.55180675","0.5514787","0.5497691","0.54875803","0.54550385","0.54546773","0.5443024","0.54284513","0.5415947","0.54077226","0.54019994","0.5373497","0.5365453","0.53550607","0.53534025","0.53488284","0.53388625","0.5328245","0.53236675","0.53183585","0.53183573","0.5313673","0.53066677","0.5300035","0.52927244","0.5287823","0.5285911","0.52592075","0.52545404","0.52399004","0.5231522","0.5227502","0.5209638","0.5209372","0.5207987","0.52068245","0.5196745","0.51908076","0.51841193","0.51819843","0.51787394","0.5161697","0.51527166","0.51507515","0.51502776","0.51405567","0.5138698","0.513742","0.51365757"],"string":"[\n \"0.66810745\",\n \"0.62842715\",\n \"0.61882734\",\n \"0.6179658\",\n \"0.6170243\",\n \"0.61617494\",\n \"0.6159305\",\n \"0.6144904\",\n \"0.61183137\",\n \"0.61148167\",\n \"0.6114717\",\n \"0.6114136\",\n \"0.611184\",\n \"0.6051959\",\n \"0.6038199\",\n \"0.60099494\",\n \"0.59697807\",\n \"0.595084\",\n \"0.5949616\",\n \"0.59400827\",\n \"0.5939316\",\n \"0.593854\",\n \"0.5932895\",\n \"0.59132886\",\n \"0.5905\",\n \"0.586446\",\n \"0.5829084\",\n \"0.5783972\",\n \"0.5771515\",\n \"0.5764975\",\n \"0.5724567\",\n \"0.57176685\",\n \"0.57135487\",\n \"0.5667401\",\n \"0.56636757\",\n \"0.5641175\",\n \"0.5634357\",\n \"0.5620668\",\n \"0.56087035\",\n \"0.5590496\",\n \"0.55801785\",\n \"0.5580024\",\n \"0.5575625\",\n \"0.5569536\",\n \"0.556646\",\n \"0.55622184\",\n \"0.5551398\",\n \"0.55367637\",\n \"0.55338085\",\n \"0.55275977\",\n \"0.5525159\",\n \"0.55180675\",\n \"0.5514787\",\n \"0.5497691\",\n \"0.54875803\",\n \"0.54550385\",\n \"0.54546773\",\n \"0.5443024\",\n \"0.54284513\",\n \"0.5415947\",\n \"0.54077226\",\n \"0.54019994\",\n \"0.5373497\",\n \"0.5365453\",\n \"0.53550607\",\n \"0.53534025\",\n \"0.53488284\",\n \"0.53388625\",\n \"0.5328245\",\n \"0.53236675\",\n \"0.53183585\",\n \"0.53183573\",\n \"0.5313673\",\n \"0.53066677\",\n \"0.5300035\",\n \"0.52927244\",\n \"0.5287823\",\n \"0.5285911\",\n \"0.52592075\",\n \"0.52545404\",\n \"0.52399004\",\n \"0.5231522\",\n \"0.5227502\",\n \"0.5209638\",\n \"0.5209372\",\n \"0.5207987\",\n \"0.52068245\",\n \"0.5196745\",\n \"0.51908076\",\n \"0.51841193\",\n \"0.51819843\",\n \"0.51787394\",\n \"0.5161697\",\n \"0.51527166\",\n \"0.51507515\",\n \"0.51502776\",\n \"0.51405567\",\n \"0.5138698\",\n \"0.513742\",\n \"0.51365757\"\n]"},"document_score":{"kind":"string","value":"0.6898038"},"document_rank":{"kind":"string","value":"0"}}},{"rowIdx":558,"cells":{"query":{"kind":"string","value":"Close the form if one is currently open Also hide applications list div when adding a new application"},"document":{"kind":"string","value":"function setClose() {\n\t\tif (props.total_results != 0) {\n\t\t\tif (jobType != null) {\n\t\t\t\tsetJobType(null);\n\t\t\t\tdocument.getElementById('apps').style.display = 'initial';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById('apps').style.display = 'none';\n\t\t\t}\n\t\t} else {\n\t\t\tif (jobType != null) {\n\t\t\t\tsetJobType(null);\n\t\t\t} else {\n\t\t\t}\n\t\t}\n\t}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function hideListForm() {\n if (!isAddingList) {\n vm.isListFormVisible = false;\n }\n }","function hideForm() {\n mainForm.style.display = 'none';\n newInfoButton.style.display = 'block';\n}","hideCreateForm() {\n this.changeFormMode(this.FORM_MODES.LIST);\n }","function closeForm(){\n document.getElementsByClassName('container-toDO')[0].style.display = 'block';\n let PopUp = document.getElementsByClassName('pop-up')[0];\n PopUp.classList.add('hides');\n document.getElementById(\"myForm\").style.display = \"none\";\n }","function closeModuleList() {\n $(\".graybg\").hide();\n $('.add_module_list').hide();\n $('body').css('overflow-y', 'auto');\n visibleAddEvent = false;\n}","function hideForm() {\n\t\tthat.state.formShow = false;\n\t}","function closeForm() {\n $('.add-parent-popup').hide();\n $('.overlay').hide();\n clearFields();\n $('#pin-message').hide();\n}","function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\";\n document.getElementById(\"post-start\").style.display = \"none\";\n document.getElementById(\"post-start-title\").style.display = \"none\";\n document.getElementById(\"delete\").disabled = false;\n document.getElementById(\"add\").disabled = false;\n document.getElementById(\"upload\").disabled = false;\n}","function cancelNewProgramForm() {\n $('#injected-content').hide();\n $('#main-content').fadeIn();\n $('aside div').hide();\n $('aside div.new-program').fadeIn().css(\"display\",\"inline-block\");\n}","function hideAddDeviceForm() {\n $(\"#addDeviceControl\").show(); // Hide the add device link\n $(\"#addDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}","function hideAddDeviceForm() {\n $(\"#addDeviceControl\").show(); // Hide the add device link\n $(\"#addDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}","function hideAddDeviceForm() {\n $(\"#addDeviceControl\").show(); // Hide the add device link\n $(\"#addDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}","function closeInput() {\n document.getElementById('editForm').style.display = 'none';\n}","function CloseAppt() {\n $(\"#add-appt\").css(\"display\", \"inline-block\");\n $(\"#appt-form\").css(\"display\", \"none\");\n $(\"#add-btn\").css(\"display\", \"none\");\n $(\"#cancel-btn\").css(\"display\", \"none\");\n}","function closeFormButton() {\n clearFields();\n $('#add-section').hide();\n $('.show-form-btn').show();\n}","function closeApp()\n{\n\tdocument.getElementById(\"openAppHolder\").remove();\n}","function openForm(){\n document.getElementsByClassName('container-toDO')[0].style.display = 'none';\n let PopUp = document.getElementsByClassName('pop-up')[0];\n PopUp.classList.remove('hides');\n document.getElementById(\"myForm\").style.display = \"block\";\n}","function hideAllForms() {\n\t$('#add-item-form').hide();\n\t$('#set-email-form').hide();\n}","function closeSubmitted(e) {\n if(e.target === submitBtn && bookTitle.value !== \"\" && bookAuthor.value !== \"\" && pages.value !== \"\"){\n formContainer.style.display = 'none'\n }else{\n displayData()\n }\n}","function hideAddListForm() {\r\n\r\n let addListForm = document.getElementById(\"addListForm\");\r\n let annuleerAddList = document.getElementById(\"annuleerAddList\");\r\n\r\n addListForm.classList.add(\"invisible\");\r\n annuleerAddList.classList.add(\"invisible\");\r\n}","function view () {\n $('div.employeeList').removeClass('hidden');\n // $('form.addForm').addClass('hidden');\n var forms = document.querySelectorAll('form');\n if (forms[0] != undefined) {\n document.body.removeChild(forms[0]);\n }\n toggleActive('View');\n}","function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\"; \n}","function closeForm() {\r\n document.getElementById(\"popupForm\").style.display = \"none\";\r\n document.getElementById(\"taForm\").style.display = \"none\";\r\n document.getElementById(\"anmtForm\").style.display = \"none\";\r\n}","function displayFormWindow(){\r\n if(!AddTAWindow.isVisible()){\r\n resetAddForm();\r\n AddTAWindow.show();\r\n } else {\r\n AddTAWindow.toFront();\r\n }\r\n \r\n \r\n }","function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\";\n document.getElementById('openBtn').style.display = 'block';\n // clear channel poller running in window\n clearInterval(window.poller);\n}","function hideReplaceDeviceForm() {\n $(\"#relpaceDeviceControl\").show(); // Hide the add device link\n $(\"#replaceDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}","function closeAdd(e) {\n //if form isn't open don't bother checking anything.\n if ($(\"#newCollectibleForm\").css(\"display\") === \"none\")\n return;\n var container = $(\"#newCollectibleForm\");\n\n if (!container.is(e.target)\n && container.has(e.target).length === 0)\n {\n console.log(\"Closing...\");\n //if we click on the toast don't close the form\n if ($(e.target).attr(\"class\").indexOf(\"toast\") !== -1)\n return;\n\n clearForm();\n closeForm();\n $(document).off(\"mouseup\");\n }\n }","function hideForm() {\n $scope.formDisplay = false;\n }","function closeAddFrom(){\n var container = document.getElementById(\"addFromContainer\");\n container.style.display = \"none\";\n}","function showNewProgramForm() {\n var url = \"includes/new_program_form.php\";\n var contentContainer = $('#injected-content');\n $('#main-content').hide();\n getData(url, injectContent, contentContainer);\n contentContainer.fadeIn();\n $('aside div').hide();\n $('aside div.cancel').fadeIn().css(\"display\",\"inline-block\");\n}","function exitForm() {\n $('#contactForm').hide();\n}","function toggleEntryForm() {\n const HideForm = document.getElementById(\"dino-compare\");\n HideForm.classList.add(\"hide\");\n }","function closeCreateUserForm() {\n document.getElementById(\"createUserForm\").style.display = \"none\";\n}","function displayFormWindow(){\r\n if(!AddPriceWindow.isVisible()){\r\n resetPriceForm();\r\n AddPriceWindow.show();\r\n } else {\r\n AddPriceWindow.toFront();\r\n }\r\n\r\n\r\n }","function hideForm() {\n orderForm.style.display = 'none';\n}","function displayEFormWindow(){\r\n if(!EditCourseWindow.isVisible()){\r\n resetECourseForm();\r\n EditCourseWindow.show();\r\n } else {\r\n EditCourseWindow.toFront();\r\n }\r\n \r\n \r\n }","function hideFormMedidaCreate(){\n $(\"#medida-table\").show(300);\n $(\"#medida-pagination\").show(300);\n $(\"#medida-view\").hide(300);\n $(\"#medida-create\").hide(300);\n $(\"#medida-button\").removeClass(\"active\");\n}","function hideForm() {\n form.classList.add('hidden');\n}","function showAddListForm() {\r\n\r\n let addListForm = document.getElementById(\"addListForm\");\r\n let annuleerAddList = document.getElementById(\"annuleerAddList\");\r\n\r\n addListForm.classList.remove(\"invisible\");\r\n annuleerAddList.classList.remove(\"invisible\");\r\n}","function hideForm() {\n document.getElementById('appendForm').style.display = \"none\"\n // test commit made through Github interface.\n // to start editing, I opened this specific file in Github, then I pressed: .\n // That's it. If I can edit and commit from here, this is officially crazy. \n }","function closeForm() {\n document.getElementById(\"msgForm\").style.display = \"none\";\n}","function hideForm1() {\n $('.form-1').hide();\n }","function removeForm() {\n const form = document.querySelector('#dino-compare');\n form.style.display = \"none\";\n }","function revealInputForm() {\n $(this).find('form').removeClass('hidden');\n }","function closeApp() {\n document.getElementById(\"form-close\").submit();\n}","function showForm(){\n form.reset();\n background.classList.add(\"transparent\")\n addBookForm.classList.remove(\"form--hidden\");\n }","closeLoginForm() {\n document.getElementById(\"showLoginForm\").checked = false;\n this.switchToLogin();\n updatePageTitle(\"Utforsk nye aktiviteter\");\n }","function showForm() {\n document.querySelector(\"#new-book-form\").classList.remove(\"hide\");\n document.querySelector(\"#new-book-form\").classList.add(\"show\");\n}","function toggleForm() {\n formContainer.classList.toggle(\"invisible\");\n mainContainer.classList.toggle(\"invisible\");\n}","closeForm(){\n this.setState({showEditForm: false});\n sessionStorage.setItem('showEditForm', 'false');\n }","function closeListContent() {\n $(\"#sidebar2\").css(\"display\",\"none\");\n}","function AddBookForm() {\n document.querySelector('.heading').style.display = 'none';\n document.querySelector('#lib').style.display = 'none';\n document.querySelector('#list_container').style.display = 'none';\n document.querySelector('.line').style.display = 'none';\n document.querySelector('#AddNewbook_container').style.display = 'block';\n document.querySelector('#contact').style.display = 'none';\n document.querySelector('#welcome').style.display = 'none';\n}","hide()\n {\n this._window.hide();\n }","function startapp(app) {\n/*\nif (document.getElementById(app).style.display==\"block\") {\ndocument.getElementById(app).style.display=\"none\"; }\nelse {document.getElementById(app).style.display=\"block\";}\n*/\n}","function closeList() {\n\tif (iPopupOpen) {\n\t\tofVBAISpan.style.display=\"none\";\n\t\tiPopupOpen=false;\n\t\t}\n\t}","function closeForm() {\n document.getElementById(\"author\").value = \"\";\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"pages\").value = \"\";\n document.getElementById(\"read\").checked = false;\n document.getElementById(\"notRead\").checked = true;\n document.getElementById(\"form\").style.display = \"none\";\n}","function attachCloseButtonToForm() {\n let closeFormButton = document.querySelector(\"#cancel-form\");\n closeFormButton.addEventListener(\"click\", () => {\n editOrCreateFormContainer.style.display = \"none\";\n document.querySelector(\"#create-meme-iframe\").style.display = \"unset\";\n modifyElemenetsWithClassHidden(\"none\");\n clearForm();\n });\n}","function frmPatientSummary_hideDropDownsOnFormclick() {\n frmPatientSummary.fcunitslist.setVisibility(false);\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 }","function closeElement() {\r\n\t\tvar removeDocument = document.getElementById(\"removeDocument\");\r\n\t\tif (removeDocument.style.visibility === \"visible\") removeDocument.style.visibility = \"hidden\";\r\n\t\tvar openDocument = document.getElementById(\"openDocument\");\r\n\t\tif (openDocument.style.visibility === \"visible\") openDocument.style.visibility = \"hidden\";\r\n\t }","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\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._screen.scrollTop(0).hide();\n\n // Hide the content behind the placeholders\n $(\"#page--info .ph-hidden-content\").hide();\n\n // Stop the placeholders animation\n this._placeholders.removeClass(\"ph-animate\").show();\n\n // Hide the delete button\n $(\"#info-delete\").hide();\n\n // Hide the info button\n $(\"#info-edit\").hide();\n\n // Show all the fields\n $(\".info-block\").show();\n\n // Delete the content of each of the fields\n $(\"#info-createdAt .info-content\").html(\"\");\n $(\"#info-updatedAt .info-content\").html(\"\");\n $(\"#info-coordinates .info-content\").html(\"\");\n $(\"#info-coordinatesAccuracy .info-content\").html(\"\");\n $(\"#info-altitude .info-content\").html(\"\");\n $(\"#info-altitudeAccuracy .info-content\").html(\"\");\n $(\"#info-type .info-content\").html(\"\");\n $(\"#info-materialType .info-content\").html(\"\");\n $(\"#info-hillPosition .info-content\").html(\"\");\n $(\"#info-water .info-content\").html(\"\");\n $(\"#info-vegetation .info-content\").html(\"\");\n $(\"#info-mitigation .info-content\").html(\"\");\n $(\"#info-mitigationsList .info-content\").html(\"\");\n $(\"#info-monitoring .info-content\").html(\"\");\n $(\"#info-monitoringList .info-content\").html(\"\");\n $(\"#info-damages .info-content\").html(\"\");\n $(\"#info-damagesList .info-content\").html(\"\");\n $(\"#info-notes .info-content\").html(\"\");\n\n // Show the image placeholder\n $(\"#info-photo-preview\").attr(\"src\", \"img/no-img-placeholder-200.png\");\n\n }","closeSearch() {\n if (this.closable) {\n this.element_main.style.visibility = \"hidden\"; // hide search box\n document.activeElement.blur(); // remove focus from search box \n this.visible = false; // search not visible\n }\n }","function hideForm(){\n const form = document.getElementById('dino-compare');\n form.style.display = 'none';\n}","function hideBoardEditForm() {\n vm.isBoardEditFormVisible = false;\n }","function closeEditForm(event) {\n const element = event.currentTarget;\n\n var iconGroup = element.parentNode,\n iconColumn = iconGroup.parentNode,\n row = iconColumn.parentNode,\n formContainer = row.parentNode,\n parent = formContainer.parentNode,\n studentContainer = parent.querySelector(\".student-details\");\n console.log();\n\n formContainer\n .classList\n .add(\"d-none\");\n\n studentContainer\n .classList\n .remove(\"d-none\");\n}","function closeDesktopSearch() {\n document.getElementsByClassName('search-form-desktop')[0].setAttribute('class', 'search-form');\n document.getElementsByClassName('search-form-icon-desktop-active')[0].style.cssText = 'display: none;';\n document.getElementsByClassName('search-form-icon-desktop')[0].style.cssText = 'display: inline-block;';\n}","function closeExcursionsMenu() {\n !!list.excursionMenu && list.excursionMenu.hide();\n }","function openSearchForm() {\n spaceList.innerHTML = '';\n selectionHeading.innerText = '';\n searchWindow.classList.toggle('show');\n}","function closeRegister(){\n document.getElementById(\"register-page\").style.display='none';\n}","function parClose(){\n if (typeof parent.delSubmitSafe == 'function')\n parent.delSubmitSafe();\n if (typeof top.delSubmitSafe == 'function')\n top.delSubmitSafe();\n if (par!=null)\n par.style.display='none';\n}","function fHideAllForms() {\n fLog(\"fHideAllForms\");\n for (i = 0; i < vaServices.length; i++) {\n var dService = vaServices[i];\n var oForm = dService[\"form\"];\n fHide(oForm);\n }\n}","function closeForm() {\n const form = document.querySelector('#form')\n let title = document.querySelector('#formTitle').value;\n let author = document.querySelector('#formAuthor').value;\n let pages = document.querySelector('#formPage').value;\n let read = document.querySelector('#formRead').value;\n let newBook = new book(title, author, pages, read);\n debugger\n console.log(newBook);\n form.style.display = 'block';\n //form grabs data but disapears????\n}","function hideForm() {\n document.getElementById(\"dino-compare\").style.display = 'none'\n}","function closeSystemInfo() {\n if (isSystemInfoOpen) {\n systemInfoPanel.classList.add('hidden');\n isSystemInfoOpen = false;\n }\n }","function hideOtherThreads() {\n var array = $$('.threadItem');\n var open = false;\n array.each(function(item){\n if(item.get('open') == 'true') {\n open = true;\n }\n });\n // If there is an opened item\n if (open == true) {\n array = $$('.threadItem[open = false]');\n // For each unopened thread item\n array.each(function(item){\n item.setStyles({\n 'visibility' : 'hidden',\n 'display':'none'\n }); \n }); \n // Not on thread page so dispose of thread button\n $('addThreadButton').dispose();\n if($('newThreadForm') != null) {\n // if the form has been opened dipose of it too\n $('newThreadForm').dispose();\n }\n }\n}","function hideOnCloseBtn() {\n $(\".closebtn\").on('click', function() {\n $(\".user_login\").hide();\n })\n }","hideWindow() {\n\t\tfinsembleWindow.hide();\n\t}","function showHideForm() {\n /*\n If the form is hidden:\n * Show the form\n * Set the button text to 'Hide Form' or 'Cancel'\n * Set the input focus to the name field\n Else\n * Clear the form (call resetFormValues())\n * Hide the form\n * Set the button text back to 'Add Review'\n */\n let form = document.querySelector('form');\n let addButton = document.getElementById('btnToggleForm');\n if (form.classList.contains('d-none')) {\n form.classList.remove('d-none');\n addButton.innerText = \"Hide Form\";\n document.getElementById('name').focus();\n } else {\n form.classList.add('d-none');\n addButton.innerText = \"Add Review\";\n resetFormValues();\n }\n}","function hide_widget_wizard() {\n $('#open-nc-widget').remove();\n $('#dd-form, #data-tables').show('slow'); \n }","function showApp() {\n if (!isHidden) {\n return;\n }\n\n Object(external_lodash_[\"forEach\"])(hiddenElements, function (element) {\n element.removeAttribute('aria-hidden');\n });\n hiddenElements = [];\n isHidden = false;\n}","function openEdit(div, form){\n\tdiv.style.display = \"none\";\n\tform.style.display = \"block\";\n}","function openEdit(div, form){\n\tdiv.style.display = \"none\";\n\tform.style.display = \"block\";\n}","function closeFPOpenCurrent(id) {\n\tif (document.getElementsByClassName('form-popup').style.display != 'none') {\n\t\tdocument.getElementsByClassName('form-popup').style.display = 'none';\n\t\tdocument.getElementById(id).style.display = 'block';\n\t}\n}","function closeOption(param) {\n\n gw_com_api.hide(\"frmOption\");\n\n}","function closeQuoteForm()\n\t{\n\t\tdocument.getElementById('quote_form').style.display=\"none\";\n\t}","handleTaskForm()\n {\n if(this.state.dispForm == true)\n {\n this.state.dispForm = false;\n document.getElementById(\"addTaskForm\").style.display=\"none\";\n \n }\n else if(this.state.dispForm == false)\n {\n this.state.dispForm = true;\n document.getElementById(\"addTaskForm\").style.display=\"block\";\n \n }\n \n }","function checkForm() {\n addBookToLibrary();\n let myLibrarySize = myLibrary.length - 1;\n for (let i in myLibrary[myLibrarySize]){\n if (myLibrary[myLibrarySize][i] == \"\"){\n myLibrary.pop();\n return false;\n }\n }\n removeAll();\n closeForm();\n displayBook();\n return true;\n}","function hideWorkflowUpdateEditor()\n {\n $.PercDataList.enableButtons(container);\n $(\"#perc-workflow-name\").val(\"\");\n $(\"#perc-wf-update-editor\").hide();\n $(\"#perc-wf-name-wrapper\").show();\n dirtyController.setDirty(false);\n }","function displayAddMenuWindow(){\r\n if(!AddMenuWindow.isVisible()){\r\n resetAddMenuForm();\r\n AddMenuWindow.show();\r\n } else {\r\n AddMenuWindow.toFront();\r\n }\r\n \r\n \r\n }","function openForm(hiddenFormID) {\n\tvar allFormPopups = document.getElementsByClassName('form-popup');\n\tfor (x = 0; x < allFormPopups.length; x++) {\n\t\tdocument.getElementsByClassName('form-popup')[x].style.display = 'none';\n\t}\n\tdocument.getElementById(hiddenFormID).style.display = 'block';\n}","function cancelForm() { switchToView('listing'); }","function closeInformationDialogBox() {\n document.getElementById(\"checkDoc\").style.display = \"none\";\n document.getElementById(\"dialogBox\").style.display = \"none\";\n}","function hide_add_product()\n{\n\t//hide the modal box \n\t$('.overlay').hide(); \n\t$('#product_picker').hide(); \t\n\t//Redraw the screen \n\tredraw_order_list();\n}","function openGestionFilm() {\n\n $(\"#logindiv\").hide();\n $(\"#signupdiv\").hide();\n $(\"#allProd\").hide();\n $(\"#gestionMembreDiv\").hide();\n $(\"#gestionFilmDiv\").show();\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 hideBoardTitleForm() {\n vm.isBoardTitleFormVisible = false;\n }","function hideForm2() {\n $('.form-2').hide();\n }","function showForm() {\n var orderForm = document.forms.order;\n orderForm.classList.toggle('disactive');\n }","function closeForm(hiddenFormID) {\n\tdocument.getElementById(hiddenFormID).style.display = 'none';\n}"],"string":"[\n \"function hideListForm() {\\n if (!isAddingList) {\\n vm.isListFormVisible = false;\\n }\\n }\",\n \"function hideForm() {\\n mainForm.style.display = 'none';\\n newInfoButton.style.display = 'block';\\n}\",\n \"hideCreateForm() {\\n this.changeFormMode(this.FORM_MODES.LIST);\\n }\",\n \"function closeForm(){\\n document.getElementsByClassName('container-toDO')[0].style.display = 'block';\\n let PopUp = document.getElementsByClassName('pop-up')[0];\\n PopUp.classList.add('hides');\\n document.getElementById(\\\"myForm\\\").style.display = \\\"none\\\";\\n }\",\n \"function closeModuleList() {\\n $(\\\".graybg\\\").hide();\\n $('.add_module_list').hide();\\n $('body').css('overflow-y', 'auto');\\n visibleAddEvent = false;\\n}\",\n \"function hideForm() {\\n\\t\\tthat.state.formShow = false;\\n\\t}\",\n \"function closeForm() {\\n $('.add-parent-popup').hide();\\n $('.overlay').hide();\\n clearFields();\\n $('#pin-message').hide();\\n}\",\n \"function closeForm() {\\n document.getElementById(\\\"myForm\\\").style.display = \\\"none\\\";\\n document.getElementById(\\\"post-start\\\").style.display = \\\"none\\\";\\n document.getElementById(\\\"post-start-title\\\").style.display = \\\"none\\\";\\n document.getElementById(\\\"delete\\\").disabled = false;\\n document.getElementById(\\\"add\\\").disabled = false;\\n document.getElementById(\\\"upload\\\").disabled = false;\\n}\",\n \"function cancelNewProgramForm() {\\n $('#injected-content').hide();\\n $('#main-content').fadeIn();\\n $('aside div').hide();\\n $('aside div.new-program').fadeIn().css(\\\"display\\\",\\\"inline-block\\\");\\n}\",\n \"function hideAddDeviceForm() {\\n $(\\\"#addDeviceControl\\\").show(); // Hide the add device link\\n $(\\\"#addDeviceForm\\\").slideUp(); // Show the add device form\\n $(\\\"#error\\\").hide();\\n}\",\n \"function hideAddDeviceForm() {\\n $(\\\"#addDeviceControl\\\").show(); // Hide the add device link\\n $(\\\"#addDeviceForm\\\").slideUp(); // Show the add device form\\n $(\\\"#error\\\").hide();\\n}\",\n \"function hideAddDeviceForm() {\\n $(\\\"#addDeviceControl\\\").show(); // Hide the add device link\\n $(\\\"#addDeviceForm\\\").slideUp(); // Show the add device form\\n $(\\\"#error\\\").hide();\\n}\",\n \"function closeInput() {\\n document.getElementById('editForm').style.display = 'none';\\n}\",\n \"function CloseAppt() {\\n $(\\\"#add-appt\\\").css(\\\"display\\\", \\\"inline-block\\\");\\n $(\\\"#appt-form\\\").css(\\\"display\\\", \\\"none\\\");\\n $(\\\"#add-btn\\\").css(\\\"display\\\", \\\"none\\\");\\n $(\\\"#cancel-btn\\\").css(\\\"display\\\", \\\"none\\\");\\n}\",\n \"function closeFormButton() {\\n clearFields();\\n $('#add-section').hide();\\n $('.show-form-btn').show();\\n}\",\n \"function closeApp()\\n{\\n\\tdocument.getElementById(\\\"openAppHolder\\\").remove();\\n}\",\n \"function openForm(){\\n document.getElementsByClassName('container-toDO')[0].style.display = 'none';\\n let PopUp = document.getElementsByClassName('pop-up')[0];\\n PopUp.classList.remove('hides');\\n document.getElementById(\\\"myForm\\\").style.display = \\\"block\\\";\\n}\",\n \"function hideAllForms() {\\n\\t$('#add-item-form').hide();\\n\\t$('#set-email-form').hide();\\n}\",\n \"function closeSubmitted(e) {\\n if(e.target === submitBtn && bookTitle.value !== \\\"\\\" && bookAuthor.value !== \\\"\\\" && pages.value !== \\\"\\\"){\\n formContainer.style.display = 'none'\\n }else{\\n displayData()\\n }\\n}\",\n \"function hideAddListForm() {\\r\\n\\r\\n let addListForm = document.getElementById(\\\"addListForm\\\");\\r\\n let annuleerAddList = document.getElementById(\\\"annuleerAddList\\\");\\r\\n\\r\\n addListForm.classList.add(\\\"invisible\\\");\\r\\n annuleerAddList.classList.add(\\\"invisible\\\");\\r\\n}\",\n \"function view () {\\n $('div.employeeList').removeClass('hidden');\\n // $('form.addForm').addClass('hidden');\\n var forms = document.querySelectorAll('form');\\n if (forms[0] != undefined) {\\n document.body.removeChild(forms[0]);\\n }\\n toggleActive('View');\\n}\",\n \"function closeForm() {\\n document.getElementById(\\\"myForm\\\").style.display = \\\"none\\\"; \\n}\",\n \"function closeForm() {\\r\\n document.getElementById(\\\"popupForm\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"taForm\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"anmtForm\\\").style.display = \\\"none\\\";\\r\\n}\",\n \"function displayFormWindow(){\\r\\n if(!AddTAWindow.isVisible()){\\r\\n resetAddForm();\\r\\n AddTAWindow.show();\\r\\n } else {\\r\\n AddTAWindow.toFront();\\r\\n }\\r\\n \\r\\n \\r\\n }\",\n \"function closeForm() {\\n document.getElementById(\\\"myForm\\\").style.display = \\\"none\\\";\\n document.getElementById('openBtn').style.display = 'block';\\n // clear channel poller running in window\\n clearInterval(window.poller);\\n}\",\n \"function hideReplaceDeviceForm() {\\n $(\\\"#relpaceDeviceControl\\\").show(); // Hide the add device link\\n $(\\\"#replaceDeviceForm\\\").slideUp(); // Show the add device form\\n $(\\\"#error\\\").hide();\\n}\",\n \"function closeAdd(e) {\\n //if form isn't open don't bother checking anything.\\n if ($(\\\"#newCollectibleForm\\\").css(\\\"display\\\") === \\\"none\\\")\\n return;\\n var container = $(\\\"#newCollectibleForm\\\");\\n\\n if (!container.is(e.target)\\n && container.has(e.target).length === 0)\\n {\\n console.log(\\\"Closing...\\\");\\n //if we click on the toast don't close the form\\n if ($(e.target).attr(\\\"class\\\").indexOf(\\\"toast\\\") !== -1)\\n return;\\n\\n clearForm();\\n closeForm();\\n $(document).off(\\\"mouseup\\\");\\n }\\n }\",\n \"function hideForm() {\\n $scope.formDisplay = false;\\n }\",\n \"function closeAddFrom(){\\n var container = document.getElementById(\\\"addFromContainer\\\");\\n container.style.display = \\\"none\\\";\\n}\",\n \"function showNewProgramForm() {\\n var url = \\\"includes/new_program_form.php\\\";\\n var contentContainer = $('#injected-content');\\n $('#main-content').hide();\\n getData(url, injectContent, contentContainer);\\n contentContainer.fadeIn();\\n $('aside div').hide();\\n $('aside div.cancel').fadeIn().css(\\\"display\\\",\\\"inline-block\\\");\\n}\",\n \"function exitForm() {\\n $('#contactForm').hide();\\n}\",\n \"function toggleEntryForm() {\\n const HideForm = document.getElementById(\\\"dino-compare\\\");\\n HideForm.classList.add(\\\"hide\\\");\\n }\",\n \"function closeCreateUserForm() {\\n document.getElementById(\\\"createUserForm\\\").style.display = \\\"none\\\";\\n}\",\n \"function displayFormWindow(){\\r\\n if(!AddPriceWindow.isVisible()){\\r\\n resetPriceForm();\\r\\n AddPriceWindow.show();\\r\\n } else {\\r\\n AddPriceWindow.toFront();\\r\\n }\\r\\n\\r\\n\\r\\n }\",\n \"function hideForm() {\\n orderForm.style.display = 'none';\\n}\",\n \"function displayEFormWindow(){\\r\\n if(!EditCourseWindow.isVisible()){\\r\\n resetECourseForm();\\r\\n EditCourseWindow.show();\\r\\n } else {\\r\\n EditCourseWindow.toFront();\\r\\n }\\r\\n \\r\\n \\r\\n }\",\n \"function hideFormMedidaCreate(){\\n $(\\\"#medida-table\\\").show(300);\\n $(\\\"#medida-pagination\\\").show(300);\\n $(\\\"#medida-view\\\").hide(300);\\n $(\\\"#medida-create\\\").hide(300);\\n $(\\\"#medida-button\\\").removeClass(\\\"active\\\");\\n}\",\n \"function hideForm() {\\n form.classList.add('hidden');\\n}\",\n \"function showAddListForm() {\\r\\n\\r\\n let addListForm = document.getElementById(\\\"addListForm\\\");\\r\\n let annuleerAddList = document.getElementById(\\\"annuleerAddList\\\");\\r\\n\\r\\n addListForm.classList.remove(\\\"invisible\\\");\\r\\n annuleerAddList.classList.remove(\\\"invisible\\\");\\r\\n}\",\n \"function hideForm() {\\n document.getElementById('appendForm').style.display = \\\"none\\\"\\n // test commit made through Github interface.\\n // to start editing, I opened this specific file in Github, then I pressed: .\\n // That's it. If I can edit and commit from here, this is officially crazy. \\n }\",\n \"function closeForm() {\\n document.getElementById(\\\"msgForm\\\").style.display = \\\"none\\\";\\n}\",\n \"function hideForm1() {\\n $('.form-1').hide();\\n }\",\n \"function removeForm() {\\n const form = document.querySelector('#dino-compare');\\n form.style.display = \\\"none\\\";\\n }\",\n \"function revealInputForm() {\\n $(this).find('form').removeClass('hidden');\\n }\",\n \"function closeApp() {\\n document.getElementById(\\\"form-close\\\").submit();\\n}\",\n \"function showForm(){\\n form.reset();\\n background.classList.add(\\\"transparent\\\")\\n addBookForm.classList.remove(\\\"form--hidden\\\");\\n }\",\n \"closeLoginForm() {\\n document.getElementById(\\\"showLoginForm\\\").checked = false;\\n this.switchToLogin();\\n updatePageTitle(\\\"Utforsk nye aktiviteter\\\");\\n }\",\n \"function showForm() {\\n document.querySelector(\\\"#new-book-form\\\").classList.remove(\\\"hide\\\");\\n document.querySelector(\\\"#new-book-form\\\").classList.add(\\\"show\\\");\\n}\",\n \"function toggleForm() {\\n formContainer.classList.toggle(\\\"invisible\\\");\\n mainContainer.classList.toggle(\\\"invisible\\\");\\n}\",\n \"closeForm(){\\n this.setState({showEditForm: false});\\n sessionStorage.setItem('showEditForm', 'false');\\n }\",\n \"function closeListContent() {\\n $(\\\"#sidebar2\\\").css(\\\"display\\\",\\\"none\\\");\\n}\",\n \"function AddBookForm() {\\n document.querySelector('.heading').style.display = 'none';\\n document.querySelector('#lib').style.display = 'none';\\n document.querySelector('#list_container').style.display = 'none';\\n document.querySelector('.line').style.display = 'none';\\n document.querySelector('#AddNewbook_container').style.display = 'block';\\n document.querySelector('#contact').style.display = 'none';\\n document.querySelector('#welcome').style.display = 'none';\\n}\",\n \"hide()\\n {\\n this._window.hide();\\n }\",\n \"function startapp(app) {\\n/*\\nif (document.getElementById(app).style.display==\\\"block\\\") {\\ndocument.getElementById(app).style.display=\\\"none\\\"; }\\nelse {document.getElementById(app).style.display=\\\"block\\\";}\\n*/\\n}\",\n \"function closeList() {\\n\\tif (iPopupOpen) {\\n\\t\\tofVBAISpan.style.display=\\\"none\\\";\\n\\t\\tiPopupOpen=false;\\n\\t\\t}\\n\\t}\",\n \"function closeForm() {\\n document.getElementById(\\\"author\\\").value = \\\"\\\";\\n document.getElementById(\\\"title\\\").value = \\\"\\\";\\n document.getElementById(\\\"pages\\\").value = \\\"\\\";\\n document.getElementById(\\\"read\\\").checked = false;\\n document.getElementById(\\\"notRead\\\").checked = true;\\n document.getElementById(\\\"form\\\").style.display = \\\"none\\\";\\n}\",\n \"function attachCloseButtonToForm() {\\n let closeFormButton = document.querySelector(\\\"#cancel-form\\\");\\n closeFormButton.addEventListener(\\\"click\\\", () => {\\n editOrCreateFormContainer.style.display = \\\"none\\\";\\n document.querySelector(\\\"#create-meme-iframe\\\").style.display = \\\"unset\\\";\\n modifyElemenetsWithClassHidden(\\\"none\\\");\\n clearForm();\\n });\\n}\",\n \"function frmPatientSummary_hideDropDownsOnFormclick() {\\n frmPatientSummary.fcunitslist.setVisibility(false);\\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 }\",\n \"function closeElement() {\\r\\n\\t\\tvar removeDocument = document.getElementById(\\\"removeDocument\\\");\\r\\n\\t\\tif (removeDocument.style.visibility === \\\"visible\\\") removeDocument.style.visibility = \\\"hidden\\\";\\r\\n\\t\\tvar openDocument = document.getElementById(\\\"openDocument\\\");\\r\\n\\t\\tif (openDocument.style.visibility === \\\"visible\\\") openDocument.style.visibility = \\\"hidden\\\";\\r\\n\\t }\",\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 }\",\n \"close() {\\n\\n // Pop the activity from the stack\\n utils.popStackActivity();\\n\\n // Hide the screen\\n this._screen.scrollTop(0).hide();\\n\\n // Hide the content behind the placeholders\\n $(\\\"#page--info .ph-hidden-content\\\").hide();\\n\\n // Stop the placeholders animation\\n this._placeholders.removeClass(\\\"ph-animate\\\").show();\\n\\n // Hide the delete button\\n $(\\\"#info-delete\\\").hide();\\n\\n // Hide the info button\\n $(\\\"#info-edit\\\").hide();\\n\\n // Show all the fields\\n $(\\\".info-block\\\").show();\\n\\n // Delete the content of each of the fields\\n $(\\\"#info-createdAt .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-updatedAt .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-coordinates .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-coordinatesAccuracy .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-altitude .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-altitudeAccuracy .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-type .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-materialType .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-hillPosition .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-water .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-vegetation .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-mitigation .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-mitigationsList .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-monitoring .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-monitoringList .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-damages .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-damagesList .info-content\\\").html(\\\"\\\");\\n $(\\\"#info-notes .info-content\\\").html(\\\"\\\");\\n\\n // Show the image placeholder\\n $(\\\"#info-photo-preview\\\").attr(\\\"src\\\", \\\"img/no-img-placeholder-200.png\\\");\\n\\n }\",\n \"closeSearch() {\\n if (this.closable) {\\n this.element_main.style.visibility = \\\"hidden\\\"; // hide search box\\n document.activeElement.blur(); // remove focus from search box \\n this.visible = false; // search not visible\\n }\\n }\",\n \"function hideForm(){\\n const form = document.getElementById('dino-compare');\\n form.style.display = 'none';\\n}\",\n \"function hideBoardEditForm() {\\n vm.isBoardEditFormVisible = false;\\n }\",\n \"function closeEditForm(event) {\\n const element = event.currentTarget;\\n\\n var iconGroup = element.parentNode,\\n iconColumn = iconGroup.parentNode,\\n row = iconColumn.parentNode,\\n formContainer = row.parentNode,\\n parent = formContainer.parentNode,\\n studentContainer = parent.querySelector(\\\".student-details\\\");\\n console.log();\\n\\n formContainer\\n .classList\\n .add(\\\"d-none\\\");\\n\\n studentContainer\\n .classList\\n .remove(\\\"d-none\\\");\\n}\",\n \"function closeDesktopSearch() {\\n document.getElementsByClassName('search-form-desktop')[0].setAttribute('class', 'search-form');\\n document.getElementsByClassName('search-form-icon-desktop-active')[0].style.cssText = 'display: none;';\\n document.getElementsByClassName('search-form-icon-desktop')[0].style.cssText = 'display: inline-block;';\\n}\",\n \"function closeExcursionsMenu() {\\n !!list.excursionMenu && list.excursionMenu.hide();\\n }\",\n \"function openSearchForm() {\\n spaceList.innerHTML = '';\\n selectionHeading.innerText = '';\\n searchWindow.classList.toggle('show');\\n}\",\n \"function closeRegister(){\\n document.getElementById(\\\"register-page\\\").style.display='none';\\n}\",\n \"function parClose(){\\n if (typeof parent.delSubmitSafe == 'function')\\n parent.delSubmitSafe();\\n if (typeof top.delSubmitSafe == 'function')\\n top.delSubmitSafe();\\n if (par!=null)\\n par.style.display='none';\\n}\",\n \"function fHideAllForms() {\\n fLog(\\\"fHideAllForms\\\");\\n for (i = 0; i < vaServices.length; i++) {\\n var dService = vaServices[i];\\n var oForm = dService[\\\"form\\\"];\\n fHide(oForm);\\n }\\n}\",\n \"function closeForm() {\\n const form = document.querySelector('#form')\\n let title = document.querySelector('#formTitle').value;\\n let author = document.querySelector('#formAuthor').value;\\n let pages = document.querySelector('#formPage').value;\\n let read = document.querySelector('#formRead').value;\\n let newBook = new book(title, author, pages, read);\\n debugger\\n console.log(newBook);\\n form.style.display = 'block';\\n //form grabs data but disapears????\\n}\",\n \"function hideForm() {\\n document.getElementById(\\\"dino-compare\\\").style.display = 'none'\\n}\",\n \"function closeSystemInfo() {\\n if (isSystemInfoOpen) {\\n systemInfoPanel.classList.add('hidden');\\n isSystemInfoOpen = false;\\n }\\n }\",\n \"function hideOtherThreads() {\\n var array = $$('.threadItem');\\n var open = false;\\n array.each(function(item){\\n if(item.get('open') == 'true') {\\n open = true;\\n }\\n });\\n // If there is an opened item\\n if (open == true) {\\n array = $$('.threadItem[open = false]');\\n // For each unopened thread item\\n array.each(function(item){\\n item.setStyles({\\n 'visibility' : 'hidden',\\n 'display':'none'\\n }); \\n }); \\n // Not on thread page so dispose of thread button\\n $('addThreadButton').dispose();\\n if($('newThreadForm') != null) {\\n // if the form has been opened dipose of it too\\n $('newThreadForm').dispose();\\n }\\n }\\n}\",\n \"function hideOnCloseBtn() {\\n $(\\\".closebtn\\\").on('click', function() {\\n $(\\\".user_login\\\").hide();\\n })\\n }\",\n \"hideWindow() {\\n\\t\\tfinsembleWindow.hide();\\n\\t}\",\n \"function showHideForm() {\\n /*\\n If the form is hidden:\\n * Show the form\\n * Set the button text to 'Hide Form' or 'Cancel'\\n * Set the input focus to the name field\\n Else\\n * Clear the form (call resetFormValues())\\n * Hide the form\\n * Set the button text back to 'Add Review'\\n */\\n let form = document.querySelector('form');\\n let addButton = document.getElementById('btnToggleForm');\\n if (form.classList.contains('d-none')) {\\n form.classList.remove('d-none');\\n addButton.innerText = \\\"Hide Form\\\";\\n document.getElementById('name').focus();\\n } else {\\n form.classList.add('d-none');\\n addButton.innerText = \\\"Add Review\\\";\\n resetFormValues();\\n }\\n}\",\n \"function hide_widget_wizard() {\\n $('#open-nc-widget').remove();\\n $('#dd-form, #data-tables').show('slow'); \\n }\",\n \"function showApp() {\\n if (!isHidden) {\\n return;\\n }\\n\\n Object(external_lodash_[\\\"forEach\\\"])(hiddenElements, function (element) {\\n element.removeAttribute('aria-hidden');\\n });\\n hiddenElements = [];\\n isHidden = false;\\n}\",\n \"function openEdit(div, form){\\n\\tdiv.style.display = \\\"none\\\";\\n\\tform.style.display = \\\"block\\\";\\n}\",\n \"function openEdit(div, form){\\n\\tdiv.style.display = \\\"none\\\";\\n\\tform.style.display = \\\"block\\\";\\n}\",\n \"function closeFPOpenCurrent(id) {\\n\\tif (document.getElementsByClassName('form-popup').style.display != 'none') {\\n\\t\\tdocument.getElementsByClassName('form-popup').style.display = 'none';\\n\\t\\tdocument.getElementById(id).style.display = 'block';\\n\\t}\\n}\",\n \"function closeOption(param) {\\n\\n gw_com_api.hide(\\\"frmOption\\\");\\n\\n}\",\n \"function closeQuoteForm()\\n\\t{\\n\\t\\tdocument.getElementById('quote_form').style.display=\\\"none\\\";\\n\\t}\",\n \"handleTaskForm()\\n {\\n if(this.state.dispForm == true)\\n {\\n this.state.dispForm = false;\\n document.getElementById(\\\"addTaskForm\\\").style.display=\\\"none\\\";\\n \\n }\\n else if(this.state.dispForm == false)\\n {\\n this.state.dispForm = true;\\n document.getElementById(\\\"addTaskForm\\\").style.display=\\\"block\\\";\\n \\n }\\n \\n }\",\n \"function checkForm() {\\n addBookToLibrary();\\n let myLibrarySize = myLibrary.length - 1;\\n for (let i in myLibrary[myLibrarySize]){\\n if (myLibrary[myLibrarySize][i] == \\\"\\\"){\\n myLibrary.pop();\\n return false;\\n }\\n }\\n removeAll();\\n closeForm();\\n displayBook();\\n return true;\\n}\",\n \"function hideWorkflowUpdateEditor()\\n {\\n $.PercDataList.enableButtons(container);\\n $(\\\"#perc-workflow-name\\\").val(\\\"\\\");\\n $(\\\"#perc-wf-update-editor\\\").hide();\\n $(\\\"#perc-wf-name-wrapper\\\").show();\\n dirtyController.setDirty(false);\\n }\",\n \"function displayAddMenuWindow(){\\r\\n if(!AddMenuWindow.isVisible()){\\r\\n resetAddMenuForm();\\r\\n AddMenuWindow.show();\\r\\n } else {\\r\\n AddMenuWindow.toFront();\\r\\n }\\r\\n \\r\\n \\r\\n }\",\n \"function openForm(hiddenFormID) {\\n\\tvar allFormPopups = document.getElementsByClassName('form-popup');\\n\\tfor (x = 0; x < allFormPopups.length; x++) {\\n\\t\\tdocument.getElementsByClassName('form-popup')[x].style.display = 'none';\\n\\t}\\n\\tdocument.getElementById(hiddenFormID).style.display = 'block';\\n}\",\n \"function cancelForm() { switchToView('listing'); }\",\n \"function closeInformationDialogBox() {\\n document.getElementById(\\\"checkDoc\\\").style.display = \\\"none\\\";\\n document.getElementById(\\\"dialogBox\\\").style.display = \\\"none\\\";\\n}\",\n \"function hide_add_product()\\n{\\n\\t//hide the modal box \\n\\t$('.overlay').hide(); \\n\\t$('#product_picker').hide(); \\t\\n\\t//Redraw the screen \\n\\tredraw_order_list();\\n}\",\n \"function openGestionFilm() {\\n\\n $(\\\"#logindiv\\\").hide();\\n $(\\\"#signupdiv\\\").hide();\\n $(\\\"#allProd\\\").hide();\\n $(\\\"#gestionMembreDiv\\\").hide();\\n $(\\\"#gestionFilmDiv\\\").show();\\n}\",\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}\",\n \"function hideBoardTitleForm() {\\n vm.isBoardTitleFormVisible = false;\\n }\",\n \"function hideForm2() {\\n $('.form-2').hide();\\n }\",\n \"function showForm() {\\n var orderForm = document.forms.order;\\n orderForm.classList.toggle('disactive');\\n }\",\n \"function closeForm(hiddenFormID) {\\n\\tdocument.getElementById(hiddenFormID).style.display = 'none';\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.66123235","0.65635896","0.65525305","0.6478083","0.64173216","0.6416694","0.63985556","0.63683105","0.6364733","0.6262822","0.6239844","0.6239844","0.62326294","0.62016577","0.6171097","0.61555815","0.6123144","0.61150104","0.605529","0.6045824","0.6034964","0.6020635","0.60058105","0.6000355","0.5962955","0.59553236","0.5954376","0.593601","0.5935975","0.5922114","0.5914204","0.59117377","0.5902933","0.58901304","0.5887187","0.5878359","0.58661675","0.58653164","0.58613193","0.58590055","0.5856311","0.58548945","0.58495075","0.58452684","0.5836889","0.5807491","0.58072984","0.5805092","0.57990897","0.5797489","0.57939374","0.579127","0.5785707","0.5772961","0.57650936","0.57518905","0.57480216","0.5729151","0.5723177","0.571721","0.5716925","0.5713456","0.5706872","0.57061213","0.5698954","0.5695646","0.56955296","0.5695333","0.5694598","0.5687887","0.5676821","0.56765413","0.5652718","0.5651643","0.5648468","0.5648005","0.56463915","0.5640329","0.56329113","0.56296974","0.562784","0.56255484","0.56255484","0.5625307","0.56226504","0.5622209","0.5619102","0.56189984","0.5615688","0.56149393","0.56131756","0.5604892","0.5602997","0.56000817","0.5595475","0.55951494","0.5592343","0.5590404","0.5590198","0.5588344"],"string":"[\n \"0.66123235\",\n \"0.65635896\",\n \"0.65525305\",\n \"0.6478083\",\n \"0.64173216\",\n \"0.6416694\",\n \"0.63985556\",\n \"0.63683105\",\n \"0.6364733\",\n \"0.6262822\",\n \"0.6239844\",\n \"0.6239844\",\n \"0.62326294\",\n \"0.62016577\",\n \"0.6171097\",\n \"0.61555815\",\n \"0.6123144\",\n \"0.61150104\",\n \"0.605529\",\n \"0.6045824\",\n \"0.6034964\",\n \"0.6020635\",\n \"0.60058105\",\n \"0.6000355\",\n \"0.5962955\",\n \"0.59553236\",\n \"0.5954376\",\n \"0.593601\",\n \"0.5935975\",\n \"0.5922114\",\n \"0.5914204\",\n \"0.59117377\",\n \"0.5902933\",\n \"0.58901304\",\n \"0.5887187\",\n \"0.5878359\",\n \"0.58661675\",\n \"0.58653164\",\n \"0.58613193\",\n \"0.58590055\",\n \"0.5856311\",\n \"0.58548945\",\n \"0.58495075\",\n \"0.58452684\",\n \"0.5836889\",\n \"0.5807491\",\n \"0.58072984\",\n \"0.5805092\",\n \"0.57990897\",\n \"0.5797489\",\n \"0.57939374\",\n \"0.579127\",\n \"0.5785707\",\n \"0.5772961\",\n \"0.57650936\",\n \"0.57518905\",\n \"0.57480216\",\n \"0.5729151\",\n \"0.5723177\",\n \"0.571721\",\n \"0.5716925\",\n \"0.5713456\",\n \"0.5706872\",\n \"0.57061213\",\n \"0.5698954\",\n \"0.5695646\",\n \"0.56955296\",\n \"0.5695333\",\n \"0.5694598\",\n \"0.5687887\",\n \"0.5676821\",\n \"0.56765413\",\n \"0.5652718\",\n \"0.5651643\",\n \"0.5648468\",\n \"0.5648005\",\n \"0.56463915\",\n \"0.5640329\",\n \"0.56329113\",\n \"0.56296974\",\n \"0.562784\",\n \"0.56255484\",\n \"0.56255484\",\n \"0.5625307\",\n \"0.56226504\",\n \"0.5622209\",\n \"0.5619102\",\n \"0.56189984\",\n \"0.5615688\",\n \"0.56149393\",\n \"0.56131756\",\n \"0.5604892\",\n \"0.5602997\",\n \"0.56000817\",\n \"0.5595475\",\n \"0.55951494\",\n \"0.5592343\",\n \"0.5590404\",\n \"0.5590198\",\n \"0.5588344\"\n]"},"document_score":{"kind":"string","value":"0.64333135"},"document_rank":{"kind":"string","value":"4"}}},{"rowIdx":559,"cells":{"query":{"kind":"string","value":"read saved data on start"},"document":{"kind":"string","value":"async function loadSavedData() {\n const newData = await new Promise(resolve => {\n fs.readFile(TMP_DB_PATH, (err, content) => {\n if (err) console.log(\"Error loading saved data from file. \", err);\n return resolve(JSON.parse(content));\n });\n });\n if (Array.isArray(newData) && newData.length) {\n data = newData;\n console.log(\"Loaded saved data from file.\");\n } else {\n console.log(\"No data in the file.\");\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function initialize() {\n fs.readFile(\"data.json\", (err, data) => {\n if (err) {\n return console.error(\"FATAL: couldn't restore app state from data.json\");\n }\n var state = JSON.parse(data);\n interactionsHistory = data.interactionsHistory || {};\n engagementHistory = data.engagementHistory || [];\n lastMentionId = data.lastMentionId || 1;\n lastCycleTime = data.lastCycleTime || 0;\n \n schedule();\n });\n}","function readAppData()\n {\n nsmethods.readDataIntoApplication();\n }","function LoadData(){\n\tLoadDataFiles();\n\tExtractDataFromFiles();\n}","function prepareProcessedData() {\n // #BUG: Had to add resourcesDirectory for Android...\n state.processedData = JSON.parse(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory + 'common/data-base.json').read().text);\n}","readData() {\n\t\t// Se non esiste, lo crea, con le impostazioni di default\n\t\tif (!fs.existsSync(this.filepath)) {\n\t\t\tlogger.debug('Creato nuovo file di impostazioni.');\n\t\t\tthis.writeData();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst text = fs.readFileSync(this.filepath, 'utf8');\n\t\t\t// file YAML => {}\n\t\t\tconst data = yaml.safeLoad(text);\n\n\t\t\t// NOTE: validazione in lettura su readData, mentre in scrittura su setData.\n\t\t\tif (!isValid(data)) {\n\t\t\t\tthrow new Error('impostazioni del file non valide.');\n\t\t\t} else {\n\t\t\t\tthis.data = data;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tlogger.error(`Errore nella lettura file yaml: ${e.toString()}`);\n\t\t}\n\t}","function loadData()\n{\n /***************\n * GET INTEGER *\n ***************/\n function getInt(name)\n {\n return parseInt(localStorage.getItem(name));\n }\n\n /***************\n * GET BOOLEAN *\n ***************/\n function getBool(name)\n {\n var data = getInt(name);\n if (data !== 0 && data !== null && data != undefined && !isNaN(data))\n return true;\n else\n return false;\n }\n \n // if local data exists, then get it\n if (getBool('data') === true)\n {\n // parse data\n ax = getInt('ax');\n ay = getInt('ay');\n dx = getInt('dx');\n dy = getInt('dy');\n score = getInt('score');\n recent = getInt('recent');\n hScore = getInt('hScore');\n paused = getBool('paused');\n doWrap = getBool('doWrap');\n \n // parse snake dataa\n var length = getInt('length');\n snake = [];\n for (var i = 0; i < length; i++)\n {\n var sx = getInt('snake' + i + 'x');\n var sy = getInt('snake' + i + 'y');\n snake.push({x: sx, y: sy}); \n }\n }\n // otherwise, initialize it\n else\n resetData();\n}","function loadData() {\n try {\n const fsStorageAsArray = JSON.parse(localStorage.getItem(\"saveArray\"));\n fromSaveFormat(fsStorageAsArray);\n } catch (err) {\n // fill some initial data\n fsStorage = [\n {\n id: 0, name: \"root\", children: [\n { id: 1, name: \"sub1\", children: [\n { id: 4, name: \"file.txt\"},\n { id: 5, name: \"sub3\", children: [\n {id: 6, name: \"file2.txt\", content: \"content2\"}\n ]}\n ]},\n { id: 2, name: \"sub2\", children: []},\n { id: 3, name: \"file1.txt\", content: \"text\"}\n ]\n }\n ]\n }\n }","function loadData() {\n try {\n get_valsFromJSON(JSON.parse(atob(localStorage.sv1)));\n } catch(NoSuchSaveException) { \n console.log(\"No saved data to load: \" + NoSuchSaveException);\n }\n}","function loadData() {\n var strBookPath = io.appendPath(conf.bookPath, this.strBookName);\n var strBookStructurePath = io.appendPath(strBookPath, conf.bookStructureFileName);\n io.getXmlContent(strBookStructurePath, setBookStructureXml);\n io.getFilesInDirectory(strBookPath, setPageFileNames);\n}","function _loadSavedData(cb) {\n if (window.localStorage._taskData === undefined) {\n window.memory.data = {\n \"FOCUS\" : [],\n \"TODAY\" : [],\n \"LATER\" : [],\n \"ASANA\" : [],\n \"NEVER\" : []\n };\n } else {\n window.memory.data = JSON.parse(window.localStorage._taskData);\n }\n if (cb) cb();\n}","function loadData()\n\t{\n\t\tloadMaterials(false);\n\t\tloadLabors(false);\n\t}","loadData() {\r\n\t\t// load the current tracker type data from localStorage\r\n\t\tlet currentData = localStorage.getItem( this.type );\r\n\r\n\t\t// parse it into an object if it exists\r\n\t\tif ( currentData ) {\r\n\t\t\tthis.data = JSON.parse(currentData);\r\n\t\t} else {\r\n\t\t\tthis.data = {};\r\n\t\t}\r\n\t}","function loadData(){\n\t\tloadParetoData();\n\t\tloadConstraints();\n\t\t\n\t}","function loadData() {\n // set all our variables\n setVars(twitch.configuration)\n // do an initial browse to `/`(root)\n navigate()\n // remove our loading element from the DM\n removeElement(\"repo-loading\")\n}","readData() {\r\n if (window.localStorage.getItem(this[\"key\"]) != null) {\r\n this.data = JSON.parse(window.localStorage.getItem(this[\"key\"]));\r\n }\r\n \r\n return this.data;\r\n }","function getAndProcessData() { \n\t\tchooseFileSource();\n\t}","initializeLoadOrder() {\n this.loadorder = json.read(\"user/cache/loadorder.json\");\n }","function preload () { \n training_data = loadStrings('./data/train_10000.csv', () => console.log(\"Training data loaded\"))\n testing_data = loadStrings('./data/test_1000.csv', () => console.log(\"Testing data loaded\"))\n}","function readUserData() {\r\n\treturn fs.readFileSync(storagePath, \"utf8\");\r\n}","function readStorage() {\n\tstudentGrade = localStorage.getItem(\"Student Grade:\");\n\tstudentGender = localStorage.getItem(\"Student Gender:\");\n\tstudentClub = localStorage.getItem(\"Student Club:\");\n\tstudentNumber = localStorage.getItem(\"Student Number:\");\n\tannTitle = JSON.parse(localStorage.getItem(\"AnnTitle:\"));\n\tannDetails = JSON.parse(localStorage.getItem(\"AnnDetails:\"));\n\tannGrade = JSON.parse(localStorage.getItem(\"AnnGrade:\"));\n\tannGender = JSON.parse(localStorage.getItem(\"AnnGender:\"));\n\tannClub = JSON.parse(localStorage.getItem(\"AnnClub:\"));\n\tannStudentNumber = JSON.parse(localStorage.getItem(\"AnnStudentNumber:\"));\n\tannDateTime = JSON.parse(localStorage.getItem(\"AnnDateTime:\"));\n}","function ImportData() {\n //in this method we can connect to database or read our necessery info from file\n //Currently we read registered users from file and History matches from file(maybe) and save to lists\n ReadFromFile();\n}","function _loadData()\n\t{\n\t\ttry\n\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t//create EZ.script.options from defaults\n\t\t\tvar options = EZ.script.options = EZ.options(EZ.defaultOptions.script);\t\t\n\t\t\t\n\t\t\t//---------------------------------------------------------------------\n\t\t\tvar json = localStorage.getItem('EZ.script.savedData')\n\t\t\tEZ.script.savedData = json ? JSON.parse(json) : {}\t\n\t\t\t//---------------------------------------------------------------------\n\t\t\t\n\t\t\tvar savedData = json ? JSON.parse(json) : {}\t\n\t\t\tif (savedData.version != options.version)\n\t\t\t\tsavedData = {version: options.version, timestamp:''};\n\t\t\t//savedData.listValues = savedData.listValues || {}\n\t\t\tsavedData.listOptions = savedData.listOptions || {};\n\t\t\tsavedData.fieldValues = savedData.fieldValues || {};\n\t\t\t\n\t\t\tvar log = EZ.field.add(savedData.fieldValues);\t//restore saved fieldValues\n\t\t\tEZ.log('EZscript.loadData', 'restored fieldValues', log);\n\t\t\t\n\t\t\tlog = EZ.field.add(['EZscript']);\t\t\t\t//add fields with default values (not saved)\n\t\t\tEZ.log('EZscript.loadData', 'all EZscript fields', {log:log});\n\t\t\t\n\t\t\tlog = EZ.event.trigger(['EZscript']);\t\t\t//fire events to initialize EZ.script.options\n\t\t\tEZ.log('EZscript.loadData', {'onload events':log})\n\t\t\t\n\t\t\tsetTimeout(function()\t\t\t\t\t\t\t//after events run...\n\t\t\t{\n\t\t\t\toptions.listNames.forEach(function(name)\t//populate saved list(s) options\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t//...and select save values\n\t\t\t\t\tvar list = _getEl(options.tags[name]);\n\t\t\t\t\tif (list)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar listValue = EZ.get(list);\n\t\t\t\t\t\tvar listOptions = '.'.concat(name,'.optionsList').ov(savedData.listOptions)\n\t\t\t\t\t\t\t\t\t || [].slice.call(list.options);\n\t\t\t\t\t\tlistOptions = EZ.script.listOptions[name] \n\t\t\t\t\t\t\t\t\t= EZ.displayDropdown(list, listOptions, listValue);\n\t\t\t\t\t\t_displayValue(name + 'Count', listOptions.valueList.length.wrap('['))\n\n\t\t\t\t\t\tvar value = EZ.get(list)\n\t\t\t\t\t\tif (name == 'history' && value.toInt() > 0)\n\t\t\t\t\t\t\t_displayValue('optionTime', value);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (name == 'favorites' && list.selectedIndex > 1)\n\t\t\t\t\t\t\t_displayValue('favoriteName', list.options[list.selectedIndex].text);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tEZ.script.saveData()\n\t\t\t}, 0 );\n\t\t}\n\t\tcatch (e)\n\t\t{\n\t\t\treturn EZ.oops(e);\n\t\t}\n\t}","function loadSaveData() {\n // Load configuration first\n let iconConfig = localStorage.getItem(\"IconConfig\") || \"image\";\n setIcons(iconConfig, false);\n \n let styleConfig = localStorage.getItem(\"StyleConfig\") || \"light\";\n setStyle(styleConfig);\n \n setListStyle(isListActive(), false);\n \n if (getLocal(currentMode, \"CompletedVisible\") == null) {\n let isNewSave = (getLocal(currentMode, \"Completed\") == null);\n setLocal(currentMode, \"CompletedVisible\", isNewSave.toString()); // New saves start open\n }\n \n if (currentMode == \"event\") {\n loadEventSaveData();\n } else {\n loadMainSaveData();\n }\n \n // Finally load up the completion time data\n missionCompletionTimes = {};\n let loadedCompletionTimes = getLocal(currentMode, \"CompletionTimes\");\n if (loadedCompletionTimes != null) {\n let completionTimesHash = JSON.parse(loadedCompletionTimes);\n for (let missionId in completionTimesHash) {\n missionCompletionTimes[missionId] = parseInt(completionTimesHash[missionId]);\n }\n }\n}","readin () {\n this.content = readFile(this.path);\n }","function Load()\n{\n // The file *does* exist\n if (fs.existsSync(\"save.json\"))\n {\n savedatasw = 1;\n const importdata = fs.readFileSync('save.json', 'utf8');\n const playerdata = JSON.parse(importdata);\n playername=playerdata.playername;\n playerlvl=playerdata.playerlvl;\n health=playerdata.health;\n mana=playerdata.mana;\n gold=playerdata.gold;\n savecoord=playerdata.savecoord;\n savedatasw=playerdata.savedatasw;\n playerinfo.playername=playername;\n playerinfo.playerlvl=playerlvl;\n playerinfo.health=health;\n playerinfo.mana=mana;\n playerinfo.gold=gold;\n playerinfo.savecoord=savecoord;\n playerinfo.savedatasw=savedatasw;\n return;\n }\n\n return;\n }","function restoreData() {\n myLibrary = []\n retrieveDataFromStorage(myLibrary)\n}","static async initGlobalData(){\n\t\tvar fileNames = await this.GetFileNames();\n\t\t\n\t\t_retrieveGlobal = async () => {\n\t\t\ttry {\n\t\t\t\tconst value = await AsyncStorage.getItem(\"GlobalData\");\n\t\t\t\t\n\t\t\t\tif (value != null) {\n\t\t\t\t\t//we have played before, load our GlobalData object into GameData\n\t\t\t\t\tGameData.setGlobalData(JSON.parse(value));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t//we have never played before, do nothing, waiting until the end of a player's first level to save the GlobalData object \n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (error) {\n\t\t\t\t// Error retrieving data\n\t\t\t\talert(error);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn _retrieveGlobal();\n\t}","function preload ( ) {\n // Read in all the data\n lines = loadStrings ( \"./distances2.csv\" ) ;\n}","loadData() {\n\n }","function initStorage(storage) {\n if (storage.isEmpty()) {\n // load the initial knowledge base from a text file in turtle format\n $.get('initial_kb.txt', function(turtle) {\n storage.loadKnowledgeBaseFromString(turtle);\n //alert(\"from local file: \" + turtle);\n storage.save();\n }, 'text');\n } else {\n storage.load();\n }\n}","function init() {\n if (localStorage.AddressBookRecord) {\n addresBookArray = JSON.parse(localStorage.AddressBookRecord);\n }\n}","load() {\n\t\t\tlet storage = Storage.local.get('commander') || null;\n\t\t\tif (storage) {\n\t\t\t\tupdate(bs => {\n\t\t\t\t\tbs = storage;\n\t\t\t\t\treturn bs;\n\t\t\t\t});\n\t\t\t}\n\t\t}","function init() {\n fs.readFile(\"./db/notes.json\", \"utf8\", function (err, data) {\n if (err) {\n throw err;\n }\n let notesJSON = JSON.parse(data);\n notesJSON.forEach(function (note) {\n notes.push(note);\n });\n lastId = Math.max(...notes.map((obj) => obj.id), 0) + 1;\n });\n}","function init(){\n getData();\n}","startReading() {\n this.startDate = Date.now();\n this.updatedDate = this.startDate;\n this.pageNumber = 1;\n }","function dataLoad()\n{\n try{\n var writ = fs.readFileSync('note.json')\n var buff = writ.toString();\n return JSON.parse(buff);\n }\n catch(e)\n {\n return [];\n }\n}","function readData() {\n\t\t\t\tconsole.log(\"Estado Session:\", sessionService.estadoSesion);\n\t\t\t\tif(sessionService.estadoSesion !== 00){\n\t\t\t\t\tjAlert(mensajeTexto.sesionExpirada, mensajeTexto.controlAcces, function () {\n\t\t\t\t\t\t$state.go('login');\t\n\t\t \t});\n\t\t\t\t}else{\n\t\t\t\t\treadDataSel();\n\t\t\t\t\treadDataQueue();\n\t\t\t\t}\n\t\t\t}","function read() {\n\tvar data = JSON.parse(fs.readFileSync('db/db.json', 'utf-8'));\n\treturn data;\n}","function preLoad() {\n\n\t\t\tangular.forEach($localStorage, function(value, key) {\n\t\t\t\tlocalStorageObj[key] = value\n\t\t\t});\n\n\t\t}","function initData(callback) {\n initLanguage(); // set the system language if not set\n DB.loadAll(function() {\n if(getUsers() === null){\n setUsers(DB.users);\n console.log('storing users in localStorage');\n }\n if(getBeverages() === null){\n setBeverages(DB.beverages);\n console.log('Storing beverages in localstorage');\n }\n if(getOrders() === null){\n setOrders([]);\n }\n if(callback) callback();\n });\n}","function preload() {\n //load json file\n data = loadJSON(\"./content.json\");\n}","function preload(){\n\t//loads .json data\n\t\tdata = loadJSON('paris-weather.json');\n}","function loadData() {\n sizeJSON = localStorage != null ? localStorage[\"size\"] : null;\n cartDataJSON = localStorage != null ? localStorage[\"cartData\"] : null;\n if (cartDataJSON != null && sizeJSON != null && JSON != null) {\n try {\n size = JSON.parse(sizeJSON);\n cartData = JSON.parse(cartDataJSON);\n }\n catch (err) {\n // ignore errors while loading...\n }\n }\n }","async initializeDataLoad() {\n }","function init() {\n createDataReader('heartbeat', true);\n createDataReader('timing');\n createDataReader('telemetry');\n }","preIngestData() {}","function readData() {\n d3.json(url).then(function (data) {\n samples_data = data;\n initializeIDPulldown();\n buildBarChart(0);\n buildBubbleChart(0);\n buildDemographics(0);\n buildGaugeChart(0);\n // log out the entire dataset\n console.log(samples_data);\n })\n}","async loadStartData() {\n console.timeStart('track');\n for (let document of this.documents.all()) {\n if (this.shouldTrackFile(vscode_uri_1.URI.parse(document.uri).fsPath)) {\n this.trackOpenedDocument(document);\n }\n }\n if (this.alwaysIncludeGlobPattern) {\n let alwaysIncludePaths = await util_1.promisify(glob_1.glob)(this.alwaysIncludeGlobPattern, {\n cwd: this.startPath || undefined,\n absolute: true,\n });\n for (let filePath of alwaysIncludePaths) {\n filePath = vscode_uri_1.URI.file(filePath).fsPath;\n if (this.shouldTrackFile(filePath)) {\n this.trackFile(filePath);\n }\n }\n }\n await this.trackFileOrFolder(this.startPath);\n console.timeEnd('track', `${this.map.size} files tracked`);\n this.startDataLoaded = true;\n }","async function init() {\n try {\n // Fetch new data\n currentLocation = await getLocation();\n const coordinates = `${currentLocation.coords.latitude},${currentLocation.coords.longitude}`;\n forecast = await getForecast(coordinates);\n\n // Render data\n renderForecast(forecast);\n renderCoordinates(currentLocation);\n\n // Save data\n localStorage.setItem('location', coordinates);\n localStorage.setItem('forecast', JSON.stringify(forecast));\n } catch (err) {\n renderErrors(err);\n }\n}","function loaddata(){\n\t\tvar data1 = localStorage.getItem(\"infor_sku\") || \"\";\n\t\tvar data2 = localStorage.getItem(\"pd\") || \"\";\n\t\tvar data3 = localStorage.getItem(\"sh\") || \"\";\n\t\tif (!!data1) { sku_items = JSON.parse(data1); }\n\t\tif (!!data2) { pd_items = JSON.parse(data2); }\n\t\tif (!!data3) { sh_items = JSON.parse(data3); }\n\t\t$(\"#datafile\").val( localStorage.getItem(\"datafile\") ||\"http://123.123.123.250:5000/\");\n\t\t$(\"#myfile\").val( localStorage.getItem(\"myfile\") ||\"spchkm/\");\n\t\t\n\t}","function initializeData() {\n const profileContents = fs.readFileSync(profileEntriesFile, 'utf8');\n const data = jsonic(profileContents);\n _.each(data, function (entry) {\n profileData.push(entry);\n });\n\n filterInterest.initData();\n}","loadStateImage() {\n let stateData = path.join(this.cwd, this.USER_DATA, this.TUTORSTATE);\n this.state = JSON.parse(fs.readFileSync(stateData));\n }","function preload(){\n\tdata = loadJSON('population.json'); // data variable is assigned json data\n}","function readData(){\r\n let dataRead = fs.readFileSync('data.json');\r\n let infoRead = JSON.parse(dataRead);\r\n return infoRead;\r\n}","function getSavedData() {\n chrome.storage.sync.get({\n data: SAMPLE_DATA,\n }, function (saved) {\n data = saved.data;\n });\n}","function preload() {\n data = loadTable('dict.csv', 'csv');\n}","function initData(){\n o_data = user.original_musics;\n d_data = user.derivative_musics;\n c_data = user.collected_musics;\n}","function loadData() {\n // STAND\n loadStandData();\n // PIT\n loadPitData();\n // IMAGES\n loadImageData();\n // NOTES\n loadNotesData();\n // PRESCOUTING\n loadPrescouting(\"./resources/prescout.csv\");\n\n}","function initializeStock() {\n\tbank = json.readFileSync(\"./wallet/bank.json\");\n}","function start() {\n\treadStorage();\n\tdisplayAnn();\n}","function ResumeManager_LoadData()\n{\n\t//by default we have no data\n\tvar resume = null;\n\t//do we have a valid controller?\n\tif (__CONTROLLER && __CONTROLLER.getResumeData)\n\t{\n\t\t//retrieve the resume data\n\t\tresume = __CONTROLLER.getResumeData();\n\t\t//valid?\n\t\tif (resume)\n\t\t{\n\t\t\t//is this a string?\n\t\t\tif (typeof resume == \"string\")\n\t\t\t{\n\t\t\t\t//convert to object\n\t\t\t\tresume = JSON.parse(resume);\n\t\t\t}\n\t\t\t//designer data object?\n\t\t\tif (resume.DesignerPreview)\n\t\t\t{\n\t\t\t\t//build the resume data from the preview data (using this so that all (most!) the resume code is here)\n\t\t\t\tresume = ResumeManager_GeneratePreviewData(resume.PathToStart);\n\t\t\t}\n\t\t\t//and now update its funcions\n\t\t\tresume.RestoreLesson = Resume_RestoreLesson;\n\t\t\tresume.StatesLoaded = Resume_StatesLoaded;\n\t\t\tresume.VerifySatesOptimised = Resume_VerifySatesOptimised;\n\t\t\tresume.MaximiseData = Resume_MaximiseData;\n\t\t\tresume.Notify_Get_ItemList_CallBack = Resume_Notify_CallBack;\n\t\t\tresume.Notify_State_CallBack = Resume_Notify_CallBack;\n\t\t}\n\t}\n\t//return the data\n\treturn resume;\n}","constructor() {\n this.data = this._loadData();\n }","loadFromFile() {\n // Don't save or load state if useRootDir is true\n if ( this.useRootDir ) {\n return;\n }\n\n if ( fs.existsSync( this.saveFile ) ) {\n const serialization = JSON.parse( fs.readFileSync( this.saveFile, 'utf-8' ) );\n this.snapshots = serialization.snapshots.map( Snapshot.deserialize );\n this.trashSnapshots = serialization.trashSnapshots ? serialization.trashSnapshots.map( Snapshot.deserializeStub ) : [];\n if ( serialization.pendingSnapshot && serialization.pendingSnapshot.directory ) {\n this.trashSnapshots.push( Snapshot.deserializeStub( serialization.pendingSnapshot ) );\n }\n }\n }","function loadData(){ \t\n \t//if (gameData.data.player.playerID>0) {\n \t\tCORE.LOG.addInfo(\"PROFILE_PAGE:loadData\");\n \t\t//var p = new ProfileCommunication(CORE.SOCKET, setData); \t\t\n \t\t//p.getData(gameData.data.player.playerID); \t\t\n \t\t\n \t//}\n \t//else \n \t\tsetDataFromLocalStorage(); \t \t \t\n }","function recoverPomoData() {\n if (localStorage.getItem(\"cpid\") !== null) {\n // Do not change these to getters and setters\n currentPomoID = parseInt(localStorage.getItem(\"cpid\"));\n pomoData = JSON.parse(localStorage.getItem(\"pomoData\"));\n }\n updateTable();\n}","function preload() {\n\tdata = loadJSON('new-york-weather.json');\n}","function initializeDataStorage() {\n for(i = 0; i < ordered_plates.length; i++) {\n sessionStorage.setItem(ordered_plates[i].name, 0);\n }\n }","getData() {\n // todo: read from fs if you have it already or retrieve using storage layer client\n return fs.readFileSync(Chunk.getChunkStoragePath(this.id), { encoding: null });\n }","function loadAll(){\n\tchangeSeason()\n\tgetAnimeData()\n\tgetCharacterData()\n\tgetEpisodeData()\n\tgetImageData()\n\tgetVideoData()\n}","load() {\n try {\n appState.state.cursor().update( cursor => {\n return cursor.merge( JSON.parse( window.localStorage.getItem( APPCONFIG.LS ) ) )\n })\n } catch( err ) {\n console.error( 'Error loading from local storage' )\n console.error( err )\n return\n }\n\n console.log( 'loaded' )\n }","async function load() {\n const str = await localStorage.getItem(KEY);\n if (!str) return;\n let initialState;\n ({ path, text, revision, lineCount, store: initialState } = JSON.parse(\n str\n ));\n store = createStore(reducer, initialState);\n }","function readFromFileAndInitAppState(fileName) {\n var stringReadFromFile = null;\n\n // Initialize a roaming folder variable.\n var roamingFolder = Windows.Storage.ApplicationData.current.roamingFolder;\n\n // Open tne file asynchronously.\n roamingFolder.getFileAsync(fileName).done(function (file) {\n file.openAsync(Windows.Storage.FileAccessMode.read).done(function (stream) {\n var size = stream.size;\n var inputStream = stream.getInputStreamAt(0);\n\n // Create a DataReader object.\n var reader = new Windows.Storage.Streams.DataReader(inputStream);\n\n // Read from the file.\n reader.loadAsync(size).done(function () {\n stringReadFromFile = reader.readString(size);\n\t\t reader.close();\n if (stringReadFromFile) {\n loadStatus = initializeAppState(stringReadFromFile, fileName);\n }\n callBackToComputeLoadState();\n }, function (errorOnReaderLoadAsync) {\n reader.close();\n callBackToComputeLoadState();\n });\n }, function (errorOnOpenFile) {\n callBackToComputeLoadState();\n });\n }, function (errorOnGetFileAsync) {\n callBackToComputeLoadState();\n });\n }","function load() {\n m_data.load(\"b4w/obj/moto.json\", load_cb);\n}","function loadLocalData(){\n if($scope.loading){\n return;\n }\n $scope.loading = true;\n storeService.getAllEntries(soup.name, sortBy, 'ascending').then(function(result){\n $scope.entries = result.currentPageOrderedEntries;\n console.log('entries', $scope.entries);\n $scope.loading = false;\n }, function(err){\n $scope.loading = false;\n });\n }","function loadData() {\n var storedDay = JSON.parse(localStorage.getItem(\"myDay\"));\n\n if (storedDay) {\n myDay = storedDay;\n }\n\n saveToDos();\n displayToDos();\n}","function loadData()\n{\n loadJSON('lastSearch.json', loadedData);\n}","read() {\n try {\n this._toggleEditThrobber();\n var id = parseInt(document.getElementById('edit_id').value);\n var outputEl = this._clearOutput();\n \n // read data from db\n var jsonObj = this.dao.read(id);\n if (!jsonObj) throw `Error reading experiment data for audiogram ${id}`;\n //console.log(jsonObj)\n this._showOutput(id, jsonObj);\n\n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleEditThrobber();\n }","preloadJson()\n {\n currentScene.load.json('dialogues', 'data/SingleDialogues.json');\n currentScene.load.json('notes', 'data/Notes.json');\n }","function readTrie() {\n var triePath = path.join(__dirname, './trie.json');\n if (fs.existsSync(triePath)) {\n // Read trie data from file (stored in case server restarts)\n const data = fs.readFileSync(triePath);\n var fileDataTrie = JSON.parse(data);\n trie = Object.setPrototypeOf(fileDataTrie, trieNode.prototype);\n console.log(\"Loading of previous trie done.\");\n } else {\n saveTrie();\n }\n}","function preload() {\n restaurantFile = loadJSON(\"Restaurant.json\");\n}","function loadData() {\n\n //Users name.\n loadName()\n\n //Users config.\n loadConfig()\n}","read() {\n return readFileAsync(\"db/db.json\", \"utf8\"); // shows the notes from the database json file (db.json)\n }","onLoad() {\n this.curLogic = require(\"logic\").getInstance();\n emitter.on(\"getdifficultData\",this.resetdifficultData,this); //保证能在数据层的json读取后赋值\n this.difficult = null;\n this.difficultData = this.curLogic.get(\"difficultData\");\n this.levelsData = [];\n this.initDiffState();\n this.initEditLevel();\n this.isshowLevels();\n }","function start_db () {\r\n dataref = firebase.database()\r\n read()\r\n}","function reloadData() {\n if (typeof (CPData) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataSoon) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataDownloaded) != \"undefined\") { CPData.regenerate(); }\n loadInfo();\n }","function init()\r\n\t\t\t{ \r\n\t\t\t\tget_data('get_dir','','directory');\r\n\t\t\t\tget_data('read_dir','current_dir','file_folder');\r\n\t\t\t}","leerDB() {\n //Verificar si existe el archivo, si no existe, el array de historial queda como se declaro (vacio).\n if (fs.existsSync(this.dbPath)) {\n const info = fs.readFileSync(this.dbPath, { encoding: 'utf-8' });\n const data = JSON.parse(info);\n this.historial = data;\n }\n }","function initLoad() {\n\n\tvar cityHistStore = JSON.parse(localStorage.getItem('city'));\n\n\tif (cityHistStore !== null) {\n\t\tcityHist = cityHistStore\n\t}\n\tgetHistory();\n\tgetWeatherToday();\n}","function load(callback){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}","function initialize() {\n//here you would load your data\n}","loadingData() {}","loadingData() {}","resetData() {\n\t\t\tthis.initFlags();\n\t\t\tthis.initMetadata();\n\t\t}","function read(){\n let AllKeys = Object.keys(localStorage);\n devKeys=AllKeys.filter(value => value.startsWith('Sdev'));\n // the global variable for al the objects\n devObjects=devKeys.map(obj => JSON.parse(localStorage.getItem(obj)));\n display_developers();\n}","function preload() {\n data = loadJSON(\"data/clean_speech_pop_20.json\");\n table = loadTable(\"data/mturk_task_sortedcity.csv\", \"csv\", \"header\");\n}","function initializeData() {\n \tconsole.log(\"Initializing data from session.json...\")\n \tvar rawData = fs.readFileSync(dataFile);\n \tdata = JSON.parse(rawData);\n\n \t// Reads in current collections located in data/corpus-files\n \tlet collections = fs.readdirSync('./data/corpus-files').filter(function (file) {\n\t\treturn fs.statSync('./data/corpus-files/' + file).isDirectory();\n\t});\n\n\t// Deletes any collections in the data JSON structure that don't appear\n\t// within our folder and prints a warning message.\n\tvar remove = [];\n\tfor (var c in data['collections']) {\n\t\tif (!collections.includes(c)) {\n\t\t\tremove.push(c);\n\t\t}\n\t}\n\tfor (var i in remove) {\n\t\tdelete data[remove[i]];\n\t\tconsole.log('WARNING: ' + remove[i] + ' collection doesn\\'t exist in data/corpus-files. Please either add the files or delete the entry from session.json.');\n\t}\n }","function readLocalStorage() {\n let readed = localStorage.getItem(\"language\");\n if(readed == null) {\n readed = \"English\"; // First time - Default\n console.log(\"No había nada en LocalStorage\");\n }\n controlLanguage(readed);\n }","function load_progress_as_of_last_saved() {\n\tif (progress_snapshot == 0) {\n\t\t// No progress, load from the start of level\n\t\t// Note that these values are already filled out\n\t\treturn true\n\t}\n\telse {\n\t\tlevel_number = progress_snapshot[0]\n\t\tquestion_number = progress_snapshot[1]\n\t\tdisplay_format = progress_snapshot[2]\n\t\tquestions_correct_total_count = progress_snapshot[3]\n\t\tquestions_incorrect_total_count = progress_snapshot[4]\n\t\tquestions_correct_level_count = progress_snapshot[5]\n\t\tquestions_incorrect_level_count = progress_snapshot[6]\n\t}\n}","function initData(){\n container.prepend(progressInfo);\n jQuery.get(getPageURL(0, resource)).done(function(data) {\n records = processData(data, true);\n initView(new recline.Model.Dataset({records:records}));\n numReq = getRequestNumber(data.result.total, pageSize);\n for (var i = 1; i <= numReq; i++) {\n requestData(getPageURL(i, resource));\n };\n });\n }","loadProgram() {\n const getBooks = JSON.parse(localStorage.getItem(STORAGE_NAME));\n const getId = JSON.parse(localStorage.getItem(STORAGE_ID));\n if (getBooks && getBooks.length != 0) {\n const storedBooks = getBooks;\n const storedId = getId;\n myLibrary = [...storedBooks];\n bookId = parseInt(storedId);\n console.log('loaded');\n } else {\n myLibrary = [...FILLER_DATA];\n bookId = 2;\n console.log('default');\n }\n storage.saveData();\n this.renderElem.render();\n }"],"string":"[\n \"function initialize() {\\n fs.readFile(\\\"data.json\\\", (err, data) => {\\n if (err) {\\n return console.error(\\\"FATAL: couldn't restore app state from data.json\\\");\\n }\\n var state = JSON.parse(data);\\n interactionsHistory = data.interactionsHistory || {};\\n engagementHistory = data.engagementHistory || [];\\n lastMentionId = data.lastMentionId || 1;\\n lastCycleTime = data.lastCycleTime || 0;\\n \\n schedule();\\n });\\n}\",\n \"function readAppData()\\n {\\n nsmethods.readDataIntoApplication();\\n }\",\n \"function LoadData(){\\n\\tLoadDataFiles();\\n\\tExtractDataFromFiles();\\n}\",\n \"function prepareProcessedData() {\\n // #BUG: Had to add resourcesDirectory for Android...\\n state.processedData = JSON.parse(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory + 'common/data-base.json').read().text);\\n}\",\n \"readData() {\\n\\t\\t// Se non esiste, lo crea, con le impostazioni di default\\n\\t\\tif (!fs.existsSync(this.filepath)) {\\n\\t\\t\\tlogger.debug('Creato nuovo file di impostazioni.');\\n\\t\\t\\tthis.writeData();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\ttry {\\n\\t\\t\\tconst text = fs.readFileSync(this.filepath, 'utf8');\\n\\t\\t\\t// file YAML => {}\\n\\t\\t\\tconst data = yaml.safeLoad(text);\\n\\n\\t\\t\\t// NOTE: validazione in lettura su readData, mentre in scrittura su setData.\\n\\t\\t\\tif (!isValid(data)) {\\n\\t\\t\\t\\tthrow new Error('impostazioni del file non valide.');\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tthis.data = data;\\n\\t\\t\\t}\\n\\t\\t} catch (e) {\\n\\t\\t\\tlogger.error(`Errore nella lettura file yaml: ${e.toString()}`);\\n\\t\\t}\\n\\t}\",\n \"function loadData()\\n{\\n /***************\\n * GET INTEGER *\\n ***************/\\n function getInt(name)\\n {\\n return parseInt(localStorage.getItem(name));\\n }\\n\\n /***************\\n * GET BOOLEAN *\\n ***************/\\n function getBool(name)\\n {\\n var data = getInt(name);\\n if (data !== 0 && data !== null && data != undefined && !isNaN(data))\\n return true;\\n else\\n return false;\\n }\\n \\n // if local data exists, then get it\\n if (getBool('data') === true)\\n {\\n // parse data\\n ax = getInt('ax');\\n ay = getInt('ay');\\n dx = getInt('dx');\\n dy = getInt('dy');\\n score = getInt('score');\\n recent = getInt('recent');\\n hScore = getInt('hScore');\\n paused = getBool('paused');\\n doWrap = getBool('doWrap');\\n \\n // parse snake dataa\\n var length = getInt('length');\\n snake = [];\\n for (var i = 0; i < length; i++)\\n {\\n var sx = getInt('snake' + i + 'x');\\n var sy = getInt('snake' + i + 'y');\\n snake.push({x: sx, y: sy}); \\n }\\n }\\n // otherwise, initialize it\\n else\\n resetData();\\n}\",\n \"function loadData() {\\n try {\\n const fsStorageAsArray = JSON.parse(localStorage.getItem(\\\"saveArray\\\"));\\n fromSaveFormat(fsStorageAsArray);\\n } catch (err) {\\n // fill some initial data\\n fsStorage = [\\n {\\n id: 0, name: \\\"root\\\", children: [\\n { id: 1, name: \\\"sub1\\\", children: [\\n { id: 4, name: \\\"file.txt\\\"},\\n { id: 5, name: \\\"sub3\\\", children: [\\n {id: 6, name: \\\"file2.txt\\\", content: \\\"content2\\\"}\\n ]}\\n ]},\\n { id: 2, name: \\\"sub2\\\", children: []},\\n { id: 3, name: \\\"file1.txt\\\", content: \\\"text\\\"}\\n ]\\n }\\n ]\\n }\\n }\",\n \"function loadData() {\\n try {\\n get_valsFromJSON(JSON.parse(atob(localStorage.sv1)));\\n } catch(NoSuchSaveException) { \\n console.log(\\\"No saved data to load: \\\" + NoSuchSaveException);\\n }\\n}\",\n \"function loadData() {\\n var strBookPath = io.appendPath(conf.bookPath, this.strBookName);\\n var strBookStructurePath = io.appendPath(strBookPath, conf.bookStructureFileName);\\n io.getXmlContent(strBookStructurePath, setBookStructureXml);\\n io.getFilesInDirectory(strBookPath, setPageFileNames);\\n}\",\n \"function _loadSavedData(cb) {\\n if (window.localStorage._taskData === undefined) {\\n window.memory.data = {\\n \\\"FOCUS\\\" : [],\\n \\\"TODAY\\\" : [],\\n \\\"LATER\\\" : [],\\n \\\"ASANA\\\" : [],\\n \\\"NEVER\\\" : []\\n };\\n } else {\\n window.memory.data = JSON.parse(window.localStorage._taskData);\\n }\\n if (cb) cb();\\n}\",\n \"function loadData()\\n\\t{\\n\\t\\tloadMaterials(false);\\n\\t\\tloadLabors(false);\\n\\t}\",\n \"loadData() {\\r\\n\\t\\t// load the current tracker type data from localStorage\\r\\n\\t\\tlet currentData = localStorage.getItem( this.type );\\r\\n\\r\\n\\t\\t// parse it into an object if it exists\\r\\n\\t\\tif ( currentData ) {\\r\\n\\t\\t\\tthis.data = JSON.parse(currentData);\\r\\n\\t\\t} else {\\r\\n\\t\\t\\tthis.data = {};\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function loadData(){\\n\\t\\tloadParetoData();\\n\\t\\tloadConstraints();\\n\\t\\t\\n\\t}\",\n \"function loadData() {\\n // set all our variables\\n setVars(twitch.configuration)\\n // do an initial browse to `/`(root)\\n navigate()\\n // remove our loading element from the DM\\n removeElement(\\\"repo-loading\\\")\\n}\",\n \"readData() {\\r\\n if (window.localStorage.getItem(this[\\\"key\\\"]) != null) {\\r\\n this.data = JSON.parse(window.localStorage.getItem(this[\\\"key\\\"]));\\r\\n }\\r\\n \\r\\n return this.data;\\r\\n }\",\n \"function getAndProcessData() { \\n\\t\\tchooseFileSource();\\n\\t}\",\n \"initializeLoadOrder() {\\n this.loadorder = json.read(\\\"user/cache/loadorder.json\\\");\\n }\",\n \"function preload () { \\n training_data = loadStrings('./data/train_10000.csv', () => console.log(\\\"Training data loaded\\\"))\\n testing_data = loadStrings('./data/test_1000.csv', () => console.log(\\\"Testing data loaded\\\"))\\n}\",\n \"function readUserData() {\\r\\n\\treturn fs.readFileSync(storagePath, \\\"utf8\\\");\\r\\n}\",\n \"function readStorage() {\\n\\tstudentGrade = localStorage.getItem(\\\"Student Grade:\\\");\\n\\tstudentGender = localStorage.getItem(\\\"Student Gender:\\\");\\n\\tstudentClub = localStorage.getItem(\\\"Student Club:\\\");\\n\\tstudentNumber = localStorage.getItem(\\\"Student Number:\\\");\\n\\tannTitle = JSON.parse(localStorage.getItem(\\\"AnnTitle:\\\"));\\n\\tannDetails = JSON.parse(localStorage.getItem(\\\"AnnDetails:\\\"));\\n\\tannGrade = JSON.parse(localStorage.getItem(\\\"AnnGrade:\\\"));\\n\\tannGender = JSON.parse(localStorage.getItem(\\\"AnnGender:\\\"));\\n\\tannClub = JSON.parse(localStorage.getItem(\\\"AnnClub:\\\"));\\n\\tannStudentNumber = JSON.parse(localStorage.getItem(\\\"AnnStudentNumber:\\\"));\\n\\tannDateTime = JSON.parse(localStorage.getItem(\\\"AnnDateTime:\\\"));\\n}\",\n \"function ImportData() {\\n //in this method we can connect to database or read our necessery info from file\\n //Currently we read registered users from file and History matches from file(maybe) and save to lists\\n ReadFromFile();\\n}\",\n \"function _loadData()\\n\\t{\\n\\t\\ttry\\n\\t\\t{\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t//create EZ.script.options from defaults\\n\\t\\t\\tvar options = EZ.script.options = EZ.options(EZ.defaultOptions.script);\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t//---------------------------------------------------------------------\\n\\t\\t\\tvar json = localStorage.getItem('EZ.script.savedData')\\n\\t\\t\\tEZ.script.savedData = json ? JSON.parse(json) : {}\\t\\n\\t\\t\\t//---------------------------------------------------------------------\\n\\t\\t\\t\\n\\t\\t\\tvar savedData = json ? JSON.parse(json) : {}\\t\\n\\t\\t\\tif (savedData.version != options.version)\\n\\t\\t\\t\\tsavedData = {version: options.version, timestamp:''};\\n\\t\\t\\t//savedData.listValues = savedData.listValues || {}\\n\\t\\t\\tsavedData.listOptions = savedData.listOptions || {};\\n\\t\\t\\tsavedData.fieldValues = savedData.fieldValues || {};\\n\\t\\t\\t\\n\\t\\t\\tvar log = EZ.field.add(savedData.fieldValues);\\t//restore saved fieldValues\\n\\t\\t\\tEZ.log('EZscript.loadData', 'restored fieldValues', log);\\n\\t\\t\\t\\n\\t\\t\\tlog = EZ.field.add(['EZscript']);\\t\\t\\t\\t//add fields with default values (not saved)\\n\\t\\t\\tEZ.log('EZscript.loadData', 'all EZscript fields', {log:log});\\n\\t\\t\\t\\n\\t\\t\\tlog = EZ.event.trigger(['EZscript']);\\t\\t\\t//fire events to initialize EZ.script.options\\n\\t\\t\\tEZ.log('EZscript.loadData', {'onload events':log})\\n\\t\\t\\t\\n\\t\\t\\tsetTimeout(function()\\t\\t\\t\\t\\t\\t\\t//after events run...\\n\\t\\t\\t{\\n\\t\\t\\t\\toptions.listNames.forEach(function(name)\\t//populate saved list(s) options\\n\\t\\t\\t\\t{\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t//...and select save values\\n\\t\\t\\t\\t\\tvar list = _getEl(options.tags[name]);\\n\\t\\t\\t\\t\\tif (list)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tvar listValue = EZ.get(list);\\n\\t\\t\\t\\t\\t\\tvar listOptions = '.'.concat(name,'.optionsList').ov(savedData.listOptions)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t || [].slice.call(list.options);\\n\\t\\t\\t\\t\\t\\tlistOptions = EZ.script.listOptions[name] \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t= EZ.displayDropdown(list, listOptions, listValue);\\n\\t\\t\\t\\t\\t\\t_displayValue(name + 'Count', listOptions.valueList.length.wrap('['))\\n\\n\\t\\t\\t\\t\\t\\tvar value = EZ.get(list)\\n\\t\\t\\t\\t\\t\\tif (name == 'history' && value.toInt() > 0)\\n\\t\\t\\t\\t\\t\\t\\t_displayValue('optionTime', value);\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\tif (name == 'favorites' && list.selectedIndex > 1)\\n\\t\\t\\t\\t\\t\\t\\t_displayValue('favoriteName', list.options[list.selectedIndex].text);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\tEZ.script.saveData()\\n\\t\\t\\t}, 0 );\\n\\t\\t}\\n\\t\\tcatch (e)\\n\\t\\t{\\n\\t\\t\\treturn EZ.oops(e);\\n\\t\\t}\\n\\t}\",\n \"function loadSaveData() {\\n // Load configuration first\\n let iconConfig = localStorage.getItem(\\\"IconConfig\\\") || \\\"image\\\";\\n setIcons(iconConfig, false);\\n \\n let styleConfig = localStorage.getItem(\\\"StyleConfig\\\") || \\\"light\\\";\\n setStyle(styleConfig);\\n \\n setListStyle(isListActive(), false);\\n \\n if (getLocal(currentMode, \\\"CompletedVisible\\\") == null) {\\n let isNewSave = (getLocal(currentMode, \\\"Completed\\\") == null);\\n setLocal(currentMode, \\\"CompletedVisible\\\", isNewSave.toString()); // New saves start open\\n }\\n \\n if (currentMode == \\\"event\\\") {\\n loadEventSaveData();\\n } else {\\n loadMainSaveData();\\n }\\n \\n // Finally load up the completion time data\\n missionCompletionTimes = {};\\n let loadedCompletionTimes = getLocal(currentMode, \\\"CompletionTimes\\\");\\n if (loadedCompletionTimes != null) {\\n let completionTimesHash = JSON.parse(loadedCompletionTimes);\\n for (let missionId in completionTimesHash) {\\n missionCompletionTimes[missionId] = parseInt(completionTimesHash[missionId]);\\n }\\n }\\n}\",\n \"readin () {\\n this.content = readFile(this.path);\\n }\",\n \"function Load()\\n{\\n // The file *does* exist\\n if (fs.existsSync(\\\"save.json\\\"))\\n {\\n savedatasw = 1;\\n const importdata = fs.readFileSync('save.json', 'utf8');\\n const playerdata = JSON.parse(importdata);\\n playername=playerdata.playername;\\n playerlvl=playerdata.playerlvl;\\n health=playerdata.health;\\n mana=playerdata.mana;\\n gold=playerdata.gold;\\n savecoord=playerdata.savecoord;\\n savedatasw=playerdata.savedatasw;\\n playerinfo.playername=playername;\\n playerinfo.playerlvl=playerlvl;\\n playerinfo.health=health;\\n playerinfo.mana=mana;\\n playerinfo.gold=gold;\\n playerinfo.savecoord=savecoord;\\n playerinfo.savedatasw=savedatasw;\\n return;\\n }\\n\\n return;\\n }\",\n \"function restoreData() {\\n myLibrary = []\\n retrieveDataFromStorage(myLibrary)\\n}\",\n \"static async initGlobalData(){\\n\\t\\tvar fileNames = await this.GetFileNames();\\n\\t\\t\\n\\t\\t_retrieveGlobal = async () => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst value = await AsyncStorage.getItem(\\\"GlobalData\\\");\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif (value != null) {\\n\\t\\t\\t\\t\\t//we have played before, load our GlobalData object into GameData\\n\\t\\t\\t\\t\\tGameData.setGlobalData(JSON.parse(value));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\t//we have never played before, do nothing, waiting until the end of a player's first level to save the GlobalData object \\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t} catch (error) {\\n\\t\\t\\t\\t// Error retrieving data\\n\\t\\t\\t\\talert(error);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn _retrieveGlobal();\\n\\t}\",\n \"function preload ( ) {\\n // Read in all the data\\n lines = loadStrings ( \\\"./distances2.csv\\\" ) ;\\n}\",\n \"loadData() {\\n\\n }\",\n \"function initStorage(storage) {\\n if (storage.isEmpty()) {\\n // load the initial knowledge base from a text file in turtle format\\n $.get('initial_kb.txt', function(turtle) {\\n storage.loadKnowledgeBaseFromString(turtle);\\n //alert(\\\"from local file: \\\" + turtle);\\n storage.save();\\n }, 'text');\\n } else {\\n storage.load();\\n }\\n}\",\n \"function init() {\\n if (localStorage.AddressBookRecord) {\\n addresBookArray = JSON.parse(localStorage.AddressBookRecord);\\n }\\n}\",\n \"load() {\\n\\t\\t\\tlet storage = Storage.local.get('commander') || null;\\n\\t\\t\\tif (storage) {\\n\\t\\t\\t\\tupdate(bs => {\\n\\t\\t\\t\\t\\tbs = storage;\\n\\t\\t\\t\\t\\treturn bs;\\n\\t\\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t}\",\n \"function init() {\\n fs.readFile(\\\"./db/notes.json\\\", \\\"utf8\\\", function (err, data) {\\n if (err) {\\n throw err;\\n }\\n let notesJSON = JSON.parse(data);\\n notesJSON.forEach(function (note) {\\n notes.push(note);\\n });\\n lastId = Math.max(...notes.map((obj) => obj.id), 0) + 1;\\n });\\n}\",\n \"function init(){\\n getData();\\n}\",\n \"startReading() {\\n this.startDate = Date.now();\\n this.updatedDate = this.startDate;\\n this.pageNumber = 1;\\n }\",\n \"function dataLoad()\\n{\\n try{\\n var writ = fs.readFileSync('note.json')\\n var buff = writ.toString();\\n return JSON.parse(buff);\\n }\\n catch(e)\\n {\\n return [];\\n }\\n}\",\n \"function readData() {\\n\\t\\t\\t\\tconsole.log(\\\"Estado Session:\\\", sessionService.estadoSesion);\\n\\t\\t\\t\\tif(sessionService.estadoSesion !== 00){\\n\\t\\t\\t\\t\\tjAlert(mensajeTexto.sesionExpirada, mensajeTexto.controlAcces, function () {\\n\\t\\t\\t\\t\\t\\t$state.go('login');\\t\\n\\t\\t \\t});\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\treadDataSel();\\n\\t\\t\\t\\t\\treadDataQueue();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function read() {\\n\\tvar data = JSON.parse(fs.readFileSync('db/db.json', 'utf-8'));\\n\\treturn data;\\n}\",\n \"function preLoad() {\\n\\n\\t\\t\\tangular.forEach($localStorage, function(value, key) {\\n\\t\\t\\t\\tlocalStorageObj[key] = value\\n\\t\\t\\t});\\n\\n\\t\\t}\",\n \"function initData(callback) {\\n initLanguage(); // set the system language if not set\\n DB.loadAll(function() {\\n if(getUsers() === null){\\n setUsers(DB.users);\\n console.log('storing users in localStorage');\\n }\\n if(getBeverages() === null){\\n setBeverages(DB.beverages);\\n console.log('Storing beverages in localstorage');\\n }\\n if(getOrders() === null){\\n setOrders([]);\\n }\\n if(callback) callback();\\n });\\n}\",\n \"function preload() {\\n //load json file\\n data = loadJSON(\\\"./content.json\\\");\\n}\",\n \"function preload(){\\n\\t//loads .json data\\n\\t\\tdata = loadJSON('paris-weather.json');\\n}\",\n \"function loadData() {\\n sizeJSON = localStorage != null ? localStorage[\\\"size\\\"] : null;\\n cartDataJSON = localStorage != null ? localStorage[\\\"cartData\\\"] : null;\\n if (cartDataJSON != null && sizeJSON != null && JSON != null) {\\n try {\\n size = JSON.parse(sizeJSON);\\n cartData = JSON.parse(cartDataJSON);\\n }\\n catch (err) {\\n // ignore errors while loading...\\n }\\n }\\n }\",\n \"async initializeDataLoad() {\\n }\",\n \"function init() {\\n createDataReader('heartbeat', true);\\n createDataReader('timing');\\n createDataReader('telemetry');\\n }\",\n \"preIngestData() {}\",\n \"function readData() {\\n d3.json(url).then(function (data) {\\n samples_data = data;\\n initializeIDPulldown();\\n buildBarChart(0);\\n buildBubbleChart(0);\\n buildDemographics(0);\\n buildGaugeChart(0);\\n // log out the entire dataset\\n console.log(samples_data);\\n })\\n}\",\n \"async loadStartData() {\\n console.timeStart('track');\\n for (let document of this.documents.all()) {\\n if (this.shouldTrackFile(vscode_uri_1.URI.parse(document.uri).fsPath)) {\\n this.trackOpenedDocument(document);\\n }\\n }\\n if (this.alwaysIncludeGlobPattern) {\\n let alwaysIncludePaths = await util_1.promisify(glob_1.glob)(this.alwaysIncludeGlobPattern, {\\n cwd: this.startPath || undefined,\\n absolute: true,\\n });\\n for (let filePath of alwaysIncludePaths) {\\n filePath = vscode_uri_1.URI.file(filePath).fsPath;\\n if (this.shouldTrackFile(filePath)) {\\n this.trackFile(filePath);\\n }\\n }\\n }\\n await this.trackFileOrFolder(this.startPath);\\n console.timeEnd('track', `${this.map.size} files tracked`);\\n this.startDataLoaded = true;\\n }\",\n \"async function init() {\\n try {\\n // Fetch new data\\n currentLocation = await getLocation();\\n const coordinates = `${currentLocation.coords.latitude},${currentLocation.coords.longitude}`;\\n forecast = await getForecast(coordinates);\\n\\n // Render data\\n renderForecast(forecast);\\n renderCoordinates(currentLocation);\\n\\n // Save data\\n localStorage.setItem('location', coordinates);\\n localStorage.setItem('forecast', JSON.stringify(forecast));\\n } catch (err) {\\n renderErrors(err);\\n }\\n}\",\n \"function loaddata(){\\n\\t\\tvar data1 = localStorage.getItem(\\\"infor_sku\\\") || \\\"\\\";\\n\\t\\tvar data2 = localStorage.getItem(\\\"pd\\\") || \\\"\\\";\\n\\t\\tvar data3 = localStorage.getItem(\\\"sh\\\") || \\\"\\\";\\n\\t\\tif (!!data1) { sku_items = JSON.parse(data1); }\\n\\t\\tif (!!data2) { pd_items = JSON.parse(data2); }\\n\\t\\tif (!!data3) { sh_items = JSON.parse(data3); }\\n\\t\\t$(\\\"#datafile\\\").val( localStorage.getItem(\\\"datafile\\\") ||\\\"http://123.123.123.250:5000/\\\");\\n\\t\\t$(\\\"#myfile\\\").val( localStorage.getItem(\\\"myfile\\\") ||\\\"spchkm/\\\");\\n\\t\\t\\n\\t}\",\n \"function initializeData() {\\n const profileContents = fs.readFileSync(profileEntriesFile, 'utf8');\\n const data = jsonic(profileContents);\\n _.each(data, function (entry) {\\n profileData.push(entry);\\n });\\n\\n filterInterest.initData();\\n}\",\n \"loadStateImage() {\\n let stateData = path.join(this.cwd, this.USER_DATA, this.TUTORSTATE);\\n this.state = JSON.parse(fs.readFileSync(stateData));\\n }\",\n \"function preload(){\\n\\tdata = loadJSON('population.json'); // data variable is assigned json data\\n}\",\n \"function readData(){\\r\\n let dataRead = fs.readFileSync('data.json');\\r\\n let infoRead = JSON.parse(dataRead);\\r\\n return infoRead;\\r\\n}\",\n \"function getSavedData() {\\n chrome.storage.sync.get({\\n data: SAMPLE_DATA,\\n }, function (saved) {\\n data = saved.data;\\n });\\n}\",\n \"function preload() {\\n data = loadTable('dict.csv', 'csv');\\n}\",\n \"function initData(){\\n o_data = user.original_musics;\\n d_data = user.derivative_musics;\\n c_data = user.collected_musics;\\n}\",\n \"function loadData() {\\n // STAND\\n loadStandData();\\n // PIT\\n loadPitData();\\n // IMAGES\\n loadImageData();\\n // NOTES\\n loadNotesData();\\n // PRESCOUTING\\n loadPrescouting(\\\"./resources/prescout.csv\\\");\\n\\n}\",\n \"function initializeStock() {\\n\\tbank = json.readFileSync(\\\"./wallet/bank.json\\\");\\n}\",\n \"function start() {\\n\\treadStorage();\\n\\tdisplayAnn();\\n}\",\n \"function ResumeManager_LoadData()\\n{\\n\\t//by default we have no data\\n\\tvar resume = null;\\n\\t//do we have a valid controller?\\n\\tif (__CONTROLLER && __CONTROLLER.getResumeData)\\n\\t{\\n\\t\\t//retrieve the resume data\\n\\t\\tresume = __CONTROLLER.getResumeData();\\n\\t\\t//valid?\\n\\t\\tif (resume)\\n\\t\\t{\\n\\t\\t\\t//is this a string?\\n\\t\\t\\tif (typeof resume == \\\"string\\\")\\n\\t\\t\\t{\\n\\t\\t\\t\\t//convert to object\\n\\t\\t\\t\\tresume = JSON.parse(resume);\\n\\t\\t\\t}\\n\\t\\t\\t//designer data object?\\n\\t\\t\\tif (resume.DesignerPreview)\\n\\t\\t\\t{\\n\\t\\t\\t\\t//build the resume data from the preview data (using this so that all (most!) the resume code is here)\\n\\t\\t\\t\\tresume = ResumeManager_GeneratePreviewData(resume.PathToStart);\\n\\t\\t\\t}\\n\\t\\t\\t//and now update its funcions\\n\\t\\t\\tresume.RestoreLesson = Resume_RestoreLesson;\\n\\t\\t\\tresume.StatesLoaded = Resume_StatesLoaded;\\n\\t\\t\\tresume.VerifySatesOptimised = Resume_VerifySatesOptimised;\\n\\t\\t\\tresume.MaximiseData = Resume_MaximiseData;\\n\\t\\t\\tresume.Notify_Get_ItemList_CallBack = Resume_Notify_CallBack;\\n\\t\\t\\tresume.Notify_State_CallBack = Resume_Notify_CallBack;\\n\\t\\t}\\n\\t}\\n\\t//return the data\\n\\treturn resume;\\n}\",\n \"constructor() {\\n this.data = this._loadData();\\n }\",\n \"loadFromFile() {\\n // Don't save or load state if useRootDir is true\\n if ( this.useRootDir ) {\\n return;\\n }\\n\\n if ( fs.existsSync( this.saveFile ) ) {\\n const serialization = JSON.parse( fs.readFileSync( this.saveFile, 'utf-8' ) );\\n this.snapshots = serialization.snapshots.map( Snapshot.deserialize );\\n this.trashSnapshots = serialization.trashSnapshots ? serialization.trashSnapshots.map( Snapshot.deserializeStub ) : [];\\n if ( serialization.pendingSnapshot && serialization.pendingSnapshot.directory ) {\\n this.trashSnapshots.push( Snapshot.deserializeStub( serialization.pendingSnapshot ) );\\n }\\n }\\n }\",\n \"function loadData(){ \\t\\n \\t//if (gameData.data.player.playerID>0) {\\n \\t\\tCORE.LOG.addInfo(\\\"PROFILE_PAGE:loadData\\\");\\n \\t\\t//var p = new ProfileCommunication(CORE.SOCKET, setData); \\t\\t\\n \\t\\t//p.getData(gameData.data.player.playerID); \\t\\t\\n \\t\\t\\n \\t//}\\n \\t//else \\n \\t\\tsetDataFromLocalStorage(); \\t \\t \\t\\n }\",\n \"function recoverPomoData() {\\n if (localStorage.getItem(\\\"cpid\\\") !== null) {\\n // Do not change these to getters and setters\\n currentPomoID = parseInt(localStorage.getItem(\\\"cpid\\\"));\\n pomoData = JSON.parse(localStorage.getItem(\\\"pomoData\\\"));\\n }\\n updateTable();\\n}\",\n \"function preload() {\\n\\tdata = loadJSON('new-york-weather.json');\\n}\",\n \"function initializeDataStorage() {\\n for(i = 0; i < ordered_plates.length; i++) {\\n sessionStorage.setItem(ordered_plates[i].name, 0);\\n }\\n }\",\n \"getData() {\\n // todo: read from fs if you have it already or retrieve using storage layer client\\n return fs.readFileSync(Chunk.getChunkStoragePath(this.id), { encoding: null });\\n }\",\n \"function loadAll(){\\n\\tchangeSeason()\\n\\tgetAnimeData()\\n\\tgetCharacterData()\\n\\tgetEpisodeData()\\n\\tgetImageData()\\n\\tgetVideoData()\\n}\",\n \"load() {\\n try {\\n appState.state.cursor().update( cursor => {\\n return cursor.merge( JSON.parse( window.localStorage.getItem( APPCONFIG.LS ) ) )\\n })\\n } catch( err ) {\\n console.error( 'Error loading from local storage' )\\n console.error( err )\\n return\\n }\\n\\n console.log( 'loaded' )\\n }\",\n \"async function load() {\\n const str = await localStorage.getItem(KEY);\\n if (!str) return;\\n let initialState;\\n ({ path, text, revision, lineCount, store: initialState } = JSON.parse(\\n str\\n ));\\n store = createStore(reducer, initialState);\\n }\",\n \"function readFromFileAndInitAppState(fileName) {\\n var stringReadFromFile = null;\\n\\n // Initialize a roaming folder variable.\\n var roamingFolder = Windows.Storage.ApplicationData.current.roamingFolder;\\n\\n // Open tne file asynchronously.\\n roamingFolder.getFileAsync(fileName).done(function (file) {\\n file.openAsync(Windows.Storage.FileAccessMode.read).done(function (stream) {\\n var size = stream.size;\\n var inputStream = stream.getInputStreamAt(0);\\n\\n // Create a DataReader object.\\n var reader = new Windows.Storage.Streams.DataReader(inputStream);\\n\\n // Read from the file.\\n reader.loadAsync(size).done(function () {\\n stringReadFromFile = reader.readString(size);\\n\\t\\t reader.close();\\n if (stringReadFromFile) {\\n loadStatus = initializeAppState(stringReadFromFile, fileName);\\n }\\n callBackToComputeLoadState();\\n }, function (errorOnReaderLoadAsync) {\\n reader.close();\\n callBackToComputeLoadState();\\n });\\n }, function (errorOnOpenFile) {\\n callBackToComputeLoadState();\\n });\\n }, function (errorOnGetFileAsync) {\\n callBackToComputeLoadState();\\n });\\n }\",\n \"function load() {\\n m_data.load(\\\"b4w/obj/moto.json\\\", load_cb);\\n}\",\n \"function loadLocalData(){\\n if($scope.loading){\\n return;\\n }\\n $scope.loading = true;\\n storeService.getAllEntries(soup.name, sortBy, 'ascending').then(function(result){\\n $scope.entries = result.currentPageOrderedEntries;\\n console.log('entries', $scope.entries);\\n $scope.loading = false;\\n }, function(err){\\n $scope.loading = false;\\n });\\n }\",\n \"function loadData() {\\n var storedDay = JSON.parse(localStorage.getItem(\\\"myDay\\\"));\\n\\n if (storedDay) {\\n myDay = storedDay;\\n }\\n\\n saveToDos();\\n displayToDos();\\n}\",\n \"function loadData()\\n{\\n loadJSON('lastSearch.json', loadedData);\\n}\",\n \"read() {\\n try {\\n this._toggleEditThrobber();\\n var id = parseInt(document.getElementById('edit_id').value);\\n var outputEl = this._clearOutput();\\n \\n // read data from db\\n var jsonObj = this.dao.read(id);\\n if (!jsonObj) throw `Error reading experiment data for audiogram ${id}`;\\n //console.log(jsonObj)\\n this._showOutput(id, jsonObj);\\n\\n } catch(e) {\\n console.log(e);\\n alert(e);\\n }\\n this._toggleEditThrobber();\\n }\",\n \"preloadJson()\\n {\\n currentScene.load.json('dialogues', 'data/SingleDialogues.json');\\n currentScene.load.json('notes', 'data/Notes.json');\\n }\",\n \"function readTrie() {\\n var triePath = path.join(__dirname, './trie.json');\\n if (fs.existsSync(triePath)) {\\n // Read trie data from file (stored in case server restarts)\\n const data = fs.readFileSync(triePath);\\n var fileDataTrie = JSON.parse(data);\\n trie = Object.setPrototypeOf(fileDataTrie, trieNode.prototype);\\n console.log(\\\"Loading of previous trie done.\\\");\\n } else {\\n saveTrie();\\n }\\n}\",\n \"function preload() {\\n restaurantFile = loadJSON(\\\"Restaurant.json\\\");\\n}\",\n \"function loadData() {\\n\\n //Users name.\\n loadName()\\n\\n //Users config.\\n loadConfig()\\n}\",\n \"read() {\\n return readFileAsync(\\\"db/db.json\\\", \\\"utf8\\\"); // shows the notes from the database json file (db.json)\\n }\",\n \"onLoad() {\\n this.curLogic = require(\\\"logic\\\").getInstance();\\n emitter.on(\\\"getdifficultData\\\",this.resetdifficultData,this); //保证能在数据层的json读取后赋值\\n this.difficult = null;\\n this.difficultData = this.curLogic.get(\\\"difficultData\\\");\\n this.levelsData = [];\\n this.initDiffState();\\n this.initEditLevel();\\n this.isshowLevels();\\n }\",\n \"function start_db () {\\r\\n dataref = firebase.database()\\r\\n read()\\r\\n}\",\n \"function reloadData() {\\n if (typeof (CPData) != \\\"undefined\\\") { CPData.regenerate(); }\\n if (typeof (CPDataSoon) != \\\"undefined\\\") { CPData.regenerate(); }\\n if (typeof (CPDataDownloaded) != \\\"undefined\\\") { CPData.regenerate(); }\\n loadInfo();\\n }\",\n \"function init()\\r\\n\\t\\t\\t{ \\r\\n\\t\\t\\t\\tget_data('get_dir','','directory');\\r\\n\\t\\t\\t\\tget_data('read_dir','current_dir','file_folder');\\r\\n\\t\\t\\t}\",\n \"leerDB() {\\n //Verificar si existe el archivo, si no existe, el array de historial queda como se declaro (vacio).\\n if (fs.existsSync(this.dbPath)) {\\n const info = fs.readFileSync(this.dbPath, { encoding: 'utf-8' });\\n const data = JSON.parse(info);\\n this.historial = data;\\n }\\n }\",\n \"function initLoad() {\\n\\n\\tvar cityHistStore = JSON.parse(localStorage.getItem('city'));\\n\\n\\tif (cityHistStore !== null) {\\n\\t\\tcityHist = cityHistStore\\n\\t}\\n\\tgetHistory();\\n\\tgetWeatherToday();\\n}\",\n \"function load(callback){\\r\\n\\tutil.log(\\\"Data: Saving All...\\\");\\r\\n\\t//Save Each\\r\\n\\tutil.log(\\\"Data: Saving Done...\\\");\\r\\n}\",\n \"function initialize() {\\n//here you would load your data\\n}\",\n \"loadingData() {}\",\n \"loadingData() {}\",\n \"resetData() {\\n\\t\\t\\tthis.initFlags();\\n\\t\\t\\tthis.initMetadata();\\n\\t\\t}\",\n \"function read(){\\n let AllKeys = Object.keys(localStorage);\\n devKeys=AllKeys.filter(value => value.startsWith('Sdev'));\\n // the global variable for al the objects\\n devObjects=devKeys.map(obj => JSON.parse(localStorage.getItem(obj)));\\n display_developers();\\n}\",\n \"function preload() {\\n data = loadJSON(\\\"data/clean_speech_pop_20.json\\\");\\n table = loadTable(\\\"data/mturk_task_sortedcity.csv\\\", \\\"csv\\\", \\\"header\\\");\\n}\",\n \"function initializeData() {\\n \\tconsole.log(\\\"Initializing data from session.json...\\\")\\n \\tvar rawData = fs.readFileSync(dataFile);\\n \\tdata = JSON.parse(rawData);\\n\\n \\t// Reads in current collections located in data/corpus-files\\n \\tlet collections = fs.readdirSync('./data/corpus-files').filter(function (file) {\\n\\t\\treturn fs.statSync('./data/corpus-files/' + file).isDirectory();\\n\\t});\\n\\n\\t// Deletes any collections in the data JSON structure that don't appear\\n\\t// within our folder and prints a warning message.\\n\\tvar remove = [];\\n\\tfor (var c in data['collections']) {\\n\\t\\tif (!collections.includes(c)) {\\n\\t\\t\\tremove.push(c);\\n\\t\\t}\\n\\t}\\n\\tfor (var i in remove) {\\n\\t\\tdelete data[remove[i]];\\n\\t\\tconsole.log('WARNING: ' + remove[i] + ' collection doesn\\\\'t exist in data/corpus-files. Please either add the files or delete the entry from session.json.');\\n\\t}\\n }\",\n \"function readLocalStorage() {\\n let readed = localStorage.getItem(\\\"language\\\");\\n if(readed == null) {\\n readed = \\\"English\\\"; // First time - Default\\n console.log(\\\"No había nada en LocalStorage\\\");\\n }\\n controlLanguage(readed);\\n }\",\n \"function load_progress_as_of_last_saved() {\\n\\tif (progress_snapshot == 0) {\\n\\t\\t// No progress, load from the start of level\\n\\t\\t// Note that these values are already filled out\\n\\t\\treturn true\\n\\t}\\n\\telse {\\n\\t\\tlevel_number = progress_snapshot[0]\\n\\t\\tquestion_number = progress_snapshot[1]\\n\\t\\tdisplay_format = progress_snapshot[2]\\n\\t\\tquestions_correct_total_count = progress_snapshot[3]\\n\\t\\tquestions_incorrect_total_count = progress_snapshot[4]\\n\\t\\tquestions_correct_level_count = progress_snapshot[5]\\n\\t\\tquestions_incorrect_level_count = progress_snapshot[6]\\n\\t}\\n}\",\n \"function initData(){\\n container.prepend(progressInfo);\\n jQuery.get(getPageURL(0, resource)).done(function(data) {\\n records = processData(data, true);\\n initView(new recline.Model.Dataset({records:records}));\\n numReq = getRequestNumber(data.result.total, pageSize);\\n for (var i = 1; i <= numReq; i++) {\\n requestData(getPageURL(i, resource));\\n };\\n });\\n }\",\n \"loadProgram() {\\n const getBooks = JSON.parse(localStorage.getItem(STORAGE_NAME));\\n const getId = JSON.parse(localStorage.getItem(STORAGE_ID));\\n if (getBooks && getBooks.length != 0) {\\n const storedBooks = getBooks;\\n const storedId = getId;\\n myLibrary = [...storedBooks];\\n bookId = parseInt(storedId);\\n console.log('loaded');\\n } else {\\n myLibrary = [...FILLER_DATA];\\n bookId = 2;\\n console.log('default');\\n }\\n storage.saveData();\\n this.renderElem.render();\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.6337528","0.6305773","0.6291212","0.6202274","0.6178993","0.614394","0.61196107","0.6113442","0.60658365","0.6051222","0.60293895","0.60205126","0.6005231","0.59646505","0.59555554","0.59379375","0.5937245","0.59237146","0.59133095","0.5900318","0.5896602","0.58939207","0.58935153","0.5884373","0.58748674","0.5871461","0.5851313","0.58184916","0.5812505","0.5797529","0.579699","0.57866293","0.5786326","0.57850844","0.57582784","0.5758056","0.5749623","0.57407033","0.5733216","0.5731504","0.5721111","0.57196075","0.571893","0.5715971","0.56941974","0.56937623","0.5690691","0.56858116","0.5678913","0.56781936","0.56743354","0.5674023","0.56720024","0.5652469","0.5632007","0.56315756","0.5618594","0.56185764","0.5618086","0.56170684","0.5606926","0.5599955","0.55984265","0.55936545","0.55741334","0.5566473","0.5563877","0.5552855","0.5551358","0.55511","0.55506945","0.55490553","0.55479467","0.5547575","0.55427366","0.5539239","0.5534968","0.5522669","0.55174625","0.55149156","0.5513518","0.55041283","0.55026764","0.5500902","0.5499541","0.54888046","0.5479354","0.54706514","0.5461493","0.5460238","0.5458647","0.5458647","0.5457808","0.5455821","0.5454698","0.5449108","0.5446502","0.5442149","0.5440132","0.5436397"],"string":"[\n \"0.6337528\",\n \"0.6305773\",\n \"0.6291212\",\n \"0.6202274\",\n \"0.6178993\",\n \"0.614394\",\n \"0.61196107\",\n \"0.6113442\",\n \"0.60658365\",\n \"0.6051222\",\n \"0.60293895\",\n \"0.60205126\",\n \"0.6005231\",\n \"0.59646505\",\n \"0.59555554\",\n \"0.59379375\",\n \"0.5937245\",\n \"0.59237146\",\n \"0.59133095\",\n \"0.5900318\",\n \"0.5896602\",\n \"0.58939207\",\n \"0.58935153\",\n \"0.5884373\",\n \"0.58748674\",\n \"0.5871461\",\n \"0.5851313\",\n \"0.58184916\",\n \"0.5812505\",\n \"0.5797529\",\n \"0.579699\",\n \"0.57866293\",\n \"0.5786326\",\n \"0.57850844\",\n \"0.57582784\",\n \"0.5758056\",\n \"0.5749623\",\n \"0.57407033\",\n \"0.5733216\",\n \"0.5731504\",\n \"0.5721111\",\n \"0.57196075\",\n \"0.571893\",\n \"0.5715971\",\n \"0.56941974\",\n \"0.56937623\",\n \"0.5690691\",\n \"0.56858116\",\n \"0.5678913\",\n \"0.56781936\",\n \"0.56743354\",\n \"0.5674023\",\n \"0.56720024\",\n \"0.5652469\",\n \"0.5632007\",\n \"0.56315756\",\n \"0.5618594\",\n \"0.56185764\",\n \"0.5618086\",\n \"0.56170684\",\n \"0.5606926\",\n \"0.5599955\",\n \"0.55984265\",\n \"0.55936545\",\n \"0.55741334\",\n \"0.5566473\",\n \"0.5563877\",\n \"0.5552855\",\n \"0.5551358\",\n \"0.55511\",\n \"0.55506945\",\n \"0.55490553\",\n \"0.55479467\",\n \"0.5547575\",\n \"0.55427366\",\n \"0.5539239\",\n \"0.5534968\",\n \"0.5522669\",\n \"0.55174625\",\n \"0.55149156\",\n \"0.5513518\",\n \"0.55041283\",\n \"0.55026764\",\n \"0.5500902\",\n \"0.5499541\",\n \"0.54888046\",\n \"0.5479354\",\n \"0.54706514\",\n \"0.5461493\",\n \"0.5460238\",\n \"0.5458647\",\n \"0.5458647\",\n \"0.5457808\",\n \"0.5455821\",\n \"0.5454698\",\n \"0.5449108\",\n \"0.5446502\",\n \"0.5442149\",\n \"0.5440132\",\n \"0.5436397\"\n]"},"document_score":{"kind":"string","value":"0.6179756"},"document_rank":{"kind":"string","value":"4"}}},{"rowIdx":560,"cells":{"query":{"kind":"string","value":"Component responsible for present list of all posts"},"document":{"kind":"string","value":"function UserShow(props) {\n const { match } = props;\n\n const [posts, setPosts] = useState([]);\n const [user, setUser] = useState({});\n const [totalItems, setTotalItems] = useState(0);\n // Default page in pagination\n const [page, setPage] = useState(1);\n const [perPage, setPerPage] = useState(0);\n const [isLoading, setIsLoading] = useState(true);\n const [errors, setErrors] = useState(\"\");\n\n // Fetch post list from backend with pagination. Refetch data when page change\n useEffect(() => {\n setIsLoading(true);\n userService\n .show(match.params.id, page)\n .then(response => {\n setPosts(response.data.posts);\n setUser(response.data.user);\n setTotalItems(response.data.meta.total);\n setPerPage(response.data.meta.per_page);\n setIsLoading(false);\n })\n .catch(error => {\n if (error.response) {\n let error_messages = \"\";\n if (error.response.status === 500) {\n error_messages = \"Backend not responding\";\n } else {\n error_messages = error.response.statusText;\n }\n setErrors(error_messages);\n } else if (error.request) {\n setErrors(\"Something went wrong. Try again later.\");\n }\n setIsLoading(false);\n });\n }, [match.params.id, page]);\n\n // Handle page change\n function onChange(page) {\n setPage(page);\n }\n return (\n \n {!isLoading && !errors ? : null}\n \n \n \n );\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["async function listPosts() {\n\t\tconst p = await API.graphql(graphqlOperation(ListPosts));\n\t\tupdatePosts(p.data.listPosts.items);\n\t}","async function list(ctx, next) {\n ctx.body = await render('list', { posts: posts})\n}","getPosts() {\r\n return this.posts;\r\n }","function PostList({ posts, setPosts }) {\n // TODO: Diplay the list of posts.\n // TODO: Create at least one additional component that is used by this component.\n // TODO: Each post must have className=\"post\" for the tests to work.\n // TODO: Each post must have a delete button - Delete - that deletes the post when clicked\n return (\n \n {posts.map((post) => (\n
\n ))}\n
\n );\n}","all_posts(state){ \n return state.posts\n }","function displayPosts() {\n var posts = JSON.parse(this.response);\n var postsContainer = $(\"#posts\");\n for (var i=0; i\" + posts[i].body + \"\")\n }\n }","async function showPosts() {\n\tconst posts = await getPosts();\n\n\t// Get post one by one\n\tposts.forEach((post) => {\n\t\t// ! Create post container from api\n\t\tconst postEl = document.createElement('div');\n\t\tpostEl.classList.add('post');\n\t\tpostEl.innerHTML = `\n ${post.id}
\n \n
${post.title} \n
${post.body}
\n
`;\n\n\t\t// ! Add the post data in to the post container\n\t\tpostContainer.appendChild(postEl);\n\t});\n}","getAllPosts() {\n return this.http.get(\"http://localhost:8080/api/posts\");\n }","renderPosts() {\n if ( this.props.posts.length > 0 ) {\n return this.props.posts.map( ( post ) => {\n return {post.title}
;\n });\n } else if (!this.props.posts) {\n return No posts found.
;\n } else {\n return Loading...
\n }\n }","list(req, res, next) {\n PostModel.find((err, posts) => {\n res.render('posts', { posts });\n }); //end of PostModel.find\n }","function getPosts() {\n $.get('/api/posts/', function (data) {\n var postsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n\n newPost = data[i];\n\n postsToAdd.push(createPostDiv(newPost));\n renderPost(postsToAdd);\n }\n });\n }","async function showPosts() {\n const posts = await getPosts();\n\n posts.forEach((post) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = `\n ${post.id}
\n \n
${post.title} \n
${post.body}
\n
\n `;\n postsContainer.appendChild(postEl);\n // The Node.appendChild() method adds a node to the end of the list of children of a specified parent node.\n // The fetch() method takes one mandatory argument, the path to the resource you want to fetch.\n // It returns a Promise that resolves to the Response to that request, whether it is successful or not\n });\n}","render() {\n\t\t//console.log(links);\n\t\treturn (\n\t\t\t\n\t\t\t\t{posts.map((post)=>{\n return
\n })}\n\t\t\t \n\t\t);\n\t}","renderList() {\n if (this.props.posts) {\n return this.props.posts.map(post => (\n \n \n \n {post.id} \n \n ));\n }\n return ;\n }","function getAllPosts() {\n const endpoint = 'posts?query={}&sort={\"_kmd.ect\": -1}';\n\n return remote.get('appdata', endpoint, 'kinvey');\n }","createListItems() {\n // map the property(Allposts array)\n return this.props.AllPosts.map((post) => {\n return (\n Title: {post.title} Body:{post.body} \n )\n })\n }","function PostsMain({ posts, ...rest }) {\n return (\n \n
\n
\n
\n \n Add New Post\n \n
\n
( )\n } />\n \n
\n \n
\n
\n
\n );\n}","renderList() {\n return this.props.posts.map((post) => { // return a JSX full result\n return( // returns one piece of JSX for each iteration\n \n
\n
\n
\n
{post.title} \n
{post.body}
\n
\n
\n
\n );\n });\n }","get posts() {\r\n return new Posts(this);\r\n }","function renderPosts(event) {\n event.preventDefault();\n let postList = localStorage.getItem(\"postList\");\n postList = JSON.parse(postList);\n\n if (postList != null) {\n for (post in postList) {\n makePost(postList[post]);\n }\n }\n}","getPosts( state ){\n return state.post\n }","renderPosts(){\n return this.props.posts.map((post) => {\n //for each post in post's arr we return li\n return (\n // back end generates id\n \n \n {post.categories} \n {post.title} \n \n \n )\n })\n }","getAllPost() {\n return service\n .get('/posts/')\n .then((res) => res.data)\n .catch(errorHandler);\n }","function getPosts() {\n Post\n // remote method that returns `posts` array with username\n .findAll()\n .$promise\n .then(function(results) {\n vm.posts = results.posts;\n });\n }","displayPosts() {\n const { data } = this.props;\n\n return data.posts.map(post => {\n return (\n \n \n \n {/* Pass ID through here, make call */}\n \n {post.heading}\n \n \n \n \n \n );\n });\n }","componentWillMount() {\n this.getPosts();\n }","async index({ view }) {\n // const posts = [\n // {title:'Post One', body:'This is post one'},\n // {title:'Post Two', body:'This is post two'},\n // {title:'Post Three', body:'This is post three'},\n // ]\n\n // The posts object is an instance of Vanilla serializer\n const posts = await Post.all();\n // render index page under posts & pass the data title over to the frontend\n return view.render('posts.index', {\n title: 'Latest Posts',\n posts: posts.toJSON(),\n })\n }","generatePosts(){\n const feedPosts = [];\n\n for(var i = 0; i < this.state.posts.length; i++) {\n feedPosts.push(\n \n );\n }\n\n return(\n feedPosts\n );\n }","getAllPosts() {\n return this.storyapi\n .get('cdn/stories', {\n starts_with: 'posts/',\n version,\n })\n .catch((error) => console.log(error));\n }","static displayEntries() {\n let posts = Store.getEntries();\n\n posts.forEach((entry) => UI.addEntryToList(entry));\n\n }","render() {\n\t\treturn(\n\t\t\t \n\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t\t\tAdd a Post\n\t\t\t\t\t\n\t\t\t\t
\t\n\t\t\t\tList of Blog Posts\n\t\t\t\t
Posts \n\t\t\t\t
\n\t\t\t\t\t{this.renderPosts()}\n\t\t\t\t \n\t\t\t
\n\t\t);\n\t}","function PostListCtrl(Post) {\n this.posts = Post.query();\n }","async routes () {\n let { data } = await axios.post(process.env.POSTS_URL,\n JSON.stringify({\n filter: { published: true },\n sort: {_created:-1},\n populate: 1\n }),\n {\n headers: { 'Content-Type': 'application/json' }\n })\n\n const collection = collect(data.entries)\n\n let tags = collection.map(post => post.tags)\n .flatten()\n .unique()\n .map(tag => `category/${tag}`)\n .all()\n\n let posts = collection.map(post => post.title_slug).all()\n\n if(perPage < data.total) {\n let pages = collection\n .take(perPage-data.total)\n .chunk(perPage)\n .map((items, key) => `blog/${key+2}`)\n .all()\n\n return posts.concat(tags,pages)\n }\n\n return posts.concat(tags)\n }","getAllPosts(state){\n return state.loadData\n }","function loadPosts() {\n // Note: \"posts\" is the [API] -> [endpoint] -> [name] in src -> index.js\n return API.get(\"posts\", `/searching/all/${name}`);\n }","getPost() {\n\t\t// fetch all posts from the server\n\t\tfetch(postURL)\n\t\t\t.then(response => response.json())\n\t\t\t// put them into this.posts and store them there\n\t\t\t.then(data => {\n\t\t\t\tthis.posts = data;\n\t\t\t\treturn data;\n\t\t\t})\n\t\t\t// Use .showPost() to display posts\n\t\t\t.then(data => this.showPost(data));\n\t}","function Home() {\n const { loading, data: { getPosts: posts } = [] } = useQuery(\n FETCH_POSTS_QUERY\n );\n\n return (\n \n (\n \n \n \n \n {post.title}\n \n \n }\n description={`${post.username} • ${getTopDomain(\n post.url\n )} • ${moment(post.createdAt).fromNow(true)} ago`}\n />\n \n \n )}\n />\n
\n );\n}","function renderPosts() {\n // assign posts object to a variable\n var posts = memory.posts;\n // loop through posts object\n for (var i = 0; i < posts.length; i++) {\n // call render method\n memory.posts[i].render();\n };\n }","function getAllPostIts() {\n\t\tpostItService.getAll().then(function(result) {\n\t\t\t$scope.postIts = result;\n\t\t}, function (error) {\n\t\t\talert(error);\n\t\t});\n\t}","function loadPosts() {\n return API.get(\"posts\", \"/publicposts\");\n }","loadPosts() {\n if (this.props.thread.posts) {\n return (\n Object.keys(this.props.thread.posts).map(key =>\n \n ))\n }\n }","function getPosts() {\n\tvar snippet = {\n\t\tquery : {},\n\t\tfields: \"title,category,thumbnail\"\n\t}\n\t// for unpublished\n\t// snippet.query = {published: false, nextKey: '-K_W8zLX65ktmaKwf1Yx'}\n\n\trimer.post.find(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}","function allPost(req,res){\n //get all posts from database\n Post.find({},(err,posts)=>{\n if(err){\n res.status(404);\n res.send('Post Not Found !');\n }\n\n //return a view with post data\n res.render('./partials/postlst',{\n posts:posts,\n layout:'./layouts/layout'\n });\n });\n}","allposts( state, data ){\n return state.post = data\n }","render() {\n return (\n \n
Posts \n {\n this.state.posts.map(post =>{\n return
\n
{post.title} \n
{post.body}
\n
\n })\n }\n
\n )\n }","async getPosts() {\n this.loading = false;\n const posts = [];\n const counter = await contract.methods.getCounter().call({\n from: this.currentAccount,\n });\n\n if (counter !== null) {\n const hashes = [];\n const captions = [];\n for (let i = counter; i >= 1; i -= 1) {\n hashes.push(contract.methods.getHash(i).call({\n from: this.currentAccount,\n }));\n }\n\n const postHashes = await Promise.all(hashes);\n\n for (let i = 0; i < postHashes.length; i += 1) {\n captions.push(fetch(`https://gateway.ipfs.io/ipfs/${postHashes[i].text}`)\n .then(res => res.text()));\n }\n\n const postCaptions = await Promise.all(captions);\n\n for (let i = 0; i < postHashes.length; i += 1) {\n posts.push({\n id: i,\n key: `key${i}`,\n caption: postCaptions[i],\n src: `https://gateway.ipfs.io/ipfs/${postHashes[i].img}`,\n });\n }\n\n this.currentPosts = posts;\n this.loading = false;\n }\n }","render() {\n return (\n \n
\n \n Add a Post\n \n
\n
Posts \n
\n {this.renderPosts()}\n \n
\n );\n }","constructor(props) {\n super(props);\n this.state = {\n posts: []\n }\n }","function displayPostsDOM(posts) {\n posts.forEach((post) => {\n appendPostDOM(post);\n });\n}","async function showPosts() {\n const posts = await getPosts();\n\n //console.log(posts);\n\n postContainer.innerHTML += posts\n .map(\n (post) => `\n \n
${post[\"id\"]}
\n
\n
${post[\"title\"]} \n
\n ${post[\"body\"]}\n
\n
\n
`\n )\n .join(\"\");\n}","ngOnInit() {\n this.postService.getAllPosts().subscribe(p => {\n this.allPosts = p;\n this.filterPosts();\n });\n }","function index(req, res) {\n Post.find({})\n .then((Posts) => {\n res.render(\"posts/index\", {\n user: req.user,\n title: \"Message Board\",\n posts: Posts.reverse()\n })\n })\n }","function allPostsView(targetname){\n\n let posts = Model.getPosts();\n let count = 0;\n\n for (let i =0; i\n \n Refresh \n
\n \n {\n posts && posts.map(data =>\n \n \n \n )\n }\n \n \n\n );\n }","static getAllPosts() {\n return fetch('https://dev-selfiegram.consumertrack.com/users/1/feed').then(response => {\n return response.json();\n }).catch(error => {\n return error;\n });\n }","async getPosts(){\n const postData = await this.getPostData()\n\n return postData\n }","async getPosts (params) {\n const endpoint = this.addParamsToEndPoint('posts', params)\n\n const { posts } = await this.get(endpoint)\n return posts\n }","function sendPostsList(request, response) {\n response.send(posts);\n}","function uiGetPosts () {\r\n getAllPosts().then((data)=>{\r\n console.log(data)\r\n const display = document.querySelector('div.response')\r\n display.innerHTML = JSON.stringify(data, null, 2)\r\n })\r\n}","static async list(token) {\n return await sendRequest(\"GET\", \"/posts\", token);\n }","function posts(arr) {\n let postApi = arr.filter((el) => el.userId == id);\n postApi.forEach(element => {\n fragmentPost.appendChild(renderPosts(element));\n });\n elPostListWrapper.appendChild(fragmentPost)\n }","render() {\n\t return (\n\t \t\n\t \t{\n\t \t this.state.posts.map ((item, value) => (\n\t \t \t
\n\t \t ))\n\t \t}\t \n\t \n\t );\n\t}","renderpost(){\n {return this.state.posts.map(post=> )}\n }","fetchAll(params) {\n return api.get('posts', params).then(response => ({\n posts: _.map(_.filter(response.data, filterPosts), post => new Post(post)),\n paging: response.paging\n }));\n }","constructor(props) {\n super(props);\n this.state = {\n posts: []\n };\n }","function load_posts() {\n document.querySelector('#form-view').style.display = 'block';\n document.querySelector('#post-list').style.display = 'block';\n document.querySelector('#post-list').innerHTML = '';\n document.querySelector('#profile-view').style.display = 'none'; \n document.querySelector('#profile-view').innerHTML = ''; \n\n fetch('/show')\n .then(response => response.json())\n .then(posts => {\n paginate_posts(posts);\n });\n}","function getPosts() {\n return [{\n id: 'hello-nextjs',\n title: 'Hello Next.js'\n }, {\n id: 'learn-nextjs',\n title: 'Learn Next.js is awesome'\n }, {\n id: 'deploy-nextjs',\n title: 'Deploy apps with ZEIT'\n }];\n}","function Blog({ posts }) {\n return (\n <>\n This is a blog with content from an API \n \n {posts.map((post) => (\n {post.title} \n ))}\n \n >\n )\n}","componentDidMount() {\n this.props.getPosts();\n }","allPosts() {\n console.log('New posts have arrived.');\n // console.log('allPosts was modified, updating feed!');\n if (!this.allPosts) {\n return;\n }\n this.redrawFeed();\n }","posts(user) {\n return user.getPosts();\n }","function renderPosts(data) {\r\n postLists.innerHTML = null;\r\n const nameBox = document.createElement(\"h3\");\r\n nameBox.textContent = \"POSTS\";\r\n postLists.appendChild(nameBox);\r\n\r\n data.forEach((element) => {\r\n const newUserPost = userPostTemp.cloneNode(true);\r\n const postTitle = newUserPost.querySelector(\".post-title\");\r\n postTitle.textContent = element.title;\r\n postTitle.dataset.post_id = element.id;\r\n newUserPost.querySelector(\".body\").textContent = element.body;\r\n postLists.appendChild(newUserPost);\r\n });\r\n}","function loadPosts() {\n const postsCollection = firebase.firestore().collection(\"postagens\");\n container.querySelector(\"#lista-feed\").innerHTML = \"Carregando...\";\n postsCollection.get().then((querySnapshot) => {\n container.querySelector(\"#lista-feed\").innerHTML = \"\";\n querySnapshot.forEach((doc) => {\n const post = { id: doc.id, data: doc.data() };\n const componente = postTemplate(post);\n console.log(componente)\n container.querySelector(\"#lista-feed\").appendChild(componente);\n });\n });\n }","render() {\n return (\n \n { \n this.state.feed.map(post => (\n // Setar uma key com um ID unico faz o react conseguir achar os \n // elementos mais rapidamente na DOM e ter uma performance melhor\n \n \n \n \n \n \n \n ))\n } \n \n );\n }","componentDidMount() {\n this.retrievePosts();\n }","componentDidMount() {\n this.loadPosts();\n }","function displayPosts(posts) {\r\n\t// use helper function displayPost\r\n\r\n}","async index( req, res ){\n const posts = await Post.find().sort('-createdAt')\n res.json( posts )\n }","renderPosts(posts) {\n //When iterating over post we can get an index value\n //which we can use as \n return posts.map((post, index) => {\n return (\n \n {/* passing data via a query string parameter (a query param). \n In our case, it's the title query param. \n */}\n \n {post.title} \n \n \n )\n })\n }","bindResources(props) {\n const page = props.params.page ? Number.parseInt(props.params.page) : 1\n this.setState({ page });\n const query = {\n filter: {\n limit: this.state.perPage,\n skip: this.state.perPage * (page - 1),\n include: ['roles']\n }\n }\n // # retrieve all the posts from the Post Store\n this.retrieveAll(this.store, { query });\n }","function loadPosts() {// 02\n $.get({ // send get to take all posts\n url: apiBaseUrl + 'posts',\n headers: authorizationHeader\n })\n .then(fillDropDownMenu)\n .catch(renderError);\n }","async getPosts() {\n try {\n const posts = await Post.find().sort({ createdAt: -1 });\n return posts;\n } catch (err) {\n console.log(` An error as occurred while fetching the posts ${JSON.stringify(err)} `);\n throw new Error(err);\n }\n }","function getAllPosts() {\n fetch(\"https://bloguefp.herokuapp.com/\")\n .then((r) => r.json())\n .then(appendPosts)\n .catch(console.warn);\n}","async getReplies () {\n\t\tconst postId = this.codeError.get('postId');\n\t\tif (!postId) {\n\t\t\t\tthrow this.errorHandler.error('notFound', { info: 'postId' });\n\t\t}\n\n\t\t// TODO this should be paginated\n\t\tconst posts = await this.data.posts.getByQuery(\n\t\t\t\t{\n\t\t\t\t\t\tteamId: this.codeError.get('teamId'),\n\t\t\t\t\t\tstreamId: this.codeError.get('streamId'),\n\t\t\t\t\t\tparentPostId: postId\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\thint: PostIndexes.byParentPostId\n\t\t\t\t}\n\t\t);\n\n\t\t// also get posts that are replies to these posts\n\t\tconst postIds = posts.map(post => post.id);\n\t\tconst replies = await this.data.posts.getByQuery(\n\t\t\t\t{\n\t\t\t\t\t\tteamId: this.codeError.get('teamId'),\n\t\t\t\t\t\tstreamId: this.codeError.get('streamId'),\n\t\t\t\t\t\tparentPostId: this.data.posts.inQuery(postIds)\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\thint: PostIndexes.byParentPostId\n\t\t\t\t}\n\t\t);\n\n\t\tthis.posts = [\n\t\t\t\t...posts,\n\t\t\t\t...replies\n\t\t].sort((a, b) => {\n\t\t\t\treturn b.get('seqNum') - a.get('seqNum');\n\t\t});\n\t}","static async getAll() {\n let page = 1;\n let shouldQueryMorePosts = true;\n const returnPosts = [];\n\n while (shouldQueryMorePosts) {\n const response = await this.getPaginated(page);\n\n if (response.posts.length > 0) {\n returnPosts.push(...response.posts);\n }\n\n shouldQueryMorePosts = returnPosts.length < response.total;\n page++;\n }\n\n return returnPosts;\n }","function Feed({posts}) {\n\n return (\n \n
\n {images.map((image) => {\n return (\n \n )\n })}\n \n
\n
\n )\n // return (\n // \n //
photos will show up here \n //
\n //
\n //
\n // );\n}","function get_posts(){\r\n\treturn app.getHits('Post', {published:true}, {sort:{'date':'desc'}});\r\n}","async getAll(query = {}) {\n // NOTE convertToQuery will take an object and turn it into a queryString\n const res = await api.get('api/posts' + convertToQuery(query))\n logger.log(res.data)\n AppState.posts = res.data\n // logger.log('This is the post material', AppState.posts)\n // NOTE goes through the entire function but will not post to page. Function is good.\n }","static get all() {\n return new Promise(async (resolve, reject) => {\n try {\n const postsData = await db.query(`SELECT * FROM thoughts;`)\n const posts = postsData.rows.map(p => new Post(p))\n resolve(posts);\n } catch (err) {\n reject(\"Sorry No Posts Found\")\n }\n })\n }","function allPosts(req, res) {\n request(\n 'https://jsonplaceholder.typicode.com/posts',\n function(err, response, posts) {\n res.render('posts', {posts: JSON.parse(posts)})\n }\n )\n}","getPosts() {\n let communicationController = new CommunicationController()\n let response = function (result) {\n // Rimozione dei post precedenti sia dal model che dall'html\n Model.getInstance().clearPosts()\n\n this._imagePosts = new Array()\n let posts = result.posts.reverse()\n for (let i = 0; i < posts.length; i++) {\n\n Model.getInstance().addPost(posts[i]);\n if (Model.getInstance().actualUser.uid == posts[i].uid) {\n this.myPostHTML(posts[i]);\n } else {\n this.othersPostHTML(posts[i]);\n }\n }\n this.fullScreenImage()\n this.openProfilePicturesDataBase()\n this.openImagesDataBase()\n\n // Apertura mappa per i post di tipo posizione\n $(\".locationButton\").click(function () {\n console.log(\"click\");\n let postIndex = $(\".post\").index($(this).parent());\n let map = new Map();\n map.setPostLocation(result.posts[postIndex].lat, result.posts[postIndex].lon);\n });\n }\n communicationController.getChannel(ctitle, response.bind(this));\n }","function getPosts(author) {\n authorId = author || \"\";\n if (authorId) {\n authorId = \"/?author_id=\" + authorId;\n }\n $.get(\"/api/posts\" + authorId, function(data) {\n console.log(\"Posts\", data);\n posts = data;\n if (!posts || !posts.length) {\n displayEmpty(author);\n }\n else {\n initializeRows();\n }\n });\n }","function renderBlogposts() {\n\n let $sideBlogList = $(`\n \n `);\n\n function addBlogToList(model) {\n let $liContainer = $(`\n \n ${model.get('username')}\n ${model.get('title')} \n ${model.get('body')}
\n \n `);\n $sideBlogList.find('ul').append($liContainer);\n }\n\n\n blogCollection.forEach(addBlogToList);\n blogCollection.on('add', addBlogToList);\n blogCollection.fetch();\n\n let $sideBlog = $(`\n \n `);\n\n\n\n\n return $sideBlogList;\n}","async userIndex({view, auth}) {\n const posts = await auth.user.posts().fetch();\n\n return view.render('posts', { posts: posts.toJSON() });\n }","function Posts(props) {\n const [posts, setPosts] = useState([]);\n\n useEffect(() => {\n async function getPosts() {\n const response = await fetch(\n \"https://strangers-things.herokuapp.com/api/2109-LSU-RM-WEB-FT/posts\"\n );\n\n const responseObj = await response.json();\n\n setPosts(responseObj.data.posts);\n }\n console.log(posts);\n getPosts();\n }, [posts]);\n\n const postsToRender = posts.map((post) => {\n return ;\n });\n\n return (\n \n
Posts: \n {postsToRender}\n \n );\n}","render() {\n\t\t//5. Loop over all of the to do list items now living in state from firebase!\n\t\tlet blogPosts = this.state.blogPosts.map((item, index)=>{\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
{item.title} \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
{item.body}
\n\t\t\t\t\t
\n\t\t\t\t\t
Delete \n\t\t\t\t
\n\t\t\t)\n\n\t\t});\n\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Blog \n\t\t\t\t\t\n\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\t
\n\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\t\tSubmit \n\t\t\t\t\t\t\tDelete All Posts \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\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
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t
Previous Posts \n\t\t\t\t\t\t\t{blogPosts}\n\t\t\t\t\t\n\t\t\t
\n\n\t\t);\n\t}","function postListController(RecipeFactory){\n const vm=this\n vm.post = [{\n title: \"Cats, and they're pissed\",\n description: \"Not really sure why these cats are so pissed, but they're pissed. Nothing can really be known about why they are pissed because they dont speak, they meow. No one has understood the meow explicitly... but tone goes a long way, and they're pissed.\",\n author: \"Tom Swagger\",\n votes: 6,\n imageURL: \"http://dailypicksandflicks.com/wp-content/uploads/2011/01/angry-wet-cat.jpg\",\n createdAt: '2015-05-02',\n comments : [\n {content: \"this is a shitty book\"}\n ]\n },\n {\n title: \"A book of names, for Hamsters\",\n description: \"Hamsters can have names, but a name shapes a hamster... this book will help you choose wisely. Shape your hamster into your best friend starting with a name. It's all in a name\",\n author: \"Theo Thunderbutt\",\n votes: 1,\n imageURL: \"https://s-media-cache-ak0.pinimg.com/736x/d5/db/06/d5db068c895eab1df0091510ee242c61--hamster-stuff-baby-hamster.jpg\",\n createdAt: '2006-09-22',\n comments : [\n {content: \"this is a great book.\"},\n {content: \"well, your an idiot.\"},\n {content: \"no YOU'RE an idiot... fuckturd.\"}\n ]\n },\n {\n title: \"Sex with my neighbor\",\n description: \"too good to be ok, I should not do it...\",\n author: \"Anonymous\",\n votes: 4,\n imageURL: \"https://images-na.ssl-images-amazon.com/images/I/81XIpcZfo-L._SL1500_.jpg\",\n createdAt: '2016-09-22',\n comments : [\n {content: \"this is not a book\"},\n {content: \"thi is practically a porno! my kids are ruined.\"},\n {content: \"you're a porno, and your kids were already ruined\"}\n ]\n }]\n }","async fetchPage() {\n this.listPair = await this.readListPair();\n const { crowdtangle_saved_searches: savedSearches } = this.listPair;\n\n const savedSearchIds = Object.keys(savedSearches).join(\",\");\n\n if (this.savedSearchToggle) {\n this.queryParams = {\n ...this.queryParams,\n listIds: savedSearchIds, // Saved Searches\n };\n } else {\n this.queryParams = {\n ...this.queryParams,\n listIds: undefined, // Lists\n };\n }\n\n const posts = await super.fetchPage();\n posts.forEach((post) => this.addCrowdTangleTags(post));\n\n this.savedSearchToggle = !this.savedSearchToggle;\n\n return posts;\n }","function Home(){\n // to store the articles\n const [articles , setArticles] = useState([]);\n\n useEffect(() => {\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n //get request to fetch all the posts and store it\n fetch('https://jsonplaceholder.typicode.com/posts', requestOptions)\n .then(response => response.json())\n .then(data => setArticles(data));\n }, []);\n\n //mapping through the entire lists and renderering a card fo revery post\n const posts=articles.map((currPost)=>\n \n \n
\n )\n return (\n \n
\n Articles\n \n
\n {posts}\n \n
\n \n )\n}","componentWillMount() {\n this.props.fetchPosts();\n }","function getPosts() {\n setTimeout(() => {\n let output = \"\";\n posts.forEach((e, i) => {\n output += `${e.title} `;\n });\n document.body.innerHTML = output;\n }, 1000);\n}"],"string":"[\n \"async function listPosts() {\\n\\t\\tconst p = await API.graphql(graphqlOperation(ListPosts));\\n\\t\\tupdatePosts(p.data.listPosts.items);\\n\\t}\",\n \"async function list(ctx, next) {\\n ctx.body = await render('list', { posts: posts})\\n}\",\n \"getPosts() {\\r\\n return this.posts;\\r\\n }\",\n \"function PostList({ posts, setPosts }) {\\n // TODO: Diplay the list of posts.\\n // TODO: Create at least one additional component that is used by this component.\\n // TODO: Each post must have className=\\\"post\\\" for the tests to work.\\n // TODO: Each post must have a delete button - Delete - that deletes the post when clicked\\n return (\\n \\n {posts.map((post) => (\\n
\\n ))}\\n
\\n );\\n}\",\n \"all_posts(state){ \\n return state.posts\\n }\",\n \"function displayPosts() {\\n var posts = JSON.parse(this.response);\\n var postsContainer = $(\\\"#posts\\\");\\n for (var i=0; i\\\" + posts[i].body + \\\"\\\")\\n }\\n }\",\n \"async function showPosts() {\\n\\tconst posts = await getPosts();\\n\\n\\t// Get post one by one\\n\\tposts.forEach((post) => {\\n\\t\\t// ! Create post container from api\\n\\t\\tconst postEl = document.createElement('div');\\n\\t\\tpostEl.classList.add('post');\\n\\t\\tpostEl.innerHTML = `\\n ${post.id}
\\n \\n
${post.title} \\n
${post.body}
\\n
`;\\n\\n\\t\\t// ! Add the post data in to the post container\\n\\t\\tpostContainer.appendChild(postEl);\\n\\t});\\n}\",\n \"getAllPosts() {\\n return this.http.get(\\\"http://localhost:8080/api/posts\\\");\\n }\",\n \"renderPosts() {\\n if ( this.props.posts.length > 0 ) {\\n return this.props.posts.map( ( post ) => {\\n return {post.title}
;\\n });\\n } else if (!this.props.posts) {\\n return No posts found.
;\\n } else {\\n return Loading...
\\n }\\n }\",\n \"list(req, res, next) {\\n PostModel.find((err, posts) => {\\n res.render('posts', { posts });\\n }); //end of PostModel.find\\n }\",\n \"function getPosts() {\\n $.get('/api/posts/', function (data) {\\n var postsToAdd = [];\\n for (var i = 0; i < data.length; i++) {\\n\\n newPost = data[i];\\n\\n postsToAdd.push(createPostDiv(newPost));\\n renderPost(postsToAdd);\\n }\\n });\\n }\",\n \"async function showPosts() {\\n const posts = await getPosts();\\n\\n posts.forEach((post) => {\\n const postEl = document.createElement(\\\"div\\\");\\n postEl.classList.add(\\\"post\\\");\\n postEl.innerHTML = `\\n ${post.id}
\\n \\n
${post.title} \\n
${post.body}
\\n
\\n `;\\n postsContainer.appendChild(postEl);\\n // The Node.appendChild() method adds a node to the end of the list of children of a specified parent node.\\n // The fetch() method takes one mandatory argument, the path to the resource you want to fetch.\\n // It returns a Promise that resolves to the Response to that request, whether it is successful or not\\n });\\n}\",\n \"render() {\\n\\t\\t//console.log(links);\\n\\t\\treturn (\\n\\t\\t\\t\\n\\t\\t\\t\\t{posts.map((post)=>{\\n return
\\n })}\\n\\t\\t\\t \\n\\t\\t);\\n\\t}\",\n \"renderList() {\\n if (this.props.posts) {\\n return this.props.posts.map(post => (\\n \\n \\n \\n {post.id} \\n \\n ));\\n }\\n return ;\\n }\",\n \"function getAllPosts() {\\n const endpoint = 'posts?query={}&sort={\\\"_kmd.ect\\\": -1}';\\n\\n return remote.get('appdata', endpoint, 'kinvey');\\n }\",\n \"createListItems() {\\n // map the property(Allposts array)\\n return this.props.AllPosts.map((post) => {\\n return (\\n Title: {post.title} Body:{post.body} \\n )\\n })\\n }\",\n \"function PostsMain({ posts, ...rest }) {\\n return (\\n \\n
\\n
\\n
\\n \\n Add New Post\\n \\n
\\n
( )\\n } />\\n \\n
\\n \\n
\\n
\\n
\\n );\\n}\",\n \"renderList() {\\n return this.props.posts.map((post) => { // return a JSX full result\\n return( // returns one piece of JSX for each iteration\\n \\n
\\n
\\n
\\n
{post.title} \\n
{post.body}
\\n
\\n
\\n
\\n );\\n });\\n }\",\n \"get posts() {\\r\\n return new Posts(this);\\r\\n }\",\n \"function renderPosts(event) {\\n event.preventDefault();\\n let postList = localStorage.getItem(\\\"postList\\\");\\n postList = JSON.parse(postList);\\n\\n if (postList != null) {\\n for (post in postList) {\\n makePost(postList[post]);\\n }\\n }\\n}\",\n \"getPosts( state ){\\n return state.post\\n }\",\n \"renderPosts(){\\n return this.props.posts.map((post) => {\\n //for each post in post's arr we return li\\n return (\\n // back end generates id\\n \\n \\n {post.categories} \\n {post.title} \\n \\n \\n )\\n })\\n }\",\n \"getAllPost() {\\n return service\\n .get('/posts/')\\n .then((res) => res.data)\\n .catch(errorHandler);\\n }\",\n \"function getPosts() {\\n Post\\n // remote method that returns `posts` array with username\\n .findAll()\\n .$promise\\n .then(function(results) {\\n vm.posts = results.posts;\\n });\\n }\",\n \"displayPosts() {\\n const { data } = this.props;\\n\\n return data.posts.map(post => {\\n return (\\n \\n \\n \\n {/* Pass ID through here, make call */}\\n \\n {post.heading}\\n \\n \\n \\n \\n \\n );\\n });\\n }\",\n \"componentWillMount() {\\n this.getPosts();\\n }\",\n \"async index({ view }) {\\n // const posts = [\\n // {title:'Post One', body:'This is post one'},\\n // {title:'Post Two', body:'This is post two'},\\n // {title:'Post Three', body:'This is post three'},\\n // ]\\n\\n // The posts object is an instance of Vanilla serializer\\n const posts = await Post.all();\\n // render index page under posts & pass the data title over to the frontend\\n return view.render('posts.index', {\\n title: 'Latest Posts',\\n posts: posts.toJSON(),\\n })\\n }\",\n \"generatePosts(){\\n const feedPosts = [];\\n\\n for(var i = 0; i < this.state.posts.length; i++) {\\n feedPosts.push(\\n \\n );\\n }\\n\\n return(\\n feedPosts\\n );\\n }\",\n \"getAllPosts() {\\n return this.storyapi\\n .get('cdn/stories', {\\n starts_with: 'posts/',\\n version,\\n })\\n .catch((error) => console.log(error));\\n }\",\n \"static displayEntries() {\\n let posts = Store.getEntries();\\n\\n posts.forEach((entry) => UI.addEntryToList(entry));\\n\\n }\",\n \"render() {\\n\\t\\treturn(\\n\\t\\t\\t \\n\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t \\n\\t\\t\\t\\t\\t\\tAdd a Post\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t
\\t\\n\\t\\t\\t\\tList of Blog Posts\\n\\t\\t\\t\\t
Posts \\n\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t{this.renderPosts()}\\n\\t\\t\\t\\t \\n\\t\\t\\t
\\n\\t\\t);\\n\\t}\",\n \"function PostListCtrl(Post) {\\n this.posts = Post.query();\\n }\",\n \"async routes () {\\n let { data } = await axios.post(process.env.POSTS_URL,\\n JSON.stringify({\\n filter: { published: true },\\n sort: {_created:-1},\\n populate: 1\\n }),\\n {\\n headers: { 'Content-Type': 'application/json' }\\n })\\n\\n const collection = collect(data.entries)\\n\\n let tags = collection.map(post => post.tags)\\n .flatten()\\n .unique()\\n .map(tag => `category/${tag}`)\\n .all()\\n\\n let posts = collection.map(post => post.title_slug).all()\\n\\n if(perPage < data.total) {\\n let pages = collection\\n .take(perPage-data.total)\\n .chunk(perPage)\\n .map((items, key) => `blog/${key+2}`)\\n .all()\\n\\n return posts.concat(tags,pages)\\n }\\n\\n return posts.concat(tags)\\n }\",\n \"getAllPosts(state){\\n return state.loadData\\n }\",\n \"function loadPosts() {\\n // Note: \\\"posts\\\" is the [API] -> [endpoint] -> [name] in src -> index.js\\n return API.get(\\\"posts\\\", `/searching/all/${name}`);\\n }\",\n \"getPost() {\\n\\t\\t// fetch all posts from the server\\n\\t\\tfetch(postURL)\\n\\t\\t\\t.then(response => response.json())\\n\\t\\t\\t// put them into this.posts and store them there\\n\\t\\t\\t.then(data => {\\n\\t\\t\\t\\tthis.posts = data;\\n\\t\\t\\t\\treturn data;\\n\\t\\t\\t})\\n\\t\\t\\t// Use .showPost() to display posts\\n\\t\\t\\t.then(data => this.showPost(data));\\n\\t}\",\n \"function Home() {\\n const { loading, data: { getPosts: posts } = [] } = useQuery(\\n FETCH_POSTS_QUERY\\n );\\n\\n return (\\n \\n (\\n \\n \\n \\n \\n {post.title}\\n \\n \\n }\\n description={`${post.username} • ${getTopDomain(\\n post.url\\n )} • ${moment(post.createdAt).fromNow(true)} ago`}\\n />\\n \\n \\n )}\\n />\\n
\\n );\\n}\",\n \"function renderPosts() {\\n // assign posts object to a variable\\n var posts = memory.posts;\\n // loop through posts object\\n for (var i = 0; i < posts.length; i++) {\\n // call render method\\n memory.posts[i].render();\\n };\\n }\",\n \"function getAllPostIts() {\\n\\t\\tpostItService.getAll().then(function(result) {\\n\\t\\t\\t$scope.postIts = result;\\n\\t\\t}, function (error) {\\n\\t\\t\\talert(error);\\n\\t\\t});\\n\\t}\",\n \"function loadPosts() {\\n return API.get(\\\"posts\\\", \\\"/publicposts\\\");\\n }\",\n \"loadPosts() {\\n if (this.props.thread.posts) {\\n return (\\n Object.keys(this.props.thread.posts).map(key =>\\n \\n ))\\n }\\n }\",\n \"function getPosts() {\\n\\tvar snippet = {\\n\\t\\tquery : {},\\n\\t\\tfields: \\\"title,category,thumbnail\\\"\\n\\t}\\n\\t// for unpublished\\n\\t// snippet.query = {published: false, nextKey: '-K_W8zLX65ktmaKwf1Yx'}\\n\\n\\trimer.post.find(snippet, function(error, value) {\\n\\t\\tif(error) {\\n\\t\\t\\tconsole.log(error)\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(value)\\n\\t\\t}\\n\\t})\\n}\",\n \"function allPost(req,res){\\n //get all posts from database\\n Post.find({},(err,posts)=>{\\n if(err){\\n res.status(404);\\n res.send('Post Not Found !');\\n }\\n\\n //return a view with post data\\n res.render('./partials/postlst',{\\n posts:posts,\\n layout:'./layouts/layout'\\n });\\n });\\n}\",\n \"allposts( state, data ){\\n return state.post = data\\n }\",\n \"render() {\\n return (\\n \\n
Posts \\n {\\n this.state.posts.map(post =>{\\n return
\\n
{post.title} \\n
{post.body}
\\n
\\n })\\n }\\n
\\n )\\n }\",\n \"async getPosts() {\\n this.loading = false;\\n const posts = [];\\n const counter = await contract.methods.getCounter().call({\\n from: this.currentAccount,\\n });\\n\\n if (counter !== null) {\\n const hashes = [];\\n const captions = [];\\n for (let i = counter; i >= 1; i -= 1) {\\n hashes.push(contract.methods.getHash(i).call({\\n from: this.currentAccount,\\n }));\\n }\\n\\n const postHashes = await Promise.all(hashes);\\n\\n for (let i = 0; i < postHashes.length; i += 1) {\\n captions.push(fetch(`https://gateway.ipfs.io/ipfs/${postHashes[i].text}`)\\n .then(res => res.text()));\\n }\\n\\n const postCaptions = await Promise.all(captions);\\n\\n for (let i = 0; i < postHashes.length; i += 1) {\\n posts.push({\\n id: i,\\n key: `key${i}`,\\n caption: postCaptions[i],\\n src: `https://gateway.ipfs.io/ipfs/${postHashes[i].img}`,\\n });\\n }\\n\\n this.currentPosts = posts;\\n this.loading = false;\\n }\\n }\",\n \"render() {\\n return (\\n \\n
\\n \\n Add a Post\\n \\n
\\n
Posts \\n
\\n {this.renderPosts()}\\n \\n
\\n );\\n }\",\n \"constructor(props) {\\n super(props);\\n this.state = {\\n posts: []\\n }\\n }\",\n \"function displayPostsDOM(posts) {\\n posts.forEach((post) => {\\n appendPostDOM(post);\\n });\\n}\",\n \"async function showPosts() {\\n const posts = await getPosts();\\n\\n //console.log(posts);\\n\\n postContainer.innerHTML += posts\\n .map(\\n (post) => `\\n \\n
${post[\\\"id\\\"]}
\\n
\\n
${post[\\\"title\\\"]} \\n
\\n ${post[\\\"body\\\"]}\\n
\\n
\\n
`\\n )\\n .join(\\\"\\\");\\n}\",\n \"ngOnInit() {\\n this.postService.getAllPosts().subscribe(p => {\\n this.allPosts = p;\\n this.filterPosts();\\n });\\n }\",\n \"function index(req, res) {\\n Post.find({})\\n .then((Posts) => {\\n res.render(\\\"posts/index\\\", {\\n user: req.user,\\n title: \\\"Message Board\\\",\\n posts: Posts.reverse()\\n })\\n })\\n }\",\n \"function allPostsView(targetname){\\n\\n let posts = Model.getPosts();\\n let count = 0;\\n\\n for (let i =0; i\\n \\n Refresh \\n
\\n \\n {\\n posts && posts.map(data =>\\n \\n \\n \\n )\\n }\\n \\n \\n\\n );\\n }\",\n \"static getAllPosts() {\\n return fetch('https://dev-selfiegram.consumertrack.com/users/1/feed').then(response => {\\n return response.json();\\n }).catch(error => {\\n return error;\\n });\\n }\",\n \"async getPosts(){\\n const postData = await this.getPostData()\\n\\n return postData\\n }\",\n \"async getPosts (params) {\\n const endpoint = this.addParamsToEndPoint('posts', params)\\n\\n const { posts } = await this.get(endpoint)\\n return posts\\n }\",\n \"function sendPostsList(request, response) {\\n response.send(posts);\\n}\",\n \"function uiGetPosts () {\\r\\n getAllPosts().then((data)=>{\\r\\n console.log(data)\\r\\n const display = document.querySelector('div.response')\\r\\n display.innerHTML = JSON.stringify(data, null, 2)\\r\\n })\\r\\n}\",\n \"static async list(token) {\\n return await sendRequest(\\\"GET\\\", \\\"/posts\\\", token);\\n }\",\n \"function posts(arr) {\\n let postApi = arr.filter((el) => el.userId == id);\\n postApi.forEach(element => {\\n fragmentPost.appendChild(renderPosts(element));\\n });\\n elPostListWrapper.appendChild(fragmentPost)\\n }\",\n \"render() {\\n\\t return (\\n\\t \\t\\n\\t \\t{\\n\\t \\t this.state.posts.map ((item, value) => (\\n\\t \\t \\t
\\n\\t \\t ))\\n\\t \\t}\\t \\n\\t \\n\\t );\\n\\t}\",\n \"renderpost(){\\n {return this.state.posts.map(post=> )}\\n }\",\n \"fetchAll(params) {\\n return api.get('posts', params).then(response => ({\\n posts: _.map(_.filter(response.data, filterPosts), post => new Post(post)),\\n paging: response.paging\\n }));\\n }\",\n \"constructor(props) {\\n super(props);\\n this.state = {\\n posts: []\\n };\\n }\",\n \"function load_posts() {\\n document.querySelector('#form-view').style.display = 'block';\\n document.querySelector('#post-list').style.display = 'block';\\n document.querySelector('#post-list').innerHTML = '';\\n document.querySelector('#profile-view').style.display = 'none'; \\n document.querySelector('#profile-view').innerHTML = ''; \\n\\n fetch('/show')\\n .then(response => response.json())\\n .then(posts => {\\n paginate_posts(posts);\\n });\\n}\",\n \"function getPosts() {\\n return [{\\n id: 'hello-nextjs',\\n title: 'Hello Next.js'\\n }, {\\n id: 'learn-nextjs',\\n title: 'Learn Next.js is awesome'\\n }, {\\n id: 'deploy-nextjs',\\n title: 'Deploy apps with ZEIT'\\n }];\\n}\",\n \"function Blog({ posts }) {\\n return (\\n <>\\n This is a blog with content from an API \\n \\n {posts.map((post) => (\\n {post.title} \\n ))}\\n \\n >\\n )\\n}\",\n \"componentDidMount() {\\n this.props.getPosts();\\n }\",\n \"allPosts() {\\n console.log('New posts have arrived.');\\n // console.log('allPosts was modified, updating feed!');\\n if (!this.allPosts) {\\n return;\\n }\\n this.redrawFeed();\\n }\",\n \"posts(user) {\\n return user.getPosts();\\n }\",\n \"function renderPosts(data) {\\r\\n postLists.innerHTML = null;\\r\\n const nameBox = document.createElement(\\\"h3\\\");\\r\\n nameBox.textContent = \\\"POSTS\\\";\\r\\n postLists.appendChild(nameBox);\\r\\n\\r\\n data.forEach((element) => {\\r\\n const newUserPost = userPostTemp.cloneNode(true);\\r\\n const postTitle = newUserPost.querySelector(\\\".post-title\\\");\\r\\n postTitle.textContent = element.title;\\r\\n postTitle.dataset.post_id = element.id;\\r\\n newUserPost.querySelector(\\\".body\\\").textContent = element.body;\\r\\n postLists.appendChild(newUserPost);\\r\\n });\\r\\n}\",\n \"function loadPosts() {\\n const postsCollection = firebase.firestore().collection(\\\"postagens\\\");\\n container.querySelector(\\\"#lista-feed\\\").innerHTML = \\\"Carregando...\\\";\\n postsCollection.get().then((querySnapshot) => {\\n container.querySelector(\\\"#lista-feed\\\").innerHTML = \\\"\\\";\\n querySnapshot.forEach((doc) => {\\n const post = { id: doc.id, data: doc.data() };\\n const componente = postTemplate(post);\\n console.log(componente)\\n container.querySelector(\\\"#lista-feed\\\").appendChild(componente);\\n });\\n });\\n }\",\n \"render() {\\n return (\\n \\n { \\n this.state.feed.map(post => (\\n // Setar uma key com um ID unico faz o react conseguir achar os \\n // elementos mais rapidamente na DOM e ter uma performance melhor\\n \\n \\n \\n \\n \\n \\n \\n ))\\n } \\n \\n );\\n }\",\n \"componentDidMount() {\\n this.retrievePosts();\\n }\",\n \"componentDidMount() {\\n this.loadPosts();\\n }\",\n \"function displayPosts(posts) {\\r\\n\\t// use helper function displayPost\\r\\n\\r\\n}\",\n \"async index( req, res ){\\n const posts = await Post.find().sort('-createdAt')\\n res.json( posts )\\n }\",\n \"renderPosts(posts) {\\n //When iterating over post we can get an index value\\n //which we can use as \\n return posts.map((post, index) => {\\n return (\\n \\n {/* passing data via a query string parameter (a query param). \\n In our case, it's the title query param. \\n */}\\n \\n {post.title} \\n \\n \\n )\\n })\\n }\",\n \"bindResources(props) {\\n const page = props.params.page ? Number.parseInt(props.params.page) : 1\\n this.setState({ page });\\n const query = {\\n filter: {\\n limit: this.state.perPage,\\n skip: this.state.perPage * (page - 1),\\n include: ['roles']\\n }\\n }\\n // # retrieve all the posts from the Post Store\\n this.retrieveAll(this.store, { query });\\n }\",\n \"function loadPosts() {// 02\\n $.get({ // send get to take all posts\\n url: apiBaseUrl + 'posts',\\n headers: authorizationHeader\\n })\\n .then(fillDropDownMenu)\\n .catch(renderError);\\n }\",\n \"async getPosts() {\\n try {\\n const posts = await Post.find().sort({ createdAt: -1 });\\n return posts;\\n } catch (err) {\\n console.log(` An error as occurred while fetching the posts ${JSON.stringify(err)} `);\\n throw new Error(err);\\n }\\n }\",\n \"function getAllPosts() {\\n fetch(\\\"https://bloguefp.herokuapp.com/\\\")\\n .then((r) => r.json())\\n .then(appendPosts)\\n .catch(console.warn);\\n}\",\n \"async getReplies () {\\n\\t\\tconst postId = this.codeError.get('postId');\\n\\t\\tif (!postId) {\\n\\t\\t\\t\\tthrow this.errorHandler.error('notFound', { info: 'postId' });\\n\\t\\t}\\n\\n\\t\\t// TODO this should be paginated\\n\\t\\tconst posts = await this.data.posts.getByQuery(\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tteamId: this.codeError.get('teamId'),\\n\\t\\t\\t\\t\\t\\tstreamId: this.codeError.get('streamId'),\\n\\t\\t\\t\\t\\t\\tparentPostId: postId\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\thint: PostIndexes.byParentPostId\\n\\t\\t\\t\\t}\\n\\t\\t);\\n\\n\\t\\t// also get posts that are replies to these posts\\n\\t\\tconst postIds = posts.map(post => post.id);\\n\\t\\tconst replies = await this.data.posts.getByQuery(\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tteamId: this.codeError.get('teamId'),\\n\\t\\t\\t\\t\\t\\tstreamId: this.codeError.get('streamId'),\\n\\t\\t\\t\\t\\t\\tparentPostId: this.data.posts.inQuery(postIds)\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\thint: PostIndexes.byParentPostId\\n\\t\\t\\t\\t}\\n\\t\\t);\\n\\n\\t\\tthis.posts = [\\n\\t\\t\\t\\t...posts,\\n\\t\\t\\t\\t...replies\\n\\t\\t].sort((a, b) => {\\n\\t\\t\\t\\treturn b.get('seqNum') - a.get('seqNum');\\n\\t\\t});\\n\\t}\",\n \"static async getAll() {\\n let page = 1;\\n let shouldQueryMorePosts = true;\\n const returnPosts = [];\\n\\n while (shouldQueryMorePosts) {\\n const response = await this.getPaginated(page);\\n\\n if (response.posts.length > 0) {\\n returnPosts.push(...response.posts);\\n }\\n\\n shouldQueryMorePosts = returnPosts.length < response.total;\\n page++;\\n }\\n\\n return returnPosts;\\n }\",\n \"function Feed({posts}) {\\n\\n return (\\n \\n
\\n {images.map((image) => {\\n return (\\n \\n )\\n })}\\n \\n
\\n
\\n )\\n // return (\\n // \\n //
photos will show up here \\n //
\\n //
\\n //
\\n // );\\n}\",\n \"function get_posts(){\\r\\n\\treturn app.getHits('Post', {published:true}, {sort:{'date':'desc'}});\\r\\n}\",\n \"async getAll(query = {}) {\\n // NOTE convertToQuery will take an object and turn it into a queryString\\n const res = await api.get('api/posts' + convertToQuery(query))\\n logger.log(res.data)\\n AppState.posts = res.data\\n // logger.log('This is the post material', AppState.posts)\\n // NOTE goes through the entire function but will not post to page. Function is good.\\n }\",\n \"static get all() {\\n return new Promise(async (resolve, reject) => {\\n try {\\n const postsData = await db.query(`SELECT * FROM thoughts;`)\\n const posts = postsData.rows.map(p => new Post(p))\\n resolve(posts);\\n } catch (err) {\\n reject(\\\"Sorry No Posts Found\\\")\\n }\\n })\\n }\",\n \"function allPosts(req, res) {\\n request(\\n 'https://jsonplaceholder.typicode.com/posts',\\n function(err, response, posts) {\\n res.render('posts', {posts: JSON.parse(posts)})\\n }\\n )\\n}\",\n \"getPosts() {\\n let communicationController = new CommunicationController()\\n let response = function (result) {\\n // Rimozione dei post precedenti sia dal model che dall'html\\n Model.getInstance().clearPosts()\\n\\n this._imagePosts = new Array()\\n let posts = result.posts.reverse()\\n for (let i = 0; i < posts.length; i++) {\\n\\n Model.getInstance().addPost(posts[i]);\\n if (Model.getInstance().actualUser.uid == posts[i].uid) {\\n this.myPostHTML(posts[i]);\\n } else {\\n this.othersPostHTML(posts[i]);\\n }\\n }\\n this.fullScreenImage()\\n this.openProfilePicturesDataBase()\\n this.openImagesDataBase()\\n\\n // Apertura mappa per i post di tipo posizione\\n $(\\\".locationButton\\\").click(function () {\\n console.log(\\\"click\\\");\\n let postIndex = $(\\\".post\\\").index($(this).parent());\\n let map = new Map();\\n map.setPostLocation(result.posts[postIndex].lat, result.posts[postIndex].lon);\\n });\\n }\\n communicationController.getChannel(ctitle, response.bind(this));\\n }\",\n \"function getPosts(author) {\\n authorId = author || \\\"\\\";\\n if (authorId) {\\n authorId = \\\"/?author_id=\\\" + authorId;\\n }\\n $.get(\\\"/api/posts\\\" + authorId, function(data) {\\n console.log(\\\"Posts\\\", data);\\n posts = data;\\n if (!posts || !posts.length) {\\n displayEmpty(author);\\n }\\n else {\\n initializeRows();\\n }\\n });\\n }\",\n \"function renderBlogposts() {\\n\\n let $sideBlogList = $(`\\n \\n `);\\n\\n function addBlogToList(model) {\\n let $liContainer = $(`\\n \\n ${model.get('username')}\\n ${model.get('title')} \\n ${model.get('body')}
\\n \\n `);\\n $sideBlogList.find('ul').append($liContainer);\\n }\\n\\n\\n blogCollection.forEach(addBlogToList);\\n blogCollection.on('add', addBlogToList);\\n blogCollection.fetch();\\n\\n let $sideBlog = $(`\\n \\n `);\\n\\n\\n\\n\\n return $sideBlogList;\\n}\",\n \"async userIndex({view, auth}) {\\n const posts = await auth.user.posts().fetch();\\n\\n return view.render('posts', { posts: posts.toJSON() });\\n }\",\n \"function Posts(props) {\\n const [posts, setPosts] = useState([]);\\n\\n useEffect(() => {\\n async function getPosts() {\\n const response = await fetch(\\n \\\"https://strangers-things.herokuapp.com/api/2109-LSU-RM-WEB-FT/posts\\\"\\n );\\n\\n const responseObj = await response.json();\\n\\n setPosts(responseObj.data.posts);\\n }\\n console.log(posts);\\n getPosts();\\n }, [posts]);\\n\\n const postsToRender = posts.map((post) => {\\n return ;\\n });\\n\\n return (\\n \\n
Posts: \\n {postsToRender}\\n \\n );\\n}\",\n \"render() {\\n\\t\\t//5. Loop over all of the to do list items now living in state from firebase!\\n\\t\\tlet blogPosts = this.state.blogPosts.map((item, index)=>{\\n\\t\\t\\treturn (\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t
{item.title} \\n\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t\\t
{item.body}
\\n\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t
Delete \\n\\t\\t\\t\\t
\\n\\t\\t\\t)\\n\\n\\t\\t});\\n\\n\\n\\t\\treturn (\\n\\t\\t\\t\\n\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t\\t
Blog \\n\\t\\t\\t\\t\\t\\n\\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\\t
\\n\\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\\t\\tSubmit \\n\\t\\t\\t\\t\\t\\t\\tDelete All Posts \\n\\t\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t
\\n\\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
\\n\\n\\n\\n\\t\\t\\t\\t\\t
\\n\\n\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t\\t
Previous Posts \\n\\t\\t\\t\\t\\t\\t\\t{blogPosts}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t
\\n\\n\\t\\t);\\n\\t}\",\n \"function postListController(RecipeFactory){\\n const vm=this\\n vm.post = [{\\n title: \\\"Cats, and they're pissed\\\",\\n description: \\\"Not really sure why these cats are so pissed, but they're pissed. Nothing can really be known about why they are pissed because they dont speak, they meow. No one has understood the meow explicitly... but tone goes a long way, and they're pissed.\\\",\\n author: \\\"Tom Swagger\\\",\\n votes: 6,\\n imageURL: \\\"http://dailypicksandflicks.com/wp-content/uploads/2011/01/angry-wet-cat.jpg\\\",\\n createdAt: '2015-05-02',\\n comments : [\\n {content: \\\"this is a shitty book\\\"}\\n ]\\n },\\n {\\n title: \\\"A book of names, for Hamsters\\\",\\n description: \\\"Hamsters can have names, but a name shapes a hamster... this book will help you choose wisely. Shape your hamster into your best friend starting with a name. It's all in a name\\\",\\n author: \\\"Theo Thunderbutt\\\",\\n votes: 1,\\n imageURL: \\\"https://s-media-cache-ak0.pinimg.com/736x/d5/db/06/d5db068c895eab1df0091510ee242c61--hamster-stuff-baby-hamster.jpg\\\",\\n createdAt: '2006-09-22',\\n comments : [\\n {content: \\\"this is a great book.\\\"},\\n {content: \\\"well, your an idiot.\\\"},\\n {content: \\\"no YOU'RE an idiot... fuckturd.\\\"}\\n ]\\n },\\n {\\n title: \\\"Sex with my neighbor\\\",\\n description: \\\"too good to be ok, I should not do it...\\\",\\n author: \\\"Anonymous\\\",\\n votes: 4,\\n imageURL: \\\"https://images-na.ssl-images-amazon.com/images/I/81XIpcZfo-L._SL1500_.jpg\\\",\\n createdAt: '2016-09-22',\\n comments : [\\n {content: \\\"this is not a book\\\"},\\n {content: \\\"thi is practically a porno! my kids are ruined.\\\"},\\n {content: \\\"you're a porno, and your kids were already ruined\\\"}\\n ]\\n }]\\n }\",\n \"async fetchPage() {\\n this.listPair = await this.readListPair();\\n const { crowdtangle_saved_searches: savedSearches } = this.listPair;\\n\\n const savedSearchIds = Object.keys(savedSearches).join(\\\",\\\");\\n\\n if (this.savedSearchToggle) {\\n this.queryParams = {\\n ...this.queryParams,\\n listIds: savedSearchIds, // Saved Searches\\n };\\n } else {\\n this.queryParams = {\\n ...this.queryParams,\\n listIds: undefined, // Lists\\n };\\n }\\n\\n const posts = await super.fetchPage();\\n posts.forEach((post) => this.addCrowdTangleTags(post));\\n\\n this.savedSearchToggle = !this.savedSearchToggle;\\n\\n return posts;\\n }\",\n \"function Home(){\\n // to store the articles\\n const [articles , setArticles] = useState([]);\\n\\n useEffect(() => {\\n const requestOptions = {\\n method: 'GET',\\n headers: { 'Content-Type': 'application/json' },\\n };\\n //get request to fetch all the posts and store it\\n fetch('https://jsonplaceholder.typicode.com/posts', requestOptions)\\n .then(response => response.json())\\n .then(data => setArticles(data));\\n }, []);\\n\\n //mapping through the entire lists and renderering a card fo revery post\\n const posts=articles.map((currPost)=>\\n \\n \\n
\\n )\\n return (\\n \\n
\\n Articles\\n \\n
\\n {posts}\\n \\n
\\n \\n )\\n}\",\n \"componentWillMount() {\\n this.props.fetchPosts();\\n }\",\n \"function getPosts() {\\n setTimeout(() => {\\n let output = \\\"\\\";\\n posts.forEach((e, i) => {\\n output += `${e.title} `;\\n });\\n document.body.innerHTML = output;\\n }, 1000);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7404693","0.7352751","0.7247325","0.7133187","0.7089901","0.70602983","0.7026492","0.70116025","0.69791776","0.69705784","0.6962189","0.6948067","0.6934963","0.6923527","0.69020087","0.6892614","0.68825185","0.6866711","0.6862716","0.68602693","0.6857877","0.68509626","0.68387324","0.6836445","0.68260235","0.6821881","0.6790404","0.67685235","0.6760753","0.675348","0.674205","0.67106164","0.6698968","0.6694361","0.6694026","0.6678343","0.6659325","0.66497314","0.65927815","0.65885216","0.65669703","0.65432954","0.653647","0.6524485","0.65167993","0.65113926","0.65053815","0.64972275","0.6485634","0.648306","0.64818203","0.6480651","0.64738816","0.64636207","0.6450268","0.6444541","0.64388","0.64378166","0.6429583","0.64144653","0.6410193","0.64030933","0.6400411","0.63996273","0.63902044","0.6365866","0.6362136","0.6356068","0.635467","0.6351133","0.634813","0.63478774","0.63470334","0.6346459","0.6328545","0.6302595","0.63025457","0.62979406","0.6283722","0.6281088","0.628076","0.6278882","0.62757117","0.62724847","0.6270682","0.6256937","0.6254665","0.6244351","0.62282085","0.6224832","0.6217947","0.62163484","0.62140256","0.6206105","0.6201837","0.62005913","0.61988837","0.6198064","0.6196904","0.6194595","0.6188534"],"string":"[\n \"0.7404693\",\n \"0.7352751\",\n \"0.7247325\",\n \"0.7133187\",\n \"0.7089901\",\n \"0.70602983\",\n \"0.7026492\",\n \"0.70116025\",\n \"0.69791776\",\n \"0.69705784\",\n \"0.6962189\",\n \"0.6948067\",\n \"0.6934963\",\n \"0.6923527\",\n \"0.69020087\",\n \"0.6892614\",\n \"0.68825185\",\n \"0.6866711\",\n \"0.6862716\",\n \"0.68602693\",\n \"0.6857877\",\n \"0.68509626\",\n \"0.68387324\",\n \"0.6836445\",\n \"0.68260235\",\n \"0.6821881\",\n \"0.6790404\",\n \"0.67685235\",\n \"0.6760753\",\n \"0.675348\",\n \"0.674205\",\n \"0.67106164\",\n \"0.6698968\",\n \"0.6694361\",\n \"0.6694026\",\n \"0.6678343\",\n \"0.6659325\",\n \"0.66497314\",\n \"0.65927815\",\n \"0.65885216\",\n \"0.65669703\",\n \"0.65432954\",\n \"0.653647\",\n \"0.6524485\",\n \"0.65167993\",\n \"0.65113926\",\n \"0.65053815\",\n \"0.64972275\",\n \"0.6485634\",\n \"0.648306\",\n \"0.64818203\",\n \"0.6480651\",\n \"0.64738816\",\n \"0.64636207\",\n \"0.6450268\",\n \"0.6444541\",\n \"0.64388\",\n \"0.64378166\",\n \"0.6429583\",\n \"0.64144653\",\n \"0.6410193\",\n \"0.64030933\",\n \"0.6400411\",\n \"0.63996273\",\n \"0.63902044\",\n \"0.6365866\",\n \"0.6362136\",\n \"0.6356068\",\n \"0.635467\",\n \"0.6351133\",\n \"0.634813\",\n \"0.63478774\",\n \"0.63470334\",\n \"0.6346459\",\n \"0.6328545\",\n \"0.6302595\",\n \"0.63025457\",\n \"0.62979406\",\n \"0.6283722\",\n \"0.6281088\",\n \"0.628076\",\n \"0.6278882\",\n \"0.62757117\",\n \"0.62724847\",\n \"0.6270682\",\n \"0.6256937\",\n \"0.6254665\",\n \"0.6244351\",\n \"0.62282085\",\n \"0.6224832\",\n \"0.6217947\",\n \"0.62163484\",\n \"0.62140256\",\n \"0.6206105\",\n \"0.6201837\",\n \"0.62005913\",\n \"0.61988837\",\n \"0.6198064\",\n \"0.6196904\",\n \"0.6194595\",\n \"0.6188534\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":561,"cells":{"query":{"kind":"string","value":"get parameters from the URL which was navigated to from autogenerated email"},"document":{"kind":"string","value":"function getParameterByName(name, url) {\r\n if (!url) url = window.location.href;\r\n name = name.replace(/[\\[\\]]/g, \"\\\\$&\");\r\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\r\n results = regex.exec(url);\r\n if (!results) return null;\r\n if (!results[2]) return '';\r\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["getUrlParams() {\n\n //var my_url_var = window.location.href;\n let my_url_var = (window.location != window.parent.location) ?\n document.referrer :\n document.location.href;\n\n let params_list = my_url_var.split(\"?\");\n\n let final = {};\n\n if (params_list.length > 1) {\n\n let params_parsed = params_list[1].split(\"&\");\n\n for (let i = 0; i < params_parsed.length; i++) {\n let p_couple = params_parsed[i].split(\"=\");\n final[p_couple[0]] = p_couple[1];\n }\n }\n\n return final;\n }","function grabLinkParams() {\n var url = new URL(window.location.href);\n var fulfillRequestTo = url.searchParams.get(\"fulfillRequestTo\");\n $(\"#destinationWalletOrEmail\").val(fulfillRequestTo);\n var fulfillRequestAmount = url.searchParams.get(\"fulfillRequestAmount\");\n $(\"#transactionAmount\").val(fulfillRequestAmount);\n }","function getURLParameters() {\n 'use strict';\n if (debugMode) {\n console.groupCollapsed(\"URL parameters\");\n }\n\n var parametersArray = {};\n\n // A bit hackish.\n if (location.href.indexOf(\"#\") > -1) {\n location.assign(location.href.replace(/\\/?#\\//, \"/\"));\n }\n\n location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\n var setting = value.split(\"#\")[0]; // Hack\n parametersArray[key] = setting;\n });\n\n var parameters = JSON.stringify(parametersArray);\n GM_setValue(\"current_parameters\", parameters);\n\n if (debugMode) {\n console.dir(parametersArray);\n console.groupEnd(\"URL parameters\");\n }\n}","function getURLArgs() {\n var query_string = {};\n let query = window.location.search.substring(1);\n let vars = query.split(\"&\");\n \n for (let i=0;i 0 ? location.search.substring(1) : \"\")\n\tvar args = {};\n\tvar items = qs.split(\"&\");\n\tvar item = null;\n\tname = null;\n\tvalue = null;\n\tfor (var i = 0; i < items.length; i++) {\n\t\titem = items[i].split(\"=\");\n\t\tname = decodeURIComponent(item[0]);\n\t\tvalue = decodeURIComponent(item[1]);\n\t\targs[name] = value;\n\t}\n\treturn args;\n}","function getUrlParams()\n {\n var decodedUri = decodeURIComponent(window.location.href);\n var params = [], hash;\n var hashes = decodedUri.slice(decodedUri.indexOf('?') + 1).split('&');\n\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n if (hash[1]) {\n params.push(hash[1].replace('+', ' '));\n }\n }\n return params;\n }","function getURLParams() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n vars[key] = value;\n });\n return vars;\n}","function getURLParams()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}","function getParams()\n{\n var idx = document.URL.indexOf('?');\n var params = [];\n if (idx != -1) {\n var pairs = document.URL.substring(idx+1, document.URL.length).split('&');\n for (var i=0; i 0) {\n view.setLocation(md[1] + '#');\n }\n }\n return result; \n }","getURLParameters() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n e = r.exec(q)\n while (e) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n e = r.exec(q);\n }\n return hashParams;\n }","function getURLParameters() {\n var params = {};\n if (location.search) {\n var parts = location.search.substring(1).split(\"&\");\n for (var i = 0; i < parts.length; i++) {\n var pair = parts[i].split(\"=\");\n if (!pair[0]) {\n continue;\n }\n params[pair[0]] = pair[1] || \"\";\n }\n }\n return params;\n}","function getRequest(){\n\tvar params = window.location.search.replace('?','').split('&').reduce(\n\t\tfunction(prev, curr){\n\t\t\tvar temp = curr.split('=');\n\t\t\tprev[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);\n\t\t\treturn prev;\n\t\t},{}\n\t);\n\treturn params;\n}","function get_url_params() {\n var url_params = new URLSearchParams(window.location.search);\n\n return url_params;\n}","getUrlParams() {\n const params = [];\n for (let key in this.urlParameters) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(this.urlParameters[key])}`);\n }\n return params.join('&');\n }","function parse_get_parameters() {\n if (location.search.length < 1) {\n return null;\n }\n else {\n var parameters = [];\n location.search\n .substr(1)\n .split(\"&\")\n .forEach(function (item) {\n let temp = item.split(\"=\");\n parameters.push(\n {\n parameter_name: temp[0],\n parameter_value: temp[1]\n }\n )\n });\n\n return parameters;\n }\n}","function getURLparams() {\n var paramsArray = getURLSearch().split('&');\n var returnArray = [];\n\n paramsArray.forEach(function(param) {\n \n splitedParams = param.split('=');\n\n returnArray.push({\n name: splitedParams[0],\n value: splitedParams[1]\n });\n\n });\n\n return returnArray;\n}","function parseCurrentUrlParams () {\n\t\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\n\t}","function getUrlVars() {\n\t\t\tvar vars = {};\n\t\t\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n\t\t\tvars[key] = value;\n\t\t\t});\n\t\t\treturn vars;\n\t\t}","function urlQueryValues() {}","function ekGetSearchParams() {\n var result = {};\n var searchParams = window.location.href.split('?');\n if (searchParams && searchParams.length > 1) {\n var vals = searchParams[1].split('&');\n for (var i = 0; i < vals.length; i++) {\n var next = vals[i].split('=');\n var key = next[0];\n var val = decodeURIComponent(next[1].replace(/\\+/g,' '));\n result[key] = val;\n }\n }\n return result;\n }","function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}","function getUrlVars() {\n\t\t\tvar vars = {};\n\t\t\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n\t\t\t\tvars[key] = value;\n\t\t\t});\n\t\t\treturn vars;\n\t\t}","function GetUrlVars() {\nvar vars = {};\nvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n vars[key] = value;\n});\nreturn vars;\n}","function getParams() {\n var res = {}\n var params = location.search.substr(1).split('&')\n\n for (var value; value = params.pop();) {\n var tmp = value.split('=')\n res[tmp[0]] = decodeURIComponent(tmp[1])\n }\n\n return res\n}","function getParams() {\n return qs.parse(window.location.search);\n}","function getUrlVars() {\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < hashes.length; i++) {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }","function getUrlVars() { \r\n var vars = {}, hash;\r\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\r\n for(var i = 0; i < hashes.length; i++)\r\n {\r\n hash = hashes[i].split('=');\r\n vars[hash[0]] = hash[1];\r\n }\r\n console.log(vars);\r\n return vars;\r\n }","function getUrlVars() {\n \t\tvar vars = {};\n \t\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n \t\tvars[key] = value;\n \t\t});\n \t\treturn vars;\n\t\t}","function getUrlVars() {\n \t\tvar vars = {};\n \t\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n \t\tvars[key] = value;\n \t\t});\n \t\treturn vars;\n\t\t}","_getParams(route) {\n var matches = route.match(/:\\w+/g)\n return (matches || []).map(match => {\n return match.substring(1, match.length)\n })\n }","function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\r\n }","function getURL() {\r\n let loc = document.location.href;\r\n\r\n if (loc.indexOf('?') > 0) {\r\n let getString = loc.split('?')[1];\r\n let GET = getString.split('&');\r\n var get = {};\r\n for (var i = 0, l = GET.length; i < l; i++) {\r\n var tmp = GET[i].split('=');\r\n get[tmp[0]] = unescape(decodeURI(tmp[1]));\r\n }\r\n return get;\r\n }\r\n}","function getUrlVars() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \n function(m,key,value) {\n vars[key] = value;\n });\n return vars;\n }","function getUrlVars() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \n function(m,key,value) {\n vars[key] = value;\n });\n return vars;\n }","function getURLParams() {\n\tvar query = window.location.search.substring(1);\n\tvar vars = query.split(\"&\");\n\tvar query_string = {};\n\tfor (var i = 0; i < vars.length; i++) {\n\t\tvar pair = vars[i].split(\"=\");\n\t\tvar key = decodeURIComponent(pair[0]);\n\t\tvar value = decodeURIComponent(pair[1]);\n\t\t// If first entry with this name\n\t\tif (typeof query_string[key] === \"undefined\") {\n\t\t\tquery_string[key] = decodeURIComponent(value);\n\t\t\t// If second entry with this name\n\t\t} \n\t\telse if (typeof query_string[key] === \"string\") {\n\t\t\tvar arr = [query_string[key], decodeURIComponent(value)];\n\t\t\tquery_string[key] = arr;\n\t\t\t// If third or later entry with this name\n\t\t} \n\t\telse {\n\t\t\tquery_string[key].push(decodeURIComponent(value));\n\t\t}\n\t}\n\treturn query_string;\n}","function getUrlParameters() {\n var params = location.search.slice(1).split('&');\n\n var targetUrl = \"\";\n var configUrl = \"\";\n\n for (var i =0; i < params.length; i++) {\n var param = params[i];\n if (param.split('=')[0] == 'target') {targetUrl = param.split('=')[1]}\n if (param.split('=')[0] == 'config') {configUrl = param.split('=')[1]}\n }\n\n // read default configuration\n $.ajax({\n type: \"GET\",\n url: \"config/default.json\",\n dataType: \"json\",\n async: false,\n success: function(data) {\n setConfig(data);\n },\n error: function() {\n alert(\"Could not read default configuration. Consult the administrator.\");\n }\n });\n\n if (configUrl != \"\") {\n $.ajax({\n type: \"GET\",\n url: configUrl,\n dataType: \"json\",\n crossDomain: true,\n success: function(data) {\n setConfig(data);\n getAnnotationFrom(targetUrl);\n },\n error: function() {\n alert('could not read the configuration from the location you specified.');\n }\n });\n } else {\n getAnnotationFrom(targetUrl);\n }\n }","function getVars(){\n var loc = document.location.href;\n var getString = loc.split('?');\n if(getString[1]){\n var GET = getString[1].split('&');\n var get = {};//This object will be filled with the key-value pairs and returned.\n\n for(var i = 0, l = GET.length; i < l; i++){\n var tmp = GET[i].split('=');\n get[tmp[0]] = unescape(decodeURI(tmp[1]));\n }\n return get;\n }else{\n return \"\";\n }\n}","function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }","function getUrlVars() {\n\t\t\t\n\t\t\t\n\t\t\tvar vars = {};\n\t\t\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n\t\t\tvars[key] = value;\n\t\t\t});\n\t\t\treturn vars;\n\t\t\t\n\t\t}","function obtainGETparameters() {\n\tvar oGetParameters = new Array();\n\n\tvar sLocation = location.search.split(\"?\");\t\n\tif(sLocation.length > 1) {\n\t\tvar sParameterList =sLocation[1].split(\"&\"); \n\n\t\tfor(var i=0; i < sParameterList.length; i++) { \n\t\t\tsParameterList[i] = sParameterList[i].split(\"+\").join(\" \");\n\t\t\tvar aValues = sParameterList[i].split(\"=\");\n\t\t\tvar sId = aValues[0];\n\t\t\tvar sValue = aValues[1];\n\t\t\toGetParameters[sId]=sValue;\n\t\t}\t\t\t\t\n\t}\n\treturn oGetParameters;\n}","function getDataUrlParams()\n\t{\n\t\treturn objThis.selectorElt.tagSuggest().getDataUrlParams();\n\t}","getURL() {\n const urlParams = new URLSearchParams(window.location.search);\n this.myParam = urlParams.get(\"gp\");\n return this.myParam;\n }","function getCompanyParams() {\n\n // adds value specification to array\n var identities = [];\n identities.push('empmin');\n identities.push('empmax');\n identities.push('valuemin');\n identities.push('valuemax');\n identities.push('street');\n identities.push('zipCode');\n\n // adds value to array\n var params = [];\n params.push(document.getElementById('qp-min-emps').value);\n params.push(document.getElementById('qp-max-emps').value);\n params.push(document.getElementById('qp-min-market').value);\n params.push(document.getElementById('qp-max-market').value);\n params.push(document.getElementById('qp-street').value);\n params.push(document.getElementById('qp-zip-code').value);\n\n // adds value specification and value to array if value exist\n var queryParams = [];\n for (var index in params) {\n if (params[index] != '' && params[index] != null) {\n queryParams.push(identities[index] + \"=\" + params[index]);\n }\n }\n $('#company-params-modal').modal('hide');\n\n // returns a joined string with '&' seperation\n return \"company?\" + queryParams.join(\"&\");\n}","function parseParameters() {\n var pageURL = window.location.href;\n var message = url(\"?message\", pageURL);\n\n if (message == \"submitted\") {\n $(\"#modal-message-submitted\").openModal();\n }\n}","function getUrlVars() {\r\n var vars = {};\r\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \r\n function(m,key,value) {\r\n vars[key] = value;\r\n });\r\n return vars;\r\n }","function getParameters(){\n\tvar url = document.URL;\n\tvar vett = url.split('?');\n\tvar rawParameters = vett[1]; // contiene tutti i parametri get separati dal carattere '&'\n\tif(rawParameters == null){\n\t\treturn null;\n\t}\n\tvar rawParametersCouples = rawParameters.split('&');\n\tvar parameters = new Array();\n\tfor(var i=0;i 0)\n {\n var arrParams = sURL.split(\"?\");\n var arrURLParams = arrParams[1].split(\"&\");\n\n var i = 0;\n for (i = 0; i\")).test(name)) {\n var trimmedName = name.replaceAll(\"<\", \"\").replaceAll(\">\", \"\");\n result[trimmedName] = values[i];\n }\n }\n return result;\n }","function getUrlVars()\n {\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n\n return vars;\n }","function getUrlVars()\n {\n var vars = [], hash;\n var vhref = window.location.href;\n //console.log('vhref:'+vhref);\n var hashes = vhref.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }","function getUrlVars() {\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }","function getUrlVars() {\n\t\tvar vars = {};\n\t\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n\t\t\tvars[key] = value.replace(\"#\", \"\");\n\t\t});\n\t\treturn vars;\n\t}","function getUrlParams ()\n{\n let query = window.location.search.substring(1);\n let params = query.split ('&');\n\n let object = new Object ();\n for (let param of params)\n {\n let pair = param.split ('=');\n\n object[pair[0]] = pair[1];\n }\n\n return object;\n}","function getUrlVars() {\n\t var vars = {};\n\t var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n\t vars[key] = value;\n\t });\n\t return vars;\n\t}","function getUrlVars() {\r\n\tvar vars = {};\r\n\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\r\n\t\tvars[key] = value;\r\n\t});\r\n\treturn vars;\r\n}","function getCampaignParamsFromURL() {\n var params = getURLParams(),\n result = {},\n key,\n val;\n for (key in vtm_vars) {\n val = vtm_vars[key];\n if (params[key])\n result[val] = params[key];\n }\n return result;\n}","function getUrlVars() {\n var vars = [],\n hash;\n var hashes = window.location.href\n .slice(window.location.href.indexOf(\"?\") + 1)\n .split(\"&\");\n for (var i = 0; i < hashes.length; i++) {\n hash = hashes[i].split(\"=\");\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }","function getParams() {\n if (!window.frameElement.hasAttribute('data-params')) {\n return;\n }\n params = JSON.parse(decodeURIComponent(window.frameElement.getAttribute('data-params')));\n }","function getUrlVars() {\n let vars = {}\n let parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\n vars[key] = value\n })\n return vars\n}","function getUrlVars() {\r\n var vars = {};\r\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,\r\n function(m,key,value) {\r\n vars[key] = value;\r\n });\r\n return vars;\r\n}","function getUrlVars() {\n\tvar urlParams;\n\t\n var match,\n pl = /\\+/g, // Regex for replacing addition symbol with a space\n search = /([^&=]+)=?([^&]*)/g,\n decode = function (s) { return decodeURIComponent(s.replace(pl, \" \")); },\n query = window.location.search.substring(1);\n \n\turlParams = {};\n while (match = search.exec(query))\n urlParams[decode(match[1])] = decode(match[2]);\n\t\n\t//if (urlParams.demoMode==\"y\") { urlParams = defaultData.ortho; } \n\t//urlParams = defaultData.ortho;\n\treturn urlParams;\n}","function getQueryString() {\n return window.location.search\n .substr(1)\n .split('&')\n .map(item => item.split('='))\n .reduce((acc, curr) => {\n acc[curr[0]] = curr[1];\n return acc;\n }, {});\n}"],"string":"[\n \"getUrlParams() {\\n\\n //var my_url_var = window.location.href;\\n let my_url_var = (window.location != window.parent.location) ?\\n document.referrer :\\n document.location.href;\\n\\n let params_list = my_url_var.split(\\\"?\\\");\\n\\n let final = {};\\n\\n if (params_list.length > 1) {\\n\\n let params_parsed = params_list[1].split(\\\"&\\\");\\n\\n for (let i = 0; i < params_parsed.length; i++) {\\n let p_couple = params_parsed[i].split(\\\"=\\\");\\n final[p_couple[0]] = p_couple[1];\\n }\\n }\\n\\n return final;\\n }\",\n \"function grabLinkParams() {\\n var url = new URL(window.location.href);\\n var fulfillRequestTo = url.searchParams.get(\\\"fulfillRequestTo\\\");\\n $(\\\"#destinationWalletOrEmail\\\").val(fulfillRequestTo);\\n var fulfillRequestAmount = url.searchParams.get(\\\"fulfillRequestAmount\\\");\\n $(\\\"#transactionAmount\\\").val(fulfillRequestAmount);\\n }\",\n \"function getURLParameters() {\\n 'use strict';\\n if (debugMode) {\\n console.groupCollapsed(\\\"URL parameters\\\");\\n }\\n\\n var parametersArray = {};\\n\\n // A bit hackish.\\n if (location.href.indexOf(\\\"#\\\") > -1) {\\n location.assign(location.href.replace(/\\\\/?#\\\\//, \\\"/\\\"));\\n }\\n\\n location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\\n var setting = value.split(\\\"#\\\")[0]; // Hack\\n parametersArray[key] = setting;\\n });\\n\\n var parameters = JSON.stringify(parametersArray);\\n GM_setValue(\\\"current_parameters\\\", parameters);\\n\\n if (debugMode) {\\n console.dir(parametersArray);\\n console.groupEnd(\\\"URL parameters\\\");\\n }\\n}\",\n \"function getURLArgs() {\\n var query_string = {};\\n let query = window.location.search.substring(1);\\n let vars = query.split(\\\"&\\\");\\n \\n for (let i=0;i 0 ? location.search.substring(1) : \\\"\\\")\\n\\tvar args = {};\\n\\tvar items = qs.split(\\\"&\\\");\\n\\tvar item = null;\\n\\tname = null;\\n\\tvalue = null;\\n\\tfor (var i = 0; i < items.length; i++) {\\n\\t\\titem = items[i].split(\\\"=\\\");\\n\\t\\tname = decodeURIComponent(item[0]);\\n\\t\\tvalue = decodeURIComponent(item[1]);\\n\\t\\targs[name] = value;\\n\\t}\\n\\treturn args;\\n}\",\n \"function getUrlParams()\\n {\\n var decodedUri = decodeURIComponent(window.location.href);\\n var params = [], hash;\\n var hashes = decodedUri.slice(decodedUri.indexOf('?') + 1).split('&');\\n\\n for(var i = 0; i < hashes.length; i++)\\n {\\n hash = hashes[i].split('=');\\n if (hash[1]) {\\n params.push(hash[1].replace('+', ' '));\\n }\\n }\\n return params;\\n }\",\n \"function getURLParams() {\\n var vars = {};\\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n vars[key] = value;\\n });\\n return vars;\\n}\",\n \"function getURLParams()\\n{\\n var vars = [], hash;\\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\\n for(var i = 0; i < hashes.length; i++)\\n {\\n hash = hashes[i].split('=');\\n vars.push(hash[0]);\\n vars[hash[0]] = hash[1];\\n }\\n return vars;\\n}\",\n \"function getParams()\\n{\\n var idx = document.URL.indexOf('?');\\n var params = [];\\n if (idx != -1) {\\n var pairs = document.URL.substring(idx+1, document.URL.length).split('&');\\n for (var i=0; i 0) {\\n view.setLocation(md[1] + '#');\\n }\\n }\\n return result; \\n }\",\n \"getURLParameters() {\\n var hashParams = {};\\n var e, r = /([^&;=]+)=?([^&;]*)/g,\\n q = window.location.hash.substring(1);\\n e = r.exec(q)\\n while (e) {\\n hashParams[e[1]] = decodeURIComponent(e[2]);\\n e = r.exec(q);\\n }\\n return hashParams;\\n }\",\n \"function getURLParameters() {\\n var params = {};\\n if (location.search) {\\n var parts = location.search.substring(1).split(\\\"&\\\");\\n for (var i = 0; i < parts.length; i++) {\\n var pair = parts[i].split(\\\"=\\\");\\n if (!pair[0]) {\\n continue;\\n }\\n params[pair[0]] = pair[1] || \\\"\\\";\\n }\\n }\\n return params;\\n}\",\n \"function getRequest(){\\n\\tvar params = window.location.search.replace('?','').split('&').reduce(\\n\\t\\tfunction(prev, curr){\\n\\t\\t\\tvar temp = curr.split('=');\\n\\t\\t\\tprev[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);\\n\\t\\t\\treturn prev;\\n\\t\\t},{}\\n\\t);\\n\\treturn params;\\n}\",\n \"function get_url_params() {\\n var url_params = new URLSearchParams(window.location.search);\\n\\n return url_params;\\n}\",\n \"getUrlParams() {\\n const params = [];\\n for (let key in this.urlParameters) {\\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(this.urlParameters[key])}`);\\n }\\n return params.join('&');\\n }\",\n \"function parse_get_parameters() {\\n if (location.search.length < 1) {\\n return null;\\n }\\n else {\\n var parameters = [];\\n location.search\\n .substr(1)\\n .split(\\\"&\\\")\\n .forEach(function (item) {\\n let temp = item.split(\\\"=\\\");\\n parameters.push(\\n {\\n parameter_name: temp[0],\\n parameter_value: temp[1]\\n }\\n )\\n });\\n\\n return parameters;\\n }\\n}\",\n \"function getURLparams() {\\n var paramsArray = getURLSearch().split('&');\\n var returnArray = [];\\n\\n paramsArray.forEach(function(param) {\\n \\n splitedParams = param.split('=');\\n\\n returnArray.push({\\n name: splitedParams[0],\\n value: splitedParams[1]\\n });\\n\\n });\\n\\n return returnArray;\\n}\",\n \"function parseCurrentUrlParams () {\\n\\t\\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\\n\\t}\",\n \"function getUrlVars() {\\n\\t\\t\\tvar vars = {};\\n\\t\\t\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n\\t\\t\\tvars[key] = value;\\n\\t\\t\\t});\\n\\t\\t\\treturn vars;\\n\\t\\t}\",\n \"function urlQueryValues() {}\",\n \"function ekGetSearchParams() {\\n var result = {};\\n var searchParams = window.location.href.split('?');\\n if (searchParams && searchParams.length > 1) {\\n var vals = searchParams[1].split('&');\\n for (var i = 0; i < vals.length; i++) {\\n var next = vals[i].split('=');\\n var key = next[0];\\n var val = decodeURIComponent(next[1].replace(/\\\\+/g,' '));\\n result[key] = val;\\n }\\n }\\n return result;\\n }\",\n \"function getSearchParameters() {\\n var prmstr = window.location.search.substr(1);\\n return prmstr != null && prmstr != \\\"\\\" ? transformToAssocArray(prmstr) : {};\\n}\",\n \"function getUrlVars() {\\n\\t\\t\\tvar vars = {};\\n\\t\\t\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n\\t\\t\\t\\tvars[key] = value;\\n\\t\\t\\t});\\n\\t\\t\\treturn vars;\\n\\t\\t}\",\n \"function GetUrlVars() {\\nvar vars = {};\\nvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n vars[key] = value;\\n});\\nreturn vars;\\n}\",\n \"function getParams() {\\n var res = {}\\n var params = location.search.substr(1).split('&')\\n\\n for (var value; value = params.pop();) {\\n var tmp = value.split('=')\\n res[tmp[0]] = decodeURIComponent(tmp[1])\\n }\\n\\n return res\\n}\",\n \"function getParams() {\\n return qs.parse(window.location.search);\\n}\",\n \"function getUrlVars() {\\n var vars = [], hash;\\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\\n for (var i = 0; i < hashes.length; i++) {\\n hash = hashes[i].split('=');\\n vars.push(hash[0]);\\n vars[hash[0]] = hash[1];\\n }\\n return vars;\\n }\",\n \"function getUrlVars() { \\r\\n var vars = {}, hash;\\r\\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\\r\\n for(var i = 0; i < hashes.length; i++)\\r\\n {\\r\\n hash = hashes[i].split('=');\\r\\n vars[hash[0]] = hash[1];\\r\\n }\\r\\n console.log(vars);\\r\\n return vars;\\r\\n }\",\n \"function getUrlVars() {\\n \\t\\tvar vars = {};\\n \\t\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n \\t\\tvars[key] = value;\\n \\t\\t});\\n \\t\\treturn vars;\\n\\t\\t}\",\n \"function getUrlVars() {\\n \\t\\tvar vars = {};\\n \\t\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n \\t\\tvars[key] = value;\\n \\t\\t});\\n \\t\\treturn vars;\\n\\t\\t}\",\n \"_getParams(route) {\\n var matches = route.match(/:\\\\w+/g)\\n return (matches || []).map(match => {\\n return match.substring(1, match.length)\\n })\\n }\",\n \"function getSearchParameters() {\\r\\n var prmstr = window.location.search.substr(1);\\r\\n return prmstr != null && prmstr != \\\"\\\" ? transformToAssocArray(prmstr) : {};\\r\\n }\",\n \"function getURL() {\\r\\n let loc = document.location.href;\\r\\n\\r\\n if (loc.indexOf('?') > 0) {\\r\\n let getString = loc.split('?')[1];\\r\\n let GET = getString.split('&');\\r\\n var get = {};\\r\\n for (var i = 0, l = GET.length; i < l; i++) {\\r\\n var tmp = GET[i].split('=');\\r\\n get[tmp[0]] = unescape(decodeURI(tmp[1]));\\r\\n }\\r\\n return get;\\r\\n }\\r\\n}\",\n \"function getUrlVars() {\\n var vars = {};\\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \\n function(m,key,value) {\\n vars[key] = value;\\n });\\n return vars;\\n }\",\n \"function getUrlVars() {\\n var vars = {};\\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \\n function(m,key,value) {\\n vars[key] = value;\\n });\\n return vars;\\n }\",\n \"function getURLParams() {\\n\\tvar query = window.location.search.substring(1);\\n\\tvar vars = query.split(\\\"&\\\");\\n\\tvar query_string = {};\\n\\tfor (var i = 0; i < vars.length; i++) {\\n\\t\\tvar pair = vars[i].split(\\\"=\\\");\\n\\t\\tvar key = decodeURIComponent(pair[0]);\\n\\t\\tvar value = decodeURIComponent(pair[1]);\\n\\t\\t// If first entry with this name\\n\\t\\tif (typeof query_string[key] === \\\"undefined\\\") {\\n\\t\\t\\tquery_string[key] = decodeURIComponent(value);\\n\\t\\t\\t// If second entry with this name\\n\\t\\t} \\n\\t\\telse if (typeof query_string[key] === \\\"string\\\") {\\n\\t\\t\\tvar arr = [query_string[key], decodeURIComponent(value)];\\n\\t\\t\\tquery_string[key] = arr;\\n\\t\\t\\t// If third or later entry with this name\\n\\t\\t} \\n\\t\\telse {\\n\\t\\t\\tquery_string[key].push(decodeURIComponent(value));\\n\\t\\t}\\n\\t}\\n\\treturn query_string;\\n}\",\n \"function getUrlParameters() {\\n var params = location.search.slice(1).split('&');\\n\\n var targetUrl = \\\"\\\";\\n var configUrl = \\\"\\\";\\n\\n for (var i =0; i < params.length; i++) {\\n var param = params[i];\\n if (param.split('=')[0] == 'target') {targetUrl = param.split('=')[1]}\\n if (param.split('=')[0] == 'config') {configUrl = param.split('=')[1]}\\n }\\n\\n // read default configuration\\n $.ajax({\\n type: \\\"GET\\\",\\n url: \\\"config/default.json\\\",\\n dataType: \\\"json\\\",\\n async: false,\\n success: function(data) {\\n setConfig(data);\\n },\\n error: function() {\\n alert(\\\"Could not read default configuration. Consult the administrator.\\\");\\n }\\n });\\n\\n if (configUrl != \\\"\\\") {\\n $.ajax({\\n type: \\\"GET\\\",\\n url: configUrl,\\n dataType: \\\"json\\\",\\n crossDomain: true,\\n success: function(data) {\\n setConfig(data);\\n getAnnotationFrom(targetUrl);\\n },\\n error: function() {\\n alert('could not read the configuration from the location you specified.');\\n }\\n });\\n } else {\\n getAnnotationFrom(targetUrl);\\n }\\n }\",\n \"function getVars(){\\n var loc = document.location.href;\\n var getString = loc.split('?');\\n if(getString[1]){\\n var GET = getString[1].split('&');\\n var get = {};//This object will be filled with the key-value pairs and returned.\\n\\n for(var i = 0, l = GET.length; i < l; i++){\\n var tmp = GET[i].split('=');\\n get[tmp[0]] = unescape(decodeURI(tmp[1]));\\n }\\n return get;\\n }else{\\n return \\\"\\\";\\n }\\n}\",\n \"function getSearchParameters() {\\n var prmstr = window.location.search.substr(1);\\n return prmstr != null && prmstr != \\\"\\\" ? transformToAssocArray(prmstr) : {};\\n }\",\n \"function getUrlVars() {\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tvar vars = {};\\n\\t\\t\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n\\t\\t\\tvars[key] = value;\\n\\t\\t\\t});\\n\\t\\t\\treturn vars;\\n\\t\\t\\t\\n\\t\\t}\",\n \"function obtainGETparameters() {\\n\\tvar oGetParameters = new Array();\\n\\n\\tvar sLocation = location.search.split(\\\"?\\\");\\t\\n\\tif(sLocation.length > 1) {\\n\\t\\tvar sParameterList =sLocation[1].split(\\\"&\\\"); \\n\\n\\t\\tfor(var i=0; i < sParameterList.length; i++) { \\n\\t\\t\\tsParameterList[i] = sParameterList[i].split(\\\"+\\\").join(\\\" \\\");\\n\\t\\t\\tvar aValues = sParameterList[i].split(\\\"=\\\");\\n\\t\\t\\tvar sId = aValues[0];\\n\\t\\t\\tvar sValue = aValues[1];\\n\\t\\t\\toGetParameters[sId]=sValue;\\n\\t\\t}\\t\\t\\t\\t\\n\\t}\\n\\treturn oGetParameters;\\n}\",\n \"function getDataUrlParams()\\n\\t{\\n\\t\\treturn objThis.selectorElt.tagSuggest().getDataUrlParams();\\n\\t}\",\n \"getURL() {\\n const urlParams = new URLSearchParams(window.location.search);\\n this.myParam = urlParams.get(\\\"gp\\\");\\n return this.myParam;\\n }\",\n \"function getCompanyParams() {\\n\\n // adds value specification to array\\n var identities = [];\\n identities.push('empmin');\\n identities.push('empmax');\\n identities.push('valuemin');\\n identities.push('valuemax');\\n identities.push('street');\\n identities.push('zipCode');\\n\\n // adds value to array\\n var params = [];\\n params.push(document.getElementById('qp-min-emps').value);\\n params.push(document.getElementById('qp-max-emps').value);\\n params.push(document.getElementById('qp-min-market').value);\\n params.push(document.getElementById('qp-max-market').value);\\n params.push(document.getElementById('qp-street').value);\\n params.push(document.getElementById('qp-zip-code').value);\\n\\n // adds value specification and value to array if value exist\\n var queryParams = [];\\n for (var index in params) {\\n if (params[index] != '' && params[index] != null) {\\n queryParams.push(identities[index] + \\\"=\\\" + params[index]);\\n }\\n }\\n $('#company-params-modal').modal('hide');\\n\\n // returns a joined string with '&' seperation\\n return \\\"company?\\\" + queryParams.join(\\\"&\\\");\\n}\",\n \"function parseParameters() {\\n var pageURL = window.location.href;\\n var message = url(\\\"?message\\\", pageURL);\\n\\n if (message == \\\"submitted\\\") {\\n $(\\\"#modal-message-submitted\\\").openModal();\\n }\\n}\",\n \"function getUrlVars() {\\r\\n var vars = {};\\r\\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \\r\\n function(m,key,value) {\\r\\n vars[key] = value;\\r\\n });\\r\\n return vars;\\r\\n }\",\n \"function getParameters(){\\n\\tvar url = document.URL;\\n\\tvar vett = url.split('?');\\n\\tvar rawParameters = vett[1]; // contiene tutti i parametri get separati dal carattere '&'\\n\\tif(rawParameters == null){\\n\\t\\treturn null;\\n\\t}\\n\\tvar rawParametersCouples = rawParameters.split('&');\\n\\tvar parameters = new Array();\\n\\tfor(var i=0;i 0)\\n {\\n var arrParams = sURL.split(\\\"?\\\");\\n var arrURLParams = arrParams[1].split(\\\"&\\\");\\n\\n var i = 0;\\n for (i = 0; i\\\")).test(name)) {\\n var trimmedName = name.replaceAll(\\\"<\\\", \\\"\\\").replaceAll(\\\">\\\", \\\"\\\");\\n result[trimmedName] = values[i];\\n }\\n }\\n return result;\\n }\",\n \"function getUrlVars()\\n {\\n var vars = [], hash;\\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\\n\\n for(var i = 0; i < hashes.length; i++)\\n {\\n hash = hashes[i].split('=');\\n vars.push(hash[0]);\\n vars[hash[0]] = hash[1];\\n }\\n\\n return vars;\\n }\",\n \"function getUrlVars()\\n {\\n var vars = [], hash;\\n var vhref = window.location.href;\\n //console.log('vhref:'+vhref);\\n var hashes = vhref.slice(window.location.href.indexOf('?') + 1).split('&');\\n for(var i = 0; i < hashes.length; i++)\\n {\\n hash = hashes[i].split('=');\\n vars.push(hash[0]);\\n vars[hash[0]] = hash[1];\\n }\\n return vars;\\n }\",\n \"function getUrlVars() {\\n var vars = [], hash;\\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\\n for(var i = 0; i < hashes.length; i++)\\n {\\n hash = hashes[i].split('=');\\n vars.push(hash[0]);\\n vars[hash[0]] = hash[1];\\n }\\n return vars;\\n }\",\n \"function getUrlVars() {\\n\\t\\tvar vars = {};\\n\\t\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n\\t\\t\\tvars[key] = value.replace(\\\"#\\\", \\\"\\\");\\n\\t\\t});\\n\\t\\treturn vars;\\n\\t}\",\n \"function getUrlParams ()\\n{\\n let query = window.location.search.substring(1);\\n let params = query.split ('&');\\n\\n let object = new Object ();\\n for (let param of params)\\n {\\n let pair = param.split ('=');\\n\\n object[pair[0]] = pair[1];\\n }\\n\\n return object;\\n}\",\n \"function getUrlVars() {\\n\\t var vars = {};\\n\\t var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\n\\t vars[key] = value;\\n\\t });\\n\\t return vars;\\n\\t}\",\n \"function getUrlVars() {\\r\\n\\tvar vars = {};\\r\\n\\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\\r\\n\\t\\tvars[key] = value;\\r\\n\\t});\\r\\n\\treturn vars;\\r\\n}\",\n \"function getCampaignParamsFromURL() {\\n var params = getURLParams(),\\n result = {},\\n key,\\n val;\\n for (key in vtm_vars) {\\n val = vtm_vars[key];\\n if (params[key])\\n result[val] = params[key];\\n }\\n return result;\\n}\",\n \"function getUrlVars() {\\n var vars = [],\\n hash;\\n var hashes = window.location.href\\n .slice(window.location.href.indexOf(\\\"?\\\") + 1)\\n .split(\\\"&\\\");\\n for (var i = 0; i < hashes.length; i++) {\\n hash = hashes[i].split(\\\"=\\\");\\n vars.push(hash[0]);\\n vars[hash[0]] = hash[1];\\n }\\n return vars;\\n }\",\n \"function getParams() {\\n if (!window.frameElement.hasAttribute('data-params')) {\\n return;\\n }\\n params = JSON.parse(decodeURIComponent(window.frameElement.getAttribute('data-params')));\\n }\",\n \"function getUrlVars() {\\n let vars = {}\\n let parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\\n vars[key] = value\\n })\\n return vars\\n}\",\n \"function getUrlVars() {\\r\\n var vars = {};\\r\\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,\\r\\n function(m,key,value) {\\r\\n vars[key] = value;\\r\\n });\\r\\n return vars;\\r\\n}\",\n \"function getUrlVars() {\\n\\tvar urlParams;\\n\\t\\n var match,\\n pl = /\\\\+/g, // Regex for replacing addition symbol with a space\\n search = /([^&=]+)=?([^&]*)/g,\\n decode = function (s) { return decodeURIComponent(s.replace(pl, \\\" \\\")); },\\n query = window.location.search.substring(1);\\n \\n\\turlParams = {};\\n while (match = search.exec(query))\\n urlParams[decode(match[1])] = decode(match[2]);\\n\\t\\n\\t//if (urlParams.demoMode==\\\"y\\\") { urlParams = defaultData.ortho; } \\n\\t//urlParams = defaultData.ortho;\\n\\treturn urlParams;\\n}\",\n \"function getQueryString() {\\n return window.location.search\\n .substr(1)\\n .split('&')\\n .map(item => item.split('='))\\n .reduce((acc, curr) => {\\n acc[curr[0]] = curr[1];\\n return acc;\\n }, {});\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6902981","0.67514557","0.6713892","0.662862","0.6604577","0.65747327","0.65498495","0.65119433","0.65069336","0.6499713","0.64825743","0.6458913","0.64554983","0.64527464","0.64510113","0.6406078","0.6378883","0.6325121","0.63198483","0.6311011","0.6303175","0.62796634","0.61942494","0.61886144","0.61845255","0.6166216","0.6162157","0.6116305","0.6111595","0.6100203","0.6094405","0.60665315","0.6063976","0.6047142","0.6036097","0.6032164","0.60313445","0.60265076","0.60102516","0.60012776","0.60012776","0.60010797","0.59962213","0.5992922","0.59888595","0.59888595","0.5985421","0.59838384","0.5981863","0.5978845","0.5970597","0.5969788","0.59688765","0.59557366","0.59380174","0.59372175","0.59357524","0.59288794","0.5919417","0.5911438","0.59107554","0.5905521","0.5896881","0.5892791","0.58925444","0.5892134","0.588894","0.5885543","0.5883209","0.5882344","0.5879047","0.5870406","0.5863388","0.5856343","0.5855996","0.5851892","0.5844001","0.58365387","0.58353496","0.58350986","0.5833465","0.5832347","0.5830555","0.58277416","0.5827647","0.5827606","0.58205175","0.5817817","0.58169985","0.5806657","0.58058643","0.5805591","0.580175","0.5801","0.5797578","0.578432","0.57766634","0.57741016","0.57732064","0.5771683","0.57709914"],"string":"[\n \"0.6902981\",\n \"0.67514557\",\n \"0.6713892\",\n \"0.662862\",\n \"0.6604577\",\n \"0.65747327\",\n \"0.65498495\",\n \"0.65119433\",\n \"0.65069336\",\n \"0.6499713\",\n \"0.64825743\",\n \"0.6458913\",\n \"0.64554983\",\n \"0.64527464\",\n \"0.64510113\",\n \"0.6406078\",\n \"0.6378883\",\n \"0.6325121\",\n \"0.63198483\",\n \"0.6311011\",\n \"0.6303175\",\n \"0.62796634\",\n \"0.61942494\",\n \"0.61886144\",\n \"0.61845255\",\n \"0.6166216\",\n \"0.6162157\",\n \"0.6116305\",\n \"0.6111595\",\n \"0.6100203\",\n \"0.6094405\",\n \"0.60665315\",\n \"0.6063976\",\n \"0.6047142\",\n \"0.6036097\",\n \"0.6032164\",\n \"0.60313445\",\n \"0.60265076\",\n \"0.60102516\",\n \"0.60012776\",\n \"0.60012776\",\n \"0.60010797\",\n \"0.59962213\",\n \"0.5992922\",\n \"0.59888595\",\n \"0.59888595\",\n \"0.5985421\",\n \"0.59838384\",\n \"0.5981863\",\n \"0.5978845\",\n \"0.5970597\",\n \"0.5969788\",\n \"0.59688765\",\n \"0.59557366\",\n \"0.59380174\",\n \"0.59372175\",\n \"0.59357524\",\n \"0.59288794\",\n \"0.5919417\",\n \"0.5911438\",\n \"0.59107554\",\n \"0.5905521\",\n \"0.5896881\",\n \"0.5892791\",\n \"0.58925444\",\n \"0.5892134\",\n \"0.588894\",\n \"0.5885543\",\n \"0.5883209\",\n \"0.5882344\",\n \"0.5879047\",\n \"0.5870406\",\n \"0.5863388\",\n \"0.5856343\",\n \"0.5855996\",\n \"0.5851892\",\n \"0.5844001\",\n \"0.58365387\",\n \"0.58353496\",\n \"0.58350986\",\n \"0.5833465\",\n \"0.5832347\",\n \"0.5830555\",\n \"0.58277416\",\n \"0.5827647\",\n \"0.5827606\",\n \"0.58205175\",\n \"0.5817817\",\n \"0.58169985\",\n \"0.5806657\",\n \"0.58058643\",\n \"0.5805591\",\n \"0.580175\",\n \"0.5801\",\n \"0.5797578\",\n \"0.578432\",\n \"0.57766634\",\n \"0.57741016\",\n \"0.57732064\",\n \"0.5771683\",\n \"0.57709914\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":562,"cells":{"query":{"kind":"string","value":"helper function to display card on successful password reset"},"document":{"kind":"string","value":"function SuccessfullyResetCard() {\r\n return (\r\n \r\n You've successfully reset your password! \r\n \r\n \r\n \r\n \r\n Return to Login\r\n \r\n \r\n
\r\n \r\n \r\n );\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function ResetCard({ email, onPasswordChange, submitForm, errorCode}) {\r\n return (\r\n \r\n \r\n Resetting Password for: \r\n {email}
\r\n \r\n \r\n {errorCode !== '' && { } }\r\n \r\n \r\n \r\n \r\n \r\n \r\n Save\r\n \r\n \r\n
\r\n \r\n \r\n Don't have an account yet? Sign up!
\r\n \r\n
\r\n \r\n \r\n \r\n );\r\n}","function resetPasswordSuccess() {\n var $formState = $('.reset-password-success');\n\n // check if reset password form was successfully submited.\n if (!$formState.length) {\n return;\n }\n\n // show success message\n $('#ResetSuccess').removeClass('hide');\n }","function resetPasswordSuccess() {\n // check if reset password form was successfully submited\n if (!$('.reset-password-success').length) {\n return;\n }\n\n // show success message\n $('#ResetSuccess').removeClass('hide');\n }","async resetPassword({ view, params, antl }) {\n return view.render('user.password', {\n token: params.token,\n key: params.key,\n action: 'UserController.storeResetPassword',\n header_msg: antl.formatMessage('main.change_password'),\n button_msg: antl.formatMessage('main.change_password'),\n })\n }","function processResetPasswordReturn (data, $message) {\n\n if (data.result === \"No\") {\n // If result returned no then something went wrong so build and display an\n // error message\n\n // Build HTML for error message\n var result = [\n '',\n '× ',\n '
Reset Password Error ',\n data.message,\n ''];\n\n // Output error message\n $message.html(result.join(''));\n\n } else {\n\n // Build HTML for success message\n var result = [\n '',\n '× ',\n 'Password successfully reset!',\n '
'];\n\n // Output error message\n $message.html(result.join(''));\n\n }\n\n}","function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }","function printResetPassword(token) {\n const main = document.getElementById(\"main\");\n main.innerHTML = `\n
\n
Reset password \n \n \n
`;\n // when the user submits the form we call the function resetPassword()\n document.getElementById(\"reset\").addEventListener('submit', function(e) {\n e.preventDefault();\n resetPassword(token);\n })\n}","function resetPassword(req, res) {\n res.render(\"resetPassword\");\n}","function resetPassword() {\n\t\t\tif (vm.newPassword != \"\" && vm.newPassword == vm.confirmPassword) {\n\t\t\t\tvm.waiting = true;\n\t\t\t\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\n\t\t\t\t\tvm.success = 1;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t}, function(res) {\n\t\t\t\t\tvm.success = 0;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgui.alertError(\"Passwords do not match.\");\n\t\t\t}\n\t\t}","renderSuccess () {\n this.response.render('auth/password-changed', {\n title: 'Password Changed', returnToUrl: this.returnToUrl\n })\n }","function resetChangePass(massage = \"\") {\n $(\"#successMassage\").html(massage);\n $(\"#verifyMassage\").html(\"\");\n $(\"#confirmMassage\").html(\"\");\n $('#currentPassword').val(\"\");\n $('#newPassword').val(\"\");\n $('#confirmPassword').val(\"\");\n}","function forgotPasswordEnterDetails(){\n formLogin.removeClass('is-selected');\n formSignup.removeClass('is-selected');\n formForgotPassword.removeClass('is-selected');\n formForgotPasswordDetailsSignup.removeClass('is-selected'); \n formEnterDetailsOTP.removeClass('is-selected');\n\t\tformEnterLoginDetailsToSignUp.removeClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n }","function cardDetails(msg) {\n header('SECURE PAYMENT', msg)\n prompt.question(\"Enter your card number: \", (options) => {\n if (options == parseInt(options)) {\n payConfirm('YOUR PAYMENT WAS SUCCESSFUL !'.cyan);\n cart = [];\n } else {\n cardDetails('PLEASE ENTER A VALID INPUT'.cyan);\n }\n })\n}","function unlockCard(card, codeInput){\r\n\tif(codeInput.substring(codeInput.length-1) == 'V'){\r\n\t\tif(codeInput.startsWith(card.password)){\r\n\t\t\tdisplayScreen(3);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tremainingTries--;\r\n\t\t\tif(remainingTries==0){\r\n\t\t\t\tdisplayScreen(5);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdisplayScreen(2);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tdocument.getElementById(\"code\").innerHTML = \"• \".repeat(codeInput.length) + \"_ \".repeat(4-codeInput.length)\r\n\t}\r\n}","function showPassword() {\n register((data, err)=>{\n if(data === -1) {\n showErr(err);\n }\n else {\n data = JSON.parse(data);\n userId = data.userId;\n attempt = 3;\n listenNextButton();\n $(\"#password1\").text(data.password_1);\n $(\"#password2\").text(data.password_2);\n $(\"#password3\").text(data.password_3);\n $(\"#ui_2\").fadeIn();\n }\n });\n}","forgotPass() \n {\n \tAlert.alert(\n\t\t 'Go To Site',\n\t\t 'Pressing this button would help you restore your password (external source)',\n\t\t [\n\t\t {text: 'OK', onPress: () => console.log('OK Pressed')},\n\t\t ],\n\t\t {cancelable: false},\n\t\t);\n }","if (\n prevProps.updatePasswordState.isFetching &&\n !this.props.updatePasswordState.isFetching &&\n this.props.updatePasswordState.error === null\n ) {\n Alert.alert(\n translate(\"reset.reset\"),\n translate(\"reset.changeSuccess\"),\n [{ text: \"OK\", onPress: () => this._returnToMain() }],\n { cancelable: false }\n );\n }","function showIncorrectPasswordPage() {\n\n // Retrieve all password elements.\n var passwordInputForm = document.getElementById(\"passwordInputForm\");\n var passwordInputLabel = document.getElementById(\"passwordInputLabel\");\n var scenarios = document.getElementById(\"scenarios\");\n\n passwordInputLabel.innerHTML = \"Enter password\";\n passwordInputForm.className = \"item shown\";\n passwordSubmitButton.className = \"item shown\";\n\n scenarios.className = \"options hide\";\n document.getElementById(\"scenariosLabel\").innerHTML = \"\";\n\n showStartupErrorMessage(\"Incorrect password\");\n }","function handlePasswordResetPage(req, res) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: false\n });\n}","function checkValidResetFormPassword() {\n let isValid = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\s).{8,}$/.test(\n ResetForm.elements[\"password-reset\"].value\n );\n\n if (!isValid) {\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\n \".error-message\"\n );\n if (errMes) return;\n\n let p = document.createElement(\"p\");\n p.classList.add(\"error-message\");\n\n let img = document.createElement(\"img\");\n img.src = \"./images/popup/exclamation.svg\";\n img.alt = \"icon\";\n\n let span = document.createElement(\"span\");\n span.innerText =\n \"Mật khẩu yêu cầu tối thiểu tám ký tự, ít nhất một chữ cái viết hoa, một chữ cái viết thường, một số và một ký tự đặc biệt\";\n\n p.appendChild(img);\n p.appendChild(span);\n\n ResetFormPassword.parentElement.parentElement.appendChild(p);\n ResetFormError.push(\"error\");\n } else {\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\n \".error-message\"\n );\n if (!errMes) return;\n\n ResetFormPassword.parentElement.parentElement.removeChild(errMes);\n ResetFormError.pop();\n }\n}","function postResetPassword() {\n const validatePasswords = validatePasswordMatch(password, confirmPassword);\n if (validatePasswords !== true) {\n setSubmitResult(validatePasswords);\n setIsError(true);\n return;\n }\n setIsLoading(true);\n setIsError(false);\n axios.post(process.env.REACT_APP_API_LINK + \"/password/reset\", {\n \"email\": data.email,\n token,\n password\n }).then(result => {\n setIsLoading(false);\n if (result.status === 200) {\n setIsSuccess(true);\n data.onCloseModal();\n alert(\"Password Reset Successful!\")\n } else {\n setSubmitResult(\"An error has occurred, please contact an administrator.\")\n setIsError(true);\n }\n }).catch(e => {\n setIsLoading(false);\n setSubmitResult(e.response.data.error);\n setIsError(true);\n });\n }","function resALert() {\n alert(\"The form has been reset. Please try again.\");\n}","function password_validation(){\n\n if(!checkResetPasswordEmail()) {\n return false;\n } else {\n document.getElementById('get_password').value = \"Sending...\";\n return true;\n }\n}","function showPassword(displayPassword) {\n document.getElementById(\"password\").textContent = displayPassword;\n}","function postResetPassword(data, textStatus, jqXHR, param) {\n\tvar user = param.user;\n\tvar uiDiv = $('#ui');\n\tuiDiv.html('');\n\tvar p = $('');\n\tuiDiv.append(p);\n\tp.html('The password for \"' + user + '\" has been reset.');\n\tvar ul = $('
');\n\tuiDiv.append(ul);\n\tvar li = $('');\n\tul.append(li);\n\tli.html('New password: \"' + data[user] + '\"');\n}","passwordReset() {\n Actions.passwordReset();\n }","resetPassword(actionCode, newPassword) {\n var accountEmail;\n let thisComponent = this;\n // Verify the password reset code is valid.\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\n var accountEmail = email;\n \n // TODO: Show the reset screen with the user's email and ask the user for\n // the new password.\n \n // Save the new password.\n auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {\n // Password reset has been confirmed and new password updated.\n \n // TODO: Display a link back to the app, or sign-in the user directly\n // if the page belongs to the same domain as the app:\n // auth.signInWithEmailAndPassword(accountEmail, newPassword);\n \n // TODO: If a continue URL is available, display a button which on\n // click redirects the user back to the app via continueUrl with\n // additional state determined from that URL's parameters.\n }).catch(function(error) {\n // Error occurred during confirmation. The code might have expired or the\n // password is too weak.\n });\n }).catch(function(error) {\n // Invalid or expired action code. Ask user to try to reset the password\n // again.\n }).then(function() {\n thisComponent.props.history.push('/signin'); // redirect to home page\n });\n }","function retrieveForgotPassword() {\n var userData = {};\n angular.copy(vm.misc.forgotPassword, userData);\n cmnSvc.resetForm(scope.forgotPasswordForm, vm.misc.authData);\n fbaseSvc.resetForgetPassword(userData.emailAdd).then(function(rs){\n alert(rs);\n }, function(err){\n alert('Error! '+err);\n });\n }","function showPasswordRecovery() {\n const form = document.getElementById(\"forgot-password\");\n form.querySelector(\"span\").classList.toggle(\"hidden\");\n}","recoverPassword({ Bert }, { email }) {\n // Call forgot password procedure\n Accounts.forgotPassword({\n email,\n }, (error) => {\n if (error) {\n Bert.alert(error.reason, 'warning');\n } else {\n Bert.alert('Check your inbox for a reset link!', 'success');\n }\n });\n }","function passwordsMismatched() {\n document.getElementById(\"passwordP\").style.display = \"visible\";\n}","function reset() {\n // Flag it to prevent double clicking, and visually communicate\n if ($scope.isSubmitting) {\n return;\n }\n\n $scope.isSubmitting = true;\n\n // Lets try to reset their password\n visitorApiService.resetPassword({\n key: $scope.key,\n password: $scope.visitor.password\n })\n .$promise.then(function(response) {\n // Unlock the submit button\n $scope.isSubmitting = false;\n\n if (response.error === null) {\n return response.result; // email\n } else {\n // Most common error is an expired key\n $scope.message = commonUtilService.getMessage(response);\n return $q.reject();\n }\n })\n .then(function(email) {\n\n // Log them in now\n return visitorApiService.login({\n email: email,\n password: $scope.visitor.password\n })\n .$promise.then(function(response) {\n if (response.error !== null) {\n $scope.message = commonUtilService.getMessage(response);\n return $q.reject();\n }\n });\n })\n .then(function() {\n // Request customer info\n return visitorLoginService.isLoggedIn(true);\n })\n .then(function() {\n // Get their cart info\n cartService.reload();\n })\n .then(function() {\n // Redirect them to their last page\n var path = angular.module(\"visitorModule\").back.path || '/account';\n $location.path(path);\n });\n\n }","function preRedeemSubmitActions(error) {\n var errorMsg = checkRedeemMandatoryFields(error);\n \n var pwdErrorMsg = validatePasswordSize();\n if (pwdErrorMsg != \"\") { \n errorMsg = errorMsg + pwdErrorMsg + \"\\n\\n\";\n }\n\n if (errorMsg != \"\"){\n alert(errorMsg);\n return false;\n }\n return errorMsg;\n}","function confirmPasswordReset (e) {\n e.preventDefault();\n showConfirmation(\"Are you sure you want to reset your password?\").then(function (confirmed) {\n if (confirmed) {\n sendResetPasswordEmail().then(function () {\n $(e.target).parent().html('Password Reset Email Sent.');\n });\n }\n }).catch(function (error) {\n showError(\"Response Error\", error);\n });\n}","function failedPasswordConfirmation(){\n req.flash('error', \"Incorrect current password.\");\n return res.redirect(\"/account\");\n }","function forgotPasswordPage(req, res) {\n res.render('forgotPassword')\n}","passwordreset(email) {\r\n return this.auth\r\n .sendPasswordResetEmail(email)\r\n .then(function () {\r\n alert(\"Email Sent!\");\r\n })\r\n .catch(function (error) {\r\n alert(\"An error occured. Please try again\");\r\n });\r\n }","function showChangePasswordDialog(passwordResetToken) {\n\tvar errorCallback = function(error, data) {\n\n\t\t// Special case when old password did not match\n\t\tif(!passwordResetToken && !error && data && data[\"resultCode\"] === \"NOT_FOUND\") {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#wrong-password\");\n\t\t} else {\n\t\t\tconsole.error(error, data);\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-change-failed\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tif(passwordResetToken) {\n\t\t\t\t\t\tdoNavigate(\"/home.html\");\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t;\n\t\t}\n\t};\n\tvar changeDispatcher = tp.dialogs.showDialog(\"changePasswordDialog\", tp.lang.getText(passwordResetToken ? \"password-change\" : \"change-password\"));\n\tif(!passwordResetToken) {\n\t\td3.select(\".password-old\").classed(\"hidden\", false);\n\t}\n\tchangeDispatcher\n\t\t.on(\"ok\", function() {\n\t\t\tvar oldPasswordElement = d3.select(\"input[name=password-old]\");\n\t\t\tvar oldPassword = oldPasswordElement.property(\"value\");\n\t\t\tvar newPasswordElement = d3.select(\"input[name=password-new]\");\n\t\t\tvar newPassword = newPasswordElement.property(\"value\");\n\t\t\tvar verifyPassword = d3.select(\"input[name=password-verify]\").property(\"value\");\n\t\t\tif(!passwordResetToken) {\n\t\t\t\tif(tp.util.isEmpty(oldPassword) || oldPassword.length < 6) {\n\t\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\t\toldPasswordElement.node().select();\n\t\t\t\t\t\t})\n\t\t\t\t\t;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tp.util.isEmpty(newPassword) || newPassword.length < 6) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tnewPasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(newPassword !== verifyPassword) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#passwords-different\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tnewPasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(passwordResetToken) {\n\t\t\t\ttp.session.resetPassword(passwordResetToken, newPassword, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\terrorCallback(error, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.dialogs.showDialog(\"messageDialog\", \"#password-reset-change-successful\")\n\t\t\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\t\t\tdoNavigate(\"/home.html?signin=true\");\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttp.session.changePassword(oldPassword, newPassword, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\terrorCallback(error, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \"messageDialog\", \"#password-change-successful\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn false;\n\t\t})\n\t\t.on(\"cancel\", function() {\n\t\t\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \"messageDialog\", \"#password-no-change\");\n\t\t\treturn false;\n\t\t})\n\t;\n}","function changePasswordHandler(response) {\n messageData = JSON.parse(response);\n if (messageData.success) \n\tdocument.getElementById(\"changePasswordForm\").reset();\n}","function forgetPassword(req, res) {\n res.render(\"forgetPassword\");\n}","function forgotPasswordEnterDetailsSignup(){\n formLogin.removeClass('is-selected');\n formSignup.removeClass('is-selected');\n formForgotPassword.removeClass('is-selected');\n formForgotPasswordDetailsSignup.addClass('is-selected'); \n formEnterDetailsOTP.removeClass('is-selected');\n formEnterLoginDetailsToSignUp.removeClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n }","function reset() {\n password = \"\";\n charactersToUse = \"\";\n lengthofPW = 0;\n\n\n\n}","handleOk() {\n const { email } = this.state;\n if (!this.validateEmail(email)) {\n message.error('Please enter valid eamil');\n return;\n }\n firebase.auth().sendPasswordResetEmail(email).then(() => {\n message.success('Password reset email has been sent.');\n }).catch((err) => {\n message.error(err.message);\n });\n this.setState({\n showModal: false,\n });\n }","function ksForgotPassword(){\n //check if the form is valid\n if(!$('#forgotpassword').valid()) return;\n \n //put the loading screen on\n loadingScreen();\n \n //create an object to send to varify auth\n var obj=new Object();\n obj.email = $('#forgotpassword input[name=\"email\"]').val();\n \n //send the reset information via ajax\n $.ajax({\n type: \"POST\",\n url: \"/login/resetpassword/\",\n dataType: \"json\",\n data: obj ,\n async: false,\n success: function(res) {\n if (res.items[0].status ==='success'){\n setSuccessToSuccess();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n \n \n $('#glassnoloading').fadeOut('normal');\n \n //change the dialog to be more informative\n $('.registerdialog img').attr(\"src\" , \"/img/success.png\");\n $('.registerdialog * .message').text('Successfully identified your account. A mail was sent to the address you supplied. To proceed with password change follow the link in the mail sent.');\n $('.registerdialog > .front-card').remove();\n \n }\n else{\n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n\n $('#glassnoloading').fadeOut('normal');\n \n //change the dialog to be more informative\n $('.registerdialog img').attr(\"src\" , \"/img/failed.png\");\n $('.registerdialog * .message').text(res.items[0].msg);\n }\n },\n error: function(res){\n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n \n //display success failure screen\n displaySuccessFailure();\n \n //$(\"#error\").text(\"Connection failure! Try again\");\n //change the dialog to be more informative\n $('.registerdialog img').attr(\"src\" , \"/img/failed.png\");\n $('.registerdialog * .message').text('Error! Connection failure. Try again');\n }\n });\n}","resetUserPassword() {\n this.security.resetUserPassword(this.passwordDetails, '/api/auth/reset/' + this.$stateParams.token)\n .then((response) => {\n this.passwordDetails = null;\n this.toastr.success(\"Your password was reset successfully.\");\n // Attach user profile\n this.authentication.user = response;\n // And redirect to the index page\n this.$state.go('home');\n })\n .catch((response) => {\n this.toastr.error(response.message.message, 'Error');\n });\n }","function logkey() {\n if(password.length <= 0) {\n // Displays message about password length requirements\n ReactDOM.render(Password length must be one character or more
, document.getElementById('password-status-1'));\n // Show password length message\n $(\"#password-status-2\").show()\n } else if (password.length > 0) {\n // Hide password length message\n $(\"#password-status-2\").hide()\n }\n }","function validateForgotPassword(e) {\n\n var regex = /^(\\d{3}\\d{3}\\d{4}|([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?))$/;\n e.preventDefault();\n if (regex.test(document.getElementById(\"capture_forgotPassword_resetPasswordUserID\").value)) {\n janrain.capture.ui.postCaptureForm('forgotPasswordForm');\n //document.getElementById('forgotFormButton').style.display = 'none';\n //document.getElementById(\"forgotFormSubmit\").click();\n } else if (document.getElementById(\"capture_forgotPassword_resetPasswordUserID\").value != '') {\n janrain.capture.ui.postCaptureForm('forgotPasswordForm');\n console.log('invalid.. fp GROUP ID');\n // document.getElementById('forgotPasswordGroupFailure').style.display = 'block';\n //document.getElementById('forgotPasswordForm').style.display = 'none';\n // document.getElementById('forgotFormButton').style.display = 'none';\n // document.getElementById(\"forgotFormSubmit\").click();\n } else {\n console.log('invalid blank fp');\n }\n}","function resetPassword(email){\n $.ajax({\n method: 'POST',\n url: \"inc/Auth/forget.php\",\n data: {email: email}\n }).done(function(msg){\n if(msg == 'user issue')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.error-forgot-exist').removeClass('novisible');\n displayError([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n if(msg == 'confirm issue')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.error-forgot-confirm').removeClass('novisible');\n displaySpecial([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n //ce msg est un retour de la fonction de mail et non de la fonction de reset\n if(msg == 'success')\n {\n AJAXloader(false, '#loader-pass-forgot');\n displayMessagesOut();\n $('.error-field').addClass('novisible');\n $('.valid-forgot').removeClass('novisible');\n displaySuccess([], '#pass-forgot-form', ['input[name=\"pass-forgot\"]'], '');\n }\n });\n}","resetPassword({ Meteor, Store, Bert }, data) {\n const { token, password } = data;\n const { dispatch } = Store;\n\n // Change state to password reset request\n dispatch(resetPasswordRequest());\n\n // Call reset password procedure\n Accounts.resetPassword(token, password, (error) => {\n if (error) {\n Bert.alert(error.reason, 'danger');\n // Change state to password reset error\n dispatch(resetPasswordError());\n } else {\n Bert.alert('Password reset!', 'success');\n // Change state to successful password reset\n dispatch(resetPasswordSuccess(Meteor.user()));\n\n // Redirect to home screen\n browserHistory.push('/');\n }\n });\n }","function AdminConfirmPassword() {\r\n var password = $(\"#admin_password\").val()\r\n var confirm_pas = $(\"#confirm_password_reset\").val()\r\n if (confirm_pas.length == null || confirm_pas.length == \"\") {\r\n $(\"#conf_password_reset_label\").show();\r\n\r\n $(\"#confirm_password_reset\").addClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").text(\"This Field is required\");\r\n return false;\r\n } \r\n else {\r\n if(confirm_pas != password) {\r\n $(\"#confirm_password_reset\").addClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").show();\r\n $(\"#conf_password_reset_label\").text(\"Password is not match\");\r\n return false;\r\n } \r\n else {\r\n $(\"#confirm_password_reset\").removeClass(\"has-error\");\r\n $(\"#conf_password_reset_label\").hide();\r\n $(\"#conf_password_reset_label\").text(\"\");\r\n return true;\r\n }\r\n }\r\n\r\n}","function showForgotPassword() {\n document.getElementById(\"newAccount\").style.display=\"none\";\n document.getElementById(\"login\").style.display=\"none\";\n document.getElementById(\"forgotPassword\").style.display=\"block\";\n document.getElementById(\"forgotUsername\").value=\"\";\n}","function displayPassword() {\n document.querySelector(\"#generate\").blur(); // remove button focus so it doesn't hang there after password is displayed.\n document.querySelector(\"#passwordBox\").value = generatePassword(); // call generate function and place returned value into HTML \n}","function resetPassword(e) {\n e.preventDefault();\n\n axios\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\n security: questions,\n newPW: password,\n })\n .then((res) => {\n localStorage.setItem(\"token\", res.data);\n alert(\"Your password has been changed! Logging you in...\");\n router.push(\"/\");\n })\n .catch(() => {\n alert(\n \"Could not reset password! You likely had the wrong answers to the security questions\"\n );\n });\n }","function onReset() {\n\tdocument.getElementById('username').value = \"\";\n\tdocument.getElementById('password').value = \"\";\n\tdocument.getElementById('email').value = \"\";\n\tdocument.getElementById('result').innerHTML = \"\";\n\tflagUsername = false;\n\tflagPassword = false;\n\tflagEmail = false;\n}","function resetPassword() {\r\n \tconsole.log(\"Inside reset password\");\r\n \t//self.user.userpassword = self.user.password;\r\n \tself.user.user_id = $(\"#id\").val();\r\n \tself.user.obsolete = $(\"#link\").val();\r\n \tdelete self.user.confpassword;\r\n \tUserService.changePassword(self.user)\r\n \t\t.then(\r\n \t\t\t\tfunction (response) {\r\n \t\t\t\t\tif(response.status == 200) {\r\n \t\t\t\t\t\tself.message = \"Password changed successfully..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.success');\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\twindow.setTimeout( function(){\r\n \t\t\t\t\t\t\twindow.location.replace('/Conti/login');\r\n \t\t\t\t \t}, 5000);\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tself.message = \"Password is not changed..!\";\r\n \t\t\t\t\t\tsuccessAnimate('.failure');\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t},\r\n \t\t\t\tfunction (errResponse) {\r\n \t\t\t\t\tconsole.log(errResponse);\r\n \t\t\t\t}\r\n \t\t\t);\r\n }","checkForError() {\n if (this.state.attemptedSubmit && this.state.changePassword) {\n if (!this.compareOldPasswords())\n return (\n \n Old password does not match current password.\n
\n );\n if (this.compareNewPasswords())\n return (\n New passwords do not match.
\n );\n }\n return null;\n }","function reset_password_form() {\n\t// Encode the String\n\tvar encoded_string = Base64.encode('login/reset_password/');\n\tvar encoded_val = encoded_string.strtr(encode_chars_obj);\n\t\n\tvar encoded_login_string = Base64.encode('login/index/');\n\tvar encoded_login_val = encoded_login_string.strtr(encode_chars_obj);\n\t\n\tvar success_msg = 'Successful';\n\tvar failure_msg = 'Failed';\n\t\n\tvar ajaxData = $(\"#resetForm\").serialize();\t\n\t\t$.ajax({\n\t\turl: base_url + encoded_val,\n\t\tdataType: \"json\",\n\t\ttype: \"post\",\n\t\tdata: ajaxData,\t\n\t\tbeforeSend: function() {\n $('.uni_wrapper').addClass('loadingDiv');\t\t\n },\t\t\n\t\tsuccess: function(response) {\n\t\t $('.uni_wrapper').removeClass('loadingDiv');\n\t\t\tif(true == response.status)\n\t\t\t{\t\t\t\t\n\t\t\t\t$(\".error-message .alert\").removeClass('alert-danger');\n\t\t\t\t$(\".error-message .alert\").addClass('alert-success');\n\t\t\t\t$(\".error-message\").show();\n\t\t\t\tif(response.message)\n\t\t\t\t{\n\t\t\t\t\tsuccess_msg = response.message;\n\t\t\t\t}\n\t\t\t\t$(\".alert\").html(success_msg);\n\t\t\t\tsetTimeout(function(){\t\t\t\t\t\t \n\t\t\t\t window.location.href = base_url + encoded_login_val;\t\t\t\t\t\t \n\t\t\t\t}, 500);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(\".error-message\").show();\n\t\t\t\tif(response.message)\n\t\t\t\t{\n\t\t\t\t\tfailure_msg = response.message;\n\t\t\t\t}\n\t\t\t\t$(\".alert\").html(failure_msg);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t});\t\n}","function showForgotPasswordDIV() {\r\n\tdocument.getElementById('forgotPwd').style.display=\"block\";\r\n}","processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }","function recoverPassword() {\n const email = document.getElementsByName(\"recover-email\").item(0);\n xhttp(\"POST\", \"forgot.php\", { email: email.value }, (response) => {\n // do nothing if it works or if it fails\n });\n const loginpage = document.getElementById(\"main\").querySelector(\"div.loginpage\");\n loginpage.innerHTML += 'If the email is in our database, an email will be sent shortly to recover your account
';\n return false;\n}","recoverPassword() {\n let { username } = this.state;\n if (username === '') {\n return this.setState({\n loginStatus: 'Enter your username or ssn for a chance to retrieve your password',\n });\n }\n fetch('/recover', {\n method: 'POST',\n body: JSON.stringify({ username }),\n headers: { 'content-type': 'application/json' },\n })\n .then(resp => resp.json())\n .then(data =>\n (data.password_hint.length\n ? this.setState({\n loginStatus: `The hint for user ${username} is: ${data.password_hint}`,\n })\n : this.setState({\n loginStatus:\n 'Looks like someone forget to set a password hint. Try making a new account instead!',\n })))\n .catch(console.error);\n }","function forgotPassword() { \n\n\t\t\t$( \"#load\" ).show();\n\t\t\t\n\t\t\tvar form = new FormData(document.getElementById('reset_form'));\n\t\t\t\n\t\t\tvar validate_url = $('#reset_form').attr('action');\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: validate_url,\n\t\t\t\t//data: dataString,\n\t\t\t\tdata: form,\n\t\t\t\t//dataType: \"json\",\n\t\t\t\tcache : false,\n\t\t\t\tcontentType: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tsuccess: function(data){\n\n\t\t\t\t\t\n\t\t\t\t\tif(data.success == true ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"input\").val('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".forgot-password-box\").html(data.notif);\n\t\n\t\t\t\t\t\tsetTimeout(function() { \n\t\t\t\t\t\t\t//$(\"#notif\").slideUp({ opacity: \"hide\" }, \"slow\");\n\t\t\t\t\t\t\t//window.location.reload(true);\n\t\t\t\t\t\t}, 2000); \n\n\t\t\t\t\t}else if(data.success == false){\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"#notif\").html(data.notif);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t},error: function(xhr, status, error) {\n\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn false;\n\t\t}","_sendPasswordReset(user, password) {\n return this.mailer.reset({email: user.email, password: password})\n }","function OtpPassword(){\r\n var otp_time_check=$(\"#reset_otp\").val();\r\n if(otp_time_check.length == '' || otp_time_check.length == null) {\r\n $(\"#reset_otp\").removeClass(\"has-success\");\r\n $(\"#reset_otp\").addClass(\"has-error\");\r\n $(\"#otp_label_reset\").show();\r\n\r\n $(\"#otp_label_reset\").text(\"This Field is required\");\r\n return false;\r\n }\r\n else{\r\n $(\"#reset_otp\").addClass(\"has-success\");\r\n $(\"#otp_label_reset\").show();\r\n $(\"#otp_label_reset\").text(\"\");\r\n return true;\r\n\r\n }\r\n \r\n }","resetPassword(event) {\n var email = this.state.email;\n firebase.auth().sendPasswordResetEmail(email).then(() => {\n this.setState({ success: true })\n }).catch((error) => {\n this.setState({ success: false })\n alert(error.message);\n });\n }","function printError() {\n if (!validatePasswd()) {\n isPasswdValid = false;\n var html = \"The two password don't Match! \";\n document.getElementById('validatepasswd').innerHTML = html; \n } else {\n isPasswdValid = true;\n }\n if (!isCorrectEmail) {\n var email = document.getElementById('email').value \n if ( !validateEmail(email)) { errorMessage(\"Please input valid email address!\"); }\n else { errorMessage(\"The email was Registered!\");}\n }\n}","function showCode() {\n\t\t\t//Reset game\n\t\t\tabortGame();\n\t\t\tvm.secretCode = Mastermind.secretCode();\n\t\t}","function handlePasswordReset(req, res) {\n csrf.verify(req);\n\n if (!verifyReferrer(req, '/account/passwordreset')) {\n res.status(403).send('Mismatched referrer');\n return;\n }\n\n var name = req.body.name,\n email = req.body.email;\n\n if (typeof name !== \"string\" || typeof email !== \"string\") {\n res.send(400);\n return;\n }\n\n if (!$util.isValidUserName(name)) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Invalid username '\" + name + \"'\"\n });\n return;\n }\n\n db.users.getEmail(name, function (err, actualEmail) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n if (actualEmail === '') {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: `Username ${name} cannot be recovered because it ` +\n \"doesn't have an email address associated with it.\"\n });\n return;\n } else if (actualEmail.toLowerCase() !== email.trim().toLowerCase()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Provided email does not match the email address on record for \" + name\n });\n return;\n }\n\n crypto.randomBytes(20, (err, bytes) => {\n if (err) {\n LOGGER.error(\n 'Could not generate random bytes for password reset: %s',\n err.stack\n );\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Internal error when generating password reset\"\n });\n return;\n }\n\n var hash = bytes.toString('hex');\n // 24-hour expiration\n var expire = Date.now() + 86400000;\n var ip = req.realIP;\n\n db.addPasswordReset({\n ip: ip,\n name: name,\n email: actualEmail,\n hash: hash,\n expire: expire\n }, function (err, _dbres) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n Logger.eventlog.log(\"[account] \" + ip + \" requested password recovery for \" +\n name + \" <\" + email + \">\");\n\n if (!emailConfig.getPasswordReset().isEnabled()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"This server does not have mail support enabled. Please \" +\n \"contact an administrator for assistance.\"\n });\n return;\n }\n\n const baseUrl = `${req.realProtocol}://${req.header(\"host\")}`;\n\n emailController.sendPasswordReset({\n username: name,\n address: email,\n url: `${baseUrl}/account/passwordrecover/${hash}`\n }).then(_result => {\n sendPug(res, \"account-passwordreset\", {\n reset: true,\n resetEmail: email,\n resetErr: false\n });\n }).catch(error => {\n LOGGER.error(\"Sending password reset email failed: %s\", error);\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Sending reset email failed. Please contact an \" +\n \"administrator for assistance.\"\n });\n });\n });\n });\n });\n}","async passwordreset({ commit, dispatch }, form) {\n form.busy = true;\n try {\n await App.post(route(\"api.auth.reset-password\"), form).then(() => {\n commit(\"isAuthenticated\", {\n isAuthenticated: vm.$auth.check()\n });\n form.busy = false;\n });\n await dispatch(\"fetchMe\");\n } catch ({ errors, message }) {\n form.errors.set(errors);\n form.busy = false;\n }\n }","async function requestResetPassword(formData) {\n const headers = {};\n attach_headers([HEADERS.CSRF], headers);\n const body = { user: formData };\n\n cleanupAuthState();\n dispatch({ type: LOADING_STARTED });\n const resp = await supervise_rq(() =>\n axios.post(API_PATHS.AUTH_UPDATE_PASSWORD, body, { headers })\n );\n\n if (resp.status === STATUS.SUCCESS) {\n dispatch({\n type: AUTH_ACTIONS.AUTH_REQUEST_RESET_PASSWORD,\n payload:\n \"If an account for the provided email exists, an email with reset instructions will be sent to you. Please check your inbox.\",\n });\n } else {\n dispatch({\n type: AUTH_ACTIONS.AUTH_ERROR,\n payload: \"Oops, something went wrong. Pleas try again later.\",\n });\n }\n }","function resetPassword() {\n password = randomnum();\n}","function forgotPass(click) {\n modal.style.display = \"block\";\n signin.style.display = \"none\";\n otp.style.display = \"none\";\n forgot.style.display = \"flex\";\n}","resetPasswordInit(email) {\n return this.afAuth.auth.sendPasswordResetEmail(email, { url: 'https://coincoininsolite-1cf37.firebaseapp.com/__/auth/action' });\n }","requirePassword() {\n this.navigateTo('walletResetRequirePassword');\n }","function restorePassword(form, email) {\n\tvar emailValue = document.getElementById(email).value;\n\tvar auth = firebase.auth();\n\t\n\tauth.sendPasswordResetEmail(emailValue).then(function() {\n\t\t\tform.unbind().submit();\n\t\t}, function(error) {\n\t\t\t// console.log(error);\n\t\t\taddHidden(form, 'error', error.code);\n\t form.unbind().submit();\n\t\t});\n}","auth() {\n \tif(this.attempt == this.correct)\n \t{\n \t\tthis.invalid = false;\n this.setState((state) => {\n return{\n \talert: \"Please enter your password: \", \n \tplacemessage: 'Enter password...'\n };\n });\n this.passInput.clear();\n this.props.navigation.navigate('MainStack');\n\n \t}\n \telse\n \t{\n \t\tthis.setState((state) => {\n this.invalid = true;\n this.showErrorAnimation();\n return{alert: \"Incorrect password. Please try again:\"};\n });\n \t}\n }","function refresh(){\n \"use strict\";\n $(\"#js-display\").text(password());\n}","function checkPasswordMatch() {\n const password = $(\"#password\").val();\n const confirmPassword = $(\"#password2\").val();\n const feedback = $(\"#divCheckPasswordMatch\");\n\n if (password !== confirmPassword) {\n feedback.html(\"Wachtwoorden zijn niet gelijk!\").removeClass('text-success').addClass('text-danger');\n return;\n }\n\n feedback.html(\"Wachtwoorden zijn gelijk.\").removeClass('text-danger').addClass('text-success');\n }","screenToShow(){ \n if(!this.props.forgotPasswordScreen){\n return \n } else {\n return \n }\n }","function showPassword(text){\n xapi.command(\"UserInterface Message TextInput Display\", {\n InputType: KEYBOARD_TYPES.PIN\n , Placeholder: \"Meeting Password (numeric)\"\n , Title: \"Meeting Password\"\n , Text: text\n , SubmitText: \"Next\"\n , FeedbackId: DIALPAD_PASSWORD\n } ).catch((error) => { console.error(error); });\n}","function warnPasswordsDoNotMatch(){\n if (!createAccountPasswordsMatch()){\n $(\"#confirmPasswordMessage\").html('Passwords do not match.
');\n }\n}","resetPassword(){\n firebase.auth().sendPasswordResetEmail(this.passwordChangeEmail)\n .then(() => alert(\"Password reset email sent\"))\n .catch((error) => this.setState({error:error.message}))\n }","_handlePasswordCheck(res) {\n var passMsg = \"Incorrect password!\";\n var termMsg = \"Please agree to the terms of use!\";\n\n if (res == \"false\") { // Wrong password\n $scope.passwordMessage = passMsg;\n $(\"#passwordMessage\").fadeIn(100);\n }\n else if (!$scope.terms) { // Terms not checked\n $scope.passwordMessage = termMsg;\n $(\"#passwordMessage\").fadeIn(100);\n }\n else { // All correct\n $(\"#slide1\").fadeOut(0);\n $(\"#slide2\").fadeIn(200);\n $scope.isLocked = false;\n $scope.checkit();\n }\n $scope.$apply();\n }","function showPassword(password) {\n $(\"input\").prev(\"p\").show(200);\n $(\"input:hidden\").show(200);\n $(\"#result\").val(password);\n}","render() {\n return (\n \n \n Admin Key Registration \n \n Please enter the secret key provided to you to request admin privileges for Academoo. \n \n \n {!this.state.isLoading && Register Key }\n \n \n {this.state.errors.map(error => (\n {error.title}: {error.message} \n ))}\n {this.state.changed && {this.state.user} has been added as a site-wide Admin! }\n\n \n \n )\n }","function generatePassword() {\n var pw = mainForm.master.value,\n sh = mainForm.siteHost.value;\n\n // Don't show error message until needed\n hide(mainForm.pwIncorrect);\n\n // Only generate if a master password has been entered\n if (pw !== '') {\n if (settings.rememberPassword) {\n verifyPassword(pw, correct => {\n if (!correct) {\n // Master password is incorrect so show a warning\n show(mainForm.pwIncorrect);\n mainForm.master.select();\n }\n });\n }\n\n // Only generate if a site has been entered\n if (sh !== '') {\n mainForm.pwResult.value = '';\n mainForm.pwResult.placeholder = 'Generating...';\n\n // Generate a password to use, regardless of correct password\n uniquify(pw, sh, unique => {\n mainForm.pwResult.value = unique;\n mainForm.pwResult.placeholder = '';\n mainForm.pwResult.select();\n }, settings);\n }\n }\n }","function showForgotPassword(){\n //position the forget password dialog in the middle\n var heighthtml = $('html').height()/2;\n var heightforget = $('#forget_password_dialog').height()/2;\n var widthhtml = $('html').width()/2;\n var widthforget = $('#forget_password_dialog').width()/2;\n $('#forget_password_dialog').css(\"top\", \"\" + (heighthtml - heightforget) + \"px\");\n $('#forget_password_dialog').css(\"left\", \"\" + (widthhtml - widthforget) + \"px\");\n $('#forget_password_dialog_success').css('display', 'none');\n $('#forget_password_dialog_error').css('display', 'none');\n $('#forget_password_dialog_body').css('display', 'block');\n $('#loginregister').fadeOut('normal', function(){\n $('#forget_password_dialog').fadeIn('normal');\n });\n}","function forget_password(){\r\n localStorage.setItem(\"time\",\"1000\");\r\n localStorage.setItem(\"link\",\"password_reset.html\");\r\n window.open('loading.html',\"_self\");\r\n }","function submitNewPassword() {\n axios.post(`/users/reset`, {onyen: onyenAndToken[0], password: password}, {\n headers: {\n Authorization: `Token ${onyenAndToken[1]}`\n }\n }).then(res => {\n window.localStorage.setItem('onyen', res.data.onyen);\n window.localStorage.setItem('name', res.data.name);\n if (res.data.admin) {\n window.localStorage.setItem(\"adminUser\", \"true\");\n history.push(\"/dashboard\");\n } else {\n window.localStorage.setItem(\"teamId\", res.data.teamId);\n window.localStorage.setItem(\"studentUser\", \"true\");\n history.push(\"/studentDash\");\n }\n });\n }","recoverPassword(){\n this.setState({ isLoading: true });\n\n const { history, intl } = this.props;\n const { email } = this.state;\n\n // firebase.auth.sendPasswordResetEmail(email)\n // .then(() => {\n // NotificationService.success(intl.formatMessage(translations.emailSended));\n // this.setState({\n // ...this.INITIAL_STATE,\n // });\n // history.push(SIGN_IN);\n // }).catch((error) => {\n // this.setState({\n // isLoading: false,\n // isApiError: true,\n // apiError: error.message\n // });\n // });\n }","handleSubmit () {\n\n let validation = validateChangePassword(this.state)\n if (validation !== false) {\n return this.props.openSnackBar(validation)\n } else {\n userChangePassword(this.state, this.props.state.token)\n .then((response) => {\n return this.props.openSnackBar('Ditt lösenord har ändrats!')\n }).catch((err) => {\n console.log(err)\n return this.props.openSnackBar('Något gick fel. Försök igen!')\n })\n }\n }","function checkConfirmPassword() {\n var password = $modalPass.val();\n var confirmPassword = $modalConfirmPass.val();\n if (password !== confirmPassword) {\n $confirmPasswordError.html(\"Passwords Did Not Match\");\n $confirmPasswordError.show();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n confirmPasswordError = true;\n } else {\n $confirmPasswordError.hide();\n $modalConfirmPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }","function checkResetPasswordEmail(){\n var reset_email = document.getElementById('recovery_email');\n var error_message = document.getElementById('error-recovery-message');\n\n if(reset_email.value.length <= 0) {\n error_message.style.visibility = \"visible\";\n error_message.innerText = \"The reset email is required\";\n reset_email.style.borderColor = \"red\";\n return false;\n } else {\n error_message.style.visibility = \"hidden\";\n error_message.innerText = \"\";\n reset_email.style.borderColor = \"red\";\n }\n return true;\n}","function afterSuccess(value)\n{\nif(value == \"Thanks for registering with us. Please check your email inbox or spambox to activate your account with us!\")\n{\n//$('#customForm').resetForm();\ndocument.getElementById(\"customForm\").reset();\n}\n}","function showMessage(res) {\n\t\tvar target = document.getElementById(\"invalid-container\");\n\t\tif (res == 'fail') {\n\t\t\tif($('#invalid-container').children().length == 0) {\n\t\t\t\tvar div = document.createElement('div');\n\t\t\t\tdiv.textContent = 'Invalid username or password';\n\t\t\t\tdiv.setAttribute('id', 'invalid');\n\t\t\t\ttarget.appendChild(div);\n\t\t\t}\n\t\t} else {\n\t\t\twindow.location='http://www.hsd-studio.com/';\n\t\t}\n\t}","function forgotPassword(method,type) {\n hideError('email');\n addFunActionLabel=\"Forgot Pasword Submit\";\n if(pageType=='not_login'){\n var email = $.trim($(\"#TenTimes-Modal #userEmailCopy\").val()); \n }else{\n var email = $.trim($(\"#TenTimes-Modal #userEmail\").val());\n }\n if(!validateEmail12345(email)){\n $(\".alert_email\").show();\n return 0;\n }\n var otpType='password';\n if(type=='N' || type=='U'){\n otpType='otp';\n }\n\n if(method == \"connect\")\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\n else\n var postData = {'email':email, 'name' : email , 'type' : otpType }\n showloading();\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\n hideloading();\n response=$.parseJSON(response);\n var resText=response.resText;\n var resLink=response.resLink;\n if(type=='N' || type=='U'){\n resText=response.resText_typeN;\n resLink=response.resLink_typeN;\n \n }\n \n switch(response.response) {\n case 'true':\n $('#getpassword').parent().replaceWith(function() { return \"\" + \"\" + resText + \"
\"+$('#getpassword').get(0).outerHTML+\" \"; });\n\n $('#getpassword').text(resLink);\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\n $('#TenTimes-Modal .partial-log').hide();\n $('#getpassword').removeAttr(\"onclick\").click(function() {\n partialLog(method,type)\n }).text(resLink).css('color','#335aa1');\n }\n break;\n case 'false':\n $(\".alert_email\").html(\"Sorry, 10times doesn't recognize that email.\");\n $(\".alert_email\").show();\n break;\n }\n }); \n}","function reset() { \n passwordLength = 0;\n specialCharacters = false;\n numbers = false;\n uppercase = false;\n lowercase = false;\n validInput = false;\n }","function wrongPass() {\n const alert = document.createElement(\"ion-alert\");\n alert.cssClass = \"my-custom-class\";\n alert.header = \"Error\";\n alert.message = \"Wrong Password\";\n alert.buttons = [\"OK\"];\n\n //console.log(\"wrong password alert!\");\n document.body.appendChild(alert);\n return alert.present();\n}","function displayPasswordValidationResults(result) {\n if (result['password-compare']) {\n $(\"#password-input\").addClass(\"is-valid\");\n $(\"#password-confirm\").addClass(\"is-valid\");\n\n $(\"#password-input-hint\").addClass(\"valid-feedback\");\n $(\"#password-confirm-hint\").addClass(\"valid-feedback\");\n $(\"#password-input-hint\").text(\"Passwords Match\");\n $(\"#password-confirm-hint\").text(\"Passwords Match\");\n }\n else {\n if (result['password'] && result['password-confirm']) {\n //both passwords filled out, don't match\n $(\"#password-input\").addClass(\"is-invalid\");\n $(\"#password-confirm\").addClass(\"is-invalid\");\n\n $(\"#password-input-hint\").addClass(\"invalid-feedback\");\n $(\"#password-confirm-hint\").addClass(\"invalid-feedback\");\n $(\"#password-input-hint\").text(\"Passwords Dont Match\");\n $(\"#password-confirm-hint\").text(\"Passwords Dont Match\");\n }\n else if (result['password'] && !result['password-confirm']) {\n //password is only filled out\n $(\"#password-confirm\").addClass(\"is-invalid\");\n\n $(\"#password-confirm-hint\").addClass(\"invalid-feedback\");\n $(\"#password-confirm-hint\").text(\"Required\");\n }\n else if (!result['password'] && result['password-confirm']) {\n //password-confirm is only filled out\n $(\"#password-input\").addClass(\"is-invalid\");\n\n $(\"#password-input-hint\").addClass(\"invalid-feedback\");\n $(\"#password-input-hint\").text(\"Required\");\n }\n else if (!result['password'] && !result['password-confirm']) {\n //neither password inputs are filled out\n $(\"#password-input\").addClass(\"is-invalid\");\n $(\"#password-confirm\").addClass(\"is-invalid\");\n\n $(\"#password-input-hint\").addClass(\"invalid-feedback\");\n $(\"#password-confirm-hint\").addClass(\"invalid-feedback\");\n $(\"#password-input-hint\").text(\"Required\");\n $(\"#password-confirm-hint\").text(\"Required\");\n }\n }\n}","function managePasswordForgotten() {\n\t$('#passwordReset').click(function() { \n\t\t// We must reset the document and send a link to the registered email\n\t\t// to a form where the end user can update the password\n\t\tclearDocument();\n\t\tloadHTML(\"navbar.html\");\n\t\tnavbarHover();\n\t\t$(document.body).append(\"Please fill in the following form ! \");\n\t\tloadHTML(\"passwordForgotten.html\");\n\t\tloadJS(\"js/forms.js\");\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\n loadHTML(\"footer.html\");\n\t});\n}"],"string":"[\n \"function ResetCard({ email, onPasswordChange, submitForm, errorCode}) {\\r\\n return (\\r\\n \\r\\n \\r\\n Resetting Password for: \\r\\n {email}
\\r\\n \\r\\n \\r\\n {errorCode !== '' && { } }\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Save\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n Don't have an account yet? Sign up!
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n}\",\n \"function resetPasswordSuccess() {\\n var $formState = $('.reset-password-success');\\n\\n // check if reset password form was successfully submited.\\n if (!$formState.length) {\\n return;\\n }\\n\\n // show success message\\n $('#ResetSuccess').removeClass('hide');\\n }\",\n \"function resetPasswordSuccess() {\\n // check if reset password form was successfully submited\\n if (!$('.reset-password-success').length) {\\n return;\\n }\\n\\n // show success message\\n $('#ResetSuccess').removeClass('hide');\\n }\",\n \"async resetPassword({ view, params, antl }) {\\n return view.render('user.password', {\\n token: params.token,\\n key: params.key,\\n action: 'UserController.storeResetPassword',\\n header_msg: antl.formatMessage('main.change_password'),\\n button_msg: antl.formatMessage('main.change_password'),\\n })\\n }\",\n \"function processResetPasswordReturn (data, $message) {\\n\\n if (data.result === \\\"No\\\") {\\n // If result returned no then something went wrong so build and display an\\n // error message\\n\\n // Build HTML for error message\\n var result = [\\n '',\\n '× ',\\n '
Reset Password Error ',\\n data.message,\\n ''];\\n\\n // Output error message\\n $message.html(result.join(''));\\n\\n } else {\\n\\n // Build HTML for success message\\n var result = [\\n '',\\n '× ',\\n 'Password successfully reset!',\\n '
'];\\n\\n // Output error message\\n $message.html(result.join(''));\\n\\n }\\n\\n}\",\n \"function handleRecoverPassword(){\\n if(emailValid()){\\n console.log(`send me my password to: ${email}`)\\n setEmail('')\\n }else{\\n console.log('invalid')\\n }\\n }\",\n \"function printResetPassword(token) {\\n const main = document.getElementById(\\\"main\\\");\\n main.innerHTML = `\\n
\\n
Reset password \\n \\n \\n
`;\\n // when the user submits the form we call the function resetPassword()\\n document.getElementById(\\\"reset\\\").addEventListener('submit', function(e) {\\n e.preventDefault();\\n resetPassword(token);\\n })\\n}\",\n \"function resetPassword(req, res) {\\n res.render(\\\"resetPassword\\\");\\n}\",\n \"function resetPassword() {\\n\\t\\t\\tif (vm.newPassword != \\\"\\\" && vm.newPassword == vm.confirmPassword) {\\n\\t\\t\\t\\tvm.waiting = true;\\n\\t\\t\\t\\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\\n\\t\\t\\t\\t\\tvm.success = 1;\\n\\t\\t\\t\\t\\tvm.waiting = false;\\n\\t\\t\\t\\t\\t$rootScope.$broadcast('loading', false); // TODO (HACK)\\n\\t\\t\\t\\t}, function(res) {\\n\\t\\t\\t\\t\\tvm.success = 0;\\n\\t\\t\\t\\t\\tvm.waiting = false;\\n\\t\\t\\t\\t\\t$rootScope.$broadcast('loading', false); // TODO (HACK)\\n\\t\\t\\t\\t});\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tgui.alertError(\\\"Passwords do not match.\\\");\\n\\t\\t\\t}\\n\\t\\t}\",\n \"renderSuccess () {\\n this.response.render('auth/password-changed', {\\n title: 'Password Changed', returnToUrl: this.returnToUrl\\n })\\n }\",\n \"function resetChangePass(massage = \\\"\\\") {\\n $(\\\"#successMassage\\\").html(massage);\\n $(\\\"#verifyMassage\\\").html(\\\"\\\");\\n $(\\\"#confirmMassage\\\").html(\\\"\\\");\\n $('#currentPassword').val(\\\"\\\");\\n $('#newPassword').val(\\\"\\\");\\n $('#confirmPassword').val(\\\"\\\");\\n}\",\n \"function forgotPasswordEnterDetails(){\\n formLogin.removeClass('is-selected');\\n formSignup.removeClass('is-selected');\\n formForgotPassword.removeClass('is-selected');\\n formForgotPasswordDetailsSignup.removeClass('is-selected'); \\n formEnterDetailsOTP.removeClass('is-selected');\\n\\t\\tformEnterLoginDetailsToSignUp.removeClass('is-selected');\\n $('.cd-switcher').find('.selected').html(\\\"Forgot Password\\\");\\n }\",\n \"function cardDetails(msg) {\\n header('SECURE PAYMENT', msg)\\n prompt.question(\\\"Enter your card number: \\\", (options) => {\\n if (options == parseInt(options)) {\\n payConfirm('YOUR PAYMENT WAS SUCCESSFUL !'.cyan);\\n cart = [];\\n } else {\\n cardDetails('PLEASE ENTER A VALID INPUT'.cyan);\\n }\\n })\\n}\",\n \"function unlockCard(card, codeInput){\\r\\n\\tif(codeInput.substring(codeInput.length-1) == 'V'){\\r\\n\\t\\tif(codeInput.startsWith(card.password)){\\r\\n\\t\\t\\tdisplayScreen(3);\\r\\n\\t\\t}\\r\\n\\t\\telse{\\r\\n\\t\\t\\tremainingTries--;\\r\\n\\t\\t\\tif(remainingTries==0){\\r\\n\\t\\t\\t\\tdisplayScreen(5);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse {\\r\\n\\t\\t\\t\\tdisplayScreen(2);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\telse {\\r\\n\\t\\tdocument.getElementById(\\\"code\\\").innerHTML = \\\"• \\\".repeat(codeInput.length) + \\\"_ \\\".repeat(4-codeInput.length)\\r\\n\\t}\\r\\n}\",\n \"function showPassword() {\\n register((data, err)=>{\\n if(data === -1) {\\n showErr(err);\\n }\\n else {\\n data = JSON.parse(data);\\n userId = data.userId;\\n attempt = 3;\\n listenNextButton();\\n $(\\\"#password1\\\").text(data.password_1);\\n $(\\\"#password2\\\").text(data.password_2);\\n $(\\\"#password3\\\").text(data.password_3);\\n $(\\\"#ui_2\\\").fadeIn();\\n }\\n });\\n}\",\n \"forgotPass() \\n {\\n \\tAlert.alert(\\n\\t\\t 'Go To Site',\\n\\t\\t 'Pressing this button would help you restore your password (external source)',\\n\\t\\t [\\n\\t\\t {text: 'OK', onPress: () => console.log('OK Pressed')},\\n\\t\\t ],\\n\\t\\t {cancelable: false},\\n\\t\\t);\\n }\",\n \"if (\\n prevProps.updatePasswordState.isFetching &&\\n !this.props.updatePasswordState.isFetching &&\\n this.props.updatePasswordState.error === null\\n ) {\\n Alert.alert(\\n translate(\\\"reset.reset\\\"),\\n translate(\\\"reset.changeSuccess\\\"),\\n [{ text: \\\"OK\\\", onPress: () => this._returnToMain() }],\\n { cancelable: false }\\n );\\n }\",\n \"function showIncorrectPasswordPage() {\\n\\n // Retrieve all password elements.\\n var passwordInputForm = document.getElementById(\\\"passwordInputForm\\\");\\n var passwordInputLabel = document.getElementById(\\\"passwordInputLabel\\\");\\n var scenarios = document.getElementById(\\\"scenarios\\\");\\n\\n passwordInputLabel.innerHTML = \\\"Enter password\\\";\\n passwordInputForm.className = \\\"item shown\\\";\\n passwordSubmitButton.className = \\\"item shown\\\";\\n\\n scenarios.className = \\\"options hide\\\";\\n document.getElementById(\\\"scenariosLabel\\\").innerHTML = \\\"\\\";\\n\\n showStartupErrorMessage(\\\"Incorrect password\\\");\\n }\",\n \"function handlePasswordResetPage(req, res) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: false\\n });\\n}\",\n \"function checkValidResetFormPassword() {\\n let isValid = /^(?=.*\\\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\\\s).{8,}$/.test(\\n ResetForm.elements[\\\"password-reset\\\"].value\\n );\\n\\n if (!isValid) {\\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\\n \\\".error-message\\\"\\n );\\n if (errMes) return;\\n\\n let p = document.createElement(\\\"p\\\");\\n p.classList.add(\\\"error-message\\\");\\n\\n let img = document.createElement(\\\"img\\\");\\n img.src = \\\"./images/popup/exclamation.svg\\\";\\n img.alt = \\\"icon\\\";\\n\\n let span = document.createElement(\\\"span\\\");\\n span.innerText =\\n \\\"Mật khẩu yêu cầu tối thiểu tám ký tự, ít nhất một chữ cái viết hoa, một chữ cái viết thường, một số và một ký tự đặc biệt\\\";\\n\\n p.appendChild(img);\\n p.appendChild(span);\\n\\n ResetFormPassword.parentElement.parentElement.appendChild(p);\\n ResetFormError.push(\\\"error\\\");\\n } else {\\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\\n \\\".error-message\\\"\\n );\\n if (!errMes) return;\\n\\n ResetFormPassword.parentElement.parentElement.removeChild(errMes);\\n ResetFormError.pop();\\n }\\n}\",\n \"function postResetPassword() {\\n const validatePasswords = validatePasswordMatch(password, confirmPassword);\\n if (validatePasswords !== true) {\\n setSubmitResult(validatePasswords);\\n setIsError(true);\\n return;\\n }\\n setIsLoading(true);\\n setIsError(false);\\n axios.post(process.env.REACT_APP_API_LINK + \\\"/password/reset\\\", {\\n \\\"email\\\": data.email,\\n token,\\n password\\n }).then(result => {\\n setIsLoading(false);\\n if (result.status === 200) {\\n setIsSuccess(true);\\n data.onCloseModal();\\n alert(\\\"Password Reset Successful!\\\")\\n } else {\\n setSubmitResult(\\\"An error has occurred, please contact an administrator.\\\")\\n setIsError(true);\\n }\\n }).catch(e => {\\n setIsLoading(false);\\n setSubmitResult(e.response.data.error);\\n setIsError(true);\\n });\\n }\",\n \"function resALert() {\\n alert(\\\"The form has been reset. Please try again.\\\");\\n}\",\n \"function password_validation(){\\n\\n if(!checkResetPasswordEmail()) {\\n return false;\\n } else {\\n document.getElementById('get_password').value = \\\"Sending...\\\";\\n return true;\\n }\\n}\",\n \"function showPassword(displayPassword) {\\n document.getElementById(\\\"password\\\").textContent = displayPassword;\\n}\",\n \"function postResetPassword(data, textStatus, jqXHR, param) {\\n\\tvar user = param.user;\\n\\tvar uiDiv = $('#ui');\\n\\tuiDiv.html('');\\n\\tvar p = $('');\\n\\tuiDiv.append(p);\\n\\tp.html('The password for \\\"' + user + '\\\" has been reset.');\\n\\tvar ul = $('
');\\n\\tuiDiv.append(ul);\\n\\tvar li = $('');\\n\\tul.append(li);\\n\\tli.html('New password: \\\"' + data[user] + '\\\"');\\n}\",\n \"passwordReset() {\\n Actions.passwordReset();\\n }\",\n \"resetPassword(actionCode, newPassword) {\\n var accountEmail;\\n let thisComponent = this;\\n // Verify the password reset code is valid.\\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\\n var accountEmail = email;\\n \\n // TODO: Show the reset screen with the user's email and ask the user for\\n // the new password.\\n \\n // Save the new password.\\n auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {\\n // Password reset has been confirmed and new password updated.\\n \\n // TODO: Display a link back to the app, or sign-in the user directly\\n // if the page belongs to the same domain as the app:\\n // auth.signInWithEmailAndPassword(accountEmail, newPassword);\\n \\n // TODO: If a continue URL is available, display a button which on\\n // click redirects the user back to the app via continueUrl with\\n // additional state determined from that URL's parameters.\\n }).catch(function(error) {\\n // Error occurred during confirmation. The code might have expired or the\\n // password is too weak.\\n });\\n }).catch(function(error) {\\n // Invalid or expired action code. Ask user to try to reset the password\\n // again.\\n }).then(function() {\\n thisComponent.props.history.push('/signin'); // redirect to home page\\n });\\n }\",\n \"function retrieveForgotPassword() {\\n var userData = {};\\n angular.copy(vm.misc.forgotPassword, userData);\\n cmnSvc.resetForm(scope.forgotPasswordForm, vm.misc.authData);\\n fbaseSvc.resetForgetPassword(userData.emailAdd).then(function(rs){\\n alert(rs);\\n }, function(err){\\n alert('Error! '+err);\\n });\\n }\",\n \"function showPasswordRecovery() {\\n const form = document.getElementById(\\\"forgot-password\\\");\\n form.querySelector(\\\"span\\\").classList.toggle(\\\"hidden\\\");\\n}\",\n \"recoverPassword({ Bert }, { email }) {\\n // Call forgot password procedure\\n Accounts.forgotPassword({\\n email,\\n }, (error) => {\\n if (error) {\\n Bert.alert(error.reason, 'warning');\\n } else {\\n Bert.alert('Check your inbox for a reset link!', 'success');\\n }\\n });\\n }\",\n \"function passwordsMismatched() {\\n document.getElementById(\\\"passwordP\\\").style.display = \\\"visible\\\";\\n}\",\n \"function reset() {\\n // Flag it to prevent double clicking, and visually communicate\\n if ($scope.isSubmitting) {\\n return;\\n }\\n\\n $scope.isSubmitting = true;\\n\\n // Lets try to reset their password\\n visitorApiService.resetPassword({\\n key: $scope.key,\\n password: $scope.visitor.password\\n })\\n .$promise.then(function(response) {\\n // Unlock the submit button\\n $scope.isSubmitting = false;\\n\\n if (response.error === null) {\\n return response.result; // email\\n } else {\\n // Most common error is an expired key\\n $scope.message = commonUtilService.getMessage(response);\\n return $q.reject();\\n }\\n })\\n .then(function(email) {\\n\\n // Log them in now\\n return visitorApiService.login({\\n email: email,\\n password: $scope.visitor.password\\n })\\n .$promise.then(function(response) {\\n if (response.error !== null) {\\n $scope.message = commonUtilService.getMessage(response);\\n return $q.reject();\\n }\\n });\\n })\\n .then(function() {\\n // Request customer info\\n return visitorLoginService.isLoggedIn(true);\\n })\\n .then(function() {\\n // Get their cart info\\n cartService.reload();\\n })\\n .then(function() {\\n // Redirect them to their last page\\n var path = angular.module(\\\"visitorModule\\\").back.path || '/account';\\n $location.path(path);\\n });\\n\\n }\",\n \"function preRedeemSubmitActions(error) {\\n var errorMsg = checkRedeemMandatoryFields(error);\\n \\n var pwdErrorMsg = validatePasswordSize();\\n if (pwdErrorMsg != \\\"\\\") { \\n errorMsg = errorMsg + pwdErrorMsg + \\\"\\\\n\\\\n\\\";\\n }\\n\\n if (errorMsg != \\\"\\\"){\\n alert(errorMsg);\\n return false;\\n }\\n return errorMsg;\\n}\",\n \"function confirmPasswordReset (e) {\\n e.preventDefault();\\n showConfirmation(\\\"Are you sure you want to reset your password?\\\").then(function (confirmed) {\\n if (confirmed) {\\n sendResetPasswordEmail().then(function () {\\n $(e.target).parent().html('Password Reset Email Sent.');\\n });\\n }\\n }).catch(function (error) {\\n showError(\\\"Response Error\\\", error);\\n });\\n}\",\n \"function failedPasswordConfirmation(){\\n req.flash('error', \\\"Incorrect current password.\\\");\\n return res.redirect(\\\"/account\\\");\\n }\",\n \"function forgotPasswordPage(req, res) {\\n res.render('forgotPassword')\\n}\",\n \"passwordreset(email) {\\r\\n return this.auth\\r\\n .sendPasswordResetEmail(email)\\r\\n .then(function () {\\r\\n alert(\\\"Email Sent!\\\");\\r\\n })\\r\\n .catch(function (error) {\\r\\n alert(\\\"An error occured. Please try again\\\");\\r\\n });\\r\\n }\",\n \"function showChangePasswordDialog(passwordResetToken) {\\n\\tvar errorCallback = function(error, data) {\\n\\n\\t\\t// Special case when old password did not match\\n\\t\\tif(!passwordResetToken && !error && data && data[\\\"resultCode\\\"] === \\\"NOT_FOUND\\\") {\\n\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#wrong-password\\\");\\n\\t\\t} else {\\n\\t\\t\\tconsole.error(error, data);\\n\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#password-change-failed\\\")\\n\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\tif(passwordResetToken) {\\n\\t\\t\\t\\t\\t\\tdoNavigate(\\\"/home.html\\\");\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t})\\n\\t\\t\\t;\\n\\t\\t}\\n\\t};\\n\\tvar changeDispatcher = tp.dialogs.showDialog(\\\"changePasswordDialog\\\", tp.lang.getText(passwordResetToken ? \\\"password-change\\\" : \\\"change-password\\\"));\\n\\tif(!passwordResetToken) {\\n\\t\\td3.select(\\\".password-old\\\").classed(\\\"hidden\\\", false);\\n\\t}\\n\\tchangeDispatcher\\n\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\tvar oldPasswordElement = d3.select(\\\"input[name=password-old]\\\");\\n\\t\\t\\tvar oldPassword = oldPasswordElement.property(\\\"value\\\");\\n\\t\\t\\tvar newPasswordElement = d3.select(\\\"input[name=password-new]\\\");\\n\\t\\t\\tvar newPassword = newPasswordElement.property(\\\"value\\\");\\n\\t\\t\\tvar verifyPassword = d3.select(\\\"input[name=password-verify]\\\").property(\\\"value\\\");\\n\\t\\t\\tif(!passwordResetToken) {\\n\\t\\t\\t\\tif(tp.util.isEmpty(oldPassword) || oldPassword.length < 6) {\\n\\t\\t\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#password-too-short\\\")\\n\\t\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\t\\toldPasswordElement.node().select();\\n\\t\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t;\\n\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(tp.util.isEmpty(newPassword) || newPassword.length < 6) {\\n\\t\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#password-too-short\\\")\\n\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\tnewPasswordElement.node().select();\\n\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t;\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\tif(newPassword !== verifyPassword) {\\n\\t\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#passwords-different\\\")\\n\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\tnewPasswordElement.node().select();\\n\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t;\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\tif(passwordResetToken) {\\n\\t\\t\\t\\ttp.session.resetPassword(passwordResetToken, newPassword, function(error, data) {\\n\\t\\t\\t\\t\\tif(error) {\\n\\t\\t\\t\\t\\t\\terrorCallback(error, data);\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\ttp.dialogs.showDialog(\\\"messageDialog\\\", \\\"#password-reset-change-successful\\\")\\n\\t\\t\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\t\\t\\tdoNavigate(\\\"/home.html?signin=true\\\");\\n\\t\\t\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t\\t;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t});\\n\\t\\t\\t} else {\\n\\t\\t\\t\\ttp.session.changePassword(oldPassword, newPassword, function(error, data) {\\n\\t\\t\\t\\t\\tif(error) {\\n\\t\\t\\t\\t\\t\\terrorCallback(error, data);\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \\\"messageDialog\\\", \\\"#password-change-successful\\\");\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t\\treturn false;\\n\\t\\t})\\n\\t\\t.on(\\\"cancel\\\", function() {\\n\\t\\t\\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \\\"messageDialog\\\", \\\"#password-no-change\\\");\\n\\t\\t\\treturn false;\\n\\t\\t})\\n\\t;\\n}\",\n \"function changePasswordHandler(response) {\\n messageData = JSON.parse(response);\\n if (messageData.success) \\n\\tdocument.getElementById(\\\"changePasswordForm\\\").reset();\\n}\",\n \"function forgetPassword(req, res) {\\n res.render(\\\"forgetPassword\\\");\\n}\",\n \"function forgotPasswordEnterDetailsSignup(){\\n formLogin.removeClass('is-selected');\\n formSignup.removeClass('is-selected');\\n formForgotPassword.removeClass('is-selected');\\n formForgotPasswordDetailsSignup.addClass('is-selected'); \\n formEnterDetailsOTP.removeClass('is-selected');\\n formEnterLoginDetailsToSignUp.removeClass('is-selected');\\n $('.cd-switcher').find('.selected').html(\\\"Forgot Password\\\");\\n }\",\n \"function reset() {\\n password = \\\"\\\";\\n charactersToUse = \\\"\\\";\\n lengthofPW = 0;\\n\\n\\n\\n}\",\n \"handleOk() {\\n const { email } = this.state;\\n if (!this.validateEmail(email)) {\\n message.error('Please enter valid eamil');\\n return;\\n }\\n firebase.auth().sendPasswordResetEmail(email).then(() => {\\n message.success('Password reset email has been sent.');\\n }).catch((err) => {\\n message.error(err.message);\\n });\\n this.setState({\\n showModal: false,\\n });\\n }\",\n \"function ksForgotPassword(){\\n //check if the form is valid\\n if(!$('#forgotpassword').valid()) return;\\n \\n //put the loading screen on\\n loadingScreen();\\n \\n //create an object to send to varify auth\\n var obj=new Object();\\n obj.email = $('#forgotpassword input[name=\\\"email\\\"]').val();\\n \\n //send the reset information via ajax\\n $.ajax({\\n type: \\\"POST\\\",\\n url: \\\"/login/resetpassword/\\\",\\n dataType: \\\"json\\\",\\n data: obj ,\\n async: false,\\n success: function(res) {\\n if (res.items[0].status ==='success'){\\n setSuccessToSuccess();\\n //loading screen\\n removeLoadingScreen();\\n\\n //display success failure screen\\n displaySuccessFailure();\\n \\n \\n $('#glassnoloading').fadeOut('normal');\\n \\n //change the dialog to be more informative\\n $('.registerdialog img').attr(\\\"src\\\" , \\\"/img/success.png\\\");\\n $('.registerdialog * .message').text('Successfully identified your account. A mail was sent to the address you supplied. To proceed with password change follow the link in the mail sent.');\\n $('.registerdialog > .front-card').remove();\\n \\n }\\n else{\\n setSuccessToFailed();\\n //loading screen\\n removeLoadingScreen();\\n\\n //display success failure screen\\n displaySuccessFailure();\\n\\n $('#glassnoloading').fadeOut('normal');\\n \\n //change the dialog to be more informative\\n $('.registerdialog img').attr(\\\"src\\\" , \\\"/img/failed.png\\\");\\n $('.registerdialog * .message').text(res.items[0].msg);\\n }\\n },\\n error: function(res){\\n setSuccessToFailed();\\n //loading screen\\n removeLoadingScreen();\\n \\n //display success failure screen\\n displaySuccessFailure();\\n \\n //$(\\\"#error\\\").text(\\\"Connection failure! Try again\\\");\\n //change the dialog to be more informative\\n $('.registerdialog img').attr(\\\"src\\\" , \\\"/img/failed.png\\\");\\n $('.registerdialog * .message').text('Error! Connection failure. Try again');\\n }\\n });\\n}\",\n \"resetUserPassword() {\\n this.security.resetUserPassword(this.passwordDetails, '/api/auth/reset/' + this.$stateParams.token)\\n .then((response) => {\\n this.passwordDetails = null;\\n this.toastr.success(\\\"Your password was reset successfully.\\\");\\n // Attach user profile\\n this.authentication.user = response;\\n // And redirect to the index page\\n this.$state.go('home');\\n })\\n .catch((response) => {\\n this.toastr.error(response.message.message, 'Error');\\n });\\n }\",\n \"function logkey() {\\n if(password.length <= 0) {\\n // Displays message about password length requirements\\n ReactDOM.render(Password length must be one character or more
, document.getElementById('password-status-1'));\\n // Show password length message\\n $(\\\"#password-status-2\\\").show()\\n } else if (password.length > 0) {\\n // Hide password length message\\n $(\\\"#password-status-2\\\").hide()\\n }\\n }\",\n \"function validateForgotPassword(e) {\\n\\n var regex = /^(\\\\d{3}\\\\d{3}\\\\d{4}|([\\\\w-]+(?:\\\\.[\\\\w-]+)*)@((?:[\\\\w-]+\\\\.)*\\\\w[\\\\w-]{0,66})\\\\.([a-z]{2,6}(?:\\\\.[a-z]{2})?))$/;\\n e.preventDefault();\\n if (regex.test(document.getElementById(\\\"capture_forgotPassword_resetPasswordUserID\\\").value)) {\\n janrain.capture.ui.postCaptureForm('forgotPasswordForm');\\n //document.getElementById('forgotFormButton').style.display = 'none';\\n //document.getElementById(\\\"forgotFormSubmit\\\").click();\\n } else if (document.getElementById(\\\"capture_forgotPassword_resetPasswordUserID\\\").value != '') {\\n janrain.capture.ui.postCaptureForm('forgotPasswordForm');\\n console.log('invalid.. fp GROUP ID');\\n // document.getElementById('forgotPasswordGroupFailure').style.display = 'block';\\n //document.getElementById('forgotPasswordForm').style.display = 'none';\\n // document.getElementById('forgotFormButton').style.display = 'none';\\n // document.getElementById(\\\"forgotFormSubmit\\\").click();\\n } else {\\n console.log('invalid blank fp');\\n }\\n}\",\n \"function resetPassword(email){\\n $.ajax({\\n method: 'POST',\\n url: \\\"inc/Auth/forget.php\\\",\\n data: {email: email}\\n }).done(function(msg){\\n if(msg == 'user issue')\\n {\\n AJAXloader(false, '#loader-pass-forgot');\\n displayMessagesOut();\\n $('.error-field').addClass('novisible');\\n $('.error-forgot-exist').removeClass('novisible');\\n displayError([], '#pass-forgot-form', ['input[name=\\\"pass-forgot\\\"]'], '');\\n }\\n if(msg == 'confirm issue')\\n {\\n AJAXloader(false, '#loader-pass-forgot');\\n displayMessagesOut();\\n $('.error-field').addClass('novisible');\\n $('.error-forgot-confirm').removeClass('novisible');\\n displaySpecial([], '#pass-forgot-form', ['input[name=\\\"pass-forgot\\\"]'], '');\\n }\\n //ce msg est un retour de la fonction de mail et non de la fonction de reset\\n if(msg == 'success')\\n {\\n AJAXloader(false, '#loader-pass-forgot');\\n displayMessagesOut();\\n $('.error-field').addClass('novisible');\\n $('.valid-forgot').removeClass('novisible');\\n displaySuccess([], '#pass-forgot-form', ['input[name=\\\"pass-forgot\\\"]'], '');\\n }\\n });\\n}\",\n \"resetPassword({ Meteor, Store, Bert }, data) {\\n const { token, password } = data;\\n const { dispatch } = Store;\\n\\n // Change state to password reset request\\n dispatch(resetPasswordRequest());\\n\\n // Call reset password procedure\\n Accounts.resetPassword(token, password, (error) => {\\n if (error) {\\n Bert.alert(error.reason, 'danger');\\n // Change state to password reset error\\n dispatch(resetPasswordError());\\n } else {\\n Bert.alert('Password reset!', 'success');\\n // Change state to successful password reset\\n dispatch(resetPasswordSuccess(Meteor.user()));\\n\\n // Redirect to home screen\\n browserHistory.push('/');\\n }\\n });\\n }\",\n \"function AdminConfirmPassword() {\\r\\n var password = $(\\\"#admin_password\\\").val()\\r\\n var confirm_pas = $(\\\"#confirm_password_reset\\\").val()\\r\\n if (confirm_pas.length == null || confirm_pas.length == \\\"\\\") {\\r\\n $(\\\"#conf_password_reset_label\\\").show();\\r\\n\\r\\n $(\\\"#confirm_password_reset\\\").addClass(\\\"has-error\\\");\\r\\n $(\\\"#conf_password_reset_label\\\").text(\\\"This Field is required\\\");\\r\\n return false;\\r\\n } \\r\\n else {\\r\\n if(confirm_pas != password) {\\r\\n $(\\\"#confirm_password_reset\\\").addClass(\\\"has-error\\\");\\r\\n $(\\\"#conf_password_reset_label\\\").show();\\r\\n $(\\\"#conf_password_reset_label\\\").text(\\\"Password is not match\\\");\\r\\n return false;\\r\\n } \\r\\n else {\\r\\n $(\\\"#confirm_password_reset\\\").removeClass(\\\"has-error\\\");\\r\\n $(\\\"#conf_password_reset_label\\\").hide();\\r\\n $(\\\"#conf_password_reset_label\\\").text(\\\"\\\");\\r\\n return true;\\r\\n }\\r\\n }\\r\\n\\r\\n}\",\n \"function showForgotPassword() {\\n document.getElementById(\\\"newAccount\\\").style.display=\\\"none\\\";\\n document.getElementById(\\\"login\\\").style.display=\\\"none\\\";\\n document.getElementById(\\\"forgotPassword\\\").style.display=\\\"block\\\";\\n document.getElementById(\\\"forgotUsername\\\").value=\\\"\\\";\\n}\",\n \"function displayPassword() {\\n document.querySelector(\\\"#generate\\\").blur(); // remove button focus so it doesn't hang there after password is displayed.\\n document.querySelector(\\\"#passwordBox\\\").value = generatePassword(); // call generate function and place returned value into HTML \\n}\",\n \"function resetPassword(e) {\\n e.preventDefault();\\n\\n axios\\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\\n security: questions,\\n newPW: password,\\n })\\n .then((res) => {\\n localStorage.setItem(\\\"token\\\", res.data);\\n alert(\\\"Your password has been changed! Logging you in...\\\");\\n router.push(\\\"/\\\");\\n })\\n .catch(() => {\\n alert(\\n \\\"Could not reset password! You likely had the wrong answers to the security questions\\\"\\n );\\n });\\n }\",\n \"function onReset() {\\n\\tdocument.getElementById('username').value = \\\"\\\";\\n\\tdocument.getElementById('password').value = \\\"\\\";\\n\\tdocument.getElementById('email').value = \\\"\\\";\\n\\tdocument.getElementById('result').innerHTML = \\\"\\\";\\n\\tflagUsername = false;\\n\\tflagPassword = false;\\n\\tflagEmail = false;\\n}\",\n \"function resetPassword() {\\r\\n \\tconsole.log(\\\"Inside reset password\\\");\\r\\n \\t//self.user.userpassword = self.user.password;\\r\\n \\tself.user.user_id = $(\\\"#id\\\").val();\\r\\n \\tself.user.obsolete = $(\\\"#link\\\").val();\\r\\n \\tdelete self.user.confpassword;\\r\\n \\tUserService.changePassword(self.user)\\r\\n \\t\\t.then(\\r\\n \\t\\t\\t\\tfunction (response) {\\r\\n \\t\\t\\t\\t\\tif(response.status == 200) {\\r\\n \\t\\t\\t\\t\\t\\tself.message = \\\"Password changed successfully..!\\\";\\r\\n \\t\\t\\t\\t\\t\\tsuccessAnimate('.success');\\r\\n \\t\\t\\t\\t\\t\\t\\r\\n \\t\\t\\t\\t\\t\\twindow.setTimeout( function(){\\r\\n \\t\\t\\t\\t\\t\\t\\twindow.location.replace('/Conti/login');\\r\\n \\t\\t\\t\\t \\t}, 5000);\\r\\n \\t\\t\\t\\t\\t\\t\\r\\n \\t\\t\\t\\t\\t} else {\\r\\n \\t\\t\\t\\t\\t\\tself.message = \\\"Password is not changed..!\\\";\\r\\n \\t\\t\\t\\t\\t\\tsuccessAnimate('.failure');\\r\\n \\t\\t\\t\\t\\t}\\r\\n \\t\\t\\t\\t\\t\\r\\n \\t\\t\\t\\t},\\r\\n \\t\\t\\t\\tfunction (errResponse) {\\r\\n \\t\\t\\t\\t\\tconsole.log(errResponse);\\r\\n \\t\\t\\t\\t}\\r\\n \\t\\t\\t);\\r\\n }\",\n \"checkForError() {\\n if (this.state.attemptedSubmit && this.state.changePassword) {\\n if (!this.compareOldPasswords())\\n return (\\n \\n Old password does not match current password.\\n
\\n );\\n if (this.compareNewPasswords())\\n return (\\n New passwords do not match.
\\n );\\n }\\n return null;\\n }\",\n \"function reset_password_form() {\\n\\t// Encode the String\\n\\tvar encoded_string = Base64.encode('login/reset_password/');\\n\\tvar encoded_val = encoded_string.strtr(encode_chars_obj);\\n\\t\\n\\tvar encoded_login_string = Base64.encode('login/index/');\\n\\tvar encoded_login_val = encoded_login_string.strtr(encode_chars_obj);\\n\\t\\n\\tvar success_msg = 'Successful';\\n\\tvar failure_msg = 'Failed';\\n\\t\\n\\tvar ajaxData = $(\\\"#resetForm\\\").serialize();\\t\\n\\t\\t$.ajax({\\n\\t\\turl: base_url + encoded_val,\\n\\t\\tdataType: \\\"json\\\",\\n\\t\\ttype: \\\"post\\\",\\n\\t\\tdata: ajaxData,\\t\\n\\t\\tbeforeSend: function() {\\n $('.uni_wrapper').addClass('loadingDiv');\\t\\t\\n },\\t\\t\\n\\t\\tsuccess: function(response) {\\n\\t\\t $('.uni_wrapper').removeClass('loadingDiv');\\n\\t\\t\\tif(true == response.status)\\n\\t\\t\\t{\\t\\t\\t\\t\\n\\t\\t\\t\\t$(\\\".error-message .alert\\\").removeClass('alert-danger');\\n\\t\\t\\t\\t$(\\\".error-message .alert\\\").addClass('alert-success');\\n\\t\\t\\t\\t$(\\\".error-message\\\").show();\\n\\t\\t\\t\\tif(response.message)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tsuccess_msg = response.message;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t$(\\\".alert\\\").html(success_msg);\\n\\t\\t\\t\\tsetTimeout(function(){\\t\\t\\t\\t\\t\\t \\n\\t\\t\\t\\t window.location.href = base_url + encoded_login_val;\\t\\t\\t\\t\\t\\t \\n\\t\\t\\t\\t}, 500);\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\t$(\\\".error-message\\\").show();\\n\\t\\t\\t\\tif(response.message)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tfailure_msg = response.message;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t$(\\\".alert\\\").html(failure_msg);\\n\\t\\t\\t}\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t});\\t\\n}\",\n \"function showForgotPasswordDIV() {\\r\\n\\tdocument.getElementById('forgotPwd').style.display=\\\"block\\\";\\r\\n}\",\n \"processPassRep() {\\n if (this.password.value !== this.passwordRepeat.value) {\\n this.passwordRepeat.err = true;\\n this.passwordRepeatErr.seen = true;\\n this.valid = false;\\n this.passwordRepeatErr.text = \\\"رمز عبور و تکرار آن یکسان نیستند\\\";\\n } else {\\n this.passwordRepeat.err = false;\\n this.passwordRepeatErr.seen = false;\\n }\\n }\",\n \"function recoverPassword() {\\n const email = document.getElementsByName(\\\"recover-email\\\").item(0);\\n xhttp(\\\"POST\\\", \\\"forgot.php\\\", { email: email.value }, (response) => {\\n // do nothing if it works or if it fails\\n });\\n const loginpage = document.getElementById(\\\"main\\\").querySelector(\\\"div.loginpage\\\");\\n loginpage.innerHTML += 'If the email is in our database, an email will be sent shortly to recover your account
';\\n return false;\\n}\",\n \"recoverPassword() {\\n let { username } = this.state;\\n if (username === '') {\\n return this.setState({\\n loginStatus: 'Enter your username or ssn for a chance to retrieve your password',\\n });\\n }\\n fetch('/recover', {\\n method: 'POST',\\n body: JSON.stringify({ username }),\\n headers: { 'content-type': 'application/json' },\\n })\\n .then(resp => resp.json())\\n .then(data =>\\n (data.password_hint.length\\n ? this.setState({\\n loginStatus: `The hint for user ${username} is: ${data.password_hint}`,\\n })\\n : this.setState({\\n loginStatus:\\n 'Looks like someone forget to set a password hint. Try making a new account instead!',\\n })))\\n .catch(console.error);\\n }\",\n \"function forgotPassword() { \\n\\n\\t\\t\\t$( \\\"#load\\\" ).show();\\n\\t\\t\\t\\n\\t\\t\\tvar form = new FormData(document.getElementById('reset_form'));\\n\\t\\t\\t\\n\\t\\t\\tvar validate_url = $('#reset_form').attr('action');\\n\\t\\t\\t\\n\\t\\t\\t$.ajax({\\n\\t\\t\\t\\ttype: \\\"POST\\\",\\n\\t\\t\\t\\turl: validate_url,\\n\\t\\t\\t\\t//data: dataString,\\n\\t\\t\\t\\tdata: form,\\n\\t\\t\\t\\t//dataType: \\\"json\\\",\\n\\t\\t\\t\\tcache : false,\\n\\t\\t\\t\\tcontentType: false,\\n\\t\\t\\t\\tprocessData: false,\\n\\t\\t\\t\\tsuccess: function(data){\\n\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif(data.success == true ){\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t$( \\\"#load\\\" ).hide();\\n\\t\\t\\t\\t\\t\\t$(\\\"input\\\").val('');\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t$(\\\".forgot-password-box\\\").html(data.notif);\\n\\t\\n\\t\\t\\t\\t\\t\\tsetTimeout(function() { \\n\\t\\t\\t\\t\\t\\t\\t//$(\\\"#notif\\\").slideUp({ opacity: \\\"hide\\\" }, \\\"slow\\\");\\n\\t\\t\\t\\t\\t\\t\\t//window.location.reload(true);\\n\\t\\t\\t\\t\\t\\t}, 2000); \\n\\n\\t\\t\\t\\t\\t}else if(data.success == false){\\n\\t\\t\\t\\t\\t\\t$( \\\"#load\\\" ).hide();\\n\\t\\t\\t\\t\\t\\t$(\\\"#notif\\\").html(data.notif);\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t},error: function(xhr, status, error) {\\n\\t\\t\\t\\t\\t$( \\\"#load\\\" ).hide();\\n\\t\\t\\t\\t},\\n\\t\\t\\t});\\n\\t\\t\\treturn false;\\n\\t\\t}\",\n \"_sendPasswordReset(user, password) {\\n return this.mailer.reset({email: user.email, password: password})\\n }\",\n \"function OtpPassword(){\\r\\n var otp_time_check=$(\\\"#reset_otp\\\").val();\\r\\n if(otp_time_check.length == '' || otp_time_check.length == null) {\\r\\n $(\\\"#reset_otp\\\").removeClass(\\\"has-success\\\");\\r\\n $(\\\"#reset_otp\\\").addClass(\\\"has-error\\\");\\r\\n $(\\\"#otp_label_reset\\\").show();\\r\\n\\r\\n $(\\\"#otp_label_reset\\\").text(\\\"This Field is required\\\");\\r\\n return false;\\r\\n }\\r\\n else{\\r\\n $(\\\"#reset_otp\\\").addClass(\\\"has-success\\\");\\r\\n $(\\\"#otp_label_reset\\\").show();\\r\\n $(\\\"#otp_label_reset\\\").text(\\\"\\\");\\r\\n return true;\\r\\n\\r\\n }\\r\\n \\r\\n }\",\n \"resetPassword(event) {\\n var email = this.state.email;\\n firebase.auth().sendPasswordResetEmail(email).then(() => {\\n this.setState({ success: true })\\n }).catch((error) => {\\n this.setState({ success: false })\\n alert(error.message);\\n });\\n }\",\n \"function printError() {\\n if (!validatePasswd()) {\\n isPasswdValid = false;\\n var html = \\\"The two password don't Match! \\\";\\n document.getElementById('validatepasswd').innerHTML = html; \\n } else {\\n isPasswdValid = true;\\n }\\n if (!isCorrectEmail) {\\n var email = document.getElementById('email').value \\n if ( !validateEmail(email)) { errorMessage(\\\"Please input valid email address!\\\"); }\\n else { errorMessage(\\\"The email was Registered!\\\");}\\n }\\n}\",\n \"function showCode() {\\n\\t\\t\\t//Reset game\\n\\t\\t\\tabortGame();\\n\\t\\t\\tvm.secretCode = Mastermind.secretCode();\\n\\t\\t}\",\n \"function handlePasswordReset(req, res) {\\n csrf.verify(req);\\n\\n if (!verifyReferrer(req, '/account/passwordreset')) {\\n res.status(403).send('Mismatched referrer');\\n return;\\n }\\n\\n var name = req.body.name,\\n email = req.body.email;\\n\\n if (typeof name !== \\\"string\\\" || typeof email !== \\\"string\\\") {\\n res.send(400);\\n return;\\n }\\n\\n if (!$util.isValidUserName(name)) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: \\\"Invalid username '\\\" + name + \\\"'\\\"\\n });\\n return;\\n }\\n\\n db.users.getEmail(name, function (err, actualEmail) {\\n if (err) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: err\\n });\\n return;\\n }\\n\\n if (actualEmail === '') {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: `Username ${name} cannot be recovered because it ` +\\n \\\"doesn't have an email address associated with it.\\\"\\n });\\n return;\\n } else if (actualEmail.toLowerCase() !== email.trim().toLowerCase()) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: \\\"Provided email does not match the email address on record for \\\" + name\\n });\\n return;\\n }\\n\\n crypto.randomBytes(20, (err, bytes) => {\\n if (err) {\\n LOGGER.error(\\n 'Could not generate random bytes for password reset: %s',\\n err.stack\\n );\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: email,\\n resetErr: \\\"Internal error when generating password reset\\\"\\n });\\n return;\\n }\\n\\n var hash = bytes.toString('hex');\\n // 24-hour expiration\\n var expire = Date.now() + 86400000;\\n var ip = req.realIP;\\n\\n db.addPasswordReset({\\n ip: ip,\\n name: name,\\n email: actualEmail,\\n hash: hash,\\n expire: expire\\n }, function (err, _dbres) {\\n if (err) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: err\\n });\\n return;\\n }\\n\\n Logger.eventlog.log(\\\"[account] \\\" + ip + \\\" requested password recovery for \\\" +\\n name + \\\" <\\\" + email + \\\">\\\");\\n\\n if (!emailConfig.getPasswordReset().isEnabled()) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: email,\\n resetErr: \\\"This server does not have mail support enabled. Please \\\" +\\n \\\"contact an administrator for assistance.\\\"\\n });\\n return;\\n }\\n\\n const baseUrl = `${req.realProtocol}://${req.header(\\\"host\\\")}`;\\n\\n emailController.sendPasswordReset({\\n username: name,\\n address: email,\\n url: `${baseUrl}/account/passwordrecover/${hash}`\\n }).then(_result => {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: true,\\n resetEmail: email,\\n resetErr: false\\n });\\n }).catch(error => {\\n LOGGER.error(\\\"Sending password reset email failed: %s\\\", error);\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: email,\\n resetErr: \\\"Sending reset email failed. Please contact an \\\" +\\n \\\"administrator for assistance.\\\"\\n });\\n });\\n });\\n });\\n });\\n}\",\n \"async passwordreset({ commit, dispatch }, form) {\\n form.busy = true;\\n try {\\n await App.post(route(\\\"api.auth.reset-password\\\"), form).then(() => {\\n commit(\\\"isAuthenticated\\\", {\\n isAuthenticated: vm.$auth.check()\\n });\\n form.busy = false;\\n });\\n await dispatch(\\\"fetchMe\\\");\\n } catch ({ errors, message }) {\\n form.errors.set(errors);\\n form.busy = false;\\n }\\n }\",\n \"async function requestResetPassword(formData) {\\n const headers = {};\\n attach_headers([HEADERS.CSRF], headers);\\n const body = { user: formData };\\n\\n cleanupAuthState();\\n dispatch({ type: LOADING_STARTED });\\n const resp = await supervise_rq(() =>\\n axios.post(API_PATHS.AUTH_UPDATE_PASSWORD, body, { headers })\\n );\\n\\n if (resp.status === STATUS.SUCCESS) {\\n dispatch({\\n type: AUTH_ACTIONS.AUTH_REQUEST_RESET_PASSWORD,\\n payload:\\n \\\"If an account for the provided email exists, an email with reset instructions will be sent to you. Please check your inbox.\\\",\\n });\\n } else {\\n dispatch({\\n type: AUTH_ACTIONS.AUTH_ERROR,\\n payload: \\\"Oops, something went wrong. Pleas try again later.\\\",\\n });\\n }\\n }\",\n \"function resetPassword() {\\n password = randomnum();\\n}\",\n \"function forgotPass(click) {\\n modal.style.display = \\\"block\\\";\\n signin.style.display = \\\"none\\\";\\n otp.style.display = \\\"none\\\";\\n forgot.style.display = \\\"flex\\\";\\n}\",\n \"resetPasswordInit(email) {\\n return this.afAuth.auth.sendPasswordResetEmail(email, { url: 'https://coincoininsolite-1cf37.firebaseapp.com/__/auth/action' });\\n }\",\n \"requirePassword() {\\n this.navigateTo('walletResetRequirePassword');\\n }\",\n \"function restorePassword(form, email) {\\n\\tvar emailValue = document.getElementById(email).value;\\n\\tvar auth = firebase.auth();\\n\\t\\n\\tauth.sendPasswordResetEmail(emailValue).then(function() {\\n\\t\\t\\tform.unbind().submit();\\n\\t\\t}, function(error) {\\n\\t\\t\\t// console.log(error);\\n\\t\\t\\taddHidden(form, 'error', error.code);\\n\\t form.unbind().submit();\\n\\t\\t});\\n}\",\n \"auth() {\\n \\tif(this.attempt == this.correct)\\n \\t{\\n \\t\\tthis.invalid = false;\\n this.setState((state) => {\\n return{\\n \\talert: \\\"Please enter your password: \\\", \\n \\tplacemessage: 'Enter password...'\\n };\\n });\\n this.passInput.clear();\\n this.props.navigation.navigate('MainStack');\\n\\n \\t}\\n \\telse\\n \\t{\\n \\t\\tthis.setState((state) => {\\n this.invalid = true;\\n this.showErrorAnimation();\\n return{alert: \\\"Incorrect password. Please try again:\\\"};\\n });\\n \\t}\\n }\",\n \"function refresh(){\\n \\\"use strict\\\";\\n $(\\\"#js-display\\\").text(password());\\n}\",\n \"function checkPasswordMatch() {\\n const password = $(\\\"#password\\\").val();\\n const confirmPassword = $(\\\"#password2\\\").val();\\n const feedback = $(\\\"#divCheckPasswordMatch\\\");\\n\\n if (password !== confirmPassword) {\\n feedback.html(\\\"Wachtwoorden zijn niet gelijk!\\\").removeClass('text-success').addClass('text-danger');\\n return;\\n }\\n\\n feedback.html(\\\"Wachtwoorden zijn gelijk.\\\").removeClass('text-danger').addClass('text-success');\\n }\",\n \"screenToShow(){ \\n if(!this.props.forgotPasswordScreen){\\n return \\n } else {\\n return \\n }\\n }\",\n \"function showPassword(text){\\n xapi.command(\\\"UserInterface Message TextInput Display\\\", {\\n InputType: KEYBOARD_TYPES.PIN\\n , Placeholder: \\\"Meeting Password (numeric)\\\"\\n , Title: \\\"Meeting Password\\\"\\n , Text: text\\n , SubmitText: \\\"Next\\\"\\n , FeedbackId: DIALPAD_PASSWORD\\n } ).catch((error) => { console.error(error); });\\n}\",\n \"function warnPasswordsDoNotMatch(){\\n if (!createAccountPasswordsMatch()){\\n $(\\\"#confirmPasswordMessage\\\").html('Passwords do not match.
');\\n }\\n}\",\n \"resetPassword(){\\n firebase.auth().sendPasswordResetEmail(this.passwordChangeEmail)\\n .then(() => alert(\\\"Password reset email sent\\\"))\\n .catch((error) => this.setState({error:error.message}))\\n }\",\n \"_handlePasswordCheck(res) {\\n var passMsg = \\\"Incorrect password!\\\";\\n var termMsg = \\\"Please agree to the terms of use!\\\";\\n\\n if (res == \\\"false\\\") { // Wrong password\\n $scope.passwordMessage = passMsg;\\n $(\\\"#passwordMessage\\\").fadeIn(100);\\n }\\n else if (!$scope.terms) { // Terms not checked\\n $scope.passwordMessage = termMsg;\\n $(\\\"#passwordMessage\\\").fadeIn(100);\\n }\\n else { // All correct\\n $(\\\"#slide1\\\").fadeOut(0);\\n $(\\\"#slide2\\\").fadeIn(200);\\n $scope.isLocked = false;\\n $scope.checkit();\\n }\\n $scope.$apply();\\n }\",\n \"function showPassword(password) {\\n $(\\\"input\\\").prev(\\\"p\\\").show(200);\\n $(\\\"input:hidden\\\").show(200);\\n $(\\\"#result\\\").val(password);\\n}\",\n \"render() {\\n return (\\n \\n \\n Admin Key Registration \\n \\n Please enter the secret key provided to you to request admin privileges for Academoo. \\n \\n \\n {!this.state.isLoading && Register Key }\\n \\n \\n {this.state.errors.map(error => (\\n {error.title}: {error.message} \\n ))}\\n {this.state.changed && {this.state.user} has been added as a site-wide Admin! }\\n\\n \\n \\n )\\n }\",\n \"function generatePassword() {\\n var pw = mainForm.master.value,\\n sh = mainForm.siteHost.value;\\n\\n // Don't show error message until needed\\n hide(mainForm.pwIncorrect);\\n\\n // Only generate if a master password has been entered\\n if (pw !== '') {\\n if (settings.rememberPassword) {\\n verifyPassword(pw, correct => {\\n if (!correct) {\\n // Master password is incorrect so show a warning\\n show(mainForm.pwIncorrect);\\n mainForm.master.select();\\n }\\n });\\n }\\n\\n // Only generate if a site has been entered\\n if (sh !== '') {\\n mainForm.pwResult.value = '';\\n mainForm.pwResult.placeholder = 'Generating...';\\n\\n // Generate a password to use, regardless of correct password\\n uniquify(pw, sh, unique => {\\n mainForm.pwResult.value = unique;\\n mainForm.pwResult.placeholder = '';\\n mainForm.pwResult.select();\\n }, settings);\\n }\\n }\\n }\",\n \"function showForgotPassword(){\\n //position the forget password dialog in the middle\\n var heighthtml = $('html').height()/2;\\n var heightforget = $('#forget_password_dialog').height()/2;\\n var widthhtml = $('html').width()/2;\\n var widthforget = $('#forget_password_dialog').width()/2;\\n $('#forget_password_dialog').css(\\\"top\\\", \\\"\\\" + (heighthtml - heightforget) + \\\"px\\\");\\n $('#forget_password_dialog').css(\\\"left\\\", \\\"\\\" + (widthhtml - widthforget) + \\\"px\\\");\\n $('#forget_password_dialog_success').css('display', 'none');\\n $('#forget_password_dialog_error').css('display', 'none');\\n $('#forget_password_dialog_body').css('display', 'block');\\n $('#loginregister').fadeOut('normal', function(){\\n $('#forget_password_dialog').fadeIn('normal');\\n });\\n}\",\n \"function forget_password(){\\r\\n localStorage.setItem(\\\"time\\\",\\\"1000\\\");\\r\\n localStorage.setItem(\\\"link\\\",\\\"password_reset.html\\\");\\r\\n window.open('loading.html',\\\"_self\\\");\\r\\n }\",\n \"function submitNewPassword() {\\n axios.post(`/users/reset`, {onyen: onyenAndToken[0], password: password}, {\\n headers: {\\n Authorization: `Token ${onyenAndToken[1]}`\\n }\\n }).then(res => {\\n window.localStorage.setItem('onyen', res.data.onyen);\\n window.localStorage.setItem('name', res.data.name);\\n if (res.data.admin) {\\n window.localStorage.setItem(\\\"adminUser\\\", \\\"true\\\");\\n history.push(\\\"/dashboard\\\");\\n } else {\\n window.localStorage.setItem(\\\"teamId\\\", res.data.teamId);\\n window.localStorage.setItem(\\\"studentUser\\\", \\\"true\\\");\\n history.push(\\\"/studentDash\\\");\\n }\\n });\\n }\",\n \"recoverPassword(){\\n this.setState({ isLoading: true });\\n\\n const { history, intl } = this.props;\\n const { email } = this.state;\\n\\n // firebase.auth.sendPasswordResetEmail(email)\\n // .then(() => {\\n // NotificationService.success(intl.formatMessage(translations.emailSended));\\n // this.setState({\\n // ...this.INITIAL_STATE,\\n // });\\n // history.push(SIGN_IN);\\n // }).catch((error) => {\\n // this.setState({\\n // isLoading: false,\\n // isApiError: true,\\n // apiError: error.message\\n // });\\n // });\\n }\",\n \"handleSubmit () {\\n\\n let validation = validateChangePassword(this.state)\\n if (validation !== false) {\\n return this.props.openSnackBar(validation)\\n } else {\\n userChangePassword(this.state, this.props.state.token)\\n .then((response) => {\\n return this.props.openSnackBar('Ditt lösenord har ändrats!')\\n }).catch((err) => {\\n console.log(err)\\n return this.props.openSnackBar('Något gick fel. Försök igen!')\\n })\\n }\\n }\",\n \"function checkConfirmPassword() {\\n var password = $modalPass.val();\\n var confirmPassword = $modalConfirmPass.val();\\n if (password !== confirmPassword) {\\n $confirmPasswordError.html(\\\"Passwords Did Not Match\\\");\\n $confirmPasswordError.show();\\n $modalConfirmPass.css(\\\"border-bottom\\\",\\\"2px solid #F90A0A\\\");\\n confirmPasswordError = true;\\n } else {\\n $confirmPasswordError.hide();\\n $modalConfirmPass.css(\\\"border-bottom\\\",\\\"2px solid #34F458\\\");\\n }\\n }\",\n \"function checkResetPasswordEmail(){\\n var reset_email = document.getElementById('recovery_email');\\n var error_message = document.getElementById('error-recovery-message');\\n\\n if(reset_email.value.length <= 0) {\\n error_message.style.visibility = \\\"visible\\\";\\n error_message.innerText = \\\"The reset email is required\\\";\\n reset_email.style.borderColor = \\\"red\\\";\\n return false;\\n } else {\\n error_message.style.visibility = \\\"hidden\\\";\\n error_message.innerText = \\\"\\\";\\n reset_email.style.borderColor = \\\"red\\\";\\n }\\n return true;\\n}\",\n \"function afterSuccess(value)\\n{\\nif(value == \\\"Thanks for registering with us. Please check your email inbox or spambox to activate your account with us!\\\")\\n{\\n//$('#customForm').resetForm();\\ndocument.getElementById(\\\"customForm\\\").reset();\\n}\\n}\",\n \"function showMessage(res) {\\n\\t\\tvar target = document.getElementById(\\\"invalid-container\\\");\\n\\t\\tif (res == 'fail') {\\n\\t\\t\\tif($('#invalid-container').children().length == 0) {\\n\\t\\t\\t\\tvar div = document.createElement('div');\\n\\t\\t\\t\\tdiv.textContent = 'Invalid username or password';\\n\\t\\t\\t\\tdiv.setAttribute('id', 'invalid');\\n\\t\\t\\t\\ttarget.appendChild(div);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\twindow.location='http://www.hsd-studio.com/';\\n\\t\\t}\\n\\t}\",\n \"function forgotPassword(method,type) {\\n hideError('email');\\n addFunActionLabel=\\\"Forgot Pasword Submit\\\";\\n if(pageType=='not_login'){\\n var email = $.trim($(\\\"#TenTimes-Modal #userEmailCopy\\\").val()); \\n }else{\\n var email = $.trim($(\\\"#TenTimes-Modal #userEmail\\\").val());\\n }\\n if(!validateEmail12345(email)){\\n $(\\\".alert_email\\\").show();\\n return 0;\\n }\\n var otpType='password';\\n if(type=='N' || type=='U'){\\n otpType='otp';\\n }\\n\\n if(method == \\\"connect\\\")\\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\\n else\\n var postData = {'email':email, 'name' : email , 'type' : otpType }\\n showloading();\\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\\n hideloading();\\n response=$.parseJSON(response);\\n var resText=response.resText;\\n var resLink=response.resLink;\\n if(type=='N' || type=='U'){\\n resText=response.resText_typeN;\\n resLink=response.resLink_typeN;\\n \\n }\\n \\n switch(response.response) {\\n case 'true':\\n $('#getpassword').parent().replaceWith(function() { return \\\"\\\" + \\\"\\\" + resText + \\\"
\\\"+$('#getpassword').get(0).outerHTML+\\\" \\\"; });\\n\\n $('#getpassword').text(resLink);\\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\\n $('#TenTimes-Modal .partial-log').hide();\\n $('#getpassword').removeAttr(\\\"onclick\\\").click(function() {\\n partialLog(method,type)\\n }).text(resLink).css('color','#335aa1');\\n }\\n break;\\n case 'false':\\n $(\\\".alert_email\\\").html(\\\"Sorry, 10times doesn't recognize that email.\\\");\\n $(\\\".alert_email\\\").show();\\n break;\\n }\\n }); \\n}\",\n \"function reset() { \\n passwordLength = 0;\\n specialCharacters = false;\\n numbers = false;\\n uppercase = false;\\n lowercase = false;\\n validInput = false;\\n }\",\n \"function wrongPass() {\\n const alert = document.createElement(\\\"ion-alert\\\");\\n alert.cssClass = \\\"my-custom-class\\\";\\n alert.header = \\\"Error\\\";\\n alert.message = \\\"Wrong Password\\\";\\n alert.buttons = [\\\"OK\\\"];\\n\\n //console.log(\\\"wrong password alert!\\\");\\n document.body.appendChild(alert);\\n return alert.present();\\n}\",\n \"function displayPasswordValidationResults(result) {\\n if (result['password-compare']) {\\n $(\\\"#password-input\\\").addClass(\\\"is-valid\\\");\\n $(\\\"#password-confirm\\\").addClass(\\\"is-valid\\\");\\n\\n $(\\\"#password-input-hint\\\").addClass(\\\"valid-feedback\\\");\\n $(\\\"#password-confirm-hint\\\").addClass(\\\"valid-feedback\\\");\\n $(\\\"#password-input-hint\\\").text(\\\"Passwords Match\\\");\\n $(\\\"#password-confirm-hint\\\").text(\\\"Passwords Match\\\");\\n }\\n else {\\n if (result['password'] && result['password-confirm']) {\\n //both passwords filled out, don't match\\n $(\\\"#password-input\\\").addClass(\\\"is-invalid\\\");\\n $(\\\"#password-confirm\\\").addClass(\\\"is-invalid\\\");\\n\\n $(\\\"#password-input-hint\\\").addClass(\\\"invalid-feedback\\\");\\n $(\\\"#password-confirm-hint\\\").addClass(\\\"invalid-feedback\\\");\\n $(\\\"#password-input-hint\\\").text(\\\"Passwords Dont Match\\\");\\n $(\\\"#password-confirm-hint\\\").text(\\\"Passwords Dont Match\\\");\\n }\\n else if (result['password'] && !result['password-confirm']) {\\n //password is only filled out\\n $(\\\"#password-confirm\\\").addClass(\\\"is-invalid\\\");\\n\\n $(\\\"#password-confirm-hint\\\").addClass(\\\"invalid-feedback\\\");\\n $(\\\"#password-confirm-hint\\\").text(\\\"Required\\\");\\n }\\n else if (!result['password'] && result['password-confirm']) {\\n //password-confirm is only filled out\\n $(\\\"#password-input\\\").addClass(\\\"is-invalid\\\");\\n\\n $(\\\"#password-input-hint\\\").addClass(\\\"invalid-feedback\\\");\\n $(\\\"#password-input-hint\\\").text(\\\"Required\\\");\\n }\\n else if (!result['password'] && !result['password-confirm']) {\\n //neither password inputs are filled out\\n $(\\\"#password-input\\\").addClass(\\\"is-invalid\\\");\\n $(\\\"#password-confirm\\\").addClass(\\\"is-invalid\\\");\\n\\n $(\\\"#password-input-hint\\\").addClass(\\\"invalid-feedback\\\");\\n $(\\\"#password-confirm-hint\\\").addClass(\\\"invalid-feedback\\\");\\n $(\\\"#password-input-hint\\\").text(\\\"Required\\\");\\n $(\\\"#password-confirm-hint\\\").text(\\\"Required\\\");\\n }\\n }\\n}\",\n \"function managePasswordForgotten() {\\n\\t$('#passwordReset').click(function() { \\n\\t\\t// We must reset the document and send a link to the registered email\\n\\t\\t// to a form where the end user can update the password\\n\\t\\tclearDocument();\\n\\t\\tloadHTML(\\\"navbar.html\\\");\\n\\t\\tnavbarHover();\\n\\t\\t$(document.body).append(\\\"Please fill in the following form ! \\\");\\n\\t\\tloadHTML(\\\"passwordForgotten.html\\\");\\n\\t\\tloadJS(\\\"js/forms.js\\\");\\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\\n loadHTML(\\\"footer.html\\\");\\n\\t});\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7208443","0.67232597","0.66359365","0.6481082","0.63776284","0.6299833","0.6272654","0.6238553","0.6217429","0.6184245","0.6180472","0.61693394","0.616361","0.6160195","0.6153026","0.61497974","0.6142995","0.61199033","0.6092971","0.6071315","0.6041526","0.60285306","0.6013855","0.5997027","0.5967606","0.59460497","0.5941902","0.5940685","0.59352607","0.5927691","0.5917648","0.59152555","0.59104127","0.58967966","0.5872615","0.5868968","0.5849983","0.58251864","0.58185446","0.57992864","0.5788226","0.5775835","0.5771358","0.5757017","0.57553804","0.5737938","0.5710418","0.5706936","0.57056355","0.57050556","0.56794727","0.56792736","0.56754017","0.566817","0.56485087","0.56427467","0.56369865","0.56277823","0.5622724","0.56148964","0.56116045","0.5609203","0.5602478","0.5595907","0.5590742","0.5587902","0.5586226","0.5584206","0.55834776","0.5571535","0.5570636","0.55490434","0.55470383","0.5543538","0.5542204","0.55387884","0.55368274","0.5526183","0.55204177","0.55171484","0.5513299","0.54926926","0.5491053","0.54883015","0.5484335","0.547961","0.5471295","0.54604393","0.545983","0.54578","0.54558396","0.5451013","0.54459983","0.54407465","0.5436931","0.54343754","0.5433646","0.5420389","0.5418546","0.54154915"],"string":"[\n \"0.7208443\",\n \"0.67232597\",\n \"0.66359365\",\n \"0.6481082\",\n \"0.63776284\",\n \"0.6299833\",\n \"0.6272654\",\n \"0.6238553\",\n \"0.6217429\",\n \"0.6184245\",\n \"0.6180472\",\n \"0.61693394\",\n \"0.616361\",\n \"0.6160195\",\n \"0.6153026\",\n \"0.61497974\",\n \"0.6142995\",\n \"0.61199033\",\n \"0.6092971\",\n \"0.6071315\",\n \"0.6041526\",\n \"0.60285306\",\n \"0.6013855\",\n \"0.5997027\",\n \"0.5967606\",\n \"0.59460497\",\n \"0.5941902\",\n \"0.5940685\",\n \"0.59352607\",\n \"0.5927691\",\n \"0.5917648\",\n \"0.59152555\",\n \"0.59104127\",\n \"0.58967966\",\n \"0.5872615\",\n \"0.5868968\",\n \"0.5849983\",\n \"0.58251864\",\n \"0.58185446\",\n \"0.57992864\",\n \"0.5788226\",\n \"0.5775835\",\n \"0.5771358\",\n \"0.5757017\",\n \"0.57553804\",\n \"0.5737938\",\n \"0.5710418\",\n \"0.5706936\",\n \"0.57056355\",\n \"0.57050556\",\n \"0.56794727\",\n \"0.56792736\",\n \"0.56754017\",\n \"0.566817\",\n \"0.56485087\",\n \"0.56427467\",\n \"0.56369865\",\n \"0.56277823\",\n \"0.5622724\",\n \"0.56148964\",\n \"0.56116045\",\n \"0.5609203\",\n \"0.5602478\",\n \"0.5595907\",\n \"0.5590742\",\n \"0.5587902\",\n \"0.5586226\",\n \"0.5584206\",\n \"0.55834776\",\n \"0.5571535\",\n \"0.5570636\",\n \"0.55490434\",\n \"0.55470383\",\n \"0.5543538\",\n \"0.5542204\",\n \"0.55387884\",\n \"0.55368274\",\n \"0.5526183\",\n \"0.55204177\",\n \"0.55171484\",\n \"0.5513299\",\n \"0.54926926\",\n \"0.5491053\",\n \"0.54883015\",\n \"0.5484335\",\n \"0.547961\",\n \"0.5471295\",\n \"0.54604393\",\n \"0.545983\",\n \"0.54578\",\n \"0.54558396\",\n \"0.5451013\",\n \"0.54459983\",\n \"0.54407465\",\n \"0.5436931\",\n \"0.54343754\",\n \"0.5433646\",\n \"0.5420389\",\n \"0.5418546\",\n \"0.54154915\"\n]"},"document_score":{"kind":"string","value":"0.6236474"},"document_rank":{"kind":"string","value":"8"}}},{"rowIdx":563,"cells":{"query":{"kind":"string","value":"helper function to display reset password form"},"document":{"kind":"string","value":"function ResetCard({ email, onPasswordChange, submitForm, errorCode}) {\r\n return (\r\n \r\n \r\n Resetting Password for: \r\n {email}
\r\n \r\n \r\n {errorCode !== '' && { } }\r\n \r\n \r\n \r\n \r\n \r\n \r\n Save\r\n \r\n \r\n
\r\n \r\n \r\n Don't have an account yet? Sign up!
\r\n \r\n
\r\n \r\n \r\n \r\n );\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["async resetPassword({ view, params, antl }) {\n return view.render('user.password', {\n token: params.token,\n key: params.key,\n action: 'UserController.storeResetPassword',\n header_msg: antl.formatMessage('main.change_password'),\n button_msg: antl.formatMessage('main.change_password'),\n })\n }","function resetPassword(req, res) {\n res.render(\"resetPassword\");\n}","function printResetPassword(token) {\n const main = document.getElementById(\"main\");\n main.innerHTML = `\n
\n
Reset password \n \n \n
`;\n // when the user submits the form we call the function resetPassword()\n document.getElementById(\"reset\").addEventListener('submit', function(e) {\n e.preventDefault();\n resetPassword(token);\n })\n}","function showIncorrectPasswordPage() {\n\n // Retrieve all password elements.\n var passwordInputForm = document.getElementById(\"passwordInputForm\");\n var passwordInputLabel = document.getElementById(\"passwordInputLabel\");\n var scenarios = document.getElementById(\"scenarios\");\n\n passwordInputLabel.innerHTML = \"Enter password\";\n passwordInputForm.className = \"item shown\";\n passwordSubmitButton.className = \"item shown\";\n\n scenarios.className = \"options hide\";\n document.getElementById(\"scenariosLabel\").innerHTML = \"\";\n\n showStartupErrorMessage(\"Incorrect password\");\n }","function forgotPasswordPage(req, res) {\n res.render('forgotPassword')\n}","function onPasswordSet() {\n // Back to main form\n hide(pwSetForm);\n show(mainForm);\n\n // Password was just set, so generate right away if\n // site is filled in.\n if (mainForm.siteHost.value) {\n generatePassword();\n } else {\n // If the site has not been filled in, focus it.\n mainForm.siteHost.focus();\n }\n }","function managePasswordForgotten() {\n\t$('#passwordReset').click(function() { \n\t\t// We must reset the document and send a link to the registered email\n\t\t// to a form where the end user can update the password\n\t\tclearDocument();\n\t\tloadHTML(\"navbar.html\");\n\t\tnavbarHover();\n\t\t$(document.body).append(\"Please fill in the following form ! \");\n\t\tloadHTML(\"passwordForgotten.html\");\n\t\tloadJS(\"js/forms.js\");\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\n loadHTML(\"footer.html\");\n\t});\n}","function handlePasswordResetPage(req, res) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: false\n });\n}","function forgetPassword(req, res) {\n res.render(\"forgetPassword\");\n}","function showForgotPassword() {\n document.getElementById(\"newAccount\").style.display=\"none\";\n document.getElementById(\"login\").style.display=\"none\";\n document.getElementById(\"forgotPassword\").style.display=\"block\";\n document.getElementById(\"forgotUsername\").value=\"\";\n}","function reset_password_form() {\n\t// Encode the String\n\tvar encoded_string = Base64.encode('login/reset_password/');\n\tvar encoded_val = encoded_string.strtr(encode_chars_obj);\n\t\n\tvar encoded_login_string = Base64.encode('login/index/');\n\tvar encoded_login_val = encoded_login_string.strtr(encode_chars_obj);\n\t\n\tvar success_msg = 'Successful';\n\tvar failure_msg = 'Failed';\n\t\n\tvar ajaxData = $(\"#resetForm\").serialize();\t\n\t\t$.ajax({\n\t\turl: base_url + encoded_val,\n\t\tdataType: \"json\",\n\t\ttype: \"post\",\n\t\tdata: ajaxData,\t\n\t\tbeforeSend: function() {\n $('.uni_wrapper').addClass('loadingDiv');\t\t\n },\t\t\n\t\tsuccess: function(response) {\n\t\t $('.uni_wrapper').removeClass('loadingDiv');\n\t\t\tif(true == response.status)\n\t\t\t{\t\t\t\t\n\t\t\t\t$(\".error-message .alert\").removeClass('alert-danger');\n\t\t\t\t$(\".error-message .alert\").addClass('alert-success');\n\t\t\t\t$(\".error-message\").show();\n\t\t\t\tif(response.message)\n\t\t\t\t{\n\t\t\t\t\tsuccess_msg = response.message;\n\t\t\t\t}\n\t\t\t\t$(\".alert\").html(success_msg);\n\t\t\t\tsetTimeout(function(){\t\t\t\t\t\t \n\t\t\t\t window.location.href = base_url + encoded_login_val;\t\t\t\t\t\t \n\t\t\t\t}, 500);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(\".error-message\").show();\n\t\t\t\tif(response.message)\n\t\t\t\t{\n\t\t\t\t\tfailure_msg = response.message;\n\t\t\t\t}\n\t\t\t\t$(\".alert\").html(failure_msg);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t});\t\n}","showPassword(e) {\n\t\tif(e){\n\t\t\tvar x = document.getElementById(\"exampleInputPassword1\");\n\t\t if (x.type === \"password\") {\n\t\t x.type = \"text\";\n\t\t } else {\n\t\t x.type = \"password\";\n\t\t }\n\t\t}\n\t}","function displayPassword() {\n document.querySelector(\"#generate\").blur(); // remove button focus so it doesn't hang there after password is displayed.\n document.querySelector(\"#passwordBox\").value = generatePassword(); // call generate function and place returned value into HTML \n}","function resetChangePass(massage = \"\") {\n $(\"#successMassage\").html(massage);\n $(\"#verifyMassage\").html(\"\");\n $(\"#confirmMassage\").html(\"\");\n $('#currentPassword').val(\"\");\n $('#newPassword').val(\"\");\n $('#confirmPassword').val(\"\");\n}","function postResetPassword(data, textStatus, jqXHR, param) {\n\tvar user = param.user;\n\tvar uiDiv = $('#ui');\n\tuiDiv.html('');\n\tvar p = $('');\n\tuiDiv.append(p);\n\tp.html('The password for \"' + user + '\" has been reset.');\n\tvar ul = $('
');\n\tuiDiv.append(ul);\n\tvar li = $('');\n\tul.append(li);\n\tli.html('New password: \"' + data[user] + '\"');\n}","function forgotPasswordEnterDetails(){\n formLogin.removeClass('is-selected');\n formSignup.removeClass('is-selected');\n formForgotPassword.removeClass('is-selected');\n formForgotPasswordDetailsSignup.removeClass('is-selected'); \n formEnterDetailsOTP.removeClass('is-selected');\n\t\tformEnterLoginDetailsToSignUp.removeClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n }","function showPasswordRecovery() {\n const form = document.getElementById(\"forgot-password\");\n form.querySelector(\"span\").classList.toggle(\"hidden\");\n}","function password_validation(){\n\n if(!checkResetPasswordEmail()) {\n return false;\n } else {\n document.getElementById('get_password').value = \"Sending...\";\n return true;\n }\n}","forgotPass() \n {\n \tAlert.alert(\n\t\t 'Go To Site',\n\t\t 'Pressing this button would help you restore your password (external source)',\n\t\t [\n\t\t {text: 'OK', onPress: () => console.log('OK Pressed')},\n\t\t ],\n\t\t {cancelable: false},\n\t\t);\n }","function showChangePasswordDialog(passwordResetToken) {\n\tvar errorCallback = function(error, data) {\n\n\t\t// Special case when old password did not match\n\t\tif(!passwordResetToken && !error && data && data[\"resultCode\"] === \"NOT_FOUND\") {\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#wrong-password\");\n\t\t} else {\n\t\t\tconsole.error(error, data);\n\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-change-failed\")\n\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\tif(passwordResetToken) {\n\t\t\t\t\t\tdoNavigate(\"/home.html\");\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t;\n\t\t}\n\t};\n\tvar changeDispatcher = tp.dialogs.showDialog(\"changePasswordDialog\", tp.lang.getText(passwordResetToken ? \"password-change\" : \"change-password\"));\n\tif(!passwordResetToken) {\n\t\td3.select(\".password-old\").classed(\"hidden\", false);\n\t}\n\tchangeDispatcher\n\t\t.on(\"ok\", function() {\n\t\t\tvar oldPasswordElement = d3.select(\"input[name=password-old]\");\n\t\t\tvar oldPassword = oldPasswordElement.property(\"value\");\n\t\t\tvar newPasswordElement = d3.select(\"input[name=password-new]\");\n\t\t\tvar newPassword = newPasswordElement.property(\"value\");\n\t\t\tvar verifyPassword = d3.select(\"input[name=password-verify]\").property(\"value\");\n\t\t\tif(!passwordResetToken) {\n\t\t\t\tif(tp.util.isEmpty(oldPassword) || oldPassword.length < 6) {\n\t\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\t\toldPasswordElement.node().select();\n\t\t\t\t\t\t})\n\t\t\t\t\t;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tp.util.isEmpty(newPassword) || newPassword.length < 6) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#password-too-short\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tnewPasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(newPassword !== verifyPassword) {\n\t\t\t\ttp.dialogs.showDialog(\"errorDialog\", \"#passwords-different\")\n\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\tnewPasswordElement.node().select();\n\t\t\t\t\t})\n\t\t\t\t;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(passwordResetToken) {\n\t\t\t\ttp.session.resetPassword(passwordResetToken, newPassword, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\terrorCallback(error, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.dialogs.showDialog(\"messageDialog\", \"#password-reset-change-successful\")\n\t\t\t\t\t\t\t.on(\"ok\", function() {\n\t\t\t\t\t\t\t\tdoNavigate(\"/home.html?signin=true\");\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttp.session.changePassword(oldPassword, newPassword, function(error, data) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\terrorCallback(error, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \"messageDialog\", \"#password-change-successful\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn false;\n\t\t})\n\t\t.on(\"cancel\", function() {\n\t\t\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \"messageDialog\", \"#password-no-change\");\n\t\t\treturn false;\n\t\t})\n\t;\n}","function getForgotPage(req, res) {\n res.render('forgot.ejs', {\n title: 'Forgot Password?',\n user: req.user,\n message: ''\n });\n}","function showPassword(displayPassword) {\n document.getElementById(\"password\").textContent = displayPassword;\n}","function generatePassword() {\n var pw = mainForm.master.value,\n sh = mainForm.siteHost.value;\n\n // Don't show error message until needed\n hide(mainForm.pwIncorrect);\n\n // Only generate if a master password has been entered\n if (pw !== '') {\n if (settings.rememberPassword) {\n verifyPassword(pw, correct => {\n if (!correct) {\n // Master password is incorrect so show a warning\n show(mainForm.pwIncorrect);\n mainForm.master.select();\n }\n });\n }\n\n // Only generate if a site has been entered\n if (sh !== '') {\n mainForm.pwResult.value = '';\n mainForm.pwResult.placeholder = 'Generating...';\n\n // Generate a password to use, regardless of correct password\n uniquify(pw, sh, unique => {\n mainForm.pwResult.value = unique;\n mainForm.pwResult.placeholder = '';\n mainForm.pwResult.select();\n }, settings);\n }\n }\n }","function resetpwRoute() {\n return \"/resetpw?username=\" + encodeURIComponent(user.username) + \"&schoolCode=\" + req.body.schoolCode + \"&school=\" + (user.school ? encodeURIComponent(user.school.name) : \"none\");\n }","function showPassword() {\n\tvar x = document.getElementById(\"password\");\n\tif (x.type === \"password\") {\n\t x.type = \"text\";\n\t} else {\n\t x.type = \"password\";\n\t}\n}","passwordReset() {\n Actions.passwordReset();\n }","function restorePassword(form, email) {\n\tvar emailValue = document.getElementById(email).value;\n\tvar auth = firebase.auth();\n\t\n\tauth.sendPasswordResetEmail(emailValue).then(function() {\n\t\t\tform.unbind().submit();\n\t\t}, function(error) {\n\t\t\t// console.log(error);\n\t\t\taddHidden(form, 'error', error.code);\n\t form.unbind().submit();\n\t\t});\n}","function retrieveForgotPassword() {\n var userData = {};\n angular.copy(vm.misc.forgotPassword, userData);\n cmnSvc.resetForm(scope.forgotPasswordForm, vm.misc.authData);\n fbaseSvc.resetForgetPassword(userData.emailAdd).then(function(rs){\n alert(rs);\n }, function(err){\n alert('Error! '+err);\n });\n }","function showForgotPassword(){\n //position the forget password dialog in the middle\n var heighthtml = $('html').height()/2;\n var heightforget = $('#forget_password_dialog').height()/2;\n var widthhtml = $('html').width()/2;\n var widthforget = $('#forget_password_dialog').width()/2;\n $('#forget_password_dialog').css(\"top\", \"\" + (heighthtml - heightforget) + \"px\");\n $('#forget_password_dialog').css(\"left\", \"\" + (widthhtml - widthforget) + \"px\");\n $('#forget_password_dialog_success').css('display', 'none');\n $('#forget_password_dialog_error').css('display', 'none');\n $('#forget_password_dialog_body').css('display', 'block');\n $('#loginregister').fadeOut('normal', function(){\n $('#forget_password_dialog').fadeIn('normal');\n });\n}","function showPassword(password) {\n $(\"input\").prev(\"p\").show(200);\n $(\"input:hidden\").show(200);\n $(\"#result\").val(password);\n}","function resetPasswordSuccess() {\n var $formState = $('.reset-password-success');\n\n // check if reset password form was successfully submited.\n if (!$formState.length) {\n return;\n }\n\n // show success message\n $('#ResetSuccess').removeClass('hide');\n }","function toggleRecoverPasswordForm() {\n $('#RecoverPasswordForm').toggleClass('hide');\n $('#CustomerLoginForm').toggleClass('hide');\n }","function toggleRecoverPasswordForm() {\n $('#RecoverPasswordForm').toggleClass('hide');\n $('#CustomerLoginForm').toggleClass('hide');\n }","_sendPasswordReset(user, password) {\n return this.mailer.reset({email: user.email, password: password})\n }","function checkValidResetFormPassword() {\n let isValid = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\s).{8,}$/.test(\n ResetForm.elements[\"password-reset\"].value\n );\n\n if (!isValid) {\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\n \".error-message\"\n );\n if (errMes) return;\n\n let p = document.createElement(\"p\");\n p.classList.add(\"error-message\");\n\n let img = document.createElement(\"img\");\n img.src = \"./images/popup/exclamation.svg\";\n img.alt = \"icon\";\n\n let span = document.createElement(\"span\");\n span.innerText =\n \"Mật khẩu yêu cầu tối thiểu tám ký tự, ít nhất một chữ cái viết hoa, một chữ cái viết thường, một số và một ký tự đặc biệt\";\n\n p.appendChild(img);\n p.appendChild(span);\n\n ResetFormPassword.parentElement.parentElement.appendChild(p);\n ResetFormError.push(\"error\");\n } else {\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\n \".error-message\"\n );\n if (!errMes) return;\n\n ResetFormPassword.parentElement.parentElement.removeChild(errMes);\n ResetFormError.pop();\n }\n}","show_prompt( text, type ) {\n\t\tif ( 'password' === type ) {\n\t\t\t$( '#passwordField' ).val( '' );\n\t\t\t$( '#passwordArea' ).show();\n\t\t\t$( '#passwordField' ).focus();\n\t\t}\n\t}","function forgotPasswordEnterDetailsSignup(){\n formLogin.removeClass('is-selected');\n formSignup.removeClass('is-selected');\n formForgotPassword.removeClass('is-selected');\n formForgotPasswordDetailsSignup.addClass('is-selected'); \n formEnterDetailsOTP.removeClass('is-selected');\n formEnterLoginDetailsToSignUp.removeClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n }","function showForgotPasswordDIV() {\r\n\tdocument.getElementById('forgotPwd').style.display=\"block\";\r\n}","function buildPasswordResetView(){\n\tpasswordResetWindow = Ti.UI.createWindow({\n\t\tbackgroundColor:UI_BACKGROUND_COLOR,\n\t\tmodal:true,\n\t\ttranslucent:false,\n\t\tbarImage:iOS7 ? IMAGE_PATH+'common/bar7.png' : IMAGE_PATH+'common/bar.png',\n\t\tbarColor:UI_COLOR,\n\t\ttitle:'Password Reset'\n\t});\n\t\n\t//check if version is ios 7 and higher and create new navigationWindow (3.1.3.GA)\n\t//if(iOS7){\n\t\tpasswordResetNavWin = Ti.UI.iOS.createNavigationWindow({\n\t\t modal: true,\n\t\t window: passwordResetWindow\n\t\t});\n\t//}\n\t\n\tvar passwordResetDoneButton = Titanium.UI.createButton({\n\t\tbackgroundImage:IMAGE_PATH+'common/Done_button.png',\n\t width:48,\n\t height:33\n\t});\n\tpasswordResetWindow.setRightNavButton(passwordResetDoneButton);\n\t\n\tpasswordResetDoneButton.addEventListener('click', function(e){\n\t\t//if(iOS7){\n\t\t\tpasswordResetNavWin.close();\n\t\t//}else{\n\t\t//\tpasswordResetWindow.close();\n\t\t//}\n\t});\n\t\n\tvar passwordResetDogsquareLogo = Ti.UI.createImageView({\n\t\timage:IMAGE_PATH+'signup/dogsquare_logo.png',\n\t\ttop:10\n\t});\n\tpasswordResetWindow.add(passwordResetDogsquareLogo);\n\t\n\tvar passwordResetFormBackground = Ti.UI.createView({\n\t\tbackgroundColor:'e7e6e6',\n\t\ttop:70,\n\t\twidth:262,\n\t\theight:42\n\t});\n\t\n\t//email textfield\n\tpasswordResetFieldEmail = Ti.UI.createTextField({\n\t\twidth:262,\n\t\theight:39,\n\t\tpaddingLeft:4, \n\t\tpaddingRight:4,\n\t\ttop:1,\n\t\tkeyboardType:Ti.UI.KEYBOARD_EMAIL\n\t});\n\tpasswordResetFormBackground.add(passwordResetFieldEmail);\n\tpasswordResetFieldEmail.addEventListener('change', handlePasswordResetTextFieldChange);\n\t\n\tpasswordResetFieldEmailHintTextLabel = Ti.UI.createLabel({\n\t\ttext:'Your Email',\n\t\tcolor:'999999',\n\t\ttextAlign:'left',\n\t\tleft:4,\n\t\topacity:0.7,\n\t\theight:30,\n\t\tfont:{fontSize:17, fontWeight:'regular', fontFamily:'Open Sans'}\n\t});\n\tpasswordResetFieldEmail.add(passwordResetFieldEmailHintTextLabel);\n\t\n\tvar passwordResetSepparator = Ti.UI.createView({\n\t\tbackgroundColor:'CCCCCC',\n\t\twidth:262,\n\t\theight:2,\n\t\ttop:40,\n\t\topacity:0.4\n\t});\n\tpasswordResetFormBackground.add(passwordResetSepparator);\n\t\t\n\tpasswordResetWindow.add(passwordResetFormBackground);\n\t\n\t//button to change password\n\tvar passwordResetButton = Ti.UI.createButton({\n\t\tbackgroundImage:IMAGE_PATH+'common/reset_btn.png',\n\t\twidth:270,\n\t\theight:55,\n\t\ttop:123,\n\t\tbottom:30\n\t});\n\tpasswordResetWindow.add(passwordResetButton);\n\tpasswordResetButton.addEventListener('click', handlePasswordResetButton);\n}","function showPass() {\n if($scope.checkPass)\n $scope.typeInputPass = 'text';\n else\n $scope.typeInputPass = 'password';\n }","function password(){\n\t\t\n\t\t\tvar a = document.getElementById(\"pwd1\").value;\n\t\t\tif(a.length <= 8 ){\n\t\t\t\tdocument.getElementById(\"pwd1Hint\").style.display ='block';\n\t\t\t\n\t\t\t}\n\t\t\tif(a.length >= 8){\n\t\t\t\tdocument.getElementById(\"pwd1Hint\").style.display ='none';\n\t\t\t}\n\t\t\n\t\t\t\n\t\t\t\n\t}","function showPassword(text){\n xapi.command(\"UserInterface Message TextInput Display\", {\n InputType: KEYBOARD_TYPES.PIN\n , Placeholder: \"Meeting Password (numeric)\"\n , Title: \"Meeting Password\"\n , Text: text\n , SubmitText: \"Next\"\n , FeedbackId: DIALPAD_PASSWORD\n } ).catch((error) => { console.error(error); });\n}","function reset() {\n password = \"\";\n charactersToUse = \"\";\n lengthofPW = 0;\n\n\n\n}","function onReset() {\n\tdocument.getElementById('username').value = \"\";\n\tdocument.getElementById('password').value = \"\";\n\tdocument.getElementById('email').value = \"\";\n\tdocument.getElementById('result').innerHTML = \"\";\n\tflagUsername = false;\n\tflagPassword = false;\n\tflagEmail = false;\n}","function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }","function toggleResetPswd(e){\n e.preventDefault();\n $('#logreg-forms .form-signin').toggle() // display:block or none\n $('#logreg-forms .form-reset').toggle() // display:block or none\n}","function checkPassword(form) {\r\n if (form.passwordForm.value == \"\") {\r\n document.getElementById(\"noPassword\").style.display = 'inline-block';\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}","function forgotPassword() { \n\n\t\t\t$( \"#load\" ).show();\n\t\t\t\n\t\t\tvar form = new FormData(document.getElementById('reset_form'));\n\t\t\t\n\t\t\tvar validate_url = $('#reset_form').attr('action');\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: validate_url,\n\t\t\t\t//data: dataString,\n\t\t\t\tdata: form,\n\t\t\t\t//dataType: \"json\",\n\t\t\t\tcache : false,\n\t\t\t\tcontentType: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tsuccess: function(data){\n\n\t\t\t\t\t\n\t\t\t\t\tif(data.success == true ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"input\").val('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".forgot-password-box\").html(data.notif);\n\t\n\t\t\t\t\t\tsetTimeout(function() { \n\t\t\t\t\t\t\t//$(\"#notif\").slideUp({ opacity: \"hide\" }, \"slow\");\n\t\t\t\t\t\t\t//window.location.reload(true);\n\t\t\t\t\t\t}, 2000); \n\n\t\t\t\t\t}else if(data.success == false){\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"#notif\").html(data.notif);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t},error: function(xhr, status, error) {\n\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn false;\n\t\t}","function postResetPassword() {\n const validatePasswords = validatePasswordMatch(password, confirmPassword);\n if (validatePasswords !== true) {\n setSubmitResult(validatePasswords);\n setIsError(true);\n return;\n }\n setIsLoading(true);\n setIsError(false);\n axios.post(process.env.REACT_APP_API_LINK + \"/password/reset\", {\n \"email\": data.email,\n token,\n password\n }).then(result => {\n setIsLoading(false);\n if (result.status === 200) {\n setIsSuccess(true);\n data.onCloseModal();\n alert(\"Password Reset Successful!\")\n } else {\n setSubmitResult(\"An error has occurred, please contact an administrator.\")\n setIsError(true);\n }\n }).catch(e => {\n setIsLoading(false);\n setSubmitResult(e.response.data.error);\n setIsError(true);\n });\n }","function resetPasswordSuccess() {\n // check if reset password form was successfully submited\n if (!$('.reset-password-success').length) {\n return;\n }\n\n // show success message\n $('#ResetSuccess').removeClass('hide');\n }","function ChangePassword() {\n\t}","function showPassword() {\n let button = document.getElementById('show-button');\n let password_field = document.getElementById('passwd');\n\n // If currently showing the password\n if (password_field.type == 'text') {\n password_field.type = 'password';\n button.innerHTML = 'Show';\n }\n else {\n password_field.type = 'text';\n button.innerHTML = 'Hide';\n }\n}","recoverPassword({ Bert }, { email }) {\n // Call forgot password procedure\n Accounts.forgotPassword({\n email,\n }, (error) => {\n if (error) {\n Bert.alert(error.reason, 'warning');\n } else {\n Bert.alert('Check your inbox for a reset link!', 'success');\n }\n });\n }","function pwEvent() {\r\n if (validPW()) {\r\n $password.next().hide(); //next searches through immediate following siblings\r\n } else {\r\n $password.next().show();\r\n }\r\n}","function resetPassword() {\n\t\t\tif (vm.newPassword != \"\" && vm.newPassword == vm.confirmPassword) {\n\t\t\t\tvm.waiting = true;\n\t\t\t\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\n\t\t\t\t\tvm.success = 1;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t}, function(res) {\n\t\t\t\t\tvm.success = 0;\n\t\t\t\t\tvm.waiting = false;\n\t\t\t\t\t$rootScope.$broadcast('loading', false); // TODO (HACK)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgui.alertError(\"Passwords do not match.\");\n\t\t\t}\n\t\t}","function reset() { \n passwordLength = 0;\n specialCharacters = false;\n numbers = false;\n uppercase = false;\n lowercase = false;\n validInput = false;\n }","function showpassword() {\n\tvar x = document.getElementsByName(\"pass\");\n\tfor (var i = 0; i <= x.length; i++) {\n\t\tif (x[i].type === \"password\") {\n\t\t\tx[i].type = \"text\";\n\t\t} else {\n\t\t\tx[i].type = \"password\";\n\t\t}\n\t}\n}","function forgotPassword(method,type) {\n hideError('email');\n addFunActionLabel=\"Forgot Pasword Submit\";\n if(pageType=='not_login'){\n var email = $.trim($(\"#TenTimes-Modal #userEmailCopy\").val()); \n }else{\n var email = $.trim($(\"#TenTimes-Modal #userEmail\").val());\n }\n if(!validateEmail12345(email)){\n $(\".alert_email\").show();\n return 0;\n }\n var otpType='password';\n if(type=='N' || type=='U'){\n otpType='otp';\n }\n\n if(method == \"connect\")\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\n else\n var postData = {'email':email, 'name' : email , 'type' : otpType }\n showloading();\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\n hideloading();\n response=$.parseJSON(response);\n var resText=response.resText;\n var resLink=response.resLink;\n if(type=='N' || type=='U'){\n resText=response.resText_typeN;\n resLink=response.resLink_typeN;\n \n }\n \n switch(response.response) {\n case 'true':\n $('#getpassword').parent().replaceWith(function() { return \"\" + \"\" + resText + \"
\"+$('#getpassword').get(0).outerHTML+\" \"; });\n\n $('#getpassword').text(resLink);\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\n $('#TenTimes-Modal .partial-log').hide();\n $('#getpassword').removeAttr(\"onclick\").click(function() {\n partialLog(method,type)\n }).text(resLink).css('color','#335aa1');\n }\n break;\n case 'false':\n $(\".alert_email\").html(\"Sorry, 10times doesn't recognize that email.\");\n $(\".alert_email\").show();\n break;\n }\n }); \n}","function getForgotPasswordUI() {\n fetch('/api/forgotPassword', {\n method: 'GET'\n }).then(response => response.text())\n .then(res => {\n var mainBody = document.getElementById('main-body');\n mainBody.innerHTML = res;\n selectIcon('home');\n });\n}","function resetPassword(e) {\n e.preventDefault();\n\n axios\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\n security: questions,\n newPW: password,\n })\n .then((res) => {\n localStorage.setItem(\"token\", res.data);\n alert(\"Your password has been changed! Logging you in...\");\n router.push(\"/\");\n })\n .catch(() => {\n alert(\n \"Could not reset password! You likely had the wrong answers to the security questions\"\n );\n });\n }","function vpb_request_password_link()\n{\n\tvar ue_data = $(\"#ue_data\").val();\n\t\n\tif(ue_data == \"\")\n\t{\n\t\t$(\"#ue_data\").focus();\n\t\t$(\"#this_page_errors\").html(''+$(\"#empty_username_field\").val()+'
');\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $('#ue_data').offset().top-parseInt(200)+'px'\n\t\t}, 1600);\n\t\treturn false;\n\t} else {\n\t\tvar dataString = {'ue_data': ue_data, 'page':'reset-password-validation'};\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: vpb_site_url+'forget-password',\n\t\t\tdata: dataString,\n\t\t\tcache: false,\n\t\t\tbeforeSend: function() \n\t\t\t{\n\t\t\t\t$(\"#this_page_errors\").html('');\n\t\t\t\t$(\"#disable_or_enable_this_box\").removeClass('enable_this_box');\n\t\t\t\t$(\"#disable_or_enable_this_box\").addClass('disable_this_box');\n\t\t\t\t\n\t\t\t\t$(\"#forgot_password_buttoned\").hide();\n\t\t\t\t$(\"#log_in_status\").html(' ');\n\t\t\t},\n\t\t\tsuccess: function(response)\n\t\t\t{\n\t\t\t\t$(\"#disable_or_enable_this_box\").removeClass('disable_this_box');\n\t\t\t\t$(\"#disable_or_enable_this_box\").addClass('enable_this_box');\n\t\t\n\t\t\t\t$(\"#log_in_status\").html('');\n\t\t\t\t$(\"#forgot_password_buttoned\").show();\n\t\t\t\t\t\n\t\t\t\tvar response_brought = response.indexOf(\"processCompletedStatus\");\n\t\t\t\t$vlog=JSON.parse(response);\n\t\t\t\tif(response_brought != -1)\n\t\t\t\t{\n\t\t\t\t\tif($vlog.processCompletedStatus==true){\n $(\"#ue_data\").val('');\n $(\"#this_page_errors\").html($vlog.response);\n return false;\n\t\t\t\t\t}else{\n setTimeout(function() {\n \twindow.alert(\"To change the password you first need to verify the account by entering the verification code which was sent to your gmail account earlier while sign up in the 'Enter the verification code ... ' field to proceed.\");\n window.location.replace(vpb_site_url+'verification');\n },500);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(\"#this_page_errors\").html($vlog.response);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}","function getPassword() {\n if (hasTextEncoder) {\n document.getElementById('create_button').style.display = 'none';\n document.getElementById('passphrase').style.display = 'block';\n }\n else {\n setupKeys();\n }\n}","async passwordreset({ commit, dispatch }, form) {\n form.busy = true;\n try {\n await App.post(route(\"api.auth.reset-password\"), form).then(() => {\n commit(\"isAuthenticated\", {\n isAuthenticated: vm.$auth.check()\n });\n form.busy = false;\n });\n await dispatch(\"fetchMe\");\n } catch ({ errors, message }) {\n form.errors.set(errors);\n form.busy = false;\n }\n }","function showPasswordFn() {\n\tinputPassword.type = 'text';\n\twhile (hidePassword.classList.contains('hidePassword')) {\n\t\thidePassword.classList.remove('hidePassword');\n\t}\n\tshowPassword.classList.add('showPassword');\n}","function showPassword(el)\n{\n var input = document.createElement('input');\n input.id = el.id;\n input.name = el.name;\n input.value = el.value;\n input.className = el.className;\n if (el.type == 'text' )\n { input.type = 'password'; }\n else\n { input.type = 'text'; }\n el.parentNode.replaceChild(input, el);\n}","async forgotpasswordbtn () {\n await (await this.btnForgotPassword).click();\n }","function recoverPassword() {\n const email = document.getElementsByName(\"recover-email\").item(0);\n xhttp(\"POST\", \"forgot.php\", { email: email.value }, (response) => {\n // do nothing if it works or if it fails\n });\n const loginpage = document.getElementById(\"main\").querySelector(\"div.loginpage\");\n loginpage.innerHTML += 'If the email is in our database, an email will be sent shortly to recover your account
';\n return false;\n}","renderConfirmationForm() {\n return (\n \n );\n }","renderSuccess () {\n this.response.render('auth/password-changed', {\n title: 'Password Changed', returnToUrl: this.returnToUrl\n })\n }","function confirmPasswordReset (e) {\n e.preventDefault();\n showConfirmation(\"Are you sure you want to reset your password?\").then(function (confirmed) {\n if (confirmed) {\n sendResetPasswordEmail().then(function () {\n $(e.target).parent().html('Password Reset Email Sent.');\n });\n }\n }).catch(function (error) {\n showError(\"Response Error\", error);\n });\n}","function showRegister() {\n clearErrorMsg();\n showLinks(['loginLink']);\n showView('registerForm');\n}","function ForgetPasswd(){\n $('#fopasswordModel').modal();\n $('#fopasswordModel').on('shown.bs.modal',function() {\n $('#fopasswordForm').formValidation('resetForm', true);\n });\n}","function mdm_noecho(message) {\t\n\tmdm_enable();\t\t\n\t// message;\t\n\tdocument.getElementById(\"label\").innerHTML = 'pass';\n\tdocument.getElementById(\"entry\").value = \"\";\n\tdocument.getElementById(\"entry\").type = \"password\";\n\tdocument.getElementById(\"entry\").focus();\n}","resetPasswordInit(email) {\n return this.afAuth.auth.sendPasswordResetEmail(email, { url: 'https://coincoininsolite-1cf37.firebaseapp.com/__/auth/action' });\n }","function fnc_cancelar_cambiar_password() {\n\topen_form('/Home/frm_main', gc_group_window);\n}","async function requestResetPassword(formData) {\n const headers = {};\n attach_headers([HEADERS.CSRF], headers);\n const body = { user: formData };\n\n cleanupAuthState();\n dispatch({ type: LOADING_STARTED });\n const resp = await supervise_rq(() =>\n axios.post(API_PATHS.AUTH_UPDATE_PASSWORD, body, { headers })\n );\n\n if (resp.status === STATUS.SUCCESS) {\n dispatch({\n type: AUTH_ACTIONS.AUTH_REQUEST_RESET_PASSWORD,\n payload:\n \"If an account for the provided email exists, an email with reset instructions will be sent to you. Please check your inbox.\",\n });\n } else {\n dispatch({\n type: AUTH_ACTIONS.AUTH_ERROR,\n payload: \"Oops, something went wrong. Pleas try again later.\",\n });\n }\n }","function initReset() {\n\tnew JsNameFilter(\"userId\", \"nameInput\", window['g_basePath']);\n\t\n\tif ($(\"successM\").value != '') {\n\t\tMsgBox.message('重置密码成功');\n\t}\n\t\n\t$(\"successM\").value = '';\n\taddCustomCheck('reNewPW', getMessage('js.com.warning.0012'), 'mustsame', function(value) {\n\t\tif (value != $F('newPW')) return false;\n\t\treturn true;\n\t});\n}","resetFields() {\n this.passwordField.nextElementSibling.innerHTML = Config.EMPTY_STRING;\n this.passwordField.value = Config.EMPTY_STRING;\n }","function reset() {\n // Flag it to prevent double clicking, and visually communicate\n if ($scope.isSubmitting) {\n return;\n }\n\n $scope.isSubmitting = true;\n\n // Lets try to reset their password\n visitorApiService.resetPassword({\n key: $scope.key,\n password: $scope.visitor.password\n })\n .$promise.then(function(response) {\n // Unlock the submit button\n $scope.isSubmitting = false;\n\n if (response.error === null) {\n return response.result; // email\n } else {\n // Most common error is an expired key\n $scope.message = commonUtilService.getMessage(response);\n return $q.reject();\n }\n })\n .then(function(email) {\n\n // Log them in now\n return visitorApiService.login({\n email: email,\n password: $scope.visitor.password\n })\n .$promise.then(function(response) {\n if (response.error !== null) {\n $scope.message = commonUtilService.getMessage(response);\n return $q.reject();\n }\n });\n })\n .then(function() {\n // Request customer info\n return visitorLoginService.isLoggedIn(true);\n })\n .then(function() {\n // Get their cart info\n cartService.reload();\n })\n .then(function() {\n // Redirect them to their last page\n var path = angular.module(\"visitorModule\").back.path || '/account';\n $location.path(path);\n });\n\n }","createPasswordResetLink(token, user_id) {\n\t\treturn `${SiteUrl}/auth/password-reset/${token}/${user_id}`;\n\t}","function forgotPasswordSelected(){\n\t\tformLogin.removeClass('is-selected');\n\t\tformSignup.removeClass('is-selected');\n\t\tformEnterDetailsOTP.removeClass('is-selected');\n formForgotPasswordDetailsSignup.removeClass('is-selected');\n\t formEnterLoginDetailsToSignUp.removeClass('is-selected');\n\t\tformForgotPassword.addClass('is-selected');\n $('.cd-switcher').find('.selected').html(\"Forgot Password\");\n\n\t}","function forget_password(){\r\n localStorage.setItem(\"time\",\"1000\");\r\n localStorage.setItem(\"link\",\"password_reset.html\");\r\n window.open('loading.html',\"_self\");\r\n }","function togglePassword(obj, e) {\n\t\t\t\t//alert($(obj).html());\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\t\t\t\t//var upass = document.getElementsByClassName('upass');\n\t\t\t\tvar field = $(obj).parent().parent().find(\".togglePassword\");\n\t\t\t\tvar type = field.attr('type');\n\t\t\t\t\n\t\t\t\t//alert('Type: '+type+'; Val: '+field.val());\n\t\t\t\t\n\t\t\t\tif(type == \"password\"){\n\t\t\t\t\t//field.type = \"text\";\n\t\t\t\t\tfield.attr('type', 'text');\n\t\t\t\t\t$(obj).html(\"Hide\");\n\t\t\t\t} else {\n\t\t\t\t\t//field.type = \"password\";\n\t\t\t\t\t$(obj).html(\"Show\");\n\t\t\t\t\tfield.attr('type', 'password');\n\t\t\t\t}\n\t\t\t}","function showChangePassword(){\n resetSettingsForms();\n\n $('delete_account_btn').removeClassName('selected'); // remove clicked effect from delete account button\n $('delete_account').hide(); // hide delete account view\n\n $('change_password_btn').addClassName('selected'); // add clicked effect to change password button\n $('change_password').show(); // show change password view\n}","passwordreset(email) {\r\n return this.auth\r\n .sendPasswordResetEmail(email)\r\n .then(function () {\r\n alert(\"Email Sent!\");\r\n })\r\n .catch(function (error) {\r\n alert(\"An error occured. Please try again\");\r\n });\r\n }","function resALert() {\n alert(\"The form has been reset. Please try again.\");\n}","function showPaswrd() {\r\n const paswrd = document.getElementById('paswrd');\r\n if (paswrd.type === 'password') {\r\n paswrd.type = 'text';\r\n } else {\r\n paswrd.type = 'password';\r\n }\r\n}","function checkforgotpassword()\r\n\t{\r\n\t\tif(document.forgot.email.value==\"\")\r\n\t\t{\r\n\t\t\talert(lng_plsenteremailadd);\r\n\t\t\tdocument.forgot.email.focus();\r\n\t\t\tdocument.forgot.email.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!validate_email_forgot(document.forgot.email.value,lng_entervalidemail))\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.forgot.email.select();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}","resetPassword(actionCode, newPassword) {\n var accountEmail;\n let thisComponent = this;\n // Verify the password reset code is valid.\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\n var accountEmail = email;\n \n // TODO: Show the reset screen with the user's email and ask the user for\n // the new password.\n \n // Save the new password.\n auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {\n // Password reset has been confirmed and new password updated.\n \n // TODO: Display a link back to the app, or sign-in the user directly\n // if the page belongs to the same domain as the app:\n // auth.signInWithEmailAndPassword(accountEmail, newPassword);\n \n // TODO: If a continue URL is available, display a button which on\n // click redirects the user back to the app via continueUrl with\n // additional state determined from that URL's parameters.\n }).catch(function(error) {\n // Error occurred during confirmation. The code might have expired or the\n // password is too weak.\n });\n }).catch(function(error) {\n // Invalid or expired action code. Ask user to try to reset the password\n // again.\n }).then(function() {\n thisComponent.props.history.push('/signin'); // redirect to home page\n });\n }","function getPassowrd() {\n let eyeIconShow = document.getElementById('eye-icon-slash-1');\n eyeIconShow.style.display = 'block';\n eyeIconShow.classList = 'fas fa-eye';\n\n let changeType = document.getElementById('singup-pass');\n changeType.type = 'text';\n\n let chars = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM!@#$%^&*()_+=-[]{}><:';\n let password = '';\n\n for (let i = 0; i < 12; i++) {\n let r = Math.floor(Math.random() * chars.length);\n password += chars[r];\n }\n document.getElementById('singup-pass').value = password;\n}","function handlePasswordReset(req, res) {\n csrf.verify(req);\n\n if (!verifyReferrer(req, '/account/passwordreset')) {\n res.status(403).send('Mismatched referrer');\n return;\n }\n\n var name = req.body.name,\n email = req.body.email;\n\n if (typeof name !== \"string\" || typeof email !== \"string\") {\n res.send(400);\n return;\n }\n\n if (!$util.isValidUserName(name)) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Invalid username '\" + name + \"'\"\n });\n return;\n }\n\n db.users.getEmail(name, function (err, actualEmail) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n if (actualEmail === '') {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: `Username ${name} cannot be recovered because it ` +\n \"doesn't have an email address associated with it.\"\n });\n return;\n } else if (actualEmail.toLowerCase() !== email.trim().toLowerCase()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: \"Provided email does not match the email address on record for \" + name\n });\n return;\n }\n\n crypto.randomBytes(20, (err, bytes) => {\n if (err) {\n LOGGER.error(\n 'Could not generate random bytes for password reset: %s',\n err.stack\n );\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Internal error when generating password reset\"\n });\n return;\n }\n\n var hash = bytes.toString('hex');\n // 24-hour expiration\n var expire = Date.now() + 86400000;\n var ip = req.realIP;\n\n db.addPasswordReset({\n ip: ip,\n name: name,\n email: actualEmail,\n hash: hash,\n expire: expire\n }, function (err, _dbres) {\n if (err) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: \"\",\n resetErr: err\n });\n return;\n }\n\n Logger.eventlog.log(\"[account] \" + ip + \" requested password recovery for \" +\n name + \" <\" + email + \">\");\n\n if (!emailConfig.getPasswordReset().isEnabled()) {\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"This server does not have mail support enabled. Please \" +\n \"contact an administrator for assistance.\"\n });\n return;\n }\n\n const baseUrl = `${req.realProtocol}://${req.header(\"host\")}`;\n\n emailController.sendPasswordReset({\n username: name,\n address: email,\n url: `${baseUrl}/account/passwordrecover/${hash}`\n }).then(_result => {\n sendPug(res, \"account-passwordreset\", {\n reset: true,\n resetEmail: email,\n resetErr: false\n });\n }).catch(error => {\n LOGGER.error(\"Sending password reset email failed: %s\", error);\n sendPug(res, \"account-passwordreset\", {\n reset: false,\n resetEmail: email,\n resetErr: \"Sending reset email failed. Please contact an \" +\n \"administrator for assistance.\"\n });\n });\n });\n });\n });\n}","function hidePasswordInput() {\n\n // Retrieve all password elements.\n var passwordInputForm = document.getElementById(\"passwordInputForm\");\n var passwordInputLabel = document.getElementById(\"passwordInputLabel\");\n\n passwordInputLabel.innerHTML = \"\";\n passwordInputForm.className = \"item hide\";\n passwordSubmitButton.className = \"item hide\";\n }","function tooglePasswordFields(status, formPassword, formConfirmPassword) {\n if (status == USER_STATUS_ENABLED) {\n showElemById(formPassword);\n showElemById(formConfirmPassword);\n } else {\n hideElemById(formPassword);\n hideElemById(formConfirmPassword);\n }\n}","function processResetPasswordReturn (data, $message) {\n\n if (data.result === \"No\") {\n // If result returned no then something went wrong so build and display an\n // error message\n\n // Build HTML for error message\n var result = [\n '',\n '× ',\n '
Reset Password Error ',\n data.message,\n ''];\n\n // Output error message\n $message.html(result.join(''));\n\n } else {\n\n // Build HTML for success message\n var result = [\n '',\n '× ',\n 'Password successfully reset!',\n '
'];\n\n // Output error message\n $message.html(result.join(''));\n\n }\n\n}","function passwordsMismatched() {\n document.getElementById(\"passwordP\").style.display = \"visible\";\n}","_showPassword() {\n const that = this;\n\n if (that.disabled || !that.showPasswordIcon) {\n return;\n }\n\n that.$.input.type = 'text';\n that._passwordIconPressed = true;\n }","function hideIt(password) {\n return ''\n}","function showRegistrationPassword() \r\n{\r\n var x = document.getElementById(\"registerPassword\");\r\n\r\n if (x.type === \"password\") \r\n x.type = \"text\";\r\n else \r\n x.type = \"password\";\r\n}","function changePassword() {\n $rootScope.pwdModalTitle = '修改密码';\n $rootScope.pwdModal = $modal({\n scope: $rootScope,\n templateUrl: 'partials/modal.changePassword.html?' + new Date().getTime(),\n show: true,\n backdrop: false\n });\n }","function passDetails(){\n document.getElementById('vehicleRegistrationForm').style.display =\"none\";\n messageField.innerHTML = \"Choose Pass\";\n document.getElementById(\"passForm\").style.display=\"block\";\n document.getElementById(\"getPass\").style.display=\"block\";\n inputField = \"passChoice\";\n}"],"string":"[\n \"async resetPassword({ view, params, antl }) {\\n return view.render('user.password', {\\n token: params.token,\\n key: params.key,\\n action: 'UserController.storeResetPassword',\\n header_msg: antl.formatMessage('main.change_password'),\\n button_msg: antl.formatMessage('main.change_password'),\\n })\\n }\",\n \"function resetPassword(req, res) {\\n res.render(\\\"resetPassword\\\");\\n}\",\n \"function printResetPassword(token) {\\n const main = document.getElementById(\\\"main\\\");\\n main.innerHTML = `\\n
\\n
Reset password \\n \\n \\n
`;\\n // when the user submits the form we call the function resetPassword()\\n document.getElementById(\\\"reset\\\").addEventListener('submit', function(e) {\\n e.preventDefault();\\n resetPassword(token);\\n })\\n}\",\n \"function showIncorrectPasswordPage() {\\n\\n // Retrieve all password elements.\\n var passwordInputForm = document.getElementById(\\\"passwordInputForm\\\");\\n var passwordInputLabel = document.getElementById(\\\"passwordInputLabel\\\");\\n var scenarios = document.getElementById(\\\"scenarios\\\");\\n\\n passwordInputLabel.innerHTML = \\\"Enter password\\\";\\n passwordInputForm.className = \\\"item shown\\\";\\n passwordSubmitButton.className = \\\"item shown\\\";\\n\\n scenarios.className = \\\"options hide\\\";\\n document.getElementById(\\\"scenariosLabel\\\").innerHTML = \\\"\\\";\\n\\n showStartupErrorMessage(\\\"Incorrect password\\\");\\n }\",\n \"function forgotPasswordPage(req, res) {\\n res.render('forgotPassword')\\n}\",\n \"function onPasswordSet() {\\n // Back to main form\\n hide(pwSetForm);\\n show(mainForm);\\n\\n // Password was just set, so generate right away if\\n // site is filled in.\\n if (mainForm.siteHost.value) {\\n generatePassword();\\n } else {\\n // If the site has not been filled in, focus it.\\n mainForm.siteHost.focus();\\n }\\n }\",\n \"function managePasswordForgotten() {\\n\\t$('#passwordReset').click(function() { \\n\\t\\t// We must reset the document and send a link to the registered email\\n\\t\\t// to a form where the end user can update the password\\n\\t\\tclearDocument();\\n\\t\\tloadHTML(\\\"navbar.html\\\");\\n\\t\\tnavbarHover();\\n\\t\\t$(document.body).append(\\\"Please fill in the following form ! \\\");\\n\\t\\tloadHTML(\\\"passwordForgotten.html\\\");\\n\\t\\tloadJS(\\\"js/forms.js\\\");\\n formSubmission('#passwordForgotten','generatePasswordLnkRst','Reset email successfully sent','Unknown user');\\n loadHTML(\\\"footer.html\\\");\\n\\t});\\n}\",\n \"function handlePasswordResetPage(req, res) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: false\\n });\\n}\",\n \"function forgetPassword(req, res) {\\n res.render(\\\"forgetPassword\\\");\\n}\",\n \"function showForgotPassword() {\\n document.getElementById(\\\"newAccount\\\").style.display=\\\"none\\\";\\n document.getElementById(\\\"login\\\").style.display=\\\"none\\\";\\n document.getElementById(\\\"forgotPassword\\\").style.display=\\\"block\\\";\\n document.getElementById(\\\"forgotUsername\\\").value=\\\"\\\";\\n}\",\n \"function reset_password_form() {\\n\\t// Encode the String\\n\\tvar encoded_string = Base64.encode('login/reset_password/');\\n\\tvar encoded_val = encoded_string.strtr(encode_chars_obj);\\n\\t\\n\\tvar encoded_login_string = Base64.encode('login/index/');\\n\\tvar encoded_login_val = encoded_login_string.strtr(encode_chars_obj);\\n\\t\\n\\tvar success_msg = 'Successful';\\n\\tvar failure_msg = 'Failed';\\n\\t\\n\\tvar ajaxData = $(\\\"#resetForm\\\").serialize();\\t\\n\\t\\t$.ajax({\\n\\t\\turl: base_url + encoded_val,\\n\\t\\tdataType: \\\"json\\\",\\n\\t\\ttype: \\\"post\\\",\\n\\t\\tdata: ajaxData,\\t\\n\\t\\tbeforeSend: function() {\\n $('.uni_wrapper').addClass('loadingDiv');\\t\\t\\n },\\t\\t\\n\\t\\tsuccess: function(response) {\\n\\t\\t $('.uni_wrapper').removeClass('loadingDiv');\\n\\t\\t\\tif(true == response.status)\\n\\t\\t\\t{\\t\\t\\t\\t\\n\\t\\t\\t\\t$(\\\".error-message .alert\\\").removeClass('alert-danger');\\n\\t\\t\\t\\t$(\\\".error-message .alert\\\").addClass('alert-success');\\n\\t\\t\\t\\t$(\\\".error-message\\\").show();\\n\\t\\t\\t\\tif(response.message)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tsuccess_msg = response.message;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t$(\\\".alert\\\").html(success_msg);\\n\\t\\t\\t\\tsetTimeout(function(){\\t\\t\\t\\t\\t\\t \\n\\t\\t\\t\\t window.location.href = base_url + encoded_login_val;\\t\\t\\t\\t\\t\\t \\n\\t\\t\\t\\t}, 500);\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\t$(\\\".error-message\\\").show();\\n\\t\\t\\t\\tif(response.message)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tfailure_msg = response.message;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t$(\\\".alert\\\").html(failure_msg);\\n\\t\\t\\t}\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t});\\t\\n}\",\n \"showPassword(e) {\\n\\t\\tif(e){\\n\\t\\t\\tvar x = document.getElementById(\\\"exampleInputPassword1\\\");\\n\\t\\t if (x.type === \\\"password\\\") {\\n\\t\\t x.type = \\\"text\\\";\\n\\t\\t } else {\\n\\t\\t x.type = \\\"password\\\";\\n\\t\\t }\\n\\t\\t}\\n\\t}\",\n \"function displayPassword() {\\n document.querySelector(\\\"#generate\\\").blur(); // remove button focus so it doesn't hang there after password is displayed.\\n document.querySelector(\\\"#passwordBox\\\").value = generatePassword(); // call generate function and place returned value into HTML \\n}\",\n \"function resetChangePass(massage = \\\"\\\") {\\n $(\\\"#successMassage\\\").html(massage);\\n $(\\\"#verifyMassage\\\").html(\\\"\\\");\\n $(\\\"#confirmMassage\\\").html(\\\"\\\");\\n $('#currentPassword').val(\\\"\\\");\\n $('#newPassword').val(\\\"\\\");\\n $('#confirmPassword').val(\\\"\\\");\\n}\",\n \"function postResetPassword(data, textStatus, jqXHR, param) {\\n\\tvar user = param.user;\\n\\tvar uiDiv = $('#ui');\\n\\tuiDiv.html('');\\n\\tvar p = $('');\\n\\tuiDiv.append(p);\\n\\tp.html('The password for \\\"' + user + '\\\" has been reset.');\\n\\tvar ul = $('
');\\n\\tuiDiv.append(ul);\\n\\tvar li = $('');\\n\\tul.append(li);\\n\\tli.html('New password: \\\"' + data[user] + '\\\"');\\n}\",\n \"function forgotPasswordEnterDetails(){\\n formLogin.removeClass('is-selected');\\n formSignup.removeClass('is-selected');\\n formForgotPassword.removeClass('is-selected');\\n formForgotPasswordDetailsSignup.removeClass('is-selected'); \\n formEnterDetailsOTP.removeClass('is-selected');\\n\\t\\tformEnterLoginDetailsToSignUp.removeClass('is-selected');\\n $('.cd-switcher').find('.selected').html(\\\"Forgot Password\\\");\\n }\",\n \"function showPasswordRecovery() {\\n const form = document.getElementById(\\\"forgot-password\\\");\\n form.querySelector(\\\"span\\\").classList.toggle(\\\"hidden\\\");\\n}\",\n \"function password_validation(){\\n\\n if(!checkResetPasswordEmail()) {\\n return false;\\n } else {\\n document.getElementById('get_password').value = \\\"Sending...\\\";\\n return true;\\n }\\n}\",\n \"forgotPass() \\n {\\n \\tAlert.alert(\\n\\t\\t 'Go To Site',\\n\\t\\t 'Pressing this button would help you restore your password (external source)',\\n\\t\\t [\\n\\t\\t {text: 'OK', onPress: () => console.log('OK Pressed')},\\n\\t\\t ],\\n\\t\\t {cancelable: false},\\n\\t\\t);\\n }\",\n \"function showChangePasswordDialog(passwordResetToken) {\\n\\tvar errorCallback = function(error, data) {\\n\\n\\t\\t// Special case when old password did not match\\n\\t\\tif(!passwordResetToken && !error && data && data[\\\"resultCode\\\"] === \\\"NOT_FOUND\\\") {\\n\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#wrong-password\\\");\\n\\t\\t} else {\\n\\t\\t\\tconsole.error(error, data);\\n\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#password-change-failed\\\")\\n\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\tif(passwordResetToken) {\\n\\t\\t\\t\\t\\t\\tdoNavigate(\\\"/home.html\\\");\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t})\\n\\t\\t\\t;\\n\\t\\t}\\n\\t};\\n\\tvar changeDispatcher = tp.dialogs.showDialog(\\\"changePasswordDialog\\\", tp.lang.getText(passwordResetToken ? \\\"password-change\\\" : \\\"change-password\\\"));\\n\\tif(!passwordResetToken) {\\n\\t\\td3.select(\\\".password-old\\\").classed(\\\"hidden\\\", false);\\n\\t}\\n\\tchangeDispatcher\\n\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\tvar oldPasswordElement = d3.select(\\\"input[name=password-old]\\\");\\n\\t\\t\\tvar oldPassword = oldPasswordElement.property(\\\"value\\\");\\n\\t\\t\\tvar newPasswordElement = d3.select(\\\"input[name=password-new]\\\");\\n\\t\\t\\tvar newPassword = newPasswordElement.property(\\\"value\\\");\\n\\t\\t\\tvar verifyPassword = d3.select(\\\"input[name=password-verify]\\\").property(\\\"value\\\");\\n\\t\\t\\tif(!passwordResetToken) {\\n\\t\\t\\t\\tif(tp.util.isEmpty(oldPassword) || oldPassword.length < 6) {\\n\\t\\t\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#password-too-short\\\")\\n\\t\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\t\\toldPasswordElement.node().select();\\n\\t\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t;\\n\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(tp.util.isEmpty(newPassword) || newPassword.length < 6) {\\n\\t\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#password-too-short\\\")\\n\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\tnewPasswordElement.node().select();\\n\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t;\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\tif(newPassword !== verifyPassword) {\\n\\t\\t\\t\\ttp.dialogs.showDialog(\\\"errorDialog\\\", \\\"#passwords-different\\\")\\n\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\tnewPasswordElement.node().select();\\n\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t;\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\tif(passwordResetToken) {\\n\\t\\t\\t\\ttp.session.resetPassword(passwordResetToken, newPassword, function(error, data) {\\n\\t\\t\\t\\t\\tif(error) {\\n\\t\\t\\t\\t\\t\\terrorCallback(error, data);\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\ttp.dialogs.showDialog(\\\"messageDialog\\\", \\\"#password-reset-change-successful\\\")\\n\\t\\t\\t\\t\\t\\t\\t.on(\\\"ok\\\", function() {\\n\\t\\t\\t\\t\\t\\t\\t\\tdoNavigate(\\\"/home.html?signin=true\\\");\\n\\t\\t\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t\\t;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t});\\n\\t\\t\\t} else {\\n\\t\\t\\t\\ttp.session.changePassword(oldPassword, newPassword, function(error, data) {\\n\\t\\t\\t\\t\\tif(error) {\\n\\t\\t\\t\\t\\t\\terrorCallback(error, data);\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \\\"messageDialog\\\", \\\"#password-change-successful\\\");\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t\\treturn false;\\n\\t\\t})\\n\\t\\t.on(\\\"cancel\\\", function() {\\n\\t\\t\\ttp.dialogs.closeDialogWithMessage(changeDispatcher.target, \\\"messageDialog\\\", \\\"#password-no-change\\\");\\n\\t\\t\\treturn false;\\n\\t\\t})\\n\\t;\\n}\",\n \"function getForgotPage(req, res) {\\n res.render('forgot.ejs', {\\n title: 'Forgot Password?',\\n user: req.user,\\n message: ''\\n });\\n}\",\n \"function showPassword(displayPassword) {\\n document.getElementById(\\\"password\\\").textContent = displayPassword;\\n}\",\n \"function generatePassword() {\\n var pw = mainForm.master.value,\\n sh = mainForm.siteHost.value;\\n\\n // Don't show error message until needed\\n hide(mainForm.pwIncorrect);\\n\\n // Only generate if a master password has been entered\\n if (pw !== '') {\\n if (settings.rememberPassword) {\\n verifyPassword(pw, correct => {\\n if (!correct) {\\n // Master password is incorrect so show a warning\\n show(mainForm.pwIncorrect);\\n mainForm.master.select();\\n }\\n });\\n }\\n\\n // Only generate if a site has been entered\\n if (sh !== '') {\\n mainForm.pwResult.value = '';\\n mainForm.pwResult.placeholder = 'Generating...';\\n\\n // Generate a password to use, regardless of correct password\\n uniquify(pw, sh, unique => {\\n mainForm.pwResult.value = unique;\\n mainForm.pwResult.placeholder = '';\\n mainForm.pwResult.select();\\n }, settings);\\n }\\n }\\n }\",\n \"function resetpwRoute() {\\n return \\\"/resetpw?username=\\\" + encodeURIComponent(user.username) + \\\"&schoolCode=\\\" + req.body.schoolCode + \\\"&school=\\\" + (user.school ? encodeURIComponent(user.school.name) : \\\"none\\\");\\n }\",\n \"function showPassword() {\\n\\tvar x = document.getElementById(\\\"password\\\");\\n\\tif (x.type === \\\"password\\\") {\\n\\t x.type = \\\"text\\\";\\n\\t} else {\\n\\t x.type = \\\"password\\\";\\n\\t}\\n}\",\n \"passwordReset() {\\n Actions.passwordReset();\\n }\",\n \"function restorePassword(form, email) {\\n\\tvar emailValue = document.getElementById(email).value;\\n\\tvar auth = firebase.auth();\\n\\t\\n\\tauth.sendPasswordResetEmail(emailValue).then(function() {\\n\\t\\t\\tform.unbind().submit();\\n\\t\\t}, function(error) {\\n\\t\\t\\t// console.log(error);\\n\\t\\t\\taddHidden(form, 'error', error.code);\\n\\t form.unbind().submit();\\n\\t\\t});\\n}\",\n \"function retrieveForgotPassword() {\\n var userData = {};\\n angular.copy(vm.misc.forgotPassword, userData);\\n cmnSvc.resetForm(scope.forgotPasswordForm, vm.misc.authData);\\n fbaseSvc.resetForgetPassword(userData.emailAdd).then(function(rs){\\n alert(rs);\\n }, function(err){\\n alert('Error! '+err);\\n });\\n }\",\n \"function showForgotPassword(){\\n //position the forget password dialog in the middle\\n var heighthtml = $('html').height()/2;\\n var heightforget = $('#forget_password_dialog').height()/2;\\n var widthhtml = $('html').width()/2;\\n var widthforget = $('#forget_password_dialog').width()/2;\\n $('#forget_password_dialog').css(\\\"top\\\", \\\"\\\" + (heighthtml - heightforget) + \\\"px\\\");\\n $('#forget_password_dialog').css(\\\"left\\\", \\\"\\\" + (widthhtml - widthforget) + \\\"px\\\");\\n $('#forget_password_dialog_success').css('display', 'none');\\n $('#forget_password_dialog_error').css('display', 'none');\\n $('#forget_password_dialog_body').css('display', 'block');\\n $('#loginregister').fadeOut('normal', function(){\\n $('#forget_password_dialog').fadeIn('normal');\\n });\\n}\",\n \"function showPassword(password) {\\n $(\\\"input\\\").prev(\\\"p\\\").show(200);\\n $(\\\"input:hidden\\\").show(200);\\n $(\\\"#result\\\").val(password);\\n}\",\n \"function resetPasswordSuccess() {\\n var $formState = $('.reset-password-success');\\n\\n // check if reset password form was successfully submited.\\n if (!$formState.length) {\\n return;\\n }\\n\\n // show success message\\n $('#ResetSuccess').removeClass('hide');\\n }\",\n \"function toggleRecoverPasswordForm() {\\n $('#RecoverPasswordForm').toggleClass('hide');\\n $('#CustomerLoginForm').toggleClass('hide');\\n }\",\n \"function toggleRecoverPasswordForm() {\\n $('#RecoverPasswordForm').toggleClass('hide');\\n $('#CustomerLoginForm').toggleClass('hide');\\n }\",\n \"_sendPasswordReset(user, password) {\\n return this.mailer.reset({email: user.email, password: password})\\n }\",\n \"function checkValidResetFormPassword() {\\n let isValid = /^(?=.*\\\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\\\s).{8,}$/.test(\\n ResetForm.elements[\\\"password-reset\\\"].value\\n );\\n\\n if (!isValid) {\\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\\n \\\".error-message\\\"\\n );\\n if (errMes) return;\\n\\n let p = document.createElement(\\\"p\\\");\\n p.classList.add(\\\"error-message\\\");\\n\\n let img = document.createElement(\\\"img\\\");\\n img.src = \\\"./images/popup/exclamation.svg\\\";\\n img.alt = \\\"icon\\\";\\n\\n let span = document.createElement(\\\"span\\\");\\n span.innerText =\\n \\\"Mật khẩu yêu cầu tối thiểu tám ký tự, ít nhất một chữ cái viết hoa, một chữ cái viết thường, một số và một ký tự đặc biệt\\\";\\n\\n p.appendChild(img);\\n p.appendChild(span);\\n\\n ResetFormPassword.parentElement.parentElement.appendChild(p);\\n ResetFormError.push(\\\"error\\\");\\n } else {\\n let errMes = ResetFormPassword.parentElement.parentElement.querySelector(\\n \\\".error-message\\\"\\n );\\n if (!errMes) return;\\n\\n ResetFormPassword.parentElement.parentElement.removeChild(errMes);\\n ResetFormError.pop();\\n }\\n}\",\n \"show_prompt( text, type ) {\\n\\t\\tif ( 'password' === type ) {\\n\\t\\t\\t$( '#passwordField' ).val( '' );\\n\\t\\t\\t$( '#passwordArea' ).show();\\n\\t\\t\\t$( '#passwordField' ).focus();\\n\\t\\t}\\n\\t}\",\n \"function forgotPasswordEnterDetailsSignup(){\\n formLogin.removeClass('is-selected');\\n formSignup.removeClass('is-selected');\\n formForgotPassword.removeClass('is-selected');\\n formForgotPasswordDetailsSignup.addClass('is-selected'); \\n formEnterDetailsOTP.removeClass('is-selected');\\n formEnterLoginDetailsToSignUp.removeClass('is-selected');\\n $('.cd-switcher').find('.selected').html(\\\"Forgot Password\\\");\\n }\",\n \"function showForgotPasswordDIV() {\\r\\n\\tdocument.getElementById('forgotPwd').style.display=\\\"block\\\";\\r\\n}\",\n \"function buildPasswordResetView(){\\n\\tpasswordResetWindow = Ti.UI.createWindow({\\n\\t\\tbackgroundColor:UI_BACKGROUND_COLOR,\\n\\t\\tmodal:true,\\n\\t\\ttranslucent:false,\\n\\t\\tbarImage:iOS7 ? IMAGE_PATH+'common/bar7.png' : IMAGE_PATH+'common/bar.png',\\n\\t\\tbarColor:UI_COLOR,\\n\\t\\ttitle:'Password Reset'\\n\\t});\\n\\t\\n\\t//check if version is ios 7 and higher and create new navigationWindow (3.1.3.GA)\\n\\t//if(iOS7){\\n\\t\\tpasswordResetNavWin = Ti.UI.iOS.createNavigationWindow({\\n\\t\\t modal: true,\\n\\t\\t window: passwordResetWindow\\n\\t\\t});\\n\\t//}\\n\\t\\n\\tvar passwordResetDoneButton = Titanium.UI.createButton({\\n\\t\\tbackgroundImage:IMAGE_PATH+'common/Done_button.png',\\n\\t width:48,\\n\\t height:33\\n\\t});\\n\\tpasswordResetWindow.setRightNavButton(passwordResetDoneButton);\\n\\t\\n\\tpasswordResetDoneButton.addEventListener('click', function(e){\\n\\t\\t//if(iOS7){\\n\\t\\t\\tpasswordResetNavWin.close();\\n\\t\\t//}else{\\n\\t\\t//\\tpasswordResetWindow.close();\\n\\t\\t//}\\n\\t});\\n\\t\\n\\tvar passwordResetDogsquareLogo = Ti.UI.createImageView({\\n\\t\\timage:IMAGE_PATH+'signup/dogsquare_logo.png',\\n\\t\\ttop:10\\n\\t});\\n\\tpasswordResetWindow.add(passwordResetDogsquareLogo);\\n\\t\\n\\tvar passwordResetFormBackground = Ti.UI.createView({\\n\\t\\tbackgroundColor:'e7e6e6',\\n\\t\\ttop:70,\\n\\t\\twidth:262,\\n\\t\\theight:42\\n\\t});\\n\\t\\n\\t//email textfield\\n\\tpasswordResetFieldEmail = Ti.UI.createTextField({\\n\\t\\twidth:262,\\n\\t\\theight:39,\\n\\t\\tpaddingLeft:4, \\n\\t\\tpaddingRight:4,\\n\\t\\ttop:1,\\n\\t\\tkeyboardType:Ti.UI.KEYBOARD_EMAIL\\n\\t});\\n\\tpasswordResetFormBackground.add(passwordResetFieldEmail);\\n\\tpasswordResetFieldEmail.addEventListener('change', handlePasswordResetTextFieldChange);\\n\\t\\n\\tpasswordResetFieldEmailHintTextLabel = Ti.UI.createLabel({\\n\\t\\ttext:'Your Email',\\n\\t\\tcolor:'999999',\\n\\t\\ttextAlign:'left',\\n\\t\\tleft:4,\\n\\t\\topacity:0.7,\\n\\t\\theight:30,\\n\\t\\tfont:{fontSize:17, fontWeight:'regular', fontFamily:'Open Sans'}\\n\\t});\\n\\tpasswordResetFieldEmail.add(passwordResetFieldEmailHintTextLabel);\\n\\t\\n\\tvar passwordResetSepparator = Ti.UI.createView({\\n\\t\\tbackgroundColor:'CCCCCC',\\n\\t\\twidth:262,\\n\\t\\theight:2,\\n\\t\\ttop:40,\\n\\t\\topacity:0.4\\n\\t});\\n\\tpasswordResetFormBackground.add(passwordResetSepparator);\\n\\t\\t\\n\\tpasswordResetWindow.add(passwordResetFormBackground);\\n\\t\\n\\t//button to change password\\n\\tvar passwordResetButton = Ti.UI.createButton({\\n\\t\\tbackgroundImage:IMAGE_PATH+'common/reset_btn.png',\\n\\t\\twidth:270,\\n\\t\\theight:55,\\n\\t\\ttop:123,\\n\\t\\tbottom:30\\n\\t});\\n\\tpasswordResetWindow.add(passwordResetButton);\\n\\tpasswordResetButton.addEventListener('click', handlePasswordResetButton);\\n}\",\n \"function showPass() {\\n if($scope.checkPass)\\n $scope.typeInputPass = 'text';\\n else\\n $scope.typeInputPass = 'password';\\n }\",\n \"function password(){\\n\\t\\t\\n\\t\\t\\tvar a = document.getElementById(\\\"pwd1\\\").value;\\n\\t\\t\\tif(a.length <= 8 ){\\n\\t\\t\\t\\tdocument.getElementById(\\\"pwd1Hint\\\").style.display ='block';\\n\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\tif(a.length >= 8){\\n\\t\\t\\t\\tdocument.getElementById(\\\"pwd1Hint\\\").style.display ='none';\\n\\t\\t\\t}\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t}\",\n \"function showPassword(text){\\n xapi.command(\\\"UserInterface Message TextInput Display\\\", {\\n InputType: KEYBOARD_TYPES.PIN\\n , Placeholder: \\\"Meeting Password (numeric)\\\"\\n , Title: \\\"Meeting Password\\\"\\n , Text: text\\n , SubmitText: \\\"Next\\\"\\n , FeedbackId: DIALPAD_PASSWORD\\n } ).catch((error) => { console.error(error); });\\n}\",\n \"function reset() {\\n password = \\\"\\\";\\n charactersToUse = \\\"\\\";\\n lengthofPW = 0;\\n\\n\\n\\n}\",\n \"function onReset() {\\n\\tdocument.getElementById('username').value = \\\"\\\";\\n\\tdocument.getElementById('password').value = \\\"\\\";\\n\\tdocument.getElementById('email').value = \\\"\\\";\\n\\tdocument.getElementById('result').innerHTML = \\\"\\\";\\n\\tflagUsername = false;\\n\\tflagPassword = false;\\n\\tflagEmail = false;\\n}\",\n \"function handleRecoverPassword(){\\n if(emailValid()){\\n console.log(`send me my password to: ${email}`)\\n setEmail('')\\n }else{\\n console.log('invalid')\\n }\\n }\",\n \"function toggleResetPswd(e){\\n e.preventDefault();\\n $('#logreg-forms .form-signin').toggle() // display:block or none\\n $('#logreg-forms .form-reset').toggle() // display:block or none\\n}\",\n \"function checkPassword(form) {\\r\\n if (form.passwordForm.value == \\\"\\\") {\\r\\n document.getElementById(\\\"noPassword\\\").style.display = 'inline-block';\\r\\n return false;\\r\\n } else {\\r\\n return true;\\r\\n }\\r\\n}\",\n \"function forgotPassword() { \\n\\n\\t\\t\\t$( \\\"#load\\\" ).show();\\n\\t\\t\\t\\n\\t\\t\\tvar form = new FormData(document.getElementById('reset_form'));\\n\\t\\t\\t\\n\\t\\t\\tvar validate_url = $('#reset_form').attr('action');\\n\\t\\t\\t\\n\\t\\t\\t$.ajax({\\n\\t\\t\\t\\ttype: \\\"POST\\\",\\n\\t\\t\\t\\turl: validate_url,\\n\\t\\t\\t\\t//data: dataString,\\n\\t\\t\\t\\tdata: form,\\n\\t\\t\\t\\t//dataType: \\\"json\\\",\\n\\t\\t\\t\\tcache : false,\\n\\t\\t\\t\\tcontentType: false,\\n\\t\\t\\t\\tprocessData: false,\\n\\t\\t\\t\\tsuccess: function(data){\\n\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif(data.success == true ){\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t$( \\\"#load\\\" ).hide();\\n\\t\\t\\t\\t\\t\\t$(\\\"input\\\").val('');\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t$(\\\".forgot-password-box\\\").html(data.notif);\\n\\t\\n\\t\\t\\t\\t\\t\\tsetTimeout(function() { \\n\\t\\t\\t\\t\\t\\t\\t//$(\\\"#notif\\\").slideUp({ opacity: \\\"hide\\\" }, \\\"slow\\\");\\n\\t\\t\\t\\t\\t\\t\\t//window.location.reload(true);\\n\\t\\t\\t\\t\\t\\t}, 2000); \\n\\n\\t\\t\\t\\t\\t}else if(data.success == false){\\n\\t\\t\\t\\t\\t\\t$( \\\"#load\\\" ).hide();\\n\\t\\t\\t\\t\\t\\t$(\\\"#notif\\\").html(data.notif);\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t},error: function(xhr, status, error) {\\n\\t\\t\\t\\t\\t$( \\\"#load\\\" ).hide();\\n\\t\\t\\t\\t},\\n\\t\\t\\t});\\n\\t\\t\\treturn false;\\n\\t\\t}\",\n \"function postResetPassword() {\\n const validatePasswords = validatePasswordMatch(password, confirmPassword);\\n if (validatePasswords !== true) {\\n setSubmitResult(validatePasswords);\\n setIsError(true);\\n return;\\n }\\n setIsLoading(true);\\n setIsError(false);\\n axios.post(process.env.REACT_APP_API_LINK + \\\"/password/reset\\\", {\\n \\\"email\\\": data.email,\\n token,\\n password\\n }).then(result => {\\n setIsLoading(false);\\n if (result.status === 200) {\\n setIsSuccess(true);\\n data.onCloseModal();\\n alert(\\\"Password Reset Successful!\\\")\\n } else {\\n setSubmitResult(\\\"An error has occurred, please contact an administrator.\\\")\\n setIsError(true);\\n }\\n }).catch(e => {\\n setIsLoading(false);\\n setSubmitResult(e.response.data.error);\\n setIsError(true);\\n });\\n }\",\n \"function resetPasswordSuccess() {\\n // check if reset password form was successfully submited\\n if (!$('.reset-password-success').length) {\\n return;\\n }\\n\\n // show success message\\n $('#ResetSuccess').removeClass('hide');\\n }\",\n \"function ChangePassword() {\\n\\t}\",\n \"function showPassword() {\\n let button = document.getElementById('show-button');\\n let password_field = document.getElementById('passwd');\\n\\n // If currently showing the password\\n if (password_field.type == 'text') {\\n password_field.type = 'password';\\n button.innerHTML = 'Show';\\n }\\n else {\\n password_field.type = 'text';\\n button.innerHTML = 'Hide';\\n }\\n}\",\n \"recoverPassword({ Bert }, { email }) {\\n // Call forgot password procedure\\n Accounts.forgotPassword({\\n email,\\n }, (error) => {\\n if (error) {\\n Bert.alert(error.reason, 'warning');\\n } else {\\n Bert.alert('Check your inbox for a reset link!', 'success');\\n }\\n });\\n }\",\n \"function pwEvent() {\\r\\n if (validPW()) {\\r\\n $password.next().hide(); //next searches through immediate following siblings\\r\\n } else {\\r\\n $password.next().show();\\r\\n }\\r\\n}\",\n \"function resetPassword() {\\n\\t\\t\\tif (vm.newPassword != \\\"\\\" && vm.newPassword == vm.confirmPassword) {\\n\\t\\t\\t\\tvm.waiting = true;\\n\\t\\t\\t\\tserver.resetPassword($stateParams.token, vm.newPassword).then(function(res) {\\n\\t\\t\\t\\t\\tvm.success = 1;\\n\\t\\t\\t\\t\\tvm.waiting = false;\\n\\t\\t\\t\\t\\t$rootScope.$broadcast('loading', false); // TODO (HACK)\\n\\t\\t\\t\\t}, function(res) {\\n\\t\\t\\t\\t\\tvm.success = 0;\\n\\t\\t\\t\\t\\tvm.waiting = false;\\n\\t\\t\\t\\t\\t$rootScope.$broadcast('loading', false); // TODO (HACK)\\n\\t\\t\\t\\t});\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tgui.alertError(\\\"Passwords do not match.\\\");\\n\\t\\t\\t}\\n\\t\\t}\",\n \"function reset() { \\n passwordLength = 0;\\n specialCharacters = false;\\n numbers = false;\\n uppercase = false;\\n lowercase = false;\\n validInput = false;\\n }\",\n \"function showpassword() {\\n\\tvar x = document.getElementsByName(\\\"pass\\\");\\n\\tfor (var i = 0; i <= x.length; i++) {\\n\\t\\tif (x[i].type === \\\"password\\\") {\\n\\t\\t\\tx[i].type = \\\"text\\\";\\n\\t\\t} else {\\n\\t\\t\\tx[i].type = \\\"password\\\";\\n\\t\\t}\\n\\t}\\n}\",\n \"function forgotPassword(method,type) {\\n hideError('email');\\n addFunActionLabel=\\\"Forgot Pasword Submit\\\";\\n if(pageType=='not_login'){\\n var email = $.trim($(\\\"#TenTimes-Modal #userEmailCopy\\\").val()); \\n }else{\\n var email = $.trim($(\\\"#TenTimes-Modal #userEmail\\\").val());\\n }\\n if(!validateEmail12345(email)){\\n $(\\\".alert_email\\\").show();\\n return 0;\\n }\\n var otpType='password';\\n if(type=='N' || type=='U'){\\n otpType='otp';\\n }\\n\\n if(method == \\\"connect\\\")\\n var postData = {'email':email, 'name' : receiverData.name , 'type' : otpType }\\n else\\n var postData = {'email':email, 'name' : email , 'type' : otpType }\\n showloading();\\n $.post(site_url_attend+'/user/getpassword',postData,function(response){\\n hideloading();\\n response=$.parseJSON(response);\\n var resText=response.resText;\\n var resLink=response.resLink;\\n if(type=='N' || type=='U'){\\n resText=response.resText_typeN;\\n resLink=response.resLink_typeN;\\n \\n }\\n \\n switch(response.response) {\\n case 'true':\\n $('#getpassword').parent().replaceWith(function() { return \\\"\\\" + \\\"\\\" + resText + \\\"
\\\"+$('#getpassword').get(0).outerHTML+\\\" \\\"; });\\n\\n $('#getpassword').text(resLink);\\n if(method!='signup' && method!='connect' && method!='contact_organizer_venue'){\\n $('#TenTimes-Modal .partial-log').hide();\\n $('#getpassword').removeAttr(\\\"onclick\\\").click(function() {\\n partialLog(method,type)\\n }).text(resLink).css('color','#335aa1');\\n }\\n break;\\n case 'false':\\n $(\\\".alert_email\\\").html(\\\"Sorry, 10times doesn't recognize that email.\\\");\\n $(\\\".alert_email\\\").show();\\n break;\\n }\\n }); \\n}\",\n \"function getForgotPasswordUI() {\\n fetch('/api/forgotPassword', {\\n method: 'GET'\\n }).then(response => response.text())\\n .then(res => {\\n var mainBody = document.getElementById('main-body');\\n mainBody.innerHTML = res;\\n selectIcon('home');\\n });\\n}\",\n \"function resetPassword(e) {\\n e.preventDefault();\\n\\n axios\\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\\n security: questions,\\n newPW: password,\\n })\\n .then((res) => {\\n localStorage.setItem(\\\"token\\\", res.data);\\n alert(\\\"Your password has been changed! Logging you in...\\\");\\n router.push(\\\"/\\\");\\n })\\n .catch(() => {\\n alert(\\n \\\"Could not reset password! You likely had the wrong answers to the security questions\\\"\\n );\\n });\\n }\",\n \"function vpb_request_password_link()\\n{\\n\\tvar ue_data = $(\\\"#ue_data\\\").val();\\n\\t\\n\\tif(ue_data == \\\"\\\")\\n\\t{\\n\\t\\t$(\\\"#ue_data\\\").focus();\\n\\t\\t$(\\\"#this_page_errors\\\").html(''+$(\\\"#empty_username_field\\\").val()+'
');\\n\\t\\t$('html, body').animate({\\n\\t\\t\\tscrollTop: $('#ue_data').offset().top-parseInt(200)+'px'\\n\\t\\t}, 1600);\\n\\t\\treturn false;\\n\\t} else {\\n\\t\\tvar dataString = {'ue_data': ue_data, 'page':'reset-password-validation'};\\n\\t\\t$.ajax({\\n\\t\\t\\ttype: \\\"POST\\\",\\n\\t\\t\\turl: vpb_site_url+'forget-password',\\n\\t\\t\\tdata: dataString,\\n\\t\\t\\tcache: false,\\n\\t\\t\\tbeforeSend: function() \\n\\t\\t\\t{\\n\\t\\t\\t\\t$(\\\"#this_page_errors\\\").html('');\\n\\t\\t\\t\\t$(\\\"#disable_or_enable_this_box\\\").removeClass('enable_this_box');\\n\\t\\t\\t\\t$(\\\"#disable_or_enable_this_box\\\").addClass('disable_this_box');\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t$(\\\"#forgot_password_buttoned\\\").hide();\\n\\t\\t\\t\\t$(\\\"#log_in_status\\\").html(' ');\\n\\t\\t\\t},\\n\\t\\t\\tsuccess: function(response)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$(\\\"#disable_or_enable_this_box\\\").removeClass('disable_this_box');\\n\\t\\t\\t\\t$(\\\"#disable_or_enable_this_box\\\").addClass('enable_this_box');\\n\\t\\t\\n\\t\\t\\t\\t$(\\\"#log_in_status\\\").html('');\\n\\t\\t\\t\\t$(\\\"#forgot_password_buttoned\\\").show();\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tvar response_brought = response.indexOf(\\\"processCompletedStatus\\\");\\n\\t\\t\\t\\t$vlog=JSON.parse(response);\\n\\t\\t\\t\\tif(response_brought != -1)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tif($vlog.processCompletedStatus==true){\\n $(\\\"#ue_data\\\").val('');\\n $(\\\"#this_page_errors\\\").html($vlog.response);\\n return false;\\n\\t\\t\\t\\t\\t}else{\\n setTimeout(function() {\\n \\twindow.alert(\\\"To change the password you first need to verify the account by entering the verification code which was sent to your gmail account earlier while sign up in the 'Enter the verification code ... ' field to proceed.\\\");\\n window.location.replace(vpb_site_url+'verification');\\n },500);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$(\\\"#this_page_errors\\\").html($vlog.response);\\n\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\\n}\",\n \"function getPassword() {\\n if (hasTextEncoder) {\\n document.getElementById('create_button').style.display = 'none';\\n document.getElementById('passphrase').style.display = 'block';\\n }\\n else {\\n setupKeys();\\n }\\n}\",\n \"async passwordreset({ commit, dispatch }, form) {\\n form.busy = true;\\n try {\\n await App.post(route(\\\"api.auth.reset-password\\\"), form).then(() => {\\n commit(\\\"isAuthenticated\\\", {\\n isAuthenticated: vm.$auth.check()\\n });\\n form.busy = false;\\n });\\n await dispatch(\\\"fetchMe\\\");\\n } catch ({ errors, message }) {\\n form.errors.set(errors);\\n form.busy = false;\\n }\\n }\",\n \"function showPasswordFn() {\\n\\tinputPassword.type = 'text';\\n\\twhile (hidePassword.classList.contains('hidePassword')) {\\n\\t\\thidePassword.classList.remove('hidePassword');\\n\\t}\\n\\tshowPassword.classList.add('showPassword');\\n}\",\n \"function showPassword(el)\\n{\\n var input = document.createElement('input');\\n input.id = el.id;\\n input.name = el.name;\\n input.value = el.value;\\n input.className = el.className;\\n if (el.type == 'text' )\\n { input.type = 'password'; }\\n else\\n { input.type = 'text'; }\\n el.parentNode.replaceChild(input, el);\\n}\",\n \"async forgotpasswordbtn () {\\n await (await this.btnForgotPassword).click();\\n }\",\n \"function recoverPassword() {\\n const email = document.getElementsByName(\\\"recover-email\\\").item(0);\\n xhttp(\\\"POST\\\", \\\"forgot.php\\\", { email: email.value }, (response) => {\\n // do nothing if it works or if it fails\\n });\\n const loginpage = document.getElementById(\\\"main\\\").querySelector(\\\"div.loginpage\\\");\\n loginpage.innerHTML += 'If the email is in our database, an email will be sent shortly to recover your account
';\\n return false;\\n}\",\n \"renderConfirmationForm() {\\n return (\\n \\n );\\n }\",\n \"renderSuccess () {\\n this.response.render('auth/password-changed', {\\n title: 'Password Changed', returnToUrl: this.returnToUrl\\n })\\n }\",\n \"function confirmPasswordReset (e) {\\n e.preventDefault();\\n showConfirmation(\\\"Are you sure you want to reset your password?\\\").then(function (confirmed) {\\n if (confirmed) {\\n sendResetPasswordEmail().then(function () {\\n $(e.target).parent().html('Password Reset Email Sent.');\\n });\\n }\\n }).catch(function (error) {\\n showError(\\\"Response Error\\\", error);\\n });\\n}\",\n \"function showRegister() {\\n clearErrorMsg();\\n showLinks(['loginLink']);\\n showView('registerForm');\\n}\",\n \"function ForgetPasswd(){\\n $('#fopasswordModel').modal();\\n $('#fopasswordModel').on('shown.bs.modal',function() {\\n $('#fopasswordForm').formValidation('resetForm', true);\\n });\\n}\",\n \"function mdm_noecho(message) {\\t\\n\\tmdm_enable();\\t\\t\\n\\t// message;\\t\\n\\tdocument.getElementById(\\\"label\\\").innerHTML = 'pass';\\n\\tdocument.getElementById(\\\"entry\\\").value = \\\"\\\";\\n\\tdocument.getElementById(\\\"entry\\\").type = \\\"password\\\";\\n\\tdocument.getElementById(\\\"entry\\\").focus();\\n}\",\n \"resetPasswordInit(email) {\\n return this.afAuth.auth.sendPasswordResetEmail(email, { url: 'https://coincoininsolite-1cf37.firebaseapp.com/__/auth/action' });\\n }\",\n \"function fnc_cancelar_cambiar_password() {\\n\\topen_form('/Home/frm_main', gc_group_window);\\n}\",\n \"async function requestResetPassword(formData) {\\n const headers = {};\\n attach_headers([HEADERS.CSRF], headers);\\n const body = { user: formData };\\n\\n cleanupAuthState();\\n dispatch({ type: LOADING_STARTED });\\n const resp = await supervise_rq(() =>\\n axios.post(API_PATHS.AUTH_UPDATE_PASSWORD, body, { headers })\\n );\\n\\n if (resp.status === STATUS.SUCCESS) {\\n dispatch({\\n type: AUTH_ACTIONS.AUTH_REQUEST_RESET_PASSWORD,\\n payload:\\n \\\"If an account for the provided email exists, an email with reset instructions will be sent to you. Please check your inbox.\\\",\\n });\\n } else {\\n dispatch({\\n type: AUTH_ACTIONS.AUTH_ERROR,\\n payload: \\\"Oops, something went wrong. Pleas try again later.\\\",\\n });\\n }\\n }\",\n \"function initReset() {\\n\\tnew JsNameFilter(\\\"userId\\\", \\\"nameInput\\\", window['g_basePath']);\\n\\t\\n\\tif ($(\\\"successM\\\").value != '') {\\n\\t\\tMsgBox.message('重置密码成功');\\n\\t}\\n\\t\\n\\t$(\\\"successM\\\").value = '';\\n\\taddCustomCheck('reNewPW', getMessage('js.com.warning.0012'), 'mustsame', function(value) {\\n\\t\\tif (value != $F('newPW')) return false;\\n\\t\\treturn true;\\n\\t});\\n}\",\n \"resetFields() {\\n this.passwordField.nextElementSibling.innerHTML = Config.EMPTY_STRING;\\n this.passwordField.value = Config.EMPTY_STRING;\\n }\",\n \"function reset() {\\n // Flag it to prevent double clicking, and visually communicate\\n if ($scope.isSubmitting) {\\n return;\\n }\\n\\n $scope.isSubmitting = true;\\n\\n // Lets try to reset their password\\n visitorApiService.resetPassword({\\n key: $scope.key,\\n password: $scope.visitor.password\\n })\\n .$promise.then(function(response) {\\n // Unlock the submit button\\n $scope.isSubmitting = false;\\n\\n if (response.error === null) {\\n return response.result; // email\\n } else {\\n // Most common error is an expired key\\n $scope.message = commonUtilService.getMessage(response);\\n return $q.reject();\\n }\\n })\\n .then(function(email) {\\n\\n // Log them in now\\n return visitorApiService.login({\\n email: email,\\n password: $scope.visitor.password\\n })\\n .$promise.then(function(response) {\\n if (response.error !== null) {\\n $scope.message = commonUtilService.getMessage(response);\\n return $q.reject();\\n }\\n });\\n })\\n .then(function() {\\n // Request customer info\\n return visitorLoginService.isLoggedIn(true);\\n })\\n .then(function() {\\n // Get their cart info\\n cartService.reload();\\n })\\n .then(function() {\\n // Redirect them to their last page\\n var path = angular.module(\\\"visitorModule\\\").back.path || '/account';\\n $location.path(path);\\n });\\n\\n }\",\n \"createPasswordResetLink(token, user_id) {\\n\\t\\treturn `${SiteUrl}/auth/password-reset/${token}/${user_id}`;\\n\\t}\",\n \"function forgotPasswordSelected(){\\n\\t\\tformLogin.removeClass('is-selected');\\n\\t\\tformSignup.removeClass('is-selected');\\n\\t\\tformEnterDetailsOTP.removeClass('is-selected');\\n formForgotPasswordDetailsSignup.removeClass('is-selected');\\n\\t formEnterLoginDetailsToSignUp.removeClass('is-selected');\\n\\t\\tformForgotPassword.addClass('is-selected');\\n $('.cd-switcher').find('.selected').html(\\\"Forgot Password\\\");\\n\\n\\t}\",\n \"function forget_password(){\\r\\n localStorage.setItem(\\\"time\\\",\\\"1000\\\");\\r\\n localStorage.setItem(\\\"link\\\",\\\"password_reset.html\\\");\\r\\n window.open('loading.html',\\\"_self\\\");\\r\\n }\",\n \"function togglePassword(obj, e) {\\n\\t\\t\\t\\t//alert($(obj).html());\\n\\t\\t\\t\\te.preventDefault();\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t//var upass = document.getElementsByClassName('upass');\\n\\t\\t\\t\\tvar field = $(obj).parent().parent().find(\\\".togglePassword\\\");\\n\\t\\t\\t\\tvar type = field.attr('type');\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t//alert('Type: '+type+'; Val: '+field.val());\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(type == \\\"password\\\"){\\n\\t\\t\\t\\t\\t//field.type = \\\"text\\\";\\n\\t\\t\\t\\t\\tfield.attr('type', 'text');\\n\\t\\t\\t\\t\\t$(obj).html(\\\"Hide\\\");\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t//field.type = \\\"password\\\";\\n\\t\\t\\t\\t\\t$(obj).html(\\\"Show\\\");\\n\\t\\t\\t\\t\\tfield.attr('type', 'password');\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function showChangePassword(){\\n resetSettingsForms();\\n\\n $('delete_account_btn').removeClassName('selected'); // remove clicked effect from delete account button\\n $('delete_account').hide(); // hide delete account view\\n\\n $('change_password_btn').addClassName('selected'); // add clicked effect to change password button\\n $('change_password').show(); // show change password view\\n}\",\n \"passwordreset(email) {\\r\\n return this.auth\\r\\n .sendPasswordResetEmail(email)\\r\\n .then(function () {\\r\\n alert(\\\"Email Sent!\\\");\\r\\n })\\r\\n .catch(function (error) {\\r\\n alert(\\\"An error occured. Please try again\\\");\\r\\n });\\r\\n }\",\n \"function resALert() {\\n alert(\\\"The form has been reset. Please try again.\\\");\\n}\",\n \"function showPaswrd() {\\r\\n const paswrd = document.getElementById('paswrd');\\r\\n if (paswrd.type === 'password') {\\r\\n paswrd.type = 'text';\\r\\n } else {\\r\\n paswrd.type = 'password';\\r\\n }\\r\\n}\",\n \"function checkforgotpassword()\\r\\n\\t{\\r\\n\\t\\tif(document.forgot.email.value==\\\"\\\")\\r\\n\\t\\t{\\r\\n\\t\\t\\talert(lng_plsenteremailadd);\\r\\n\\t\\t\\tdocument.forgot.email.focus();\\r\\n\\t\\t\\tdocument.forgot.email.select();\\r\\n\\t\\t\\treturn false;\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tif(!validate_email_forgot(document.forgot.email.value,lng_entervalidemail))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tdocument.forgot.email.select();\\r\\n\\t\\t\\t\\t\\treturn false;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\",\n \"resetPassword(actionCode, newPassword) {\\n var accountEmail;\\n let thisComponent = this;\\n // Verify the password reset code is valid.\\n auth.verifyPasswordResetCode(actionCode).then(function(email) {\\n var accountEmail = email;\\n \\n // TODO: Show the reset screen with the user's email and ask the user for\\n // the new password.\\n \\n // Save the new password.\\n auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {\\n // Password reset has been confirmed and new password updated.\\n \\n // TODO: Display a link back to the app, or sign-in the user directly\\n // if the page belongs to the same domain as the app:\\n // auth.signInWithEmailAndPassword(accountEmail, newPassword);\\n \\n // TODO: If a continue URL is available, display a button which on\\n // click redirects the user back to the app via continueUrl with\\n // additional state determined from that URL's parameters.\\n }).catch(function(error) {\\n // Error occurred during confirmation. The code might have expired or the\\n // password is too weak.\\n });\\n }).catch(function(error) {\\n // Invalid or expired action code. Ask user to try to reset the password\\n // again.\\n }).then(function() {\\n thisComponent.props.history.push('/signin'); // redirect to home page\\n });\\n }\",\n \"function getPassowrd() {\\n let eyeIconShow = document.getElementById('eye-icon-slash-1');\\n eyeIconShow.style.display = 'block';\\n eyeIconShow.classList = 'fas fa-eye';\\n\\n let changeType = document.getElementById('singup-pass');\\n changeType.type = 'text';\\n\\n let chars = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM!@#$%^&*()_+=-[]{}><:';\\n let password = '';\\n\\n for (let i = 0; i < 12; i++) {\\n let r = Math.floor(Math.random() * chars.length);\\n password += chars[r];\\n }\\n document.getElementById('singup-pass').value = password;\\n}\",\n \"function handlePasswordReset(req, res) {\\n csrf.verify(req);\\n\\n if (!verifyReferrer(req, '/account/passwordreset')) {\\n res.status(403).send('Mismatched referrer');\\n return;\\n }\\n\\n var name = req.body.name,\\n email = req.body.email;\\n\\n if (typeof name !== \\\"string\\\" || typeof email !== \\\"string\\\") {\\n res.send(400);\\n return;\\n }\\n\\n if (!$util.isValidUserName(name)) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: \\\"Invalid username '\\\" + name + \\\"'\\\"\\n });\\n return;\\n }\\n\\n db.users.getEmail(name, function (err, actualEmail) {\\n if (err) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: err\\n });\\n return;\\n }\\n\\n if (actualEmail === '') {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: `Username ${name} cannot be recovered because it ` +\\n \\\"doesn't have an email address associated with it.\\\"\\n });\\n return;\\n } else if (actualEmail.toLowerCase() !== email.trim().toLowerCase()) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: \\\"Provided email does not match the email address on record for \\\" + name\\n });\\n return;\\n }\\n\\n crypto.randomBytes(20, (err, bytes) => {\\n if (err) {\\n LOGGER.error(\\n 'Could not generate random bytes for password reset: %s',\\n err.stack\\n );\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: email,\\n resetErr: \\\"Internal error when generating password reset\\\"\\n });\\n return;\\n }\\n\\n var hash = bytes.toString('hex');\\n // 24-hour expiration\\n var expire = Date.now() + 86400000;\\n var ip = req.realIP;\\n\\n db.addPasswordReset({\\n ip: ip,\\n name: name,\\n email: actualEmail,\\n hash: hash,\\n expire: expire\\n }, function (err, _dbres) {\\n if (err) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: \\\"\\\",\\n resetErr: err\\n });\\n return;\\n }\\n\\n Logger.eventlog.log(\\\"[account] \\\" + ip + \\\" requested password recovery for \\\" +\\n name + \\\" <\\\" + email + \\\">\\\");\\n\\n if (!emailConfig.getPasswordReset().isEnabled()) {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: email,\\n resetErr: \\\"This server does not have mail support enabled. Please \\\" +\\n \\\"contact an administrator for assistance.\\\"\\n });\\n return;\\n }\\n\\n const baseUrl = `${req.realProtocol}://${req.header(\\\"host\\\")}`;\\n\\n emailController.sendPasswordReset({\\n username: name,\\n address: email,\\n url: `${baseUrl}/account/passwordrecover/${hash}`\\n }).then(_result => {\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: true,\\n resetEmail: email,\\n resetErr: false\\n });\\n }).catch(error => {\\n LOGGER.error(\\\"Sending password reset email failed: %s\\\", error);\\n sendPug(res, \\\"account-passwordreset\\\", {\\n reset: false,\\n resetEmail: email,\\n resetErr: \\\"Sending reset email failed. Please contact an \\\" +\\n \\\"administrator for assistance.\\\"\\n });\\n });\\n });\\n });\\n });\\n}\",\n \"function hidePasswordInput() {\\n\\n // Retrieve all password elements.\\n var passwordInputForm = document.getElementById(\\\"passwordInputForm\\\");\\n var passwordInputLabel = document.getElementById(\\\"passwordInputLabel\\\");\\n\\n passwordInputLabel.innerHTML = \\\"\\\";\\n passwordInputForm.className = \\\"item hide\\\";\\n passwordSubmitButton.className = \\\"item hide\\\";\\n }\",\n \"function tooglePasswordFields(status, formPassword, formConfirmPassword) {\\n if (status == USER_STATUS_ENABLED) {\\n showElemById(formPassword);\\n showElemById(formConfirmPassword);\\n } else {\\n hideElemById(formPassword);\\n hideElemById(formConfirmPassword);\\n }\\n}\",\n \"function processResetPasswordReturn (data, $message) {\\n\\n if (data.result === \\\"No\\\") {\\n // If result returned no then something went wrong so build and display an\\n // error message\\n\\n // Build HTML for error message\\n var result = [\\n '',\\n '× ',\\n '
Reset Password Error ',\\n data.message,\\n ''];\\n\\n // Output error message\\n $message.html(result.join(''));\\n\\n } else {\\n\\n // Build HTML for success message\\n var result = [\\n '',\\n '× ',\\n 'Password successfully reset!',\\n '
'];\\n\\n // Output error message\\n $message.html(result.join(''));\\n\\n }\\n\\n}\",\n \"function passwordsMismatched() {\\n document.getElementById(\\\"passwordP\\\").style.display = \\\"visible\\\";\\n}\",\n \"_showPassword() {\\n const that = this;\\n\\n if (that.disabled || !that.showPasswordIcon) {\\n return;\\n }\\n\\n that.$.input.type = 'text';\\n that._passwordIconPressed = true;\\n }\",\n \"function hideIt(password) {\\n return ''\\n}\",\n \"function showRegistrationPassword() \\r\\n{\\r\\n var x = document.getElementById(\\\"registerPassword\\\");\\r\\n\\r\\n if (x.type === \\\"password\\\") \\r\\n x.type = \\\"text\\\";\\r\\n else \\r\\n x.type = \\\"password\\\";\\r\\n}\",\n \"function changePassword() {\\n $rootScope.pwdModalTitle = '修改密码';\\n $rootScope.pwdModal = $modal({\\n scope: $rootScope,\\n templateUrl: 'partials/modal.changePassword.html?' + new Date().getTime(),\\n show: true,\\n backdrop: false\\n });\\n }\",\n \"function passDetails(){\\n document.getElementById('vehicleRegistrationForm').style.display =\\\"none\\\";\\n messageField.innerHTML = \\\"Choose Pass\\\";\\n document.getElementById(\\\"passForm\\\").style.display=\\\"block\\\";\\n document.getElementById(\\\"getPass\\\").style.display=\\\"block\\\";\\n inputField = \\\"passChoice\\\";\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.72689563","0.6889321","0.6628089","0.6615192","0.6602431","0.6446871","0.6413607","0.640247","0.64002264","0.639404","0.6392925","0.631702","0.63133293","0.63121516","0.62927014","0.627489","0.62289125","0.6220985","0.61990076","0.619573","0.61789095","0.6148002","0.6128637","0.61240256","0.6122078","0.6034439","0.6032202","0.6027266","0.60126626","0.5989828","0.59707737","0.5963679","0.5963679","0.5951717","0.59448606","0.59330815","0.59075534","0.58955306","0.5882358","0.58790255","0.5871278","0.58698654","0.5865065","0.58547014","0.5853642","0.585276","0.5840983","0.5834779","0.583061","0.58256394","0.5811887","0.5810058","0.58070636","0.5787056","0.5786708","0.5784965","0.5779948","0.5777264","0.5770158","0.57461965","0.5740242","0.57386273","0.5736712","0.57220066","0.5721807","0.5719256","0.5716655","0.5702047","0.56922007","0.56855774","0.56792545","0.56738096","0.56721306","0.5671236","0.56707364","0.5656456","0.56539816","0.56521523","0.5640937","0.563356","0.5629652","0.5627869","0.5627693","0.56258714","0.56250703","0.56248766","0.56152004","0.56093585","0.5608366","0.5600173","0.5597817","0.559691","0.55940914","0.5591649","0.55825377","0.55785304","0.5577073","0.5575511","0.5563621","0.55579245"],"string":"[\n \"0.72689563\",\n \"0.6889321\",\n \"0.6628089\",\n \"0.6615192\",\n \"0.6602431\",\n \"0.6446871\",\n \"0.6413607\",\n \"0.640247\",\n \"0.64002264\",\n \"0.639404\",\n \"0.6392925\",\n \"0.631702\",\n \"0.63133293\",\n \"0.63121516\",\n \"0.62927014\",\n \"0.627489\",\n \"0.62289125\",\n \"0.6220985\",\n \"0.61990076\",\n \"0.619573\",\n \"0.61789095\",\n \"0.6148002\",\n \"0.6128637\",\n \"0.61240256\",\n \"0.6122078\",\n \"0.6034439\",\n \"0.6032202\",\n \"0.6027266\",\n \"0.60126626\",\n \"0.5989828\",\n \"0.59707737\",\n \"0.5963679\",\n \"0.5963679\",\n \"0.5951717\",\n \"0.59448606\",\n \"0.59330815\",\n \"0.59075534\",\n \"0.58955306\",\n \"0.5882358\",\n \"0.58790255\",\n \"0.5871278\",\n \"0.58698654\",\n \"0.5865065\",\n \"0.58547014\",\n \"0.5853642\",\n \"0.585276\",\n \"0.5840983\",\n \"0.5834779\",\n \"0.583061\",\n \"0.58256394\",\n \"0.5811887\",\n \"0.5810058\",\n \"0.58070636\",\n \"0.5787056\",\n \"0.5786708\",\n \"0.5784965\",\n \"0.5779948\",\n \"0.5777264\",\n \"0.5770158\",\n \"0.57461965\",\n \"0.5740242\",\n \"0.57386273\",\n \"0.5736712\",\n \"0.57220066\",\n \"0.5721807\",\n \"0.5719256\",\n \"0.5716655\",\n \"0.5702047\",\n \"0.56922007\",\n \"0.56855774\",\n \"0.56792545\",\n \"0.56738096\",\n \"0.56721306\",\n \"0.5671236\",\n \"0.56707364\",\n \"0.5656456\",\n \"0.56539816\",\n \"0.56521523\",\n \"0.5640937\",\n \"0.563356\",\n \"0.5629652\",\n \"0.5627869\",\n \"0.5627693\",\n \"0.56258714\",\n \"0.56250703\",\n \"0.56248766\",\n \"0.56152004\",\n \"0.56093585\",\n \"0.5608366\",\n \"0.5600173\",\n \"0.5597817\",\n \"0.559691\",\n \"0.55940914\",\n \"0.5591649\",\n \"0.55825377\",\n \"0.55785304\",\n \"0.5577073\",\n \"0.5575511\",\n \"0.5563621\",\n \"0.55579245\"\n]"},"document_score":{"kind":"string","value":"0.6168462"},"document_rank":{"kind":"string","value":"21"}}},{"rowIdx":564,"cells":{"query":{"kind":"string","value":"fetch weather data from openweathermap api needs auth"},"document":{"kind":"string","value":"async function getWeatherReport() {\n const apiKey = \"6e27a113797392f6dee5a23a3d7cc5ef\";\n const cityName = \"London\";\n const response = await fetch(\n `http://api.openweathermap.org/data/2.5/weather?q=${cityName},uk&APPID=${apiKey}`\n );\n const myJson = await response.json();\n\n const temperature = myJson.weather;\n\n console.log(temperature);\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function getWeather(data){\n var api_key = '6996386e46f031703c26cea51cac9e6e';\n var url = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?units=imperial&APPID=${api_key}&${data}`;\n\n fetch(url).then(response => response.json()).then(json_response => displayWeather(json_response));\n}","async getWeather() { \n\t\tconst response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.zipcode}&APPID=9d0317c32366d083e6e35b438595476c&units=imperial`);\n\t\tconst responseData = response.json();\n\t\treturn responseData;\n\t}","async getWeather() {\n const response = await fetch(`http;//api.openweathermap.org/data/2.5/weather?${}`);\n }","async getWeather() {\t\n\t\tconst response = await fetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state},US&units=imperial&mode=json&appid=${this.apiKey}`\n\t\t);\t\n\n\t\tconst responseData = await response.json();\n\n\t\treturn responseData;\n\t}","async getWeather(){\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.location}&units=metric&appid=${this.apikey}`);\n\n const responseData = await response.json();\n\n return responseData;\n }","async getWeather() {\n const response = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.country}&units=metric&APPID=${this.apiKey}`\n );\n\n const responseData = await response.json();\n\n return responseData;\n }","async getWeather() {\n const response = await fetch(`http://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${this.key}/${this.latitude},${this.longitude}`)\n const result = await response.json();\n\n const ocd = await fetch(`https://api.opencagedata.com/geocode/v1/json?key=${this.ocdkey}&q=${this.latitude}%2C${this.longitude}&language=en`)\n const ocdResult = await ocd.json();\n\n return {\n result,\n ocdResult,\n }\n }","async getWeather(){\n const response = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state},us&appid=${this.apikey}`);\n\n const responseJSON = await response.json();\n return responseJSON;\n }","function getWeatherData() {\n\n var url = 'http://api.openweathermap.org/data/2.5/weather?lat=' + latitude + '&lon=' + // build query url.\n longitude + '&APPID=936e860c72edb8cb527707e7d59da1ea' +\n '&units=' + countryUnits + '&preventCache=' + new Date(); // build query url\n\n $.getJSON(url, null, function(json, textStatus) {\n\n console.log(\"weather info \" + JSON.stringify(json) + \"response Satus is \" + textStatus);\n processresponse(json);\n\n });\n }","async getWeather() {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state}&units=imperial&appid=${this.apiKey}`)\n\n const responseData = await response.json();\n\n return responseData\n }","async getWeather() {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this._city},${this._state}&appid=${this._apiKey}&units=metric`)\n\n const responseData = await response.json();\n\n return responseData; //todo !!!\n }","function getWeather(city) {\n fetch(\"https://api.openweathermap.org/data/2.5/weather?q=\"\n + city \n +\"&units=metric&appid=\"+api_key+\"\")\n .then( (response) => response.json())\n .then((data) => displayWeather(data)); \n \n}","async getWeather() {\r\n const weatherRespone = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.apiKey}&units=metric`);\r\n const weather = await weatherRespone.json();\r\n\r\n return {\r\n weather\r\n };\r\n\r\n }","async getWeather() {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.countryCode}&appid=${this.apiKey}`);\n\n const responseData = await response.json();\n\n return responseData;\n }","static async getWeather() {\n try {\n let pos = await Weather.getGeoData();\n const response = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${pos.lat}&lon=${pos.lon}&exclude=hourly,minutely,alerts&units=metric&appid=${APIKey}`);\n const data = await response.json();\n\t\t\tlet result = data.daily.slice(0,8)\n\t\t\treturn result;\n } catch(err) {\n console.log(err);\n }\n }","function fetchWeatherInfo(city) {\n let url = \"http://api.openweathermap.org/data/2.5/weather?q=\";\n url += city + \"&appid=\" + APIKey;\n // console.log(\"url is\", url);\n return fetch(url).then(response => response.json());\n}","async getWeather(){\n // narrow response info to make it faster\n const exclude = '?exclude=minutely,hourly,daily,alerts,flags';\n const response = await fetch(`https://api.darksky.net/forecast/${this.apiKeyDS}/${this.lat},${this.lon}${exclude}`);\n const responseData = await response.json();\n return responseData;\n }","function getWeather() {\n return fetch(\"https://api.openweathermap.org/data/2.5/weather?q=barcelona&units=metric&appid=644a219f426a3224328405aa28d80b8f\").then(function (res) { return res.json(); })\n .then(function (res) {\n return res;\n });\n}","function getWeatherInfo(city) {\n\n const apiKey = \" \"; //weather API key\n\n fetch(\"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \",&appid=\" + apiKey)\n .then(response => response.json())\n //.then(response => console.log(response));\n .then(response => displyWeatherInfo(response));\n\n }","function getWeatherInfo () {\n\n const long = App.city.longitude;\n const lat = App.city.latitude;\n const url = \"https://api.darksky.net/forecast/8877941a6145fd159c584b8f95b52bb9/\" + lat + \",\" + long + \"?callback=?\";\n\n $.ajax({\n url: url,\n dataType: \"jsonp\",\n success: function (json) {\n App.weatherForecast = json;\n }\n }).done(function () {\n updateWeatherInfo(App.weatherForecast);\n });\n\n }","async getGeoWeather() {\n\t\tconst geoResponse = await fetch(\n\t\t\t`https://api.opencagedata.com/geocode/v1/json?q=${this.lat}+${this.long}&key=${this.geoApiKey}`\n\t\t);\n\t\n\t\t// Convert longtitude latitude to city state\n\t\tconst geoResponseData = await geoResponse.json();\n\n\t\tlet city = geoResponseData.results[0].components.city;\n\t\tlet state = geoResponseData.results[0].components.state_code;\n\n\t\t// Pass city state to API to get current weather data\n\t\tconst response = await fetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?q=${city},${state},US&units=imperial&mode=json&appid=${this.apiKey}`\n\t\t);\n\n\t\tconst responseData = await response.json();\n\n \treturn responseData;\n\t}","async function getAllWeatherData() {\n let weatherData = await getLocationWeather(\n `https://api.openweathermap.org/data/2.5/weather?q=${input}&APPID=${API}`\n );\n\n try {\n // Extract data needed for fetching forecast data.\n let testLat = weatherData.coord.lat;\n let testLon = weatherData.coord.lon;\n\n let response = await fetch(\n `https://api.openweathermap.org/data/2.5/onecall?lat=${testLat}&lon=${testLon}&exclude=minutely,hourly&appid=${API}`\n );\n let forecastData = await response.json();\n\n handleForecastState(forecastData);\n } catch {\n alert('Getting forecast failed.');\n }\n }","function findWeatherDetails() {\n let searchLink =\n \"https://api.openweathermap.org/data/2.5/weather?q=copenhagen&appid=\" +\n appKey;\n httpRequestAsync(searchLink, theResponse);\n}","async getWeather(postcode){\r\n\r\n const tempResponse = await fetch(`//api.openweathermap.org/data/2.5/weather?zip=${this.postcode},gb&units=metric&APPID=${this.apiKey}`);\r\n\r\n const responseData = await tempResponse.json();\r\n \r\n return responseData;\r\n \r\n }","async getWeather() {\n this.requestURL = this.city;\n const weatherResponse = await fetch(this.requestURL);\n const weatherData = await weatherResponse.json();\n return weatherData\n }","function getLocation(city) {\n // fetching current conditions\n\n var apiUrl = 'https://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=a3be7588e2f22d761077e844f13fff0c&units=imperial';\n fetch(apiUrl)\n .then(function(response) {\n if (response.ok) {\n //console.log(response);\n // JSON parse\n response.json().then(function(data) {\n console.log(data)\n getForecast(data.coord.lat, data.coord.lon)\n })\n } else {\n MaterialDialog.alert('Error: ' + response.statusText);\n }\n }).catch(function(error) {\n MaterialDialog.alert('Unable to getLocation: Invalid Connection');\n });\n}","function getWeather(city) {\n fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&id=524901&appid=${api.key}`\n )\n .then((data) => {\n return data.json();\n })\n .then(displayWeather);\n}","function tokyoWeather() {\n\n // use fetch to get the weather data from Tokyo\n fetch(\"https://api.openweathermap.org/data/2.5/weather?q=Tokyo,jp&units=imperial&appid=153a1ec8f6b54ec52d519c21641a079f\")\n \n .then(function(resp) { return resp.json() }) // Convert data to json\n .then(function(data) {\n displayWeather(data);\n })\n //catch errors\n .catch(function() {\n \n });\n}","function fetchWeather(city) {\n fetch('http://api.openweathermap.org/data/2.5/weather?q='\n + city \n + '&units=metric&appid='\n + apiKey)\n .then(response => response.json())\n .then(displayData)\n .catch(error => console.error('error in server, please try again later.'))\n}","getWeatherInfo(){\n\t\tlet url = 'https://api.openweathermap.org/data/2.5/weather?q=' + this.state.cityname + '&units=metric&appid=ce0cb4b99e8ee814c20a4f76609c8196'\n\t\tfetch(url)\n\t\t.then(response => response.json())\n\t\t.then(data => {\n\t\t\tconsole.log(data);\n\t\t\t// let tempData = JSON.stringify(data);\n \t// console.log(tempData);\n\t\t\t// alert(tempData);\n\t\t\tthis.processData(data);\t\t\t\n\t\t})\n\t\t.catch(function(error){\n\t\t\tconsole.log(error.message);\n\t\t\tthrow error.message;\n\t\t});\n\n\t\t// this.getForecast();\n\t}","function getGeoWeather() {\n \tweather.getGeoWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}","async function getWeatherData() {\n getLocation();\n const URL = `http://api.openweathermap.org/data/2.5/weather?lat=${LAT}&lon=${LON}&appid=${API_KEY}`;\n const apiRES = await fetch(URL).then((res) => res.json());\n setActualTemperature(Math.ceil(apiRES.main.temp - 273.15));\n setWeatherDescription(apiRES.weather[0].description);\n setWeatherLocation(apiRES.name);\n const iconURL = `http://openweathermap.org/img/wn/${apiRES.weather[0].icon}.png`;\n setWeatherIcon(iconURL);\n }","function GetGlobalWeather(cityname,apiuri,apitkn){\n let current = httpGet(apiuri+'weather?appid='+apitkn+'&units=metric&q='+cityname);\n console.log(current.cod);\n if(current.cod == 200){\n let city = current.name;\n let coords = current.coord;\n let daily = httpGet(apiuri+'onecall?appid='+apitkn+'&lat='+coords.lat+'&lon='+coords.lon+'&exclude=hourly,current,minutely&units=metric');\n return {'current':current,'daily':daily.daily,'city':city};\n }else{\n alert(cityname+' Not finded')\n }\n \n}","function fetchWeather () {\n $.ajax({\n type: 'GET',\n dataType: 'jsonp',\n url: urlWeather,\n xhrFields: {\n withCredentials: false\n },\n success: weatherSuccess,\n\n error: fetchError\n });\n}","function getWeather(zipcode) {\n // make api call and get response\n const weather = fetch(`api.openweathermap.org/data/2.5/weather?zip=${zipcode}&appid=${API_KEY}`)\n .then(res => res.json())\n .then(data => console.log(data))\n}","function getWeather(latitude, longitude) {\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n console.log(api)\n\n fetch(api)\n .then(function (response) {\n let data = response.json();\n return data;\n })\n .then(function (data) {\n weather.city = data.name; // City name\n weather.country = data.sys.country; // Country name\n weather.iconId = data.weather[0].icon; // Icon\n weather.temperature.value = Math.floor(data.main.temp - KELVIN); // Temp\n weather.description = data.weather[0].description; // Short description\n weather.sunrise = convertTime(data.sys.sunrise); // Sunrise\n weather.sunset = convertTime(data.sys.sunset); // Sunset\n weather.wind = Math.round(data.wind.speed); // Wind speed\n weather.gust = Math.round(data.wind.gust); // Gust speed\n weather.feels_like = Math.floor(data.main.feels_like - KELVIN); // Feels-like\n weather.humidity = data.main.humidity; // Humidity \n weather.temp_min = Math.floor(data.main.temp_min - KELVIN); // Temp_min\n weather.temp_max = Math.floor(data.main.temp_max - KELVIN); // Temp_max\n })\n .then(function () {\n displayBackground();\n displayWeather();\n });\n}","function getWeather() {\n\tlet query = \"https://api.openweathermap.org/data/2.5/weather?\" +\n\t\t\"q=\" + city + \"&units=imperial&appid=\" + OWM_API_KEY;\n\t\n\t$.ajax({\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t}).done(data => {\n\t\tif (!data) return;\n\t\t\n\t\tif (data.main && data.main.temp && data.weather && data.weather.length > 0) {\n\t\t\t$('#temp').text(data.main.temp.toFixed(1) + '\\xB0' + 'F');\n\t\t\t\n\t\t\t$('#weather-main > i').remove();\n\t\t\t\n\t\t\tlet weatherData = data.weather[0];\n\t\t\t\n\t\t\tlet icon = $('');\n\t\t\tlet time = weatherData.icon.endsWith('d') ? 'day-' : weatherData.icon.endsWith('n') ? 'night-' : '';\n\t\t\tlet iconClass = 'wi wi-owm-' + time + weatherData.id;\n\t\t\ticon.addClass(iconClass);\n\t\t\t$('#weather-main').prepend(icon);\n\t\t\t\n\t\t\tlet conditions = weatherData.description;\n\t\t\t$('#weather-conditions').text(titleCase(conditions));\n\t\t\t\n\t\t\t//console.log(data);\n\t\t}\n\t});\n\t\n\tquery = 'https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=\"' + city.toLowerCase() + ', ' + state.toLowerCase() + '\")&format=json';\n\t$.ajax({\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t}).done(data => {\n\t\tif (!data || !data.query || !data.query.results || !data.query.results.channel) return;\n\t\t\n\t\tconsole.log(data.query.results.channel);\n\t\t\n\t\tif (!data.query.results.channel.item || !data.query.results.channel.item.forecast) return;\n\t\t\n\t\tlet forecast = data.query.results.channel.item.forecast;\n\t\t\n\t\tif (forecast.length > 0) {\n\t\t\t$('#temp-high').text(forecast[0].high + '\\xB0' + 'F');\n\t\t\t$('#temp-low').text(forecast[0].low + '\\xB0' + 'F');\n\t\t\t\n\t\t\t$('#weather-weekly').empty();\n\t\t\tfor (let i = 1; i < 6 && i < forecast.length; i++) {\n\t\t\t\tlet col = $('').addClass('col');\n\t\t\t\tlet panel = $('
').addClass('panel daily-forecast');\n\t\t\t\tlet dayWeather = forecast[i];\n\t\t\t\t\n\t\t\t\tpanel.append($('
').addClass('day').text(dayWeather.day.toUpperCase()));\n\t\t\t\tpanel.append($('').addClass('wi wi-yahoo-' + dayWeather.code));\n\t\t\t\tpanel.append($('
').addClass('daily-high').text(dayWeather.high + '\\xB0' + 'F'));\n\t\t\t\tpanel.append($('
').addClass('daily-low').text(dayWeather.low + '\\xB0' + 'F'));\n\t\t\t\t\n\t\t\t\tcol.append(panel);\n\t\t\t\t$('#weather-weekly').append(col);\n\t\t\t}\n\t\t}\n\t\t\n\t});\n}","async getWeather() {\n //Weather API\n let url = \"https://api.darksky.net/forecast/\" + API_KEY + \"/\" +\n this.state.latitutde + \",\" + this.state.longitude;\n \n //Location API\n let loc = \"https://us1.locationiq.com/v1/reverse.php?key=\" + API_LOCATION +\"&lat=\"+ this.state.latitutde +\"&lon=\"\n + this.state.longitude + \"&format=json\";\n\n\n //Get Weather Details from Weather API\n const response = await fetch(url)\n const json = await response.json();\n this.setState({ currentForecast: json.currently });\n this.setState({ hourlyForecast: json.hourly });\n this.setState({ dailyForecast: json.daily });\n\n //Get City Name from Location API\n const responseCity = await fetch(loc)\n const jsonCity = await responseCity.json();\n this.setState({locationJson: jsonCity.address});\n }","async getWeather(){\n const response = await fetch(`http://api.apixu.com/v1/current.json?key=${this.apiKey}&q=${this.city}&r=${this.region}`);\n const resultsData = await response.json();\n //console.log(resultsData);\n return resultsData;\n \n }","function getWeatherApi() {\n city = document.querySelector(\"#cityInput\").value;\n\n query = currentUrl + city + apiKey + \"&units=imperial\";\n\n fetch(query)\n .then((response) => response.json())\n .then((response) => {\n currentCity.textContent = response.name;\n currentTemp.textContent = \"Current Temp: \" + response.main.temp + \" F\";\n currentHumidity.textContent =\n \"Current Humidity: \" + response.main.humidity + \" %\";\n currentWindSpeed.textContent =\n \"Current Wind Speed: \" + response.wind.speed + \" MPH\";\n });\n}","fetchWeatherData(lat,lon){\n\t\t// setting up the api key value and the longitude and latitude of the devices current location to be used in the API request\n\t\tlet rqst = \"https://api.openweathermap.org/data/2.5/weather?lat=\" + lat.toString() + \"&lon=\" + lon.toString() + \"&appid=\" + this.state.apiKey;\n console.log(\"Making API Request ...\");\n\t\t$.ajax({\n\t\t\turl: rqst,\n\t\t\tdataType: \"jsonp\",\n\t\t\tsuccess : this.parseResponse,\n\t\t\terror : function(req, err){ console.log('API call failed ' + err); }\n\t\t})\n\t}","function getWeather(woeid) {\n fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`)\n .then(result => {\n // console.log(result);\n return result.json();\n })\n .then(data => {\n // console.log(data);\n const today = data.consolidated_weather[0];\n console.log(`Temperatures today in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`);\n })\n .catch(error => console.log(error));\n}","getWeather(){\n\n\t\t// Construct the API url to call\n\t\tlet url = 'https://api.openweathermap.org/data/2.5/weather?lat=' + this.state.latitude + '&lon=' + this.state.longitude + '&units=metric&appid=ce0cb4b99e8ee814c20a4f76609c8196';\n\t\t// console.log(url);\n\n\t\t// Call the API, and set the state of the weather forecast\n\t\tfetch(url)\n\t\t.then(response => response.json())\n\t\t.then(data => {\n\t\t\tconsole.log(data);\n\t\t\t// let tempData = JSON.stringify(data);\n\t\t\t\t// console.log(tempData);\n\t\t\t// alert(tempData);\n\t\t\tthis.processData(data);\n\t\t})\n\t\t.catch(function(error){\n\t\t\tconsole.log(error.message);\n\t\t\tthrow error.message;\n\t\t });\n\n\t\t// this.getForecast();\n\t}","async function fetchInitialWeatherDataForMy(city) {\n try {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=f778724f49d8bcbf6a7c1111529b5d72`, { mode: 'cors' });\n const data = await response.json();\n return data;\n } catch (err) {\n return console.error(err);\n }\n}","async getWeather() {\n const response = await this._getCall(`${this.#weatherApi}/weather?q=${this.city},${this.country}`);\n return await response.json();\n }","function getCurrentWeather () {\n\n var key = \"2fd6a7c1addf009b30af95d20e54bde2\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + searchCity + \"&units=imperial&appid=\" + key;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n // console.log(response);\n currentWeatherObj = response\n currentWeatherIcon = currentWeatherObj.weather[0].icon;\n // console.log(currentWeatherIcon);\n displayCurrentWeather();\n cityLongited = currentWeatherObj.coord.lon;\n cityLatitude = currentWeatherObj.coord.lat;\n getUVIndex();\n\n\n });\n}","function getData({city, country, apiKey, unitsSys}) {\n const url = 'https://api.openweathermap.org/data/2.5/weather?';\n fetch(url + `q=${city},${country}&units=${units[unitsSys]}&appid=${apiKey}`)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n makeWeatherCard({containerSelector: '.output',\n dataObj: data});\n })\n .catch((error) => {\n console.log(error);\n showErrorInfo({containerSelector: '.output',\n errorMsg: 'Oops! Something went wrong :('});\n });\n}","function getData() {\n var APIkey = \"c19b2f1f085df13be7309df32599c301\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=hourly,minutely,alerts&units=imperial&appid=\" + APIkey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(\"--------------------\");\n console.log(\"current date is \" + response.current.dt);\n console.log(\"current temperature is \" + response.current.temp);\n console.log(\"current humidity is \" + response.current.humidity);\n console.log(\"current wind speed is \" + response.current.wind_speed);\n console.log(\"current uv index is \" + response.current.uvi);\n console.log(\"current weather icon is \" + response.current.weather[0].icon);\n console.log(\"--------------------\");\n\n dt = response.current.dt;\n temp = response.current.temp;\n hum = response.current.humidity;\n wind = response.current.wind_speed;\n uvi = response.current.uvi;\n icon = response.current.weather[0].icon;\n daily = response.daily;\n \n currentData(city, dt, temp, hum, wind, uvi, icon);\n forecastData(daily);\n }); \n}","function getWeather(testCity) {\n var requestOptions = {\n method: 'GET',\n redirect: 'follow'\n };\n\n fetch(\"https://api.openweathermap.org/data/2.5/weather?q=\" + testCity + \"&APPID=de6cda6ee489e5192ad8edc5d0f21166&units=imperial\", requestOptions)\n .then(response => response.text())\n .then(result => {\n if (result) {\n result = JSON.parse(result)\n updateDisplay(result);\n uvIndex(result.coord.lat, result.coord.lon);\n }\n return;\n })\n .catch(error => console.log('error', error))\n .finally(() => { renderCityList() })\n\n}","function getWeather(lat, lon, city) {\n\n //var city = $(\"#citySearchTextField\").val();\n var baseURL = \"https://api.openweathermap.org/data/2.5/\";\n\n if (lat !== undefined && lon !== undefined) {\n var queryParam = \"lat=\" + lat + \"&lon=\" + lon;\n }\n else {\n var queryParam = \"q=\" + city;\n };\n\n\n var openWeatherUrl = baseURL + \"weather?&units=imperial&\" + queryParam + \"&APPID=\" + apiKey;\n openWeatherUrl = encodeURI(openWeatherUrl);\n\n // Call Weather API for general weather\n $.ajax({\n url: openWeatherUrl,\n method: \"GET\"\n\n\n }).then(function (responseW) {\n\n $(\"#currentDate\").html(\" (\" + moment().format(\"M/D/YYYY\") + \")\");\n\n $(\"#cityName\").html(responseW.name); \n $(\"#temperature\").html(\"Temperature: \"+ responseW.main.temp + \" ℉\");\n $(\"#humidity\").html(\"Humidity: \"+ responseW.main.humidity + \"%\");\n $(\"#windSpeed\").html(\"Wind Speed: \"+ responseW.wind.speed + \" MPH\");\n\n // Set weather icon\n var image_src = \"https://openweathermap.org/img/wn/\" + responseW.weather[0].icon +\"@2x.png\";\n $(\"#currentImg\").attr(\"src\",image_src);\n \n // Call Weather API for UV Index\n var uvIndexUrl = baseURL + \"uvi?lat=\" + responseW.coord.lat + \"&lon=\" + responseW.coord.lon + \"&APPID=\" + apiKey;\n $.ajax({\n url: uvIndexUrl,\n method: \"GET\"\n\n }).then(function (responseU) {\n $(\"#uvIndex\").html(\"UV Index: \" + responseU.value +\" \");\n })\n\n });\n }","function getWeather(city) {\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&APPID=${apiKey}`)\n .then(response => {\n return response.json();\n })\n .then(data => {\n $(\".date\").text(data.name + \" \" + date);\n latitude = data.coord.lat;\n longitude = data.coord.lon;\n fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&units=imperial&appid=${apiKey}`)\n .then(response => {\n return response.json();\n })\n .then(data => {\n iconCode = data.current.weather[0].icon;\n const iconUrl = \"http://openweathermap.org/img/w/\" + iconCode + \".png\";\n let uvi = data.current.uvi;\n $(\"#icon\").attr('src', iconUrl);\n $(\".temp\").text('Temp: ' + data.current.temp + '°F');\n $(\".wind\").text('Wind: ' + data.current.wind_speed + ' MPH');\n $(\".humidity\").text('Humidity: ' + data.current.humidity + ' %');\n $(\".index\").text(uvi);\n $(\".fiveCast\").empty();\n uvConditions(uvi);\n fiveDayForecast(data);\n console.log(data);\n })\n })\n }","function fetchWeatherData() {\n if (DEBUG) {\n console.log('Fetching weather data...');\n console.log('Country: ' + country);\n console.log('City: ' + city);\n console.log('WOEID: ' + woeid);\n }\n \n locChanged = (woeid != lastWOEID);\n lastWOEID = woeid;\n\n if (!config.TempUnit || config.TempUnit === '' || config.TempUnit === 'Auto') {\n // Determine temperature units from country code (US gets F, everyone else gets C)\n if (country == 'US')\n unit = 'F';\n else\n unit = 'C';\n } else {\n unit = config.TempUnit;\n }\n\n if (DEBUG) console.log('Unit: ' + unit);\n\n // URL for getting basic weather forecast data in XML format (RSS)\n reqWeather.open('GET', 'http://weather.yahooapis.com/forecastrss?w=' + woeid + '&u=' + unit.toLowerCase(), true);\n // Fetch the weather data\n reqWeather.send(null);\n }","async getWeather() {\n // Convert location to latitude and longitude using Google Maps geocoder\n const latLong = await this.getLatLong();\n const lat = latLong[0].geometry.location.lat();\n const lng = latLong[0].geometry.location.lng();\n\n // Get general weather API info for this location, including URLs for forecast, city name, etc.\n const weatherApiInfo = await (\n await fetch(`https://api.weather.gov/points/${lat},${lng}`)\n ).json();\n const forecastCity =\n weatherApiInfo.properties.relativeLocation.properties.city;\n const forecastState =\n weatherApiInfo.properties.relativeLocation.properties.state;\n\n // Get list of all weather stations in the area. Use the first station in the list.\n const observationStations = await (\n await fetch(weatherApiInfo.properties.observationStations)\n ).json();\n const weatherStation = observationStations.features[0].properties.name;\n\n // Get the current conditions\n const currentConditions = await (\n await fetch(\n `https://api.weather.gov/stations/${observationStations.features[0].properties.stationIdentifier}/observations/latest?require_qc=false`\n )\n ).json();\n\n // Get daily (7-day) forecast\n const dailyForecast = await (\n await fetch(weatherApiInfo.properties.forecast)\n ).json();\n\n // Get hourly forecast\n const hourlyForecast = await (\n await fetch(weatherApiInfo.properties.forecastHourly)\n ).json();\n\n // Return all this info and let the other module parse it and convert it\n return {\n forecastCity: forecastCity,\n forecastState: forecastState,\n weatherStationLoc: weatherStation,\n currentConditions: currentConditions.properties,\n dailyForecast: dailyForecast.properties,\n hourlyForecast: hourlyForecast.properties,\n };\n }","async function fetchTheRestOfMyWeatherData(city) {\n try {\n // calls function that fetches weather data and grabs lat / lon / dt from the user's city\n const initialData = await fetchInitialWeatherDataForMy(city);\n\n // takes lat / lon / dt from initialData variable above, and processes it for API below\n const lat = initialData.coord.lat.toFixed(2);\n const lon = initialData.coord.lon.toFixed(2);\n // final API call that is then processed and used by the app\n const response = await fetch(`http://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=f778724f49d8bcbf6a7c1111529b5d72`, { mode: 'cors' });\n return response;\n } catch (err) {\n return console.error(err);\n }\n}","function weather(){\r\n\r\n\t\tvar appKey = \"4823e0379d7d603fb2cbfdbad5c5842e\";\r\n\r\n\t\tvar request = $.ajax({\r\n\t\t\ttype: 'GET',\r\n\t\t\turl: \"https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?lat=\"+lat+\"&lon=\"+lon+\"&appid=\"+appKey+\"&units=\"+units+\"\",\r\n\t\t\tcrossDomain: true,\r\n\t\t\tdataType: 'json',\r\n\t\t\tsuccess: function(data){\r\n\t\t\t\tconsole.log('success', data);\r\n\t\t\t},\r\n\t\t\terror: function(e){\r\n\t\t\t\tconsole.log('Error Loading Weather', e);\r\n\t\t\t},\r\n\r\n\t\t});\r\n\r\n\t\t// If everything works get the corresponding image and populate the text fields\r\n\t\trequest.done(function(data){\r\n\t\t\tgetImage(data);\r\n\t\t\tpopulate(data);\r\n\t\t});\r\n\t}","function getWeather(map, latlng, windy) {\n\tvar xmlHttpRequest = new XMLHttpRequest();\n\txmlHttpRequest.onreadystatechange = function()\n\t{\n\t if( this.readyState == 4 && this.status == 200 )\n\t {\n\t if( this.response )\n\t {\n\t \t//console.log(this.response.list);\n\t showWeather(map, this.response.list, windy);\n\t }\n\t }\n\t}\n\txmlHttpRequest.open( 'GET',\"http://api.openweathermap.org/data/2.5/find?lat=\"+ latlng.lat() + \"&lon=\"+latlng.lng()+\"&cnt=10&appid=\"+ API_KEY , true );\n\txmlHttpRequest.responseType = 'json';\n\txmlHttpRequest.send( null );\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 getWeather(latitude,longitude){\n let fullApi = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${KEY}`\n \n fetch(fullApi)\n .then(function(response){\n let data = response.json();\n return data;\n })\n .then(function(data){\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\n weather.description = data.weather[0].description;\n weather.iconId = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function(){\n displayWeather();\n });\n \n\n}","function getData () {\n $.get(`https://nominatim.openstreetmap.org/?q=${cityName}&addressdetails=1&countrycodes=US&format=json&limit=1`, function(response){\n //seting the latitude of the city\n lat = response[0].lat;\n //setting the laongitute of the city\n long = response[0].lon;\n //clean up the city name\n cityName = `${cityName}, ${response[0].address.state}`\n }).then(function(){\n $.get(`https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${long}&\n exclude=hourly,daily&appid=${api}`, function(response){\n //create a current weather opject to send to the build function\n var currentWeather = {}\n //city name\n currentWeather.name = cityName\n //using moment to convert the unix timestap to human date\n currentWeather.date = moment.unix(response.current.dt).format('L');\n //format the icon url to hit the image source from OWM \n currentWeather.icon = `http://openweathermap.org/img/wn/${response.current.weather[0].icon}.png`\n //weather description, not used right now but could be fun\n currentWeather.desc = response.current.weather[0].description\n //current temp converted from K\n currentWeather.temp = (response.current.temp * (9/5) -459.67).toFixed(1);\n //humidity\n currentWeather.humidity = response.current.humidity;\n //wind speed\n currentWeather.wind = response.current.wind_speed;\n //uv index\n currentWeather.uvi = response.current.uvi;\n //send the current weather object to the build function\n buildCurrent(currentWeather)\n \n //setup fiveDay weather by popping off the last 2 peeps\n var fiveDayWeather = response.daily.slice(1,6)\n buildForcast(fiveDayWeather)\n })\n \n })\n \n }","function getWeather(longitude, latitude) {\r\n Alert.style.display = \"none\";\r\n let api = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\r\n console.log(api);\r\n fetch(api)\r\n .then(function (response) {\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(function (data) {\r\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\r\n weather.iconId = data.weather[0].icon;\r\n weather.mainDesc = data.weather[0].main;\r\n weather.description = data.weather[0].description;\r\n weather.city = data.name;\r\n weather.country = data.sys.country;\r\n\r\n weather.lon = data.coord.lon;\r\n weather.lat = data.coord.lat;\r\n weather.rise = data.sys.sunrise;\r\n weather.set = data.sys.sunset;\r\n weather.minTemp.value = Math.floor(data.main.temp_min - KELVIN);\r\n weather.maxTemp.value = Math.floor(data.main.temp_max - KELVIN);\r\n weather.press = data.main.pressure;\r\n weather.humid = data.main.humidity;\r\n weather.speedW = data.wind.speed;\r\n weather.dirW = data.wind.deg;\r\n })\r\n .then(function () {\r\n displayWeather();\r\n });\r\n}","function getWeather(city) {\n var lat = \"\";\n var lon = \"\";\n\n // Grab weather data, then make two additional API calls to get UV index and 5-day forecast\n $.ajax({\n url: `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIKEY}&units=imperial`,\n method: \"GET\"\n }).then(function(response) {\n lat = response.coord.lat;\n lon = response.coord.lon;\n saveToLocalStorage();\n renderCitySidebar();\n \n // Get UV index data using latitude and longitude from previous API call, then call renderWeatherDisplay function\n $.ajax({\n url: `https://api.openweathermap.org/data/2.5/uvi/forecast?appid=${APIKEY}&lat=${lat}&lon=${lon}&cnt=1`,\n method: \"GET\"\n }).then(function(responseUV) {\n renderWeatherDisplay(response, responseUV);\n });\n\n // Get 5 day forecast by using latitude and longitude from first API call, then call renderFiveDayForecast function\n $.ajax({\n url: `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${APIKEY}&units=imperial&exclude=current,minutely,hourly`,\n method: \"GET\"\n }).then(renderFiveDayForecast);\n });\n }","async function getWeatherSearch(city) {\r\n let res = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${API_KEY}`)\r\n let data = await res.json()\r\n return data\r\n}","function callAPI(city) {\n var weatherURL = \"https://api.weatherbit.io/v2.0/forecast/daily?key=125e5091a0b746d9a25859114793888d&days=6&city=\" + city\n return $.ajax({\n url: weatherURL,\n method: \"GET\",\n success: function (data) {\n }\n })\n }","function getWeatherData(lat, long) {\r\n var key = \"1234f59e5798e86cc9241a1ff070cd36\";\r\n var req1 = new XMLHttpRequest();\r\n req1.open(\r\n \"GET\",\r\n `http://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${long}&appid=${key}`,\r\n true\r\n );\r\n req1.send();\r\n req1.onload = function () {\r\n var result = JSON.parse(this.response);\r\n console.log(result);\r\n };\r\n}","function getWeather() {\n\tweather.getWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}","function getweatherdata(latitude, longitude){ \r\n var key = \"83362a76bd91e5c5b5de9b7fc4202b50\";\r\n var req = new XMLHttpRequest();\r\n req.open('GET', `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`, true) \r\n req.send();\r\n req.onload = function(){\r\n if(latitude!==0 && longitude!==0){\r\n var weatherdata = JSON.parse(this.response);\r\n console.log(weatherdata[\"main\"]);\r\n } \r\n }\r\n }","function getForecastWeather(lat,lon,city){\n var forecastData;\n fetch(\"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=hourly,minutely&units=imperial&appid=43802440c0c6de0f332937c0fa83470c\")\n .then(function(response) {\n if (response.ok) {\n response.json()\n .then(function(data) \n {\n //Load main panel for current day weather\n forecastData = data;\n fetch(\"https://api.openweathermap.org/data/2.5/uvi?lat=\" + lat + \"&lon=\" + lon + \"&appid=43802440c0c6de0f332937c0fa83470c\")\n .then(function(uviresponse) {\n if (uviresponse.ok) {\n uviresponse.json()\n .then(function(uvidata){\n loadCurrentWeather(forecastData,uvidata.value,city)\n });\n }\n });\n \n\n //Load forecast weather for 5 days\n loadForeCastWeather(forecastData);\n });\n } else {\n alert(\"Error: \" + response.statusText);\n }\n }).catch(function(error) {\n // Notice this `.catch()` getting chained onto the end of the `.then()` method\n alert(\"Unable to connect to Weather app\" + error);\n });\n}","function fetchWeather() {\n\tlog(\"fetchWeather()\");\n\tvar userLocation = preferences.userLocation.value;\n\tvar cityVal = preferences.cityValPref.value;\n\tvar userCity = cityVal ? \"zmw:\"+cityVal : userLocation;\n\t\n\tif (!isLocationValid(userLocation)) {\n\t\tdisplayError( \"Location missing\", \"You haven't entered a location yet. Click here to enter a location.\", showWidgetPreferences);\n\t\treturn false;\n\t}\n\t\n\tvar locale = widget.locale.substr(0, 2);\n\tvar apiLocale = convertKonfabulatorLocaleToWundergroundLocale(locale);\n\tif (apiLocale.match(/api\\.wunderground\\.locales\\./)) apiLocale = \"EN\";\n\tvar _url = weatherURL + apiKey + \"/lang:\" + escape(apiLocale) + \"/conditions/forecast/astronomy/q/\" + escape(userCity) + \".xml\";\n\t\n\tlog(\"Trying to fetch: \"+_url);\n\t\n\tvar urlFetch = new URL();\n\turlFetch.location = _url;\n\ttry {\n\t\turlFetch.fetchAsync(onWeatherDataFetched);\n\t}\n\tcatch (error) {\n\t\tdisplayConnectionError(error,_url);\n\t}\n}","function getWeather(city){\n fetch(`${api.webUrl}weather?q=${city}&units=metric&appid=${api.apiKey}`)\n .then(weather => {\n return weather.json();\n }).then(displayWeather);\n}","function getWeather(latitude,longitude){\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n fetch(api).then(function(response){\n let data = response.json();\n console.log(api);\n \n return data;\n \n })\n .then(function(data){\n weather.temperature.value = Math.floor(data.main.temp - kelvin);\n weather.description = data.weather[0].description;\n weather.iconID = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function(){\n displayWeather();\n });\n}","async function getWeather(query) {\n let weatherData = {};\n await fetch(\n `${api.base}weather?zip=${query},us&units=imperial&APPID=${api.key}`\n )\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n weatherData.temp = data.main.temp;\n weatherData.cityName = data.name;\n weatherData.iconId = data.weather[0].icon;\n })\n .catch((err) => {\n console.log(err);\n // handle error here better\n localStorage.removeItem('zip');\n inputField.classList.remove('hidden');\n weatherDisplay.classList.add('hidden');\n inputField.value = '';\n displayTempError();\n });\n return weatherData;\n}","function fetchWeather(city) {\n return fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&appid=${apiKey}`\n )\n .then((response) => response.json())\n .then((response) => {\n\n const lon = response.coord.lon;\n const lat = response.coord.lat;\n\n return fetchOnecall(lon, lat).then((onecallResponse) => {\n return {\n currentWeather: response,\n onecallWeather: onecallResponse,\n };\n });\n })\n .catch(function(err){\n console.log('not founddd');\n alert(\"City not found. Please enter a correct city name.\")\n });\n}","function getWeather() {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + currentCity + \"&appid=\" + apiKey;\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then((response) => {\n //Update the current city weather\n currentCityWeather = response;\n //Update the page with weather information\n updateCurrentWeather();\n //Add the city to the recent cities up to 10\n addCityToRecent();\n //Get the cities uv index\n getUVIndex();\n //Get the 5 day forecast\n get5DayForecast();\n }).fail((error) => {\n $(\"
\" + currentCity + \" was not found \").css({\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n left: 0,\n top: 0,\n zIndex: 1000000, // to be on the safe side\n background: '#ffffff',\n textAlign: 'center',\n verticalAlign: 'middle',\n }).appendTo($(\".current-weather\").css(\"position\", \"relative\"));\n \n feedbackTimeout = setTimeout(() => {\n $('.error-div').remove();\n }, 1500);\n })\n }","function getWeather(city){\n let api = `http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=imperial`;\n \n //Fetch is what sends out the request from openweather to get the data for the given city\n //once it receives the response its converted to JSON and the passed into the display function\n fetch(api)\n .then(response => response.json())\n .then(data => displayWeather(data))\n .catch(e => {\n displayError(); \n })\n}","function getWeather() {\n \n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=Denver&units=imperial&appid=b4e24afa7b1b97b59d4ac32e97c8b68d\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n \n $(`p`).text(\"\");\n temp.text(`Current Temperature: ` + Math.floor(response.main.temp) + ` °F`);\n humid.text(`Humidity: ` + response.main.humidity + `%`);\n wind.text(`Wind Speed: ` + response.wind.speed);\n })\n}","function getWeather() {\n\tfetch(apiCall, {\n\t\tmode: \"cors\",\n\t\theader: {\n\t\t\t\"Access-Control-Allow-Origin\": \"*\",\n\t\t\t\"Cache-Control\": \"no-store\",\n\t\t},\n\t})\n\t\t.then(function (response) {\n\t\t\tif (response.status !== 200) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"Looks like there was a problem. Status Code: \" + response.status\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.json().then(function (data) {\n\t\t\t\tcurrentWeather = data;\n\t\t\t\tconsole.log(\"Made with love in Stockholm 🏰🇪🇺\");\n\n\t\t\t\tclouds = map(currentWeather.clouds.all, 0, 100, 0, 90);\n\t\t\t\tcloudCoverage = map(currentWeather.clouds.all, 0, 100, 0, 1);\n\t\t\t\thumidity = map(currentWeather.main.humidity, 0, 100, 0, 50);\n\t\t\t\tpressure = map(currentWeather.main.pressure, 800, 1100, 10, 0);\n\t\t\t\ttemperature = map(currentWeather.main.temp, -30, 55, 0, 40);\n\t\t\t\ttempMax = map(currentWeather.main.temp_max, -30, 55, 0, 4);\n\t\t\t\ttempMin = map(currentWeather.main.temp_min, -30, 55, 0, 4);\n\t\t\t\tvisibility = map(currentWeather.visibility, 0, 10000, 0, 4);\n\t\t\t\twindDeg = map(currentWeather.wind.deg, 0, 360, 0, 360);\n\t\t\t\twindSpeed = map(currentWeather.wind.speed, 0, 14, 0.8, 5);\n\t\t\t\tcurrentTemperature = currentWeather.main.temp;\n\n\t\t\t\tdrawSunPath();\n\t\t\t});\n\t\t})\n\t\t.catch(function (err) {\n\t\t\tconsole.log(\"Fetch Error :-S\", err);\n\t\t});\n}","fetchWeather(searchZipCode) {\n fetch(`https://api.openweathermap.org/data/2.5/forecast?zip=${searchZipCode},us&units=imperial&appid=08d4fea27ae00e7c79b59befd31e8d18`)\n .then(response => response.json())\n .then(results => this.setWeather(results));\n }","function getWeather(latitude, longitude){\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n \n \n fetch(api)\n .then(function(response){\n let data = response.json();\n return data;\n })\n .then(function(data){\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\n weather.description = data.weather[0].description;\n weather.iconID = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function(){\n displayWeather();\n });\n}","fetchForecast()\n {\n var url = \"http://api.openweathermap.org/data/2.5/forecast?APPID=0cf17e23b1d108b29a4d738d2084baf5&q=\" + this.state.location + \"&units=\" + this.state.units;\n \n $.ajax({\n\t\t\turl: url,\n dataType: \"jsonp\",\n\t\t\tsuccess : this.parseResponse,\n\t\t\terror : function(req, err){ console.log('API call failed ' + err); }\n })\n\n \n }","function getWeatherData(city) {\n var currentWeatherUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=260502960360e1be7ff30b2693e2aa94`\n \n fetch(currentWeatherUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n var cityName = data.name;\n var weatherIcon = data.weather[0].icon;\n $('.current-city').append(cityName);\n $(\".todaysWeatherIcon\").attr(\"src\", `http://openweathermap.org/img/wn/${weatherIcon}.png`);\n var lat = data.coord.lat;\n var lon = data.coord.lon;\n \n var oneCallUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude={part}&appid=260502960360e1be7ff30b2693e2aa94&units=imperial`\n\n fetch(oneCallUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (cityData) {\n console.log(cityData);\n weatherReport(cityData);\n getFiveDayForecast(cityData);\n })\n })\n }","async function getWeatherAW(woeid) {\n try {\n const result = await fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`);\n const data = await result.json();\n const tomorrow = data.consolidated_weather[1];\n console.log(`Temperatures tomorrow in ${data.title} stay between ${tomorrow.min_temp} and ${tomorrow.max_temp}.`);\n return data;\n } catch(error) {\n alert(error);\n }\n}","function searchWeather(cityName){\nfetch(`https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?q=${cityName}&APPID=${apiKey}&units=${unit}`)\n.then(y => {\n return y.json()\n})\n.then(y =>{\n init(y)\n})\n.catch(function(err){\n alert('city not found, please check spelling')\n})\n\n}","function getWeather(latitude, longitude) {\r\n let api = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}&units=metric`;\r\n \r\n fetch(api).then(function (response) {\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(function (data) {\r\n weather.temp = data.main.temp;\r\n weather.city = data.name;\r\n weather.country = data.sys.country;\r\n weather.info = data.weather[0].main;\r\n weather.icon = data.weather[0].icon;\r\n \r\n displayWeather();\r\n forecast(`forecast?lat=${latitude}&lon=${longitude}`, weather.city);\r\n })\r\n\r\n function displayWeather() {\r\n $('.temp').html(Math.round(weather.temp) + \" °C\");\r\n\r\n $('img.icon-img').attr('src', `images/icons/${ weather.icon}.png`);\r\n $('.info').html(weather.info);\r\n $('.city').html(weather.city);\r\n $('.country').html(weather.country);\r\n }\r\n}","function getCoordinates(city){\n \n let URL = \"https://api.openweathermap.org/data/2.5/weather?q=\"; //here\n let queryURL = URL + city + key;\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n localStorage.setItem(\"city\",response.name);\n localStorage.setItem(response.name+\"lon\",response.coord.lon);\n localStorage.setItem(response.name+\"lat\",response.coord.lat);\n localStorage.setItem(response.name+\"humidityLevel\", response.main.humidity);\n displayStats(response.name);\n fiveDay(response.name);\n displayHistory();\n localStorage.setItem(\"lastCity\", response.name);\n });\n}","function getWeather(latitude , longitude){\n let api =`http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n //console.log(api);\n fetch(api)\n .then(function(response){\n let data = response.json();\n return data;\n })\n .then(function(data){\n weather.temperature.value = Math.floor(data.main.temp -kelvin);\n weather.descripition = data.weather[0].descripition;\n weather.iconId = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function(){\n displayWeather();\n })\n}","async function getWeather() {\n const url = `https://api.openweathermap.org/data/2.5/weather?q=${city.textContent}&lang=en&appid=1964d0a7118d50f00dc12a34ffef2fef&units=metric`;\n const res = await fetch(url);\n const data = await res.json();\n const weather = data.weather;\n\n if (data.cod === '404') {\n weatherInfo.style.display = 'none';\n localStorage.clear();\n popup.style.display = 'block';\n popupBtn.addEventListener('click', () => (popup.style.display = 'none'));\n city.textContent = '';\n } else {\n weatherIcon.src = `http://openweathermap.org/img/w/${weather[0].icon}.png`;\n temperature.textContent = `${data.main.temp.toFixed(0)}°C`;\n weatherDescription.textContent = data.weather[0].description;\n humidity.textContent = `humidity: ${data.main.humidity} %`;\n wind.textContent = `wind: ${data.wind.speed} m/s`;\n }\n}","function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tunits: 'metric'\n \t}\n }","async function getCityWeather(lat, lon) {\n var oneCallURL = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=minutely&appid=\" + APIkey + units;\n\n const response = await fetch(oneCallURL);\n const data = await response.json();\n console.log(data);\n return data;\n}","function getWeather() {\n var location = globals.location,\n usrInput = $('.input-div input').val() || '';\n\n getCityWeather(usrInput, location);\n getCityForecast(usrInput, location)\n\n }","async function getWeatherData(city) {\n let response = await fetch('http://api.openweathermap.org/data/2.5/weather?q=' + city + '&APPID=' + apikey, { mode: 'cors' })\n let weatherData = await response.json()\n //console.log(weatherData.weather[0].description);\n let data = weatherData.weather[0].description;\n return data;\n}","getWeather(){\n fetch(`https://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${process.env.REACT_APP_WEATHER_API_KEY}/${this.state.lat},${this.state.lng}`)\n .then(response => response.json())\n .then(data => {\n this.setState({ weather: data })\n })\n }","function getWeather(city){\n\t\t$.get(\"http://api.openweathermap.org/data/2.5/weather?q=\"+city+\"&appid=e9eae461e99aa01a4e6115e572b2a66f\", function(data){\n\t\t\t\tconsole.log(data);\n\t\t\t\t$(\"#desc\").html(data.weather[0].description);\n\t\t\t\t$(\"#temp\").html(data.main.temp);\n\t\t\t\t$(\"#humidity\").html(data.main.humidity);\n\n})\n\n\t}","function getCurrentWeather() {\n // const enteredZipCode = document.getElementById('zip').value;\n const zipCode = document.getElementById('zip').value;\n const apiCall = baseUrl + '?zip=' + zipCode + '&appid=' + apiKey + unit;\n // const apiCall = 'http://api.openweathermap.org/data/2.5/weather?zip=94040&appid=25b7a4527f77b209b126a463a9baa9c0';\n getWeatherAPI(apiCall)\n .then(function (d){\n postData('/send', d)\n .finally(updateUI)});\n}","async function getWeatherDetails() {\n\n // Hit the weather API\n const weatherApiUrl = 'https://api.openweathermap.org/data/2.5/forecast/daily?q=totnes&units=metric&cnt=1&appid=d94bcd435b62a031771c35633f9f310a';\n const weatherResult = await logFetch(weatherApiUrl);\n\n // Update the temp\n const weatherTemperature = weatherResult.list[0].temp;\n temperature.innerHTML = weatherTemperature.day + ' ° C';\n\n // Update the icon\n weatherIcon.innerHTML = mapWeatherIcon(weatherResult.list[0].weather[0].id);\n}","function fetchWeatherInfoWithStatAndCountry(city, state, country) {\n let url = \"http://api.openweathermap.org/data/2.5/weather?q=\";\n url = `${url}${city},{state},${country}&appid=${APIKey}`;\n // console.log(\"url is\", url);\n return fetch(url).then(response => response.json());\n}","function getWeather(latitude, longitude) {\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\n\n fetch(api)\n .then(function (response) {\n let data = response.json();\n Console.log(data);\n return data;\n })\n .then(function (data) {\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\n weather.description = data.weather[0].description;\n //weather.iconId = data.weather[0].icon;\n weather.city = data.name;\n weather.country = data.sys.country;\n })\n .then(function () {\n displayWeather();\n });\n}","function fetchLocation(apiKey, latitude, longitude) {\n\n //you don't need a proxy but you need secure your key in the google developer console.\n // var googleApiLink = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=${apiKey}`;\n // console.log(googleApiLink)\n\n fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=imperial`)\n .then(response => {\n return response.json()\n })\n .then(data => {\n // Work with JSON data here\n console.log(data)\n //Set values for the location we picked the 4 object in the results becuase show the approximate address\n document.getElementById(\"location\").innerHTML = data.name;\n city = data.name;\n document.getElementById(\"currenttemp\").innerHTML = data.main.temp;\n temp = data.main.temp;\n weather=data.weather[0].main;\n windspeed=data.wind.speed;\n humid = data.clouds.all;\n\t\t\tdocument.getElementById(\"wind_speed\").innerHTML = data.wind.speed;\n\t\t\tdocument.getElementById(\"weather\").innerHTML = data.weather[0].main;\n\t\t\tconsole.log(data.wind.speed, data.weather[0].main, humid)\n\t\t\tdocument.getElementById(\"humidity\").innerHTML = humid;\n\t\t\t document.getElementById(\"currlocation\").innerHTML = data.name;\n\t\t\tdocument.getElementById(\"temp\").innerHTML = data.main.temp;\n\n\t\t\t// var iconcode = data.weather[0].icon;\n\t\t\tconsole.log(data.weather[0].icon)\n\t\t\tvar iconurl = `http://openweathermap.org/img/w/${data.weather[0].icon}.png`;\n\t\t\tconsole.log(iconurl)\n\t\t\tvar locationicon = document.querySelector('.forecast-icon');\n\t\t\tlocationicon.innerHTML = `
`\n })\n .catch(err => {\n // Do something for an error here\n throw (`Sorry, An Error occured. ${err}`);\n })\n}","getWeather() {\n this.setState({\n loading: true,\n error: '',\n userInput: '',\n data: {},\n data10: [],\n location: {},\n icon: ''\n })\n\n axios.get(`https://api.wunderground.com/api/${config.apiKey}/conditions/q/${this.state.userInput}.json`)\n .then(res =>\n this.setState({\n data: res.data.current_observation,\n location: res.data.current_observation.display_location,\n icon: res.data.current_observation.icon_url\n })\n )\n .catch(() => this.weatherFail());\n }","function useCurrentWeatherApi(input) {\n\tif (alphabetRegex.test(input)) {\n\t\t// get weather by city name\n\t\tfetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?q=${input},us&appid=${apikey}&units=imperial`\n\t\t)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tconsole.log('current weather: ' + data);\n\t\t\t\tshowCurrentWeather(data);\n\t\t\t\tuseOneCallApi(data);\n\t\t\t});\n\t} else {\n\t\t// get weather by zip code\n\t\tfetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?zip=${input},us&appid=${apikey}&units=imperial`\n\t\t)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tconsole.log('current weather: ', data);\n\t\t\t\tshowCurrentWeather(data);\n\t\t\t\tuseOneCallApi(data);\n\t\t\t});\n\t}\n}","function getWeather(){\r\n let api = `http://api.openweathermap.org/data/2.5/forecast?q=hanoi&appid=${key}`;\r\n\r\n fetch(api)\r\n .then(function(response){\r\n let data = response.json();\r\n return data;\r\n })\r\n .then(function(data){\r\n weather.temperature.value[0] = Math.floor(data.list[6].main.temp - KELVIN);\r\n weather.temperature.value[1] = Math.floor(data.list[12].main.temp - KELVIN);\r\n weather.temperature.value[2] = Math.floor(data.list[18].main.temp - KELVIN);\r\n weather.temperature.value[3] = Math.floor(data.list[24].main.temp - KELVIN);\r\n weather.temperature.value[4] = Math.floor(data.list[30].main.temp - KELVIN);\r\n\r\n weather.description[0] = data.list[6].weather[0].description;\r\n weather.description[1] = data.list[12].weather[0].description;\r\n weather.description[2] = data.list[18].weather[0].description;\r\n weather.description[3] = data.list[24].weather[0].description;\r\n weather.description[4] = data.list[30].weather[0].description;\r\n\r\n weather.iconId[0] = data.list[6].weather[0].icon;\r\n weather.iconId[1] = data.list[12].weather[0].icon;\r\n weather.iconId[2] = data.list[18].weather[0].icon;\r\n weather.iconId[3] = data.list[24].weather[0].icon;\r\n weather.iconId[4] = data.list[30].weather[0].icon;\r\n \r\n weather.time[0] = data.list[6].dt_txt;\r\n weather.time[1] = data.list[12].dt_txt;\r\n weather.time[2] = data.list[18].dt_txt;\r\n weather.time[3] = data.list[24].dt_txt;\r\n weather.time[4] = data.list[30].dt_txt;\r\n\r\n \r\n //Location\r\n weather.city = data.city.name;\r\n weather.country = data.city.country;\r\n })\r\n .then(function(){\r\n displayWeather();\r\n })\r\n}"],"string":"[\n \"function getWeather(data){\\n var api_key = '6996386e46f031703c26cea51cac9e6e';\\n var url = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?units=imperial&APPID=${api_key}&${data}`;\\n\\n fetch(url).then(response => response.json()).then(json_response => displayWeather(json_response));\\n}\",\n \"async getWeather() { \\n\\t\\tconst response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.zipcode}&APPID=9d0317c32366d083e6e35b438595476c&units=imperial`);\\n\\t\\tconst responseData = response.json();\\n\\t\\treturn responseData;\\n\\t}\",\n \"async getWeather() {\\n const response = await fetch(`http;//api.openweathermap.org/data/2.5/weather?${}`);\\n }\",\n \"async getWeather() {\\t\\n\\t\\tconst response = await fetch(\\n\\t\\t\\t`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state},US&units=imperial&mode=json&appid=${this.apiKey}`\\n\\t\\t);\\t\\n\\n\\t\\tconst responseData = await response.json();\\n\\n\\t\\treturn responseData;\\n\\t}\",\n \"async getWeather(){\\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.location}&units=metric&appid=${this.apikey}`);\\n\\n const responseData = await response.json();\\n\\n return responseData;\\n }\",\n \"async getWeather() {\\n const response = await fetch(\\n `https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.country}&units=metric&APPID=${this.apiKey}`\\n );\\n\\n const responseData = await response.json();\\n\\n return responseData;\\n }\",\n \"async getWeather() {\\n const response = await fetch(`http://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${this.key}/${this.latitude},${this.longitude}`)\\n const result = await response.json();\\n\\n const ocd = await fetch(`https://api.opencagedata.com/geocode/v1/json?key=${this.ocdkey}&q=${this.latitude}%2C${this.longitude}&language=en`)\\n const ocdResult = await ocd.json();\\n\\n return {\\n result,\\n ocdResult,\\n }\\n }\",\n \"async getWeather(){\\n const response = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state},us&appid=${this.apikey}`);\\n\\n const responseJSON = await response.json();\\n return responseJSON;\\n }\",\n \"function getWeatherData() {\\n\\n var url = 'http://api.openweathermap.org/data/2.5/weather?lat=' + latitude + '&lon=' + // build query url.\\n longitude + '&APPID=936e860c72edb8cb527707e7d59da1ea' +\\n '&units=' + countryUnits + '&preventCache=' + new Date(); // build query url\\n\\n $.getJSON(url, null, function(json, textStatus) {\\n\\n console.log(\\\"weather info \\\" + JSON.stringify(json) + \\\"response Satus is \\\" + textStatus);\\n processresponse(json);\\n\\n });\\n }\",\n \"async getWeather() {\\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state}&units=imperial&appid=${this.apiKey}`)\\n\\n const responseData = await response.json();\\n\\n return responseData\\n }\",\n \"async getWeather() {\\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this._city},${this._state}&appid=${this._apiKey}&units=metric`)\\n\\n const responseData = await response.json();\\n\\n return responseData; //todo !!!\\n }\",\n \"function getWeather(city) {\\n fetch(\\\"https://api.openweathermap.org/data/2.5/weather?q=\\\"\\n + city \\n +\\\"&units=metric&appid=\\\"+api_key+\\\"\\\")\\n .then( (response) => response.json())\\n .then((data) => displayWeather(data)); \\n \\n}\",\n \"async getWeather() {\\r\\n const weatherRespone = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.apiKey}&units=metric`);\\r\\n const weather = await weatherRespone.json();\\r\\n\\r\\n return {\\r\\n weather\\r\\n };\\r\\n\\r\\n }\",\n \"async getWeather() {\\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.countryCode}&appid=${this.apiKey}`);\\n\\n const responseData = await response.json();\\n\\n return responseData;\\n }\",\n \"static async getWeather() {\\n try {\\n let pos = await Weather.getGeoData();\\n const response = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${pos.lat}&lon=${pos.lon}&exclude=hourly,minutely,alerts&units=metric&appid=${APIKey}`);\\n const data = await response.json();\\n\\t\\t\\tlet result = data.daily.slice(0,8)\\n\\t\\t\\treturn result;\\n } catch(err) {\\n console.log(err);\\n }\\n }\",\n \"function fetchWeatherInfo(city) {\\n let url = \\\"http://api.openweathermap.org/data/2.5/weather?q=\\\";\\n url += city + \\\"&appid=\\\" + APIKey;\\n // console.log(\\\"url is\\\", url);\\n return fetch(url).then(response => response.json());\\n}\",\n \"async getWeather(){\\n // narrow response info to make it faster\\n const exclude = '?exclude=minutely,hourly,daily,alerts,flags';\\n const response = await fetch(`https://api.darksky.net/forecast/${this.apiKeyDS}/${this.lat},${this.lon}${exclude}`);\\n const responseData = await response.json();\\n return responseData;\\n }\",\n \"function getWeather() {\\n return fetch(\\\"https://api.openweathermap.org/data/2.5/weather?q=barcelona&units=metric&appid=644a219f426a3224328405aa28d80b8f\\\").then(function (res) { return res.json(); })\\n .then(function (res) {\\n return res;\\n });\\n}\",\n \"function getWeatherInfo(city) {\\n\\n const apiKey = \\\" \\\"; //weather API key\\n\\n fetch(\\\"https://api.openweathermap.org/data/2.5/weather?q=\\\" + city + \\\",&appid=\\\" + apiKey)\\n .then(response => response.json())\\n //.then(response => console.log(response));\\n .then(response => displyWeatherInfo(response));\\n\\n }\",\n \"function getWeatherInfo () {\\n\\n const long = App.city.longitude;\\n const lat = App.city.latitude;\\n const url = \\\"https://api.darksky.net/forecast/8877941a6145fd159c584b8f95b52bb9/\\\" + lat + \\\",\\\" + long + \\\"?callback=?\\\";\\n\\n $.ajax({\\n url: url,\\n dataType: \\\"jsonp\\\",\\n success: function (json) {\\n App.weatherForecast = json;\\n }\\n }).done(function () {\\n updateWeatherInfo(App.weatherForecast);\\n });\\n\\n }\",\n \"async getGeoWeather() {\\n\\t\\tconst geoResponse = await fetch(\\n\\t\\t\\t`https://api.opencagedata.com/geocode/v1/json?q=${this.lat}+${this.long}&key=${this.geoApiKey}`\\n\\t\\t);\\n\\t\\n\\t\\t// Convert longtitude latitude to city state\\n\\t\\tconst geoResponseData = await geoResponse.json();\\n\\n\\t\\tlet city = geoResponseData.results[0].components.city;\\n\\t\\tlet state = geoResponseData.results[0].components.state_code;\\n\\n\\t\\t// Pass city state to API to get current weather data\\n\\t\\tconst response = await fetch(\\n\\t\\t\\t`https://api.openweathermap.org/data/2.5/weather?q=${city},${state},US&units=imperial&mode=json&appid=${this.apiKey}`\\n\\t\\t);\\n\\n\\t\\tconst responseData = await response.json();\\n\\n \\treturn responseData;\\n\\t}\",\n \"async function getAllWeatherData() {\\n let weatherData = await getLocationWeather(\\n `https://api.openweathermap.org/data/2.5/weather?q=${input}&APPID=${API}`\\n );\\n\\n try {\\n // Extract data needed for fetching forecast data.\\n let testLat = weatherData.coord.lat;\\n let testLon = weatherData.coord.lon;\\n\\n let response = await fetch(\\n `https://api.openweathermap.org/data/2.5/onecall?lat=${testLat}&lon=${testLon}&exclude=minutely,hourly&appid=${API}`\\n );\\n let forecastData = await response.json();\\n\\n handleForecastState(forecastData);\\n } catch {\\n alert('Getting forecast failed.');\\n }\\n }\",\n \"function findWeatherDetails() {\\n let searchLink =\\n \\\"https://api.openweathermap.org/data/2.5/weather?q=copenhagen&appid=\\\" +\\n appKey;\\n httpRequestAsync(searchLink, theResponse);\\n}\",\n \"async getWeather(postcode){\\r\\n\\r\\n const tempResponse = await fetch(`//api.openweathermap.org/data/2.5/weather?zip=${this.postcode},gb&units=metric&APPID=${this.apiKey}`);\\r\\n\\r\\n const responseData = await tempResponse.json();\\r\\n \\r\\n return responseData;\\r\\n \\r\\n }\",\n \"async getWeather() {\\n this.requestURL = this.city;\\n const weatherResponse = await fetch(this.requestURL);\\n const weatherData = await weatherResponse.json();\\n return weatherData\\n }\",\n \"function getLocation(city) {\\n // fetching current conditions\\n\\n var apiUrl = 'https://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=a3be7588e2f22d761077e844f13fff0c&units=imperial';\\n fetch(apiUrl)\\n .then(function(response) {\\n if (response.ok) {\\n //console.log(response);\\n // JSON parse\\n response.json().then(function(data) {\\n console.log(data)\\n getForecast(data.coord.lat, data.coord.lon)\\n })\\n } else {\\n MaterialDialog.alert('Error: ' + response.statusText);\\n }\\n }).catch(function(error) {\\n MaterialDialog.alert('Unable to getLocation: Invalid Connection');\\n });\\n}\",\n \"function getWeather(city) {\\n fetch(\\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&id=524901&appid=${api.key}`\\n )\\n .then((data) => {\\n return data.json();\\n })\\n .then(displayWeather);\\n}\",\n \"function tokyoWeather() {\\n\\n // use fetch to get the weather data from Tokyo\\n fetch(\\\"https://api.openweathermap.org/data/2.5/weather?q=Tokyo,jp&units=imperial&appid=153a1ec8f6b54ec52d519c21641a079f\\\")\\n \\n .then(function(resp) { return resp.json() }) // Convert data to json\\n .then(function(data) {\\n displayWeather(data);\\n })\\n //catch errors\\n .catch(function() {\\n \\n });\\n}\",\n \"function fetchWeather(city) {\\n fetch('http://api.openweathermap.org/data/2.5/weather?q='\\n + city \\n + '&units=metric&appid='\\n + apiKey)\\n .then(response => response.json())\\n .then(displayData)\\n .catch(error => console.error('error in server, please try again later.'))\\n}\",\n \"getWeatherInfo(){\\n\\t\\tlet url = 'https://api.openweathermap.org/data/2.5/weather?q=' + this.state.cityname + '&units=metric&appid=ce0cb4b99e8ee814c20a4f76609c8196'\\n\\t\\tfetch(url)\\n\\t\\t.then(response => response.json())\\n\\t\\t.then(data => {\\n\\t\\t\\tconsole.log(data);\\n\\t\\t\\t// let tempData = JSON.stringify(data);\\n \\t// console.log(tempData);\\n\\t\\t\\t// alert(tempData);\\n\\t\\t\\tthis.processData(data);\\t\\t\\t\\n\\t\\t})\\n\\t\\t.catch(function(error){\\n\\t\\t\\tconsole.log(error.message);\\n\\t\\t\\tthrow error.message;\\n\\t\\t});\\n\\n\\t\\t// this.getForecast();\\n\\t}\",\n \"function getGeoWeather() {\\n \\tweather.getGeoWeather()\\n\\t\\t.then((results) => {\\n\\t\\t\\tui.display(results);\\n\\t\\t})\\n\\t\\t.catch((err) => err);\\n}\",\n \"async function getWeatherData() {\\n getLocation();\\n const URL = `http://api.openweathermap.org/data/2.5/weather?lat=${LAT}&lon=${LON}&appid=${API_KEY}`;\\n const apiRES = await fetch(URL).then((res) => res.json());\\n setActualTemperature(Math.ceil(apiRES.main.temp - 273.15));\\n setWeatherDescription(apiRES.weather[0].description);\\n setWeatherLocation(apiRES.name);\\n const iconURL = `http://openweathermap.org/img/wn/${apiRES.weather[0].icon}.png`;\\n setWeatherIcon(iconURL);\\n }\",\n \"function GetGlobalWeather(cityname,apiuri,apitkn){\\n let current = httpGet(apiuri+'weather?appid='+apitkn+'&units=metric&q='+cityname);\\n console.log(current.cod);\\n if(current.cod == 200){\\n let city = current.name;\\n let coords = current.coord;\\n let daily = httpGet(apiuri+'onecall?appid='+apitkn+'&lat='+coords.lat+'&lon='+coords.lon+'&exclude=hourly,current,minutely&units=metric');\\n return {'current':current,'daily':daily.daily,'city':city};\\n }else{\\n alert(cityname+' Not finded')\\n }\\n \\n}\",\n \"function fetchWeather () {\\n $.ajax({\\n type: 'GET',\\n dataType: 'jsonp',\\n url: urlWeather,\\n xhrFields: {\\n withCredentials: false\\n },\\n success: weatherSuccess,\\n\\n error: fetchError\\n });\\n}\",\n \"function getWeather(zipcode) {\\n // make api call and get response\\n const weather = fetch(`api.openweathermap.org/data/2.5/weather?zip=${zipcode}&appid=${API_KEY}`)\\n .then(res => res.json())\\n .then(data => console.log(data))\\n}\",\n \"function getWeather(latitude, longitude) {\\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\\n console.log(api)\\n\\n fetch(api)\\n .then(function (response) {\\n let data = response.json();\\n return data;\\n })\\n .then(function (data) {\\n weather.city = data.name; // City name\\n weather.country = data.sys.country; // Country name\\n weather.iconId = data.weather[0].icon; // Icon\\n weather.temperature.value = Math.floor(data.main.temp - KELVIN); // Temp\\n weather.description = data.weather[0].description; // Short description\\n weather.sunrise = convertTime(data.sys.sunrise); // Sunrise\\n weather.sunset = convertTime(data.sys.sunset); // Sunset\\n weather.wind = Math.round(data.wind.speed); // Wind speed\\n weather.gust = Math.round(data.wind.gust); // Gust speed\\n weather.feels_like = Math.floor(data.main.feels_like - KELVIN); // Feels-like\\n weather.humidity = data.main.humidity; // Humidity \\n weather.temp_min = Math.floor(data.main.temp_min - KELVIN); // Temp_min\\n weather.temp_max = Math.floor(data.main.temp_max - KELVIN); // Temp_max\\n })\\n .then(function () {\\n displayBackground();\\n displayWeather();\\n });\\n}\",\n \"function getWeather() {\\n\\tlet query = \\\"https://api.openweathermap.org/data/2.5/weather?\\\" +\\n\\t\\t\\\"q=\\\" + city + \\\"&units=imperial&appid=\\\" + OWM_API_KEY;\\n\\t\\n\\t$.ajax({\\n\\t\\turl: query,\\n\\t\\tmethod: \\\"GET\\\"\\n\\t}).done(data => {\\n\\t\\tif (!data) return;\\n\\t\\t\\n\\t\\tif (data.main && data.main.temp && data.weather && data.weather.length > 0) {\\n\\t\\t\\t$('#temp').text(data.main.temp.toFixed(1) + '\\\\xB0' + 'F');\\n\\t\\t\\t\\n\\t\\t\\t$('#weather-main > i').remove();\\n\\t\\t\\t\\n\\t\\t\\tlet weatherData = data.weather[0];\\n\\t\\t\\t\\n\\t\\t\\tlet icon = $('
');\\n\\t\\t\\tlet time = weatherData.icon.endsWith('d') ? 'day-' : weatherData.icon.endsWith('n') ? 'night-' : '';\\n\\t\\t\\tlet iconClass = 'wi wi-owm-' + time + weatherData.id;\\n\\t\\t\\ticon.addClass(iconClass);\\n\\t\\t\\t$('#weather-main').prepend(icon);\\n\\t\\t\\t\\n\\t\\t\\tlet conditions = weatherData.description;\\n\\t\\t\\t$('#weather-conditions').text(titleCase(conditions));\\n\\t\\t\\t\\n\\t\\t\\t//console.log(data);\\n\\t\\t}\\n\\t});\\n\\t\\n\\tquery = 'https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=\\\"' + city.toLowerCase() + ', ' + state.toLowerCase() + '\\\")&format=json';\\n\\t$.ajax({\\n\\t\\turl: query,\\n\\t\\tmethod: \\\"GET\\\"\\n\\t}).done(data => {\\n\\t\\tif (!data || !data.query || !data.query.results || !data.query.results.channel) return;\\n\\t\\t\\n\\t\\tconsole.log(data.query.results.channel);\\n\\t\\t\\n\\t\\tif (!data.query.results.channel.item || !data.query.results.channel.item.forecast) return;\\n\\t\\t\\n\\t\\tlet forecast = data.query.results.channel.item.forecast;\\n\\t\\t\\n\\t\\tif (forecast.length > 0) {\\n\\t\\t\\t$('#temp-high').text(forecast[0].high + '\\\\xB0' + 'F');\\n\\t\\t\\t$('#temp-low').text(forecast[0].low + '\\\\xB0' + 'F');\\n\\t\\t\\t\\n\\t\\t\\t$('#weather-weekly').empty();\\n\\t\\t\\tfor (let i = 1; i < 6 && i < forecast.length; i++) {\\n\\t\\t\\t\\tlet col = $('').addClass('col');\\n\\t\\t\\t\\tlet panel = $('
').addClass('panel daily-forecast');\\n\\t\\t\\t\\tlet dayWeather = forecast[i];\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tpanel.append($('
').addClass('day').text(dayWeather.day.toUpperCase()));\\n\\t\\t\\t\\tpanel.append($('').addClass('wi wi-yahoo-' + dayWeather.code));\\n\\t\\t\\t\\tpanel.append($('
').addClass('daily-high').text(dayWeather.high + '\\\\xB0' + 'F'));\\n\\t\\t\\t\\tpanel.append($('
').addClass('daily-low').text(dayWeather.low + '\\\\xB0' + 'F'));\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tcol.append(panel);\\n\\t\\t\\t\\t$('#weather-weekly').append(col);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t});\\n}\",\n \"async getWeather() {\\n //Weather API\\n let url = \\\"https://api.darksky.net/forecast/\\\" + API_KEY + \\\"/\\\" +\\n this.state.latitutde + \\\",\\\" + this.state.longitude;\\n \\n //Location API\\n let loc = \\\"https://us1.locationiq.com/v1/reverse.php?key=\\\" + API_LOCATION +\\\"&lat=\\\"+ this.state.latitutde +\\\"&lon=\\\"\\n + this.state.longitude + \\\"&format=json\\\";\\n\\n\\n //Get Weather Details from Weather API\\n const response = await fetch(url)\\n const json = await response.json();\\n this.setState({ currentForecast: json.currently });\\n this.setState({ hourlyForecast: json.hourly });\\n this.setState({ dailyForecast: json.daily });\\n\\n //Get City Name from Location API\\n const responseCity = await fetch(loc)\\n const jsonCity = await responseCity.json();\\n this.setState({locationJson: jsonCity.address});\\n }\",\n \"async getWeather(){\\n const response = await fetch(`http://api.apixu.com/v1/current.json?key=${this.apiKey}&q=${this.city}&r=${this.region}`);\\n const resultsData = await response.json();\\n //console.log(resultsData);\\n return resultsData;\\n \\n }\",\n \"function getWeatherApi() {\\n city = document.querySelector(\\\"#cityInput\\\").value;\\n\\n query = currentUrl + city + apiKey + \\\"&units=imperial\\\";\\n\\n fetch(query)\\n .then((response) => response.json())\\n .then((response) => {\\n currentCity.textContent = response.name;\\n currentTemp.textContent = \\\"Current Temp: \\\" + response.main.temp + \\\" F\\\";\\n currentHumidity.textContent =\\n \\\"Current Humidity: \\\" + response.main.humidity + \\\" %\\\";\\n currentWindSpeed.textContent =\\n \\\"Current Wind Speed: \\\" + response.wind.speed + \\\" MPH\\\";\\n });\\n}\",\n \"fetchWeatherData(lat,lon){\\n\\t\\t// setting up the api key value and the longitude and latitude of the devices current location to be used in the API request\\n\\t\\tlet rqst = \\\"https://api.openweathermap.org/data/2.5/weather?lat=\\\" + lat.toString() + \\\"&lon=\\\" + lon.toString() + \\\"&appid=\\\" + this.state.apiKey;\\n console.log(\\\"Making API Request ...\\\");\\n\\t\\t$.ajax({\\n\\t\\t\\turl: rqst,\\n\\t\\t\\tdataType: \\\"jsonp\\\",\\n\\t\\t\\tsuccess : this.parseResponse,\\n\\t\\t\\terror : function(req, err){ console.log('API call failed ' + err); }\\n\\t\\t})\\n\\t}\",\n \"function getWeather(woeid) {\\n fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`)\\n .then(result => {\\n // console.log(result);\\n return result.json();\\n })\\n .then(data => {\\n // console.log(data);\\n const today = data.consolidated_weather[0];\\n console.log(`Temperatures today in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`);\\n })\\n .catch(error => console.log(error));\\n}\",\n \"getWeather(){\\n\\n\\t\\t// Construct the API url to call\\n\\t\\tlet url = 'https://api.openweathermap.org/data/2.5/weather?lat=' + this.state.latitude + '&lon=' + this.state.longitude + '&units=metric&appid=ce0cb4b99e8ee814c20a4f76609c8196';\\n\\t\\t// console.log(url);\\n\\n\\t\\t// Call the API, and set the state of the weather forecast\\n\\t\\tfetch(url)\\n\\t\\t.then(response => response.json())\\n\\t\\t.then(data => {\\n\\t\\t\\tconsole.log(data);\\n\\t\\t\\t// let tempData = JSON.stringify(data);\\n\\t\\t\\t\\t// console.log(tempData);\\n\\t\\t\\t// alert(tempData);\\n\\t\\t\\tthis.processData(data);\\n\\t\\t})\\n\\t\\t.catch(function(error){\\n\\t\\t\\tconsole.log(error.message);\\n\\t\\t\\tthrow error.message;\\n\\t\\t });\\n\\n\\t\\t// this.getForecast();\\n\\t}\",\n \"async function fetchInitialWeatherDataForMy(city) {\\n try {\\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=f778724f49d8bcbf6a7c1111529b5d72`, { mode: 'cors' });\\n const data = await response.json();\\n return data;\\n } catch (err) {\\n return console.error(err);\\n }\\n}\",\n \"async getWeather() {\\n const response = await this._getCall(`${this.#weatherApi}/weather?q=${this.city},${this.country}`);\\n return await response.json();\\n }\",\n \"function getCurrentWeather () {\\n\\n var key = \\\"2fd6a7c1addf009b30af95d20e54bde2\\\";\\n var queryURL = \\\"https://api.openweathermap.org/data/2.5/weather?q=\\\" + searchCity + \\\"&units=imperial&appid=\\\" + key;\\n\\n $.ajax({\\n url: queryURL,\\n method: \\\"GET\\\"\\n }).then(function(response) {\\n // console.log(response);\\n currentWeatherObj = response\\n currentWeatherIcon = currentWeatherObj.weather[0].icon;\\n // console.log(currentWeatherIcon);\\n displayCurrentWeather();\\n cityLongited = currentWeatherObj.coord.lon;\\n cityLatitude = currentWeatherObj.coord.lat;\\n getUVIndex();\\n\\n\\n });\\n}\",\n \"function getData({city, country, apiKey, unitsSys}) {\\n const url = 'https://api.openweathermap.org/data/2.5/weather?';\\n fetch(url + `q=${city},${country}&units=${units[unitsSys]}&appid=${apiKey}`)\\n .then(response => response.json())\\n .then(data => {\\n console.log(data);\\n makeWeatherCard({containerSelector: '.output',\\n dataObj: data});\\n })\\n .catch((error) => {\\n console.log(error);\\n showErrorInfo({containerSelector: '.output',\\n errorMsg: 'Oops! Something went wrong :('});\\n });\\n}\",\n \"function getData() {\\n var APIkey = \\\"c19b2f1f085df13be7309df32599c301\\\";\\n var queryURL = \\\"https://api.openweathermap.org/data/2.5/onecall?lat=\\\" + lat + \\\"&lon=\\\" + lon + \\\"&exclude=hourly,minutely,alerts&units=imperial&appid=\\\" + APIkey;\\n\\n $.ajax({\\n url: queryURL,\\n method: \\\"GET\\\"\\n }).then(function(response) {\\n console.log(\\\"--------------------\\\");\\n console.log(\\\"current date is \\\" + response.current.dt);\\n console.log(\\\"current temperature is \\\" + response.current.temp);\\n console.log(\\\"current humidity is \\\" + response.current.humidity);\\n console.log(\\\"current wind speed is \\\" + response.current.wind_speed);\\n console.log(\\\"current uv index is \\\" + response.current.uvi);\\n console.log(\\\"current weather icon is \\\" + response.current.weather[0].icon);\\n console.log(\\\"--------------------\\\");\\n\\n dt = response.current.dt;\\n temp = response.current.temp;\\n hum = response.current.humidity;\\n wind = response.current.wind_speed;\\n uvi = response.current.uvi;\\n icon = response.current.weather[0].icon;\\n daily = response.daily;\\n \\n currentData(city, dt, temp, hum, wind, uvi, icon);\\n forecastData(daily);\\n }); \\n}\",\n \"function getWeather(testCity) {\\n var requestOptions = {\\n method: 'GET',\\n redirect: 'follow'\\n };\\n\\n fetch(\\\"https://api.openweathermap.org/data/2.5/weather?q=\\\" + testCity + \\\"&APPID=de6cda6ee489e5192ad8edc5d0f21166&units=imperial\\\", requestOptions)\\n .then(response => response.text())\\n .then(result => {\\n if (result) {\\n result = JSON.parse(result)\\n updateDisplay(result);\\n uvIndex(result.coord.lat, result.coord.lon);\\n }\\n return;\\n })\\n .catch(error => console.log('error', error))\\n .finally(() => { renderCityList() })\\n\\n}\",\n \"function getWeather(lat, lon, city) {\\n\\n //var city = $(\\\"#citySearchTextField\\\").val();\\n var baseURL = \\\"https://api.openweathermap.org/data/2.5/\\\";\\n\\n if (lat !== undefined && lon !== undefined) {\\n var queryParam = \\\"lat=\\\" + lat + \\\"&lon=\\\" + lon;\\n }\\n else {\\n var queryParam = \\\"q=\\\" + city;\\n };\\n\\n\\n var openWeatherUrl = baseURL + \\\"weather?&units=imperial&\\\" + queryParam + \\\"&APPID=\\\" + apiKey;\\n openWeatherUrl = encodeURI(openWeatherUrl);\\n\\n // Call Weather API for general weather\\n $.ajax({\\n url: openWeatherUrl,\\n method: \\\"GET\\\"\\n\\n\\n }).then(function (responseW) {\\n\\n $(\\\"#currentDate\\\").html(\\\" (\\\" + moment().format(\\\"M/D/YYYY\\\") + \\\")\\\");\\n\\n $(\\\"#cityName\\\").html(responseW.name); \\n $(\\\"#temperature\\\").html(\\\"Temperature: \\\"+ responseW.main.temp + \\\" ℉\\\");\\n $(\\\"#humidity\\\").html(\\\"Humidity: \\\"+ responseW.main.humidity + \\\"%\\\");\\n $(\\\"#windSpeed\\\").html(\\\"Wind Speed: \\\"+ responseW.wind.speed + \\\" MPH\\\");\\n\\n // Set weather icon\\n var image_src = \\\"https://openweathermap.org/img/wn/\\\" + responseW.weather[0].icon +\\\"@2x.png\\\";\\n $(\\\"#currentImg\\\").attr(\\\"src\\\",image_src);\\n \\n // Call Weather API for UV Index\\n var uvIndexUrl = baseURL + \\\"uvi?lat=\\\" + responseW.coord.lat + \\\"&lon=\\\" + responseW.coord.lon + \\\"&APPID=\\\" + apiKey;\\n $.ajax({\\n url: uvIndexUrl,\\n method: \\\"GET\\\"\\n\\n }).then(function (responseU) {\\n $(\\\"#uvIndex\\\").html(\\\"UV Index: \\\" + responseU.value +\\\" \\\");\\n })\\n\\n });\\n }\",\n \"function getWeather(city) {\\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&APPID=${apiKey}`)\\n .then(response => {\\n return response.json();\\n })\\n .then(data => {\\n $(\\\".date\\\").text(data.name + \\\" \\\" + date);\\n latitude = data.coord.lat;\\n longitude = data.coord.lon;\\n fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&units=imperial&appid=${apiKey}`)\\n .then(response => {\\n return response.json();\\n })\\n .then(data => {\\n iconCode = data.current.weather[0].icon;\\n const iconUrl = \\\"http://openweathermap.org/img/w/\\\" + iconCode + \\\".png\\\";\\n let uvi = data.current.uvi;\\n $(\\\"#icon\\\").attr('src', iconUrl);\\n $(\\\".temp\\\").text('Temp: ' + data.current.temp + '°F');\\n $(\\\".wind\\\").text('Wind: ' + data.current.wind_speed + ' MPH');\\n $(\\\".humidity\\\").text('Humidity: ' + data.current.humidity + ' %');\\n $(\\\".index\\\").text(uvi);\\n $(\\\".fiveCast\\\").empty();\\n uvConditions(uvi);\\n fiveDayForecast(data);\\n console.log(data);\\n })\\n })\\n }\",\n \"function fetchWeatherData() {\\n if (DEBUG) {\\n console.log('Fetching weather data...');\\n console.log('Country: ' + country);\\n console.log('City: ' + city);\\n console.log('WOEID: ' + woeid);\\n }\\n \\n locChanged = (woeid != lastWOEID);\\n lastWOEID = woeid;\\n\\n if (!config.TempUnit || config.TempUnit === '' || config.TempUnit === 'Auto') {\\n // Determine temperature units from country code (US gets F, everyone else gets C)\\n if (country == 'US')\\n unit = 'F';\\n else\\n unit = 'C';\\n } else {\\n unit = config.TempUnit;\\n }\\n\\n if (DEBUG) console.log('Unit: ' + unit);\\n\\n // URL for getting basic weather forecast data in XML format (RSS)\\n reqWeather.open('GET', 'http://weather.yahooapis.com/forecastrss?w=' + woeid + '&u=' + unit.toLowerCase(), true);\\n // Fetch the weather data\\n reqWeather.send(null);\\n }\",\n \"async getWeather() {\\n // Convert location to latitude and longitude using Google Maps geocoder\\n const latLong = await this.getLatLong();\\n const lat = latLong[0].geometry.location.lat();\\n const lng = latLong[0].geometry.location.lng();\\n\\n // Get general weather API info for this location, including URLs for forecast, city name, etc.\\n const weatherApiInfo = await (\\n await fetch(`https://api.weather.gov/points/${lat},${lng}`)\\n ).json();\\n const forecastCity =\\n weatherApiInfo.properties.relativeLocation.properties.city;\\n const forecastState =\\n weatherApiInfo.properties.relativeLocation.properties.state;\\n\\n // Get list of all weather stations in the area. Use the first station in the list.\\n const observationStations = await (\\n await fetch(weatherApiInfo.properties.observationStations)\\n ).json();\\n const weatherStation = observationStations.features[0].properties.name;\\n\\n // Get the current conditions\\n const currentConditions = await (\\n await fetch(\\n `https://api.weather.gov/stations/${observationStations.features[0].properties.stationIdentifier}/observations/latest?require_qc=false`\\n )\\n ).json();\\n\\n // Get daily (7-day) forecast\\n const dailyForecast = await (\\n await fetch(weatherApiInfo.properties.forecast)\\n ).json();\\n\\n // Get hourly forecast\\n const hourlyForecast = await (\\n await fetch(weatherApiInfo.properties.forecastHourly)\\n ).json();\\n\\n // Return all this info and let the other module parse it and convert it\\n return {\\n forecastCity: forecastCity,\\n forecastState: forecastState,\\n weatherStationLoc: weatherStation,\\n currentConditions: currentConditions.properties,\\n dailyForecast: dailyForecast.properties,\\n hourlyForecast: hourlyForecast.properties,\\n };\\n }\",\n \"async function fetchTheRestOfMyWeatherData(city) {\\n try {\\n // calls function that fetches weather data and grabs lat / lon / dt from the user's city\\n const initialData = await fetchInitialWeatherDataForMy(city);\\n\\n // takes lat / lon / dt from initialData variable above, and processes it for API below\\n const lat = initialData.coord.lat.toFixed(2);\\n const lon = initialData.coord.lon.toFixed(2);\\n // final API call that is then processed and used by the app\\n const response = await fetch(`http://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=f778724f49d8bcbf6a7c1111529b5d72`, { mode: 'cors' });\\n return response;\\n } catch (err) {\\n return console.error(err);\\n }\\n}\",\n \"function weather(){\\r\\n\\r\\n\\t\\tvar appKey = \\\"4823e0379d7d603fb2cbfdbad5c5842e\\\";\\r\\n\\r\\n\\t\\tvar request = $.ajax({\\r\\n\\t\\t\\ttype: 'GET',\\r\\n\\t\\t\\turl: \\\"https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?lat=\\\"+lat+\\\"&lon=\\\"+lon+\\\"&appid=\\\"+appKey+\\\"&units=\\\"+units+\\\"\\\",\\r\\n\\t\\t\\tcrossDomain: true,\\r\\n\\t\\t\\tdataType: 'json',\\r\\n\\t\\t\\tsuccess: function(data){\\r\\n\\t\\t\\t\\tconsole.log('success', data);\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\terror: function(e){\\r\\n\\t\\t\\t\\tconsole.log('Error Loading Weather', e);\\r\\n\\t\\t\\t},\\r\\n\\r\\n\\t\\t});\\r\\n\\r\\n\\t\\t// If everything works get the corresponding image and populate the text fields\\r\\n\\t\\trequest.done(function(data){\\r\\n\\t\\t\\tgetImage(data);\\r\\n\\t\\t\\tpopulate(data);\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function getWeather(map, latlng, windy) {\\n\\tvar xmlHttpRequest = new XMLHttpRequest();\\n\\txmlHttpRequest.onreadystatechange = function()\\n\\t{\\n\\t if( this.readyState == 4 && this.status == 200 )\\n\\t {\\n\\t if( this.response )\\n\\t {\\n\\t \\t//console.log(this.response.list);\\n\\t showWeather(map, this.response.list, windy);\\n\\t }\\n\\t }\\n\\t}\\n\\txmlHttpRequest.open( 'GET',\\\"http://api.openweathermap.org/data/2.5/find?lat=\\\"+ latlng.lat() + \\\"&lon=\\\"+latlng.lng()+\\\"&cnt=10&appid=\\\"+ API_KEY , true );\\n\\txmlHttpRequest.responseType = 'json';\\n\\txmlHttpRequest.send( null );\\n}\",\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 }\",\n \"function getWeather(latitude,longitude){\\n let fullApi = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${KEY}`\\n \\n fetch(fullApi)\\n .then(function(response){\\n let data = response.json();\\n return data;\\n })\\n .then(function(data){\\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\\n weather.description = data.weather[0].description;\\n weather.iconId = data.weather[0].icon;\\n weather.city = data.name;\\n weather.country = data.sys.country;\\n })\\n .then(function(){\\n displayWeather();\\n });\\n \\n\\n}\",\n \"function getData () {\\n $.get(`https://nominatim.openstreetmap.org/?q=${cityName}&addressdetails=1&countrycodes=US&format=json&limit=1`, function(response){\\n //seting the latitude of the city\\n lat = response[0].lat;\\n //setting the laongitute of the city\\n long = response[0].lon;\\n //clean up the city name\\n cityName = `${cityName}, ${response[0].address.state}`\\n }).then(function(){\\n $.get(`https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${long}&\\n exclude=hourly,daily&appid=${api}`, function(response){\\n //create a current weather opject to send to the build function\\n var currentWeather = {}\\n //city name\\n currentWeather.name = cityName\\n //using moment to convert the unix timestap to human date\\n currentWeather.date = moment.unix(response.current.dt).format('L');\\n //format the icon url to hit the image source from OWM \\n currentWeather.icon = `http://openweathermap.org/img/wn/${response.current.weather[0].icon}.png`\\n //weather description, not used right now but could be fun\\n currentWeather.desc = response.current.weather[0].description\\n //current temp converted from K\\n currentWeather.temp = (response.current.temp * (9/5) -459.67).toFixed(1);\\n //humidity\\n currentWeather.humidity = response.current.humidity;\\n //wind speed\\n currentWeather.wind = response.current.wind_speed;\\n //uv index\\n currentWeather.uvi = response.current.uvi;\\n //send the current weather object to the build function\\n buildCurrent(currentWeather)\\n \\n //setup fiveDay weather by popping off the last 2 peeps\\n var fiveDayWeather = response.daily.slice(1,6)\\n buildForcast(fiveDayWeather)\\n })\\n \\n })\\n \\n }\",\n \"function getWeather(longitude, latitude) {\\r\\n Alert.style.display = \\\"none\\\";\\r\\n let api = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\\r\\n console.log(api);\\r\\n fetch(api)\\r\\n .then(function (response) {\\r\\n let data = response.json();\\r\\n return data;\\r\\n })\\r\\n .then(function (data) {\\r\\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\\r\\n weather.iconId = data.weather[0].icon;\\r\\n weather.mainDesc = data.weather[0].main;\\r\\n weather.description = data.weather[0].description;\\r\\n weather.city = data.name;\\r\\n weather.country = data.sys.country;\\r\\n\\r\\n weather.lon = data.coord.lon;\\r\\n weather.lat = data.coord.lat;\\r\\n weather.rise = data.sys.sunrise;\\r\\n weather.set = data.sys.sunset;\\r\\n weather.minTemp.value = Math.floor(data.main.temp_min - KELVIN);\\r\\n weather.maxTemp.value = Math.floor(data.main.temp_max - KELVIN);\\r\\n weather.press = data.main.pressure;\\r\\n weather.humid = data.main.humidity;\\r\\n weather.speedW = data.wind.speed;\\r\\n weather.dirW = data.wind.deg;\\r\\n })\\r\\n .then(function () {\\r\\n displayWeather();\\r\\n });\\r\\n}\",\n \"function getWeather(city) {\\n var lat = \\\"\\\";\\n var lon = \\\"\\\";\\n\\n // Grab weather data, then make two additional API calls to get UV index and 5-day forecast\\n $.ajax({\\n url: `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIKEY}&units=imperial`,\\n method: \\\"GET\\\"\\n }).then(function(response) {\\n lat = response.coord.lat;\\n lon = response.coord.lon;\\n saveToLocalStorage();\\n renderCitySidebar();\\n \\n // Get UV index data using latitude and longitude from previous API call, then call renderWeatherDisplay function\\n $.ajax({\\n url: `https://api.openweathermap.org/data/2.5/uvi/forecast?appid=${APIKEY}&lat=${lat}&lon=${lon}&cnt=1`,\\n method: \\\"GET\\\"\\n }).then(function(responseUV) {\\n renderWeatherDisplay(response, responseUV);\\n });\\n\\n // Get 5 day forecast by using latitude and longitude from first API call, then call renderFiveDayForecast function\\n $.ajax({\\n url: `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${APIKEY}&units=imperial&exclude=current,minutely,hourly`,\\n method: \\\"GET\\\"\\n }).then(renderFiveDayForecast);\\n });\\n }\",\n \"async function getWeatherSearch(city) {\\r\\n let res = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${API_KEY}`)\\r\\n let data = await res.json()\\r\\n return data\\r\\n}\",\n \"function callAPI(city) {\\n var weatherURL = \\\"https://api.weatherbit.io/v2.0/forecast/daily?key=125e5091a0b746d9a25859114793888d&days=6&city=\\\" + city\\n return $.ajax({\\n url: weatherURL,\\n method: \\\"GET\\\",\\n success: function (data) {\\n }\\n })\\n }\",\n \"function getWeatherData(lat, long) {\\r\\n var key = \\\"1234f59e5798e86cc9241a1ff070cd36\\\";\\r\\n var req1 = new XMLHttpRequest();\\r\\n req1.open(\\r\\n \\\"GET\\\",\\r\\n `http://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${long}&appid=${key}`,\\r\\n true\\r\\n );\\r\\n req1.send();\\r\\n req1.onload = function () {\\r\\n var result = JSON.parse(this.response);\\r\\n console.log(result);\\r\\n };\\r\\n}\",\n \"function getWeather() {\\n\\tweather.getWeather()\\n\\t\\t.then((results) => {\\n\\t\\t\\tui.display(results);\\n\\t\\t})\\n\\t\\t.catch((err) => err);\\n}\",\n \"function getweatherdata(latitude, longitude){ \\r\\n var key = \\\"83362a76bd91e5c5b5de9b7fc4202b50\\\";\\r\\n var req = new XMLHttpRequest();\\r\\n req.open('GET', `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`, true) \\r\\n req.send();\\r\\n req.onload = function(){\\r\\n if(latitude!==0 && longitude!==0){\\r\\n var weatherdata = JSON.parse(this.response);\\r\\n console.log(weatherdata[\\\"main\\\"]);\\r\\n } \\r\\n }\\r\\n }\",\n \"function getForecastWeather(lat,lon,city){\\n var forecastData;\\n fetch(\\\"https://api.openweathermap.org/data/2.5/onecall?lat=\\\" + lat + \\\"&lon=\\\" + lon + \\\"&exclude=hourly,minutely&units=imperial&appid=43802440c0c6de0f332937c0fa83470c\\\")\\n .then(function(response) {\\n if (response.ok) {\\n response.json()\\n .then(function(data) \\n {\\n //Load main panel for current day weather\\n forecastData = data;\\n fetch(\\\"https://api.openweathermap.org/data/2.5/uvi?lat=\\\" + lat + \\\"&lon=\\\" + lon + \\\"&appid=43802440c0c6de0f332937c0fa83470c\\\")\\n .then(function(uviresponse) {\\n if (uviresponse.ok) {\\n uviresponse.json()\\n .then(function(uvidata){\\n loadCurrentWeather(forecastData,uvidata.value,city)\\n });\\n }\\n });\\n \\n\\n //Load forecast weather for 5 days\\n loadForeCastWeather(forecastData);\\n });\\n } else {\\n alert(\\\"Error: \\\" + response.statusText);\\n }\\n }).catch(function(error) {\\n // Notice this `.catch()` getting chained onto the end of the `.then()` method\\n alert(\\\"Unable to connect to Weather app\\\" + error);\\n });\\n}\",\n \"function fetchWeather() {\\n\\tlog(\\\"fetchWeather()\\\");\\n\\tvar userLocation = preferences.userLocation.value;\\n\\tvar cityVal = preferences.cityValPref.value;\\n\\tvar userCity = cityVal ? \\\"zmw:\\\"+cityVal : userLocation;\\n\\t\\n\\tif (!isLocationValid(userLocation)) {\\n\\t\\tdisplayError( \\\"Location missing\\\", \\\"You haven't entered a location yet. Click here to enter a location.\\\", showWidgetPreferences);\\n\\t\\treturn false;\\n\\t}\\n\\t\\n\\tvar locale = widget.locale.substr(0, 2);\\n\\tvar apiLocale = convertKonfabulatorLocaleToWundergroundLocale(locale);\\n\\tif (apiLocale.match(/api\\\\.wunderground\\\\.locales\\\\./)) apiLocale = \\\"EN\\\";\\n\\tvar _url = weatherURL + apiKey + \\\"/lang:\\\" + escape(apiLocale) + \\\"/conditions/forecast/astronomy/q/\\\" + escape(userCity) + \\\".xml\\\";\\n\\t\\n\\tlog(\\\"Trying to fetch: \\\"+_url);\\n\\t\\n\\tvar urlFetch = new URL();\\n\\turlFetch.location = _url;\\n\\ttry {\\n\\t\\turlFetch.fetchAsync(onWeatherDataFetched);\\n\\t}\\n\\tcatch (error) {\\n\\t\\tdisplayConnectionError(error,_url);\\n\\t}\\n}\",\n \"function getWeather(city){\\n fetch(`${api.webUrl}weather?q=${city}&units=metric&appid=${api.apiKey}`)\\n .then(weather => {\\n return weather.json();\\n }).then(displayWeather);\\n}\",\n \"function getWeather(latitude,longitude){\\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\\n fetch(api).then(function(response){\\n let data = response.json();\\n console.log(api);\\n \\n return data;\\n \\n })\\n .then(function(data){\\n weather.temperature.value = Math.floor(data.main.temp - kelvin);\\n weather.description = data.weather[0].description;\\n weather.iconID = data.weather[0].icon;\\n weather.city = data.name;\\n weather.country = data.sys.country;\\n })\\n .then(function(){\\n displayWeather();\\n });\\n}\",\n \"async function getWeather(query) {\\n let weatherData = {};\\n await fetch(\\n `${api.base}weather?zip=${query},us&units=imperial&APPID=${api.key}`\\n )\\n .then((res) => {\\n return res.json();\\n })\\n .then((data) => {\\n weatherData.temp = data.main.temp;\\n weatherData.cityName = data.name;\\n weatherData.iconId = data.weather[0].icon;\\n })\\n .catch((err) => {\\n console.log(err);\\n // handle error here better\\n localStorage.removeItem('zip');\\n inputField.classList.remove('hidden');\\n weatherDisplay.classList.add('hidden');\\n inputField.value = '';\\n displayTempError();\\n });\\n return weatherData;\\n}\",\n \"function fetchWeather(city) {\\n return fetch(\\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&appid=${apiKey}`\\n )\\n .then((response) => response.json())\\n .then((response) => {\\n\\n const lon = response.coord.lon;\\n const lat = response.coord.lat;\\n\\n return fetchOnecall(lon, lat).then((onecallResponse) => {\\n return {\\n currentWeather: response,\\n onecallWeather: onecallResponse,\\n };\\n });\\n })\\n .catch(function(err){\\n console.log('not founddd');\\n alert(\\\"City not found. Please enter a correct city name.\\\")\\n });\\n}\",\n \"function getWeather() {\\n var queryURL = \\\"https://api.openweathermap.org/data/2.5/weather?q=\\\" + currentCity + \\\"&appid=\\\" + apiKey;\\n $.ajax({\\n url: queryURL,\\n method: 'GET'\\n }).then((response) => {\\n //Update the current city weather\\n currentCityWeather = response;\\n //Update the page with weather information\\n updateCurrentWeather();\\n //Add the city to the recent cities up to 10\\n addCityToRecent();\\n //Get the cities uv index\\n getUVIndex();\\n //Get the 5 day forecast\\n get5DayForecast();\\n }).fail((error) => {\\n $(\\\"
\\\" + currentCity + \\\" was not found \\\").css({\\n position: \\\"absolute\\\",\\n width: \\\"100%\\\",\\n height: \\\"100%\\\",\\n left: 0,\\n top: 0,\\n zIndex: 1000000, // to be on the safe side\\n background: '#ffffff',\\n textAlign: 'center',\\n verticalAlign: 'middle',\\n }).appendTo($(\\\".current-weather\\\").css(\\\"position\\\", \\\"relative\\\"));\\n \\n feedbackTimeout = setTimeout(() => {\\n $('.error-div').remove();\\n }, 1500);\\n })\\n }\",\n \"function getWeather(city){\\n let api = `http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=imperial`;\\n \\n //Fetch is what sends out the request from openweather to get the data for the given city\\n //once it receives the response its converted to JSON and the passed into the display function\\n fetch(api)\\n .then(response => response.json())\\n .then(data => displayWeather(data))\\n .catch(e => {\\n displayError(); \\n })\\n}\",\n \"function getWeather() {\\n \\n var queryURL = \\\"https://api.openweathermap.org/data/2.5/weather?q=Denver&units=imperial&appid=b4e24afa7b1b97b59d4ac32e97c8b68d\\\";\\n \\n $.ajax({\\n url: queryURL,\\n method: \\\"GET\\\"\\n }).then(function(response) {\\n \\n $(`p`).text(\\\"\\\");\\n temp.text(`Current Temperature: ` + Math.floor(response.main.temp) + ` °F`);\\n humid.text(`Humidity: ` + response.main.humidity + `%`);\\n wind.text(`Wind Speed: ` + response.wind.speed);\\n })\\n}\",\n \"function getWeather() {\\n\\tfetch(apiCall, {\\n\\t\\tmode: \\\"cors\\\",\\n\\t\\theader: {\\n\\t\\t\\t\\\"Access-Control-Allow-Origin\\\": \\\"*\\\",\\n\\t\\t\\t\\\"Cache-Control\\\": \\\"no-store\\\",\\n\\t\\t},\\n\\t})\\n\\t\\t.then(function (response) {\\n\\t\\t\\tif (response.status !== 200) {\\n\\t\\t\\t\\tconsole.log(\\n\\t\\t\\t\\t\\t\\\"Looks like there was a problem. Status Code: \\\" + response.status\\n\\t\\t\\t\\t);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tresponse.json().then(function (data) {\\n\\t\\t\\t\\tcurrentWeather = data;\\n\\t\\t\\t\\tconsole.log(\\\"Made with love in Stockholm 🏰🇪🇺\\\");\\n\\n\\t\\t\\t\\tclouds = map(currentWeather.clouds.all, 0, 100, 0, 90);\\n\\t\\t\\t\\tcloudCoverage = map(currentWeather.clouds.all, 0, 100, 0, 1);\\n\\t\\t\\t\\thumidity = map(currentWeather.main.humidity, 0, 100, 0, 50);\\n\\t\\t\\t\\tpressure = map(currentWeather.main.pressure, 800, 1100, 10, 0);\\n\\t\\t\\t\\ttemperature = map(currentWeather.main.temp, -30, 55, 0, 40);\\n\\t\\t\\t\\ttempMax = map(currentWeather.main.temp_max, -30, 55, 0, 4);\\n\\t\\t\\t\\ttempMin = map(currentWeather.main.temp_min, -30, 55, 0, 4);\\n\\t\\t\\t\\tvisibility = map(currentWeather.visibility, 0, 10000, 0, 4);\\n\\t\\t\\t\\twindDeg = map(currentWeather.wind.deg, 0, 360, 0, 360);\\n\\t\\t\\t\\twindSpeed = map(currentWeather.wind.speed, 0, 14, 0.8, 5);\\n\\t\\t\\t\\tcurrentTemperature = currentWeather.main.temp;\\n\\n\\t\\t\\t\\tdrawSunPath();\\n\\t\\t\\t});\\n\\t\\t})\\n\\t\\t.catch(function (err) {\\n\\t\\t\\tconsole.log(\\\"Fetch Error :-S\\\", err);\\n\\t\\t});\\n}\",\n \"fetchWeather(searchZipCode) {\\n fetch(`https://api.openweathermap.org/data/2.5/forecast?zip=${searchZipCode},us&units=imperial&appid=08d4fea27ae00e7c79b59befd31e8d18`)\\n .then(response => response.json())\\n .then(results => this.setWeather(results));\\n }\",\n \"function getWeather(latitude, longitude){\\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\\n \\n \\n fetch(api)\\n .then(function(response){\\n let data = response.json();\\n return data;\\n })\\n .then(function(data){\\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\\n weather.description = data.weather[0].description;\\n weather.iconID = data.weather[0].icon;\\n weather.city = data.name;\\n weather.country = data.sys.country;\\n })\\n .then(function(){\\n displayWeather();\\n });\\n}\",\n \"fetchForecast()\\n {\\n var url = \\\"http://api.openweathermap.org/data/2.5/forecast?APPID=0cf17e23b1d108b29a4d738d2084baf5&q=\\\" + this.state.location + \\\"&units=\\\" + this.state.units;\\n \\n $.ajax({\\n\\t\\t\\turl: url,\\n dataType: \\\"jsonp\\\",\\n\\t\\t\\tsuccess : this.parseResponse,\\n\\t\\t\\terror : function(req, err){ console.log('API call failed ' + err); }\\n })\\n\\n \\n }\",\n \"function getWeatherData(city) {\\n var currentWeatherUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=260502960360e1be7ff30b2693e2aa94`\\n \\n fetch(currentWeatherUrl)\\n .then(function (response) {\\n return response.json();\\n })\\n .then(function (data) {\\n console.log(data);\\n var cityName = data.name;\\n var weatherIcon = data.weather[0].icon;\\n $('.current-city').append(cityName);\\n $(\\\".todaysWeatherIcon\\\").attr(\\\"src\\\", `http://openweathermap.org/img/wn/${weatherIcon}.png`);\\n var lat = data.coord.lat;\\n var lon = data.coord.lon;\\n \\n var oneCallUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude={part}&appid=260502960360e1be7ff30b2693e2aa94&units=imperial`\\n\\n fetch(oneCallUrl)\\n .then(function (response) {\\n return response.json();\\n })\\n .then(function (cityData) {\\n console.log(cityData);\\n weatherReport(cityData);\\n getFiveDayForecast(cityData);\\n })\\n })\\n }\",\n \"async function getWeatherAW(woeid) {\\n try {\\n const result = await fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`);\\n const data = await result.json();\\n const tomorrow = data.consolidated_weather[1];\\n console.log(`Temperatures tomorrow in ${data.title} stay between ${tomorrow.min_temp} and ${tomorrow.max_temp}.`);\\n return data;\\n } catch(error) {\\n alert(error);\\n }\\n}\",\n \"function searchWeather(cityName){\\nfetch(`https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?q=${cityName}&APPID=${apiKey}&units=${unit}`)\\n.then(y => {\\n return y.json()\\n})\\n.then(y =>{\\n init(y)\\n})\\n.catch(function(err){\\n alert('city not found, please check spelling')\\n})\\n\\n}\",\n \"function getWeather(latitude, longitude) {\\r\\n let api = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}&units=metric`;\\r\\n \\r\\n fetch(api).then(function (response) {\\r\\n let data = response.json();\\r\\n return data;\\r\\n })\\r\\n .then(function (data) {\\r\\n weather.temp = data.main.temp;\\r\\n weather.city = data.name;\\r\\n weather.country = data.sys.country;\\r\\n weather.info = data.weather[0].main;\\r\\n weather.icon = data.weather[0].icon;\\r\\n \\r\\n displayWeather();\\r\\n forecast(`forecast?lat=${latitude}&lon=${longitude}`, weather.city);\\r\\n })\\r\\n\\r\\n function displayWeather() {\\r\\n $('.temp').html(Math.round(weather.temp) + \\\" °C\\\");\\r\\n\\r\\n $('img.icon-img').attr('src', `images/icons/${ weather.icon}.png`);\\r\\n $('.info').html(weather.info);\\r\\n $('.city').html(weather.city);\\r\\n $('.country').html(weather.country);\\r\\n }\\r\\n}\",\n \"function getCoordinates(city){\\n \\n let URL = \\\"https://api.openweathermap.org/data/2.5/weather?q=\\\"; //here\\n let queryURL = URL + city + key;\\n \\n $.ajax({\\n url: queryURL,\\n method: \\\"GET\\\"\\n }).then(function(response) {\\n localStorage.setItem(\\\"city\\\",response.name);\\n localStorage.setItem(response.name+\\\"lon\\\",response.coord.lon);\\n localStorage.setItem(response.name+\\\"lat\\\",response.coord.lat);\\n localStorage.setItem(response.name+\\\"humidityLevel\\\", response.main.humidity);\\n displayStats(response.name);\\n fiveDay(response.name);\\n displayHistory();\\n localStorage.setItem(\\\"lastCity\\\", response.name);\\n });\\n}\",\n \"function getWeather(latitude , longitude){\\n let api =`http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\\n //console.log(api);\\n fetch(api)\\n .then(function(response){\\n let data = response.json();\\n return data;\\n })\\n .then(function(data){\\n weather.temperature.value = Math.floor(data.main.temp -kelvin);\\n weather.descripition = data.weather[0].descripition;\\n weather.iconId = data.weather[0].icon;\\n weather.city = data.name;\\n weather.country = data.sys.country;\\n })\\n .then(function(){\\n displayWeather();\\n })\\n}\",\n \"async function getWeather() {\\n const url = `https://api.openweathermap.org/data/2.5/weather?q=${city.textContent}&lang=en&appid=1964d0a7118d50f00dc12a34ffef2fef&units=metric`;\\n const res = await fetch(url);\\n const data = await res.json();\\n const weather = data.weather;\\n\\n if (data.cod === '404') {\\n weatherInfo.style.display = 'none';\\n localStorage.clear();\\n popup.style.display = 'block';\\n popupBtn.addEventListener('click', () => (popup.style.display = 'none'));\\n city.textContent = '';\\n } else {\\n weatherIcon.src = `http://openweathermap.org/img/w/${weather[0].icon}.png`;\\n temperature.textContent = `${data.main.temp.toFixed(0)}°C`;\\n weatherDescription.textContent = data.weather[0].description;\\n humidity.textContent = `humidity: ${data.main.humidity} %`;\\n wind.textContent = `wind: ${data.wind.speed} m/s`;\\n }\\n}\",\n \"function getCurrentWeather() {\\n \\tvar dataObj = {\\n \\t\\tlat: '',\\n \\t\\tlon: '',\\n \\t\\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\\n \\t\\tunits: 'metric'\\n \\t}\\n }\",\n \"async function getCityWeather(lat, lon) {\\n var oneCallURL = \\\"https://api.openweathermap.org/data/2.5/onecall?lat=\\\" + lat + \\\"&lon=\\\" + lon + \\\"&exclude=minutely&appid=\\\" + APIkey + units;\\n\\n const response = await fetch(oneCallURL);\\n const data = await response.json();\\n console.log(data);\\n return data;\\n}\",\n \"function getWeather() {\\n var location = globals.location,\\n usrInput = $('.input-div input').val() || '';\\n\\n getCityWeather(usrInput, location);\\n getCityForecast(usrInput, location)\\n\\n }\",\n \"async function getWeatherData(city) {\\n let response = await fetch('http://api.openweathermap.org/data/2.5/weather?q=' + city + '&APPID=' + apikey, { mode: 'cors' })\\n let weatherData = await response.json()\\n //console.log(weatherData.weather[0].description);\\n let data = weatherData.weather[0].description;\\n return data;\\n}\",\n \"getWeather(){\\n fetch(`https://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${process.env.REACT_APP_WEATHER_API_KEY}/${this.state.lat},${this.state.lng}`)\\n .then(response => response.json())\\n .then(data => {\\n this.setState({ weather: data })\\n })\\n }\",\n \"function getWeather(city){\\n\\t\\t$.get(\\\"http://api.openweathermap.org/data/2.5/weather?q=\\\"+city+\\\"&appid=e9eae461e99aa01a4e6115e572b2a66f\\\", function(data){\\n\\t\\t\\t\\tconsole.log(data);\\n\\t\\t\\t\\t$(\\\"#desc\\\").html(data.weather[0].description);\\n\\t\\t\\t\\t$(\\\"#temp\\\").html(data.main.temp);\\n\\t\\t\\t\\t$(\\\"#humidity\\\").html(data.main.humidity);\\n\\n})\\n\\n\\t}\",\n \"function getCurrentWeather() {\\n // const enteredZipCode = document.getElementById('zip').value;\\n const zipCode = document.getElementById('zip').value;\\n const apiCall = baseUrl + '?zip=' + zipCode + '&appid=' + apiKey + unit;\\n // const apiCall = 'http://api.openweathermap.org/data/2.5/weather?zip=94040&appid=25b7a4527f77b209b126a463a9baa9c0';\\n getWeatherAPI(apiCall)\\n .then(function (d){\\n postData('/send', d)\\n .finally(updateUI)});\\n}\",\n \"async function getWeatherDetails() {\\n\\n // Hit the weather API\\n const weatherApiUrl = 'https://api.openweathermap.org/data/2.5/forecast/daily?q=totnes&units=metric&cnt=1&appid=d94bcd435b62a031771c35633f9f310a';\\n const weatherResult = await logFetch(weatherApiUrl);\\n\\n // Update the temp\\n const weatherTemperature = weatherResult.list[0].temp;\\n temperature.innerHTML = weatherTemperature.day + ' ° C';\\n\\n // Update the icon\\n weatherIcon.innerHTML = mapWeatherIcon(weatherResult.list[0].weather[0].id);\\n}\",\n \"function fetchWeatherInfoWithStatAndCountry(city, state, country) {\\n let url = \\\"http://api.openweathermap.org/data/2.5/weather?q=\\\";\\n url = `${url}${city},{state},${country}&appid=${APIKey}`;\\n // console.log(\\\"url is\\\", url);\\n return fetch(url).then(response => response.json());\\n}\",\n \"function getWeather(latitude, longitude) {\\n let api = `http://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${key}`;\\n\\n fetch(api)\\n .then(function (response) {\\n let data = response.json();\\n Console.log(data);\\n return data;\\n })\\n .then(function (data) {\\n weather.temperature.value = Math.floor(data.main.temp - KELVIN);\\n weather.description = data.weather[0].description;\\n //weather.iconId = data.weather[0].icon;\\n weather.city = data.name;\\n weather.country = data.sys.country;\\n })\\n .then(function () {\\n displayWeather();\\n });\\n}\",\n \"function fetchLocation(apiKey, latitude, longitude) {\\n\\n //you don't need a proxy but you need secure your key in the google developer console.\\n // var googleApiLink = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=${apiKey}`;\\n // console.log(googleApiLink)\\n\\n fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=imperial`)\\n .then(response => {\\n return response.json()\\n })\\n .then(data => {\\n // Work with JSON data here\\n console.log(data)\\n //Set values for the location we picked the 4 object in the results becuase show the approximate address\\n document.getElementById(\\\"location\\\").innerHTML = data.name;\\n city = data.name;\\n document.getElementById(\\\"currenttemp\\\").innerHTML = data.main.temp;\\n temp = data.main.temp;\\n weather=data.weather[0].main;\\n windspeed=data.wind.speed;\\n humid = data.clouds.all;\\n\\t\\t\\tdocument.getElementById(\\\"wind_speed\\\").innerHTML = data.wind.speed;\\n\\t\\t\\tdocument.getElementById(\\\"weather\\\").innerHTML = data.weather[0].main;\\n\\t\\t\\tconsole.log(data.wind.speed, data.weather[0].main, humid)\\n\\t\\t\\tdocument.getElementById(\\\"humidity\\\").innerHTML = humid;\\n\\t\\t\\t document.getElementById(\\\"currlocation\\\").innerHTML = data.name;\\n\\t\\t\\tdocument.getElementById(\\\"temp\\\").innerHTML = data.main.temp;\\n\\n\\t\\t\\t// var iconcode = data.weather[0].icon;\\n\\t\\t\\tconsole.log(data.weather[0].icon)\\n\\t\\t\\tvar iconurl = `http://openweathermap.org/img/w/${data.weather[0].icon}.png`;\\n\\t\\t\\tconsole.log(iconurl)\\n\\t\\t\\tvar locationicon = document.querySelector('.forecast-icon');\\n\\t\\t\\tlocationicon.innerHTML = `
`\\n })\\n .catch(err => {\\n // Do something for an error here\\n throw (`Sorry, An Error occured. ${err}`);\\n })\\n}\",\n \"getWeather() {\\n this.setState({\\n loading: true,\\n error: '',\\n userInput: '',\\n data: {},\\n data10: [],\\n location: {},\\n icon: ''\\n })\\n\\n axios.get(`https://api.wunderground.com/api/${config.apiKey}/conditions/q/${this.state.userInput}.json`)\\n .then(res =>\\n this.setState({\\n data: res.data.current_observation,\\n location: res.data.current_observation.display_location,\\n icon: res.data.current_observation.icon_url\\n })\\n )\\n .catch(() => this.weatherFail());\\n }\",\n \"function useCurrentWeatherApi(input) {\\n\\tif (alphabetRegex.test(input)) {\\n\\t\\t// get weather by city name\\n\\t\\tfetch(\\n\\t\\t\\t`https://api.openweathermap.org/data/2.5/weather?q=${input},us&appid=${apikey}&units=imperial`\\n\\t\\t)\\n\\t\\t\\t.then(res => res.json())\\n\\t\\t\\t.then(data => {\\n\\t\\t\\t\\tconsole.log('current weather: ' + data);\\n\\t\\t\\t\\tshowCurrentWeather(data);\\n\\t\\t\\t\\tuseOneCallApi(data);\\n\\t\\t\\t});\\n\\t} else {\\n\\t\\t// get weather by zip code\\n\\t\\tfetch(\\n\\t\\t\\t`https://api.openweathermap.org/data/2.5/weather?zip=${input},us&appid=${apikey}&units=imperial`\\n\\t\\t)\\n\\t\\t\\t.then(res => res.json())\\n\\t\\t\\t.then(data => {\\n\\t\\t\\t\\tconsole.log('current weather: ', data);\\n\\t\\t\\t\\tshowCurrentWeather(data);\\n\\t\\t\\t\\tuseOneCallApi(data);\\n\\t\\t\\t});\\n\\t}\\n}\",\n \"function getWeather(){\\r\\n let api = `http://api.openweathermap.org/data/2.5/forecast?q=hanoi&appid=${key}`;\\r\\n\\r\\n fetch(api)\\r\\n .then(function(response){\\r\\n let data = response.json();\\r\\n return data;\\r\\n })\\r\\n .then(function(data){\\r\\n weather.temperature.value[0] = Math.floor(data.list[6].main.temp - KELVIN);\\r\\n weather.temperature.value[1] = Math.floor(data.list[12].main.temp - KELVIN);\\r\\n weather.temperature.value[2] = Math.floor(data.list[18].main.temp - KELVIN);\\r\\n weather.temperature.value[3] = Math.floor(data.list[24].main.temp - KELVIN);\\r\\n weather.temperature.value[4] = Math.floor(data.list[30].main.temp - KELVIN);\\r\\n\\r\\n weather.description[0] = data.list[6].weather[0].description;\\r\\n weather.description[1] = data.list[12].weather[0].description;\\r\\n weather.description[2] = data.list[18].weather[0].description;\\r\\n weather.description[3] = data.list[24].weather[0].description;\\r\\n weather.description[4] = data.list[30].weather[0].description;\\r\\n\\r\\n weather.iconId[0] = data.list[6].weather[0].icon;\\r\\n weather.iconId[1] = data.list[12].weather[0].icon;\\r\\n weather.iconId[2] = data.list[18].weather[0].icon;\\r\\n weather.iconId[3] = data.list[24].weather[0].icon;\\r\\n weather.iconId[4] = data.list[30].weather[0].icon;\\r\\n \\r\\n weather.time[0] = data.list[6].dt_txt;\\r\\n weather.time[1] = data.list[12].dt_txt;\\r\\n weather.time[2] = data.list[18].dt_txt;\\r\\n weather.time[3] = data.list[24].dt_txt;\\r\\n weather.time[4] = data.list[30].dt_txt;\\r\\n\\r\\n \\r\\n //Location\\r\\n weather.city = data.city.name;\\r\\n weather.country = data.city.country;\\r\\n })\\r\\n .then(function(){\\r\\n displayWeather();\\r\\n })\\r\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7700457","0.76259696","0.7566452","0.753374","0.7515647","0.7472935","0.74516594","0.74449676","0.7429668","0.74257815","0.7421122","0.74142784","0.7383334","0.7372995","0.73702353","0.73059416","0.72946644","0.72866285","0.7266296","0.72584003","0.7255942","0.71885043","0.71875566","0.7176721","0.71589017","0.7148192","0.7147864","0.7135735","0.71150714","0.7090542","0.70880234","0.7087675","0.7080845","0.70747477","0.70731527","0.7071897","0.70667046","0.7054273","0.70464015","0.7046388","0.7041238","0.70362866","0.7025173","0.70131195","0.70093834","0.7007695","0.7007492","0.6992327","0.6975849","0.69754195","0.695717","0.69532746","0.6952117","0.694386","0.69419616","0.69316554","0.69158417","0.69132924","0.6896131","0.6893366","0.6890978","0.6881418","0.68804806","0.68802416","0.6878675","0.6878306","0.68722117","0.68717366","0.68695784","0.6865459","0.6864988","0.68622315","0.6851005","0.6842811","0.68413615","0.6836862","0.6832214","0.6825968","0.6825218","0.6819968","0.6813906","0.6811534","0.6805347","0.6804688","0.6803297","0.6802497","0.6800352","0.6799729","0.6795494","0.6795124","0.679423","0.6793029","0.6789712","0.6789427","0.6787254","0.67854774","0.6784115","0.6783164","0.6771043","0.6770523"],"string":"[\n \"0.7700457\",\n \"0.76259696\",\n \"0.7566452\",\n \"0.753374\",\n \"0.7515647\",\n \"0.7472935\",\n \"0.74516594\",\n \"0.74449676\",\n \"0.7429668\",\n \"0.74257815\",\n \"0.7421122\",\n \"0.74142784\",\n \"0.7383334\",\n \"0.7372995\",\n \"0.73702353\",\n \"0.73059416\",\n \"0.72946644\",\n \"0.72866285\",\n \"0.7266296\",\n \"0.72584003\",\n \"0.7255942\",\n \"0.71885043\",\n \"0.71875566\",\n \"0.7176721\",\n \"0.71589017\",\n \"0.7148192\",\n \"0.7147864\",\n \"0.7135735\",\n \"0.71150714\",\n \"0.7090542\",\n \"0.70880234\",\n \"0.7087675\",\n \"0.7080845\",\n \"0.70747477\",\n \"0.70731527\",\n \"0.7071897\",\n \"0.70667046\",\n \"0.7054273\",\n \"0.70464015\",\n \"0.7046388\",\n \"0.7041238\",\n \"0.70362866\",\n \"0.7025173\",\n \"0.70131195\",\n \"0.70093834\",\n \"0.7007695\",\n \"0.7007492\",\n \"0.6992327\",\n \"0.6975849\",\n \"0.69754195\",\n \"0.695717\",\n \"0.69532746\",\n \"0.6952117\",\n \"0.694386\",\n \"0.69419616\",\n \"0.69316554\",\n \"0.69158417\",\n \"0.69132924\",\n \"0.6896131\",\n \"0.6893366\",\n \"0.6890978\",\n \"0.6881418\",\n \"0.68804806\",\n \"0.68802416\",\n \"0.6878675\",\n \"0.6878306\",\n \"0.68722117\",\n \"0.68717366\",\n \"0.68695784\",\n \"0.6865459\",\n \"0.6864988\",\n \"0.68622315\",\n \"0.6851005\",\n \"0.6842811\",\n \"0.68413615\",\n \"0.6836862\",\n \"0.6832214\",\n \"0.6825968\",\n \"0.6825218\",\n \"0.6819968\",\n \"0.6813906\",\n \"0.6811534\",\n \"0.6805347\",\n \"0.6804688\",\n \"0.6803297\",\n \"0.6802497\",\n \"0.6800352\",\n \"0.6799729\",\n \"0.6795494\",\n \"0.6795124\",\n \"0.679423\",\n \"0.6793029\",\n \"0.6789712\",\n \"0.6789427\",\n \"0.6787254\",\n \"0.67854774\",\n \"0.6784115\",\n \"0.6783164\",\n \"0.6771043\",\n \"0.6770523\"\n]"},"document_score":{"kind":"string","value":"0.70304394"},"document_rank":{"kind":"string","value":"42"}}},{"rowIdx":565,"cells":{"query":{"kind":"string","value":"used to support hot reloading"},"document":{"kind":"string","value":"_reload() {\n js2py = require(\"../../shift-codegen-py/src\");\n this._generator = new js2py.PyCodeGen({\n topLevelComment: false,\n });\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["_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 }","function reload() { if(!production) { bsyncReload(); } }","enableForceReload() {\n this.compiler.plugin('compilation', (compilation) => {\n compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => {\n this.hotMiddleware.publish({ action: 'reload' });\n cb();\n });\n });\n }","function LiveReloadJsHandler() {\n}","__debug() {\n const watchPath = this.util.getRootPath('templates')\n if (fs.existsSync(watchPath)) {\n const self = this\n const reloadServer = reload(self.app, {\n https: this.config.ssl.enabled ? this.config.ssl.opts : undefined,\n })\n reloadServer.then(function (reloadReturned) {\n watch.watchTree(watchPath, (f, curr, prev) => {\n /// TODO: reset page cache for all paths that match the changed filepath\n /// TODO: to support the above, change the cacheKeys in rendering.js to drop the filename extension\n self.log('Asset change detected, reloading connection')\n reloadReturned.reload()\n })\n })\n } else {\n this.log.error('cannot watch because folder does not exist', {\n watchPath,\n })\n }\n }","function autoReloadServer (entryPath, outputPath) {\n var g_ws = undefined;\n\n var htmlScriptOffsetLine = 0;\n function bundleIntoHtml (scriptBody, sourceMap) {\n // sourceMap.base64() - source map file ready to serve.\n fs.writeFileSync(outputPath, '