{ // 获取包含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
'+ cart[i].productname +'
\\\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 \\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\\\" + \\\"\\\" + \\\"\\\";\\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\\t\\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 \\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 \\\"${item.alt}\\\"\\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

    ${data.prodPrice}đ x ${data.prodQty}

    \\n
    \\n

    size: ${data.proSize} /

    \\n

    màu: ${data.proColor}

    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n `\\n );\\n $('.cart_component').append(\\n `
    \\n
    \\n
    \\n \\n
    \\n
    \\n
    \\n
    \\n
    ${data.prodName}
    \\n
    \\n

    ${(data.prodSalePrice != null) ? data.prodSalePrice : ''}

    \\n

    ${data.prodPrice} đ

    \\n
    \\n
    \\n \\n\\n \\n
    ${data.proSize}
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n\\n
    \\n \\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    ${totalPriceSingle()}
    \\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 \\n \\n \\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 \\n \\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 \\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
    '+ cart[i].productname +'
    \\\\\\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, ['<', '>'], ['&lt;', '&gt;']);\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, ['<', '>'], ['&lt;', '&gt;']);\\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 - - 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 \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
    \n \n
    \n
    \n {post.user.username}{' '}\n - {post.created_at}\n \n\n

    {post.body}

    \n
    \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 }","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 {post.author}\n {post.place}\n
    \n \n \"Mais\"\n
    \n \n \"\"\n \n
    \n
    \n \n \"\"/\n \"\"/\n
    \n \n {post.likes} curtidas\n \n

    \n {post.description}\n {post.hashtags}\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
    \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\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\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\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    Subsets and Splits

    No community queries yet

    The top public SQL queries from the community will appear here once available.